diff options
author | Mike Frysinger <vapier@gentoo.org> | 2016-01-04 22:24:03 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2016-01-04 22:24:03 -0500 |
commit | bc273e17510c7680bcffee75858d374aa93f7e4b (patch) | |
tree | 70fafc5ebb2b4104b5d0169578f8e24f4a497ba4 /sim/aarch64 | |
parent | ac8eefeb243ad326946c3b2b78ba5d1367fe0f99 (diff) | |
download | gdb-bc273e17510c7680bcffee75858d374aa93f7e4b.zip gdb-bc273e17510c7680bcffee75858d374aa93f7e4b.tar.gz gdb-bc273e17510c7680bcffee75858d374aa93f7e4b.tar.bz2 |
sim: unify min/max macros
Import defines from gdb/defs.h to the sim core so we can delete the
various copies that already exist.
Diffstat (limited to 'sim/aarch64')
-rw-r--r-- | sim/aarch64/ChangeLog | 6 | ||||
-rw-r--r-- | sim/aarch64/simulator.c | 31 |
2 files changed, 20 insertions, 17 deletions
diff --git a/sim/aarch64/ChangeLog b/sim/aarch64/ChangeLog index f9b8673..b884979 100644 --- a/sim/aarch64/ChangeLog +++ b/sim/aarch64/ChangeLog @@ -1,3 +1,9 @@ +2016-01-04 Mike Frysinger <vapier@gentoo.org> + + * simulator.c (MAX, MIN): Delete. + (do_vec_maxv): Change MAX to max and MIN to min. + (do_vec_fminmaxV): Likewise. + 2016-01-04 Tristan Gingold <gingold@adacore.com> * simulator.c: Remove syscall.h include. diff --git a/sim/aarch64/simulator.c b/sim/aarch64/simulator.c index 84ce8e8..3315a2d 100644 --- a/sim/aarch64/simulator.c +++ b/sim/aarch64/simulator.c @@ -4108,9 +4108,6 @@ do_vec_XTN (sim_cpu *cpu) } } -#define MAX(A,B) ((A) > (B) ? (A) : (B)) -#define MIN(A,B) ((A) < (B) ? (A) : (B)) - static void do_vec_maxv (sim_cpu *cpu) { @@ -4147,17 +4144,17 @@ do_vec_maxv (sim_cpu *cpu) case 0: smax = aarch64_get_vec_s8 (cpu, vs, 0); for (i = 1; i < (full ? 16 : 8); i++) - smax = MAX (smax, aarch64_get_vec_s8 (cpu, vs, i)); + smax = max (smax, aarch64_get_vec_s8 (cpu, vs, i)); break; case 1: smax = aarch64_get_vec_s16 (cpu, vs, 0); for (i = 1; i < (full ? 8 : 4); i++) - smax = MAX (smax, aarch64_get_vec_s16 (cpu, vs, i)); + smax = max (smax, aarch64_get_vec_s16 (cpu, vs, i)); break; case 2: smax = aarch64_get_vec_s32 (cpu, vs, 0); for (i = 1; i < (full ? 4 : 2); i++) - smax = MAX (smax, aarch64_get_vec_s32 (cpu, vs, i)); + smax = max (smax, aarch64_get_vec_s32 (cpu, vs, i)); break; default: case 3: @@ -4175,17 +4172,17 @@ do_vec_maxv (sim_cpu *cpu) case 0: smin = aarch64_get_vec_s8 (cpu, vs, 0); for (i = 1; i < (full ? 16 : 8); i++) - smin = MIN (smin, aarch64_get_vec_s8 (cpu, vs, i)); + smin = min (smin, aarch64_get_vec_s8 (cpu, vs, i)); break; case 1: smin = aarch64_get_vec_s16 (cpu, vs, 0); for (i = 1; i < (full ? 8 : 4); i++) - smin = MIN (smin, aarch64_get_vec_s16 (cpu, vs, i)); + smin = min (smin, aarch64_get_vec_s16 (cpu, vs, i)); break; case 2: smin = aarch64_get_vec_s32 (cpu, vs, 0); for (i = 1; i < (full ? 4 : 2); i++) - smin = MIN (smin, aarch64_get_vec_s32 (cpu, vs, i)); + smin = min (smin, aarch64_get_vec_s32 (cpu, vs, i)); break; default: case 3: @@ -4203,17 +4200,17 @@ do_vec_maxv (sim_cpu *cpu) case 0: umax = aarch64_get_vec_u8 (cpu, vs, 0); for (i = 1; i < (full ? 16 : 8); i++) - umax = MAX (umax, aarch64_get_vec_u8 (cpu, vs, i)); + umax = max (umax, aarch64_get_vec_u8 (cpu, vs, i)); break; case 1: umax = aarch64_get_vec_u16 (cpu, vs, 0); for (i = 1; i < (full ? 8 : 4); i++) - umax = MAX (umax, aarch64_get_vec_u16 (cpu, vs, i)); + umax = max (umax, aarch64_get_vec_u16 (cpu, vs, i)); break; case 2: umax = aarch64_get_vec_u32 (cpu, vs, 0); for (i = 1; i < (full ? 4 : 2); i++) - umax = MAX (umax, aarch64_get_vec_u32 (cpu, vs, i)); + umax = max (umax, aarch64_get_vec_u32 (cpu, vs, i)); break; default: case 3: @@ -4231,17 +4228,17 @@ do_vec_maxv (sim_cpu *cpu) case 0: umin = aarch64_get_vec_u8 (cpu, vs, 0); for (i = 1; i < (full ? 16 : 8); i++) - umin = MIN (umin, aarch64_get_vec_u8 (cpu, vs, i)); + umin = min (umin, aarch64_get_vec_u8 (cpu, vs, i)); break; case 1: umin = aarch64_get_vec_u16 (cpu, vs, 0); for (i = 1; i < (full ? 8 : 4); i++) - umin = MIN (umin, aarch64_get_vec_u16 (cpu, vs, i)); + umin = min (umin, aarch64_get_vec_u16 (cpu, vs, i)); break; case 2: umin = aarch64_get_vec_u32 (cpu, vs, 0); for (i = 1; i < (full ? 4 : 2); i++) - umin = MIN (umin, aarch64_get_vec_u32 (cpu, vs, i)); + umin = min (umin, aarch64_get_vec_u32 (cpu, vs, i)); break; default: case 3: @@ -4287,7 +4284,7 @@ do_vec_fminmaxV (sim_cpu *cpu) case 3: /* FMINV. */ for (i = 1; i < 4; i++) - res = MIN (res, aarch64_get_vec_float (cpu, vs, i)); + res = min (res, aarch64_get_vec_float (cpu, vs, i)); break; default: @@ -4305,7 +4302,7 @@ do_vec_fminmaxV (sim_cpu *cpu) case 3: /* FMAXV. */ for (i = 1; i < 4; i++) - res = MAX (res, aarch64_get_vec_float (cpu, vs, i)); + res = max (res, aarch64_get_vec_float (cpu, vs, i)); break; default: |