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_shllv_ph.c
blob
f98a6322dc1dc4b500a131c271dd63230c96ed4f
1
#include<stdio.h>
2
#include<assert.h>
3
4
int
main
()
5
{
6
int
rd
,
rs
,
rt
,
dsp
;
7
int
result
,
resultdsp
;
8
9
rs
=
0x0
;
10
rt
=
0x12345678
;
11
result
=
0x12345678
;
12
resultdsp
=
0
;
13
14
__asm
15
(
"shllv.ph %0, %2, %3
\n\t
"
16
"rddsp %1
\n\t
"
17
:
"=r"
(
rd
),
"=r"
(
dsp
)
18
:
"r"
(
rt
),
"r"
(
rs
)
19
);
20
dsp
= (
dsp
>>
22
) &
0x01
;
21
assert
(
dsp
==
resultdsp
);
22
assert
(
rd
==
result
);
23
24
rs
=
0x0B
;
25
rt
=
0x12345678
;
26
result
=
0xA000C000
;
27
resultdsp
=
1
;
28
29
__asm
30
(
"shllv.ph %0, %2, %3
\n\t
"
31
"rddsp %1
\n\t
"
32
:
"=r"
(
rd
),
"=r"
(
dsp
)
33
:
"r"
(
rt
),
"r"
(
rs
)
34
);
35
dsp
= (
dsp
>>
22
) &
0x01
;
36
assert
(
dsp
==
resultdsp
);
37
assert
(
rd
==
result
);
38
39
return
0
;
40
}