xref: /qemu/tests/tcg/cris/bare/check_ba.s (revision d4f6e58f)
1# mach: crisv0 crisv3 crisv8 crisv10 crisv32
2# output: a\n
3
4
5 .set smalloffset,0
6 .set largeoffset,0
7
8
9	.macro fail
10	jump _fail
11	.endm
12
13	.global	main
14main:
15 moveq 0,$r3
16
17; Short forward branch.
18 ba 0f
19 addq 1,$r3
20 fail
21
22; Max short forward branch.
231:
24 ba 2f
25 addq 1,$r3
26 fail
27
28; Short backward branch.
290:
30 ba 1b
31 addq 1,$r3
32 fail
33
34 .space 254-2+smalloffset+1b-.,0
35 moveq 0,$r3
36
372:
38; Transit branch (long).
39 ba 3f
40 addq 1,$r3
41 fail
42
43 moveq 0,$r3
444:
45; Long forward branch.
46 ba 5f
47 addq 1,$r3
48 fail
49
50 .space 256-2-smalloffset+4b-.,0
51
52 moveq 0,$r3
53
54; Max short backward branch.
553:
56 ba 4b
57 addq 1,$r3
58 fail
59
605:
61; Max long forward branch.
62 ba 6f
63 addq 1,$r3
64 fail
65
66 .space 32766+largeoffset-2+5b-.,0
67
68 moveq 0,$r3
696:
70; Transit branch.
71 ba 7f
72 addq 1,$r3
73 fail
74
75 moveq 0,$r3
769:
77 jsr pass
78 nop
79
80; Transit branch.
81 moveq 0,$r3
827:
83 ba 8f
84 addq 1,$r3
85 fail
86
87 .space 32768-largeoffset+9b-.,0
88
898:
90; Max long backward branch.
91 ba 9b
92 addq 1,$r3
93 fail
94