diff options
author | Stan Shebs <shebs@codesourcery.com> | 1999-04-16 01:35:26 +0000 |
---|---|---|
committer | Stan Shebs <shebs@codesourcery.com> | 1999-04-16 01:35:26 +0000 |
commit | c906108c21474dfb4ed285bcc0ac6fe02cd400cc (patch) | |
tree | a0015aa5cedc19ccbab307251353a41722a3ae13 /sim/testsuite/d10v-elf/t-sub.s | |
parent | cd946cff9ede3f30935803403f06f6ed30cad136 (diff) | |
download | binutils-gdb-c906108c21474dfb4ed285bcc0ac6fe02cd400cc.tar.gz |
Initial creation of sourceware repositorygdb-4_18-branchpoint
Diffstat (limited to 'sim/testsuite/d10v-elf/t-sub.s')
-rw-r--r-- | sim/testsuite/d10v-elf/t-sub.s | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/sim/testsuite/d10v-elf/t-sub.s b/sim/testsuite/d10v-elf/t-sub.s new file mode 100644 index 00000000000..26d0a3a1c9a --- /dev/null +++ b/sim/testsuite/d10v-elf/t-sub.s @@ -0,0 +1,42 @@ +.include "t-macros.i" + + start + +;; The d10v implements negated addition for subtraction + + .macro check_sub s x y r c + ;; clear carry + ldi r6,#0x8004 + mvtc r6,cr0 + ;; subtract + ldi r10,#\x + ldi r11,#\y + sub r10, r11 + ;; verify result + ldi r12, #\r + cmpeq r10, r12 + brf0t 1f + ldi r6, 1 + ldi r2, #\s + trap 15 +1: + ;; verify carry + mvfc r6, cr0 + and3 r6, r6, #1 + cmpeqi r6, #\c + brf0t 1f + ldi r6, 1 + ldi r2, #\s + trap 15 +1: + .endm + +check_sub 1 0x0000 0x0000 0x0000 1 +check_sub 2 0x0000 0x0001 0xffff 0 +check_sub 3 0x0001 0x0000 0x0001 1 +check_sub 4 0x0001 0x0001 0x0000 1 +check_sub 5 0x0000 0x8000 0x8000 0 +check_sub 6 0x8000 0x0001 0x7fff 1 +check_sub 7 0x7fff 0x7fff 0x0000 1 + + exit0 |