[binutils, ARM, 5/16] BF insns infrastructure with new global reloc R_ARM_THM_BF16
[binutils-gdb.git] / sim / testsuite / d10v-elf / t-sub.s
blob26d0a3a1c9abb494741d9e407a7c265a124e9aed
1 .include "t-macros.i"
3 start
5 ;; The d10v implements negated addition for subtraction
7 .macro check_sub s x y r c
8 ;; clear carry
9 ldi r6,#0x8004
10 mvtc r6,cr0
11 ;; subtract
12 ldi r10,#\x
13 ldi r11,#\y
14 sub r10, r11
15 ;; verify result
16 ldi r12, #\r
17 cmpeq r10, r12
18 brf0t 1f
19 ldi r6, 1
20 ldi r2, #\s
21 trap 15
23 ;; verify carry
24 mvfc r6, cr0
25 and3 r6, r6, #1
26 cmpeqi r6, #\c
27 brf0t 1f
28 ldi r6, 1
29 ldi r2, #\s
30 trap 15
32 .endm
34 check_sub 1 0x0000 0x0000 0x0000 1
35 check_sub 2 0x0000 0x0001 0xffff 0
36 check_sub 3 0x0001 0x0000 0x0001 1
37 check_sub 4 0x0001 0x0001 0x0000 1
38 check_sub 5 0x0000 0x8000 0x8000 0
39 check_sub 6 0x8000 0x0001 0x7fff 1
40 check_sub 7 0x7fff 0x7fff 0x0000 1
42 exit0