aboutsummaryrefslogtreecommitdiff
path: root/sim/aarch64
diff options
context:
space:
mode:
authorJim Wilson <jim.wilson@linaro.org>2017-03-25 20:32:02 -0700
committerJim Wilson <jim.wilson@linaro.org>2017-03-25 20:32:02 -0700
commitf124168208a5927e9f1b9843094ec2bf2aad2edf (patch)
treeae49c47619cae3ca06b5f7d5dc82c36d29f9a281 /sim/aarch64
parent7ed687b257a4182771079c582887498d0a98810c (diff)
downloadgdb-f124168208a5927e9f1b9843094ec2bf2aad2edf.zip
gdb-f124168208a5927e9f1b9843094ec2bf2aad2edf.tar.gz
gdb-f124168208a5927e9f1b9843094ec2bf2aad2edf.tar.bz2
Fix bug with cmn/adds where C flag was incorrectly set.
sim/aarch64/ * simulator.c (set_flags_for_add32): Cast result to uint32_t in carry flag check. sim/testsuite/sim/aarch64/ * adds.s: Add checks for values -2 and 1, where C is not set.
Diffstat (limited to 'sim/aarch64')
-rw-r--r--sim/aarch64/ChangeLog5
-rw-r--r--sim/aarch64/simulator.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/sim/aarch64/ChangeLog b/sim/aarch64/ChangeLog
index 0bf305a..1d97291 100644
--- a/sim/aarch64/ChangeLog
+++ b/sim/aarch64/ChangeLog
@@ -1,3 +1,8 @@
+2017-03-25 Jim Wilson <jim.wilson@linaro.org>
+
+ * simulator.c (set_flags_for_add32): Cast result to uint32_t in carry
+ flag check.
+
2017-03-03 Jim Wilson <jim.wilson@linaro.org>
* simulator.c (mul64hi): Shift carry left by 32.
diff --git a/sim/aarch64/simulator.c b/sim/aarch64/simulator.c
index 8a8df7a..f0668ad 100644
--- a/sim/aarch64/simulator.c
+++ b/sim/aarch64/simulator.c
@@ -1650,7 +1650,7 @@ set_flags_for_add32 (sim_cpu *cpu, int32_t value1, int32_t value2)
if (result & (1 << 31))
flags |= N;
- if (uresult != result)
+ if (uresult != (uint32_t)result)
flags |= C;
if (sresult != result)