repo.or.cz
/
qemu.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merge tag 'qemu-macppc-20230206' of https://github.com/mcayland/qemu into staging
[qemu.git]
/
tests
/
tcg
/
mips
/
user
/
ase
/
dsp
/
test_dsp_r1_bposge32.c
blob
d25417ea77b2a84a06a2384e242b682b0efd99a4
1
#include<stdio.h>
2
#include<assert.h>
3
4
int
main
()
5
{
6
int
dsp
,
sum
;
7
int
result
;
8
9
dsp
=
0x20
;
10
sum
=
0x01
;
11
result
=
0x02
;
12
13
__asm
14
(
"wrdsp %1
\n\t
"
15
"bposge32 test1
\n\t
"
16
"nop
\n\t
"
17
"addi %0, 0xA2
\n\t
"
18
"nop
\n\t
"
19
"test1:
\n\t
"
20
"addi %0, 0x01
\n\t
"
21
:
"+r"
(
sum
)
22
:
"r"
(
dsp
)
23
);
24
assert
(
sum
==
result
);
25
26
dsp
=
0x10
;
27
sum
=
0x01
;
28
result
=
0xA4
;
29
30
__asm
31
(
"wrdsp %1
\n\t
"
32
"bposge32 test2
\n\t
"
33
"nop
\n\t
"
34
"addi %0, 0xA2
\n\t
"
35
"nop
\n\t
"
36
"test2:
\n\t
"
37
"addi %0, 0x01
\n\t
"
38
:
"+r"
(
sum
)
39
:
"r"
(
dsp
)
40
);
41
assert
(
sum
==
result
);
42
43
return
0
;
44
}