root / tests / cris / check_ba.s @ 651721b2
History | View | Annotate | Download (937 Bytes)
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 |
14 |
main: |
15 |
moveq 0,$r3 |
16 |
|
17 |
; Short forward branch. |
18 |
ba 0f |
19 |
addq 1,$r3 |
20 |
fail |
21 |
|
22 |
; Max short forward branch. |
23 |
1: |
24 |
ba 2f |
25 |
addq 1,$r3 |
26 |
fail |
27 |
|
28 |
; Short backward branch. |
29 |
0: |
30 |
ba 1b |
31 |
addq 1,$r3 |
32 |
fail |
33 |
|
34 |
.space 254-2+smalloffset+1b-.,0 |
35 |
moveq 0,$r3 |
36 |
|
37 |
2: |
38 |
; Transit branch (long). |
39 |
ba 3f |
40 |
addq 1,$r3 |
41 |
fail |
42 |
|
43 |
moveq 0,$r3 |
44 |
4: |
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. |
55 |
3: |
56 |
ba 4b |
57 |
addq 1,$r3 |
58 |
fail |
59 |
|
60 |
5: |
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 |
69 |
6: |
70 |
; Transit branch. |
71 |
ba 7f |
72 |
addq 1,$r3 |
73 |
fail |
74 |
|
75 |
moveq 0,$r3 |
76 |
9: |
77 |
jsr pass |
78 |
nop |
79 |
|
80 |
; Transit branch. |
81 |
moveq 0,$r3 |
82 |
7: |
83 |
ba 8f |
84 |
addq 1,$r3 |
85 |
fail |
86 |
|
87 |
.space 32768-largeoffset+9b-.,0 |
88 |
|
89 |
8: |
90 |
; Max long backward branch. |
91 |
ba 9b |
92 |
addq 1,$r3 |
93 |
fail |