Fixes for gdb.xml/tdesc-regs.exp.
[deliverable/binutils-gdb.git] / sim / testsuite / d10v-elf / t-sub2w.s
CommitLineData
c906108c
SS
1.include "t-macros.i"
2
3 start
4
5;; The d10v implements negated addition for subtraction
6
7 .macro check_sub2w s x y r c v
8
9 ;; clear carry
10 ldi r6,#0x8004
11 mvtc r6,cr0
12
13 ;; load opnds
14 ld2w r6, @(1f,r0)
15 ld2w r8, @(2f,r0)
16 .data
171: .long \x
182: .long \y
19 .text
20
21 ;; subtract
22 SUB2W r6, r8
23
24 ;; verify result
25 ld2w r10, @(1f,r0)
26 .data
271: .long \r
28 .text
29 cmpeq r6, r10
30 brf0f 2f
31 cmpeq r7, r11
32 brf0t 3f
332: ldi r4, 1
34 ldi r0, \s
35 trap 15
363:
37
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
461:
47 .endm
48
49check_sub2w 1 0x00000000 0x00000000 0x00000000 1 0
50check_sub2w 2 0x00000000 0x00000001 0xffffffff 0 0
51check_sub2w 3 0x00000001 0x00000000 0x00000001 1 0
52check_sub2w 3 0x00000001 0x00000001 0x00000000 1 0
53check_sub2w 5 0x00000000 0x80000000 0x80000000 0 1
54check_sub2w 6 0x80000000 0x00000001 0x7fffffff 1 1
55check_sub2w 7 0x7fffffff 0x7fffffff 0x00000000 1 0
56
57 exit0
This page took 0.925829 seconds and 4 git commands to generate.