aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg/cris/check_addcv17.s
diff options
context:
space:
mode:
authorRabin Vincent <rabinv@axis.com>2016-08-24 10:42:16 +0200
committerEdgar E. Iglesias <edgar.iglesias@xilinx.com>2016-09-28 11:32:06 +0200
commit4a58f35b793d5d09d6cef921bf6ed7ffc39669fd (patch)
tree03bac67e7d77db7bc58e7f683940a777be857c71 /tests/tcg/cris/check_addcv17.s
parentceffd34e8589a9a4f18849a21ae1fecaef3af02e (diff)
tests: cris: add v17 ADDC test
Add a test for the newly implemented ADDC instruction in the v17 CRIS CPU. Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Signed-off-by: Rabin Vincent <rabinv@axis.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Diffstat (limited to 'tests/tcg/cris/check_addcv17.s')
-rw-r--r--tests/tcg/cris/check_addcv17.s65
1 files changed, 65 insertions, 0 deletions
diff --git a/tests/tcg/cris/check_addcv17.s b/tests/tcg/cris/check_addcv17.s
new file mode 100644
index 0000000000..52ef7a9716
--- /dev/null
+++ b/tests/tcg/cris/check_addcv17.s
@@ -0,0 +1,65 @@
+# mach: crisv17
+
+ .include "testutils.inc"
+
+ .macro addc Rs Rd inc=0
+# Create the instruction manually since there is no assembler support yet
+ .word (\Rd << 12) | \Rs | (\inc << 10) | 0x09a0
+ .endm
+
+ start
+
+ .data
+mem1:
+ .dword 0x0
+mem2:
+ .dword 0x12345678
+
+ .text
+ move.d mem1,r4
+ clearf nzvc
+ addc 4 3
+ test_cc 0 1 0 0
+ checkr3 0
+
+ move.d mem1,r4
+ clearf nzvc
+ ax
+ addc 4 3
+ test_cc 0 0 0 0
+ checkr3 0
+
+ move.d mem1,r4
+ clearf nzvc
+ setf c
+ addc 4 3
+ test_cc 0 0 0 0
+ checkr3 1
+
+ move.d mem2,r4
+ moveq 2, r3
+ clearf nzvc
+ setf c
+ addc 4 3
+ test_cc 0 0 0 0
+ checkr3 1234567b
+
+ move.d mem2,r5
+ clearf nzvc
+ cmp.d r4,r5
+ test_cc 0 1 0 0
+
+ move.d mem2,r4
+ moveq 2, r3
+ clearf nzvc
+ addc 4 3 inc=1
+ test_cc 0 0 0 0
+ checkr3 1234567a
+
+ move.d mem2,r5
+ clearf nzvc
+ addq 4,r5
+ cmp.d r4,r5
+ test_cc 0 1 0 0
+
+ quit