aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg/cris/bare/check_addcv17.s
blob: 52ef7a97169c2af39d32a5edcaa8f1b2dc3bca01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# mach:  crisv17

 .include "testutils.inc"

 .macro addc Rs Rd inc=0
# Create the instruction manually since there is no assembler support yet
 .word (\Rd << 12) | \Rs | (\inc << 10) | 0x09a0
 .endm

 start

 .data
mem1:
 .dword 0x0
mem2:
 .dword 0x12345678

 .text
 move.d mem1,r4
 clearf nzvc
 addc 4 3
 test_cc 0 1 0 0
 checkr3 0

 move.d mem1,r4
 clearf nzvc
 ax
 addc 4 3
 test_cc 0 0 0 0
 checkr3 0

 move.d mem1,r4
 clearf nzvc
 setf c
 addc 4 3
 test_cc 0 0 0 0
 checkr3 1

 move.d mem2,r4
 moveq 2, r3
 clearf nzvc
 setf c
 addc 4 3
 test_cc 0 0 0 0
 checkr3 1234567b

 move.d mem2,r5
 clearf nzvc
 cmp.d r4,r5
 test_cc 0 1 0 0

 move.d mem2,r4
 moveq 2, r3
 clearf nzvc
 addc 4 3 inc=1
 test_cc 0 0 0 0
 checkr3 1234567a

 move.d mem2,r5
 clearf nzvc
 addq 4,r5
 cmp.d r4,r5
 test_cc 0 1 0 0

 quit