aboutsummaryrefslogtreecommitdiff
path: root/sim/testsuite/sim/aarch64/adds.s
diff options
context:
space:
mode:
Diffstat (limited to 'sim/testsuite/sim/aarch64/adds.s')
-rw-r--r--sim/testsuite/sim/aarch64/adds.s81
1 files changed, 81 insertions, 0 deletions
diff --git a/sim/testsuite/sim/aarch64/adds.s b/sim/testsuite/sim/aarch64/adds.s
new file mode 100644
index 0000000..2bc240c
--- /dev/null
+++ b/sim/testsuite/sim/aarch64/adds.s
@@ -0,0 +1,81 @@
+# mach: aarch64
+
+# Check the basic integer compare instructions: adds, adds64, subs, subs64.
+# For add, check value pairs 1 and -1 (Z), -1 and -1 (N), 2 and -1 (C),
+# and MIN_INT and -1 (V),
+# For sub, negate the second value.
+
+.include "testutils.inc"
+
+ start
+ mov w0, #1
+ mov w1, #-1
+ adds w2, w0, w1
+ bne .Lfailure
+ mov w0, #-1
+ mov w1, #-1
+ adds w2, w0, w1
+ bpl .Lfailure
+ mov w0, #2
+ mov w1, #-1
+ adds w2, w0, w1
+ bcc .Lfailure
+ mov w0, #0x80000000
+ mov w1, #-1
+ adds w2, w0, w1
+ bvc .Lfailure
+
+ mov x0, #1
+ mov x1, #-1
+ adds x2, x0, x1
+ bne .Lfailure
+ mov x0, #-1
+ mov x1, #-1
+ adds x2, x0, x1
+ bpl .Lfailure
+ mov x0, #2
+ mov x1, #-1
+ adds x2, x0, x1
+ bcc .Lfailure
+ mov x0, #0x8000000000000000
+ mov x1, #-1
+ adds x2, x0, x1
+ bvc .Lfailure
+
+ mov w0, #1
+ mov w1, #1
+ subs w2, w0, w1
+ bne .Lfailure
+ mov w0, #-1
+ mov w1, #1
+ subs w2, w0, w1
+ bpl .Lfailure
+ mov w0, #2
+ mov w1, #1
+ subs w2, w0, w1
+ bcc .Lfailure
+ mov w0, #0x80000000
+ mov w1, #1
+ subs w2, w0, w1
+ bvc .Lfailure
+
+ mov x0, #1
+ mov x1, #1
+ subs x2, x0, x1
+ bne .Lfailure
+ mov x0, #-1
+ mov x1, #1
+ subs x2, x0, x1
+ bpl .Lfailure
+ mov x0, #2
+ mov x1, #1
+ subs x2, x0, x1
+ bcc .Lfailure
+ mov x0, #0x8000000000000000
+ mov x1, #1
+ subs x2, x0, x1
+ bvc .Lfailure
+
+ pass
+.Lfailure:
+ fail