diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-05-01 15:51:37 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-05-01 16:23:10 -0400 |
commit | ce2248135a651d313f87d838e965477b5e4d6131 (patch) | |
tree | e0137e49b8a3ed1c366501b23ff09575bb5d4572 | |
parent | 163cb761224879c8a148fa512e80c488fdbac0a5 (diff) | |
download | gdb-ce2248135a651d313f87d838e965477b5e4d6131.zip gdb-ce2248135a651d313f87d838e965477b5e4d6131.tar.gz gdb-ce2248135a651d313f87d838e965477b5e4d6131.tar.bz2 |
sim: aarch64: fix 64-bit immediate shifts
Trying to shift immediates 63 bits fails on 32-bit systems since UL
is only 32-bits, not 64-bits. Switch to ULL to guarantee at least
64-bits here.
-rw-r--r-- | sim/aarch64/ChangeLog | 4 | ||||
-rw-r--r-- | sim/aarch64/simulator.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/sim/aarch64/ChangeLog b/sim/aarch64/ChangeLog index 23736d6..2d13cf1 100644 --- a/sim/aarch64/ChangeLog +++ b/sim/aarch64/ChangeLog @@ -1,3 +1,7 @@ +2021-05-01 Mike Frysinger <vapier@gentoo.org> + + * simulator.c (do_fcvtzu): Change UL to ULL. + 2021-04-26 Mike Frysinger <vapier@gentoo.org> * aclocal.m4, config.in, configure: Regenerate. diff --git a/sim/aarch64/simulator.c b/sim/aarch64/simulator.c index e0b428d..a839121 100644 --- a/sim/aarch64/simulator.c +++ b/sim/aarch64/simulator.c @@ -8420,7 +8420,7 @@ do_fcvtzu (sim_cpu *cpu) uint64_t value = (uint64_t) d; /* Do not raise an exception if we have reached ULONG_MAX. */ - if (value != (1UL << 63)) + if (value != (1ULL << 63)) RAISE_EXCEPTIONS (d, value, DOUBLE, ULONG); aarch64_set_reg_u64 (cpu, rd, NO_SP, value); @@ -8431,7 +8431,7 @@ do_fcvtzu (sim_cpu *cpu) uint64_t value = (uint64_t) f; /* Do not raise an exception if we have reached ULONG_MAX. */ - if (value != (1UL << 63)) + if (value != (1ULL << 63)) RAISE_EXCEPTIONS (f, value, FLOAT, ULONG); aarch64_set_reg_u64 (cpu, rd, NO_SP, value); |