xref: /openbmc/qemu/tests/tcg/cris/bare/testutils.inc (revision 139c1837)
1	.syntax	no_register_prefix
2
3	.macro	start
4	.text
5	.global	main
6main:
7	.endm
8
9	.macro	quit
10	jump	pass
11	nop
12	.endm
13
14	.macro	pass
15	jump	pass
16	nop
17	.endm
18
19	.macro	startnostack
20	start
21	.endm
22
23	.macro	fail
24	.data
2599:
26	.asciz " checkr3 failed\n"
27	.text
28	move.d	99b, $r10
29	jsr	_fail
30	nop
31	.endm
32
33	.macro	checkr3 val
34	cmp.d	0x\val, $r3
35	beq	100f
36	nop
37	.data
3899:
39	.asciz "checkr3 failed\n"
40	.text
41	move.d	99b, $r10
42	jsr	_fail
43	nop
44100:
45	.endm
46
47; Test the condition codes
48        .macro test_cc N Z V C
49        .if \N
50        bpl 9f
51        nop
52        .else
53        bmi 9f
54        nop
55        .endif
56        .if \Z
57        bne 9f
58        nop
59        .else
60        beq 9f
61        nop
62        .endif
63        .if \V
64        bvc 9f
65        nop
66        .else
67        bvs 9f
68        nop
69        .endif
70        .if \C
71        bcc 9f
72        nop
73        .else
74        bcs 9f
75        nop
76        .endif
77        ba 8f
78        nop
799:
80	.data
8199:
82	.asciz "test_move_cc failed\n"
83	.text
84	move.d	99b, $r10
85	jsr	_fail
86	nop
878:
88        .endm
89
90
91        .macro test_move_cc N Z V C
92        .if \N
93        bpl 9f
94        nop
95        .else
96        bmi 9f
97        nop
98        .endif
99        .if \Z
100        bne 9f
101        nop
102        .else
103        beq 9f
104        nop
105        .endif
106        ba 8f
107        nop
1089:
109	.data
11099:
111	.asciz "test_move_cc failed\n"
112	.text
113	move.d	99b, $r10
114	jsr	_fail
115	nop
1168:
117        .endm
118