repo.or.cz
/
qemu
/
pbrook.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
hw/omap1.c: Add fallthrough markers and breaks
[qemu/pbrook.git]
/
tests
/
tcg
/
xtensa
/
macros.inc
blob
c9be1ce5163f61b26ce1d390563c8777cad4c8e3
1
.macro test_suite name
2
.data
3
status: .word result
4
result: .space 256
5
.text
6
.global main
7
.align 4
8
main:
9
.endm
10
11
.macro reset_ps
12
movi a2, 0x4000f
13
wsr a2, ps
14
isync
15
.endm
16
17
.macro test_suite_end
18
reset_ps
19
movi a0, status
20
l32i a2, a0, 0
21
movi a0, result
22
sub a2, a2, a0
23
movi a3, 0
24
loopnez a2, 1f
25
l8ui a2, a0, 0
26
or a3, a3, a2
27
addi a0, a0, 1
28
1:
29
exit
30
.endm
31
32
.macro print text
33
.data
34
97: .ascii "\text\n"
35
98:
36
.align 4
37
.text
38
movi a2, 4
39
movi a3, 2
40
movi a4, 97b
41
movi a5, 98b
42
sub a5, a5, a4
43
simcall
44
.endm
45
46
.macro test name
47
//print test_\name
48
test_\name:
49
.global test_\name
50
.endm
51
52
.macro test_end
53
99:
54
reset_ps
55
movi a2, status
56
l32i a3, a2, 0
57
addi a3, a3, 1
58
s32i a3, a2, 0
59
.endm
60
61
.macro exit
62
movi a2, 1
63
simcall
64
.endm
65
66
.macro test_fail
67
movi a2, status
68
l32i a2, a2, 0
69
movi a3, 1
70
s8i a3, a2, 0
71
j 99f
72
.endm
73
74
.macro assert cond, arg1, arg2
75
b\cond \arg1, \arg2, 90f
76
test_fail
77
90:
78
nop
79
.endm
80
81
.macro set_vector vector, addr
82
movi a2, handler_\vector
83
movi a3, \addr
84
s32i a3, a2, 0
85
.endm