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