repo.or.cz
/
qemu
/
ar7.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
ppc/pnv: Introduce PnvMachineClass::dt_power_mgt()
[qemu/ar7.git]
/
tests
/
tcg
/
xtensa
/
test_loop.S
blob
0cfd8661ea0e5267916a7d5cc18cec7cafc63c80
1
#include "macros.inc"
2
3
test_suite loop
4
5
#if XCHAL_HAVE_LOOPS
6
7
test loop
8
movi a2, 0
9
movi a3, 5
10
loop a3, 1f
11
addi a2, a2, 1
12
1:
13
assert eqi, a2, 5
14
test_end
15
16
test loop0
17
movi a2, 0
18
loop a2, 1f
19
rsr a2, lcount
20
assert eqi, a2, -1
21
j 1f
22
1:
23
test_end
24
25
test loop_jump
26
movi a2, 0
27
movi a3, 5
28
loop a3, 1f
29
addi a2, a2, 1
30
j 1f
31
1:
32
assert eqi, a2, 1
33
test_end
34
35
test loop_branch
36
movi a2, 0
37
movi a3, 5
38
loop a3, 1f
39
addi a2, a2, 1
40
beqi a2, 3, 1f
41
1:
42
assert eqi, a2, 3
43
test_end
44
45
test loop_manual
46
movi a2, 0
47
movi a3, 5
48
movi a4, 1f
49
movi a5, 2f
50
wsr a3, lcount
51
wsr a4, lbeg
52
wsr a5, lend
53
isync
54
j 1f
55
.align 4
56
1:
57
addi a2, a2, 1
58
2:
59
assert eqi, a2, 6
60
test_end
61
62
test loop_excm
63
movi a2, 0
64
movi a3, 5
65
rsr a4, ps
66
movi a5, 0x10
67
or a4, a4, a5
68
wsr a4, ps
69
isync
70
loop a3, 1f
71
addi a2, a2, 1
72
1:
73
xor a4, a4, a5
74
isync
75
wsr a4, ps
76
assert eqi, a2, 1
77
test_end
78
79
test lbeg_invalidation
80
movi a2, 0
81
movi a3, 1
82
movi a4, 1f
83
movi a5, 3f
84
wsr a3, lcount
85
wsr a4, lbeg
86
wsr a5, lend
87
isync
88
j 1f
89
.align 4
90
1:
91
addi a2, a2, 1
92
j 2f
93
.align 4
94
2:
95
addi a2, a2, 2
96
movi a3, 2b
97
wsr a3, lbeg
98
isync
99
nop
100
3:
101
assert eqi, a2, 5
102
test_end
103
104
test lend_invalidation
105
movi a2, 0
106
movi a3, 5
107
movi a4, 1f
108
movi a5, 2f
109
wsr a3, lcount
110
wsr a4, lbeg
111
wsr a5, lend
112
isync
113
j 1f
114
.align 4
115
1:
116
addi a2, a2, 1
117
2:
118
beqi a3, 3, 1f
119
assert eqi, a2, 6
120
movi a3, 3
121
wsr a3, lcount
122
wsr a4, lend
123
isync
124
j 1b
125
1:
126
assert eqi, a2, 7
127
test_end
128
129
test loopnez
130
movi a2, 0
131
movi a3, 5
132
loopnez a3, 1f
133
addi a2, a2, 1
134
1:
135
assert eqi, a2, 5
136
137
movi a2, 0
138
movi a3, 0
139
loopnez a3, 1f
140
test_fail
141
1:
142
test_end
143
144
test loopgtz
145
movi a2, 0
146
movi a3, 5
147
loopgtz a3, 1f
148
addi a2, a2, 1
149
1:
150
assert eqi, a2, 5
151
152
movi a2, 0
153
movi a3, 0
154
loopgtz a3, 1f
155
test_fail
156
1:
157
158
movi a2, 0
159
movi a3, 0x80000000
160
loopgtz a3, 1f
161
test_fail
162
1:
163
test_end
164
165
#endif
166
167
test_suite_end