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_r2_addu_ph.c
blob
1d7a25a2a773ab80424981793f38f7d0433dc6d1
1
#include<stdio.h>
2
#include<assert.h>
3
4
int
main
()
5
{
6
int
rd
,
rs
,
rt
;
7
int
dsp
;
8
int
result
;
9
10
rs
=
0x00FF00FF
;
11
rt
=
0x00010001
;
12
result
=
0x01000100
;
13
__asm
14
(
"addu.ph %0, %1, %2
\n\t
"
15
:
"=r"
(
rd
)
16
:
"r"
(
rs
),
"r"
(
rt
)
17
);
18
assert
(
rd
==
result
);
19
20
rs
=
0xFFFF1111
;
21
rt
=
0x00020001
;
22
result
=
0x00011112
;
23
__asm
24
(
"addu.ph %0, %2, %3
\n\t
"
25
"rddsp %1
\n\t
"
26
:
"=r"
(
rd
),
"=r"
(
dsp
)
27
:
"r"
(
rs
),
"r"
(
rt
)
28
);
29
assert
(
rd
==
result
);
30
assert
(((
dsp
>>
20
) &
0x01
) ==
1
);
31
32
return
0
;
33
}