Automatic date update in version.in
[deliverable/binutils-gdb.git] / sim / testsuite / bfin / hwloop-branch-out.s
1 # Blackfin testcase for branching out of the middle of a hardware loop
2 # mach: bfin
3
4 .include "testutils.inc"
5
6 .macro test_prep lc:req, sym:req
7 imm32 P0, \lc
8 loadsym P1, \sym
9 R5 = 0;
10 R6 = 0;
11 R7 = 0;
12 LSETUP (1f, 2f) LC0 = P0;
13 .endm
14
15 .macro test_check exp5:req, exp6:req, exp7:req, expLC
16 imm32 R4, \exp5;
17 CC = R4 == R5;
18 IF !CC JUMP 2f;
19 imm32 R4, \exp6;
20 CC = R4 == R6;
21 IF !CC JUMP 2f;
22 imm32 R4, \exp7;
23 CC = R4 == R7;
24 IF !CC JUMP 2f;
25 R3 = LC0;
26 imm32 R4, \expLC;
27 CC = R4 == R3;
28 IF !CC JUMP 2f;
29 JUMP 3f;
30 2: fail
31 3:
32 .endm
33
34 start
35 mnop;
36
37 test_jump_s:
38 .macro test_jump_s lc:req
39 test_prep \lc, 3f
40 1: JUMP (P1);
41 R5 += 1;
42 2: R6 += 1;
43 fail
44 3: R7 += 1;
45 test_check 0, 0, 1, \lc
46 .endm
47 test_jump_s 0
48 test_jump_s 1
49 test_jump_s 2
50 test_jump_s 10
51
52 test_jump_m:
53 .macro test_jump_m lc:req
54 test_prep \lc, 3f
55 1: R5 += 1;
56 JUMP (P1);
57 2: R6 += 1;
58 fail
59 3: R7 += 1;
60 test_check 1, 0, 1, \lc
61 .endm
62 test_jump_m 0
63 test_jump_m 1
64 test_jump_m 2
65 test_jump_m 10
66
67 test_jump_e:
68 .macro test_jump_e lc:req, lcend:req
69 test_prep \lc, 3f
70 1: R5 += 1;
71 R6 += 1;
72 2: JUMP (P1);
73 fail
74 3: R7 += 1;
75 test_check 1, 1, 1, \lcend
76 .endm
77 test_jump_e 0, 0
78 test_jump_e 1, 0
79 test_jump_e 2, 1
80 test_jump_e 10, 9
81
82 test_call_s:
83 .macro test_call_s lc:req, exp5:req, exp6:req, exp7:req
84 test_prep \lc, __ret
85 1: CALL (P1);
86 R5 += 1;
87 2: R6 += 1;
88 3: R7 += 1;
89 test_check \exp5, \exp6, \exp7, 0
90 .endm
91 test_call_s 0, 1, 1, 2
92 test_call_s 1, 1, 1, 2
93 test_call_s 2, 2, 2, 3
94 test_call_s 10, 10, 10, 11
95
96 test_call_m:
97 .macro test_call_m lc:req, exp5:req, exp6:req, exp7:req
98 test_prep \lc, __ret
99 1: R5 += 1;
100 CALL (P1);
101 2: R6 += 1;
102 3: R7 += 1;
103 test_check \exp5, \exp6, \exp7, 0
104 .endm
105 test_call_m 0, 1, 1, 2
106 test_call_m 1, 1, 1, 2
107 test_call_m 2, 2, 2, 3
108 test_call_m 10, 10, 10, 11
109
110 test_call_e:
111 .macro test_call_e lc:req, exp5:req, exp6:req, exp7:req
112 test_prep \lc, __ret
113 1: R5 += 1;
114 R6 += 1;
115 2: CALL (P1);
116 3: R7 += 1;
117 test_check \exp5, \exp6, \exp7, 0
118 .endm
119 test_call_e 0, 1, 1, 2
120 test_call_e 1, 1, 1, 2
121 test_call_e 2, 2, 2, 3
122 test_call_e 10, 10, 10, 11
123
124 pass
125
126 __ret:
127 nop;nop;nop;
128 R7 += 1;
129 rts;
This page took 0.035476 seconds and 4 git commands to generate.