[PATCH 47/57][Arm][OBJDUMP] Add support for MVE instructions: vaddv, vmlaldav, vmlada...
[binutils-gdb.git] / sim / testsuite / d10v-elf / t-sub2w.s
blob9f1bbb7321e8758f8cef01676d3254fd578c999a
1 .include "t-macros.i"
3 start
5 ;; The d10v implements negated addition for subtraction
7 .macro check_sub2w s x y r c v
9 ;; clear carry
10 ldi r6,#0x8004
11 mvtc r6,cr0
13 ;; load opnds
14 ld2w r6, @(1f,r0)
15 ld2w r8, @(2f,r0)
16 .data
17 1: .long \x
18 2: .long \y
19 .text
21 ;; subtract
22 SUB2W r6, r8
24 ;; verify result
25 ld2w r10, @(1f,r0)
26 .data
27 1: .long \r
28 .text
29 cmpeq r6, r10
30 brf0f 2f
31 cmpeq r7, r11
32 brf0t 3f
33 2: ldi r4, 1
34 ldi r0, \s
35 trap 15
38 ;; verify carry
39 mvfc r6, cr0
40 and3 r6, r6, #1
41 cmpeqi r6, #\c
42 brf0t 1f
43 ldi r4, 1
44 ldi r0, \s
45 trap 15
47 .endm
49 check_sub2w 1 0x00000000 0x00000000 0x00000000 1 0
50 check_sub2w 2 0x00000000 0x00000001 0xffffffff 0 0
51 check_sub2w 3 0x00000001 0x00000000 0x00000001 1 0
52 check_sub2w 3 0x00000001 0x00000001 0x00000000 1 0
53 check_sub2w 5 0x00000000 0x80000000 0x80000000 0 1
54 check_sub2w 6 0x80000000 0x00000001 0x7fffffff 1 1
55 check_sub2w 7 0x7fffffff 0x7fffffff 0x00000000 1 0
57 exit0