summaryrefslogtreecommitdiff
path: root/sim/testsuite/d10v-elf/t-mac.s
diff options
context:
space:
mode:
Diffstat (limited to 'sim/testsuite/d10v-elf/t-mac.s')
-rw-r--r--sim/testsuite/d10v-elf/t-mac.s71
1 files changed, 71 insertions, 0 deletions
diff --git a/sim/testsuite/d10v-elf/t-mac.s b/sim/testsuite/d10v-elf/t-mac.s
new file mode 100644
index 00000000000..364f61531d1
--- /dev/null
+++ b/sim/testsuite/d10v-elf/t-mac.s
@@ -0,0 +1,71 @@
+.include "t-macros.i"
+
+ start
+
+ ;; clear FX
+ loadpsw2 0x8005
+ loadacc2 a1 0x7f 0xffff 0xffff
+ load r8 0xffff
+ load r9 0x8001
+test_macu1:
+ MACU a1, r9, r8
+ checkacc2 1 a1 0x80 0x8000 0x7FFE
+
+ ;; set FX
+ loadpsw2 0x8085
+ loadacc2 a1 0x7f 0xffff 0xffff
+ load r8 0xffff
+ load r9 0x8001
+test_macu2:
+ MACU a1, r9, r8
+ checkacc2 2 a1 0x81 0x0000 0xfffd
+
+
+
+
+ ;; clear FX
+ ldi r2, #0x8005
+ mvtc r2, cr0
+
+ loadacc2 a1 0x7f 0xffff 0xffff
+ ldi r8, #0xffff
+ ldi r9, #0x7FFF
+test_macsu1:
+ MACSU a1, r9, r8
+ checkacc2 3 a1 0x80 0x7FFE 0x8000
+
+ ;; set FX
+ ldi r2, #0x8085
+ mvtc r2, cr0
+
+ loadacc2 a1 0x7f 0xffff 0xffff
+ ldi r8, #0xffff
+ ldi r9, #0x7FFF
+test_macsu2:
+ MACSU a1, r9, r8
+ checkacc2 4 a1 0x80 0xfffd 0x0001
+
+ ;; clear FX
+ ldi r2, #0x8005
+ mvtc r2, cr0
+
+ loadacc2 a1 0x7f 0xffff 0xffff
+ ldi r8, 0xffff
+ ldi r9, 0x8001
+test_macsu3:
+ MACSU a1, r9, r8
+ checkacc2 5 a1 0x7F 0x8001 0x7FFE
+
+ ;; set FX
+ ldi r2, #0x8085
+ mvtc r2, cr0
+
+ loadacc2 a1 0x7f 0xffff 0xffff
+ ldi r8, #0xffff
+ ldi r9, #0x8001
+test_macsu4:
+ MACSU a1, r9, r8
+ checkacc2 6 a1 0x7f 0x0002 0xFFFD
+
+ exit0
+