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_insv.c
blob
9d674697ccaa9f5001b39ed511ef1f1c5cad1c5b
1
#include<stdio.h>
2
#include<assert.h>
3
4
int
main
()
5
{
6
int
rt
,
rs
,
dsp
;
7
int
result
;
8
9
/* msb = 10, lsb = 5 */
10
dsp
=
0x305
;
11
rt
=
0x12345678
;
12
rs
=
0x87654321
;
13
result
=
0x12345438
;
14
__asm
15
(
"wrdsp %2, 0x03
\n\t
"
16
"insv %0, %1
\n\t
"
17
:
"+r"
(
rt
)
18
:
"r"
(
rs
),
"r"
(
dsp
)
19
);
20
assert
(
rt
==
result
);
21
22
dsp
=
0x1000
;
23
rt
=
0xF0F0F0F0
;
24
rs
=
0xA5A5A5A5
;
25
result
=
0xA5A5A5A5
;
26
27
__asm
28
(
"wrdsp %2
\n\t
"
29
"insv %0, %1
\n\t
"
30
:
"+r"
(
rt
)
31
:
"r"
(
rs
),
"r"
(
dsp
)
32
);
33
assert
(
rt
==
result
);
34
35
return
0
;
36
}