repo.or.cz
/
qemu
/
agraf.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
PPC: Fix rldcl
[qemu/agraf.git]
/
tests
/
tcg
/
mips
/
mips32-dsp
/
dpaq_s_w_ph.c
blob
a6425b6edc848bcc7d19b861b1e016fdbf383cf9
1
#include<stdio.h>
2
#include<assert.h>
3
4
int
main
()
5
{
6
int
rs
,
rt
,
dsp
;
7
int
ach
=
0
,
acl
=
0
;
8
int
resulth
,
resultl
,
resultdsp
;
9
10
rs
=
0x800000FF
;
11
rt
=
0x80000002
;
12
resulth
=
0x00
;
13
resultl
=
0x800003FB
;
14
resultdsp
=
0x01
;
15
__asm
16
(
"mthi %0, $ac1
\n\t
"
17
"mtlo %1, $ac1
\n\t
"
18
"dpaq_s.w.ph $ac1, %3, %4
\n\t
"
19
"mfhi %0, $ac1
\n\t
"
20
"mflo %1, $ac1
\n\t
"
21
"rddsp %2
\n\t
"
22
:
"+r"
(
ach
),
"+r"
(
acl
),
"=r"
(
dsp
)
23
:
"r"
(
rs
),
"r"
(
rt
)
24
);
25
dsp
=
dsp
>>
17
&
0x01
;
26
assert
(
dsp
==
resultdsp
);
27
assert
(
ach
==
resulth
);
28
assert
(
acl
==
resultl
);
29
30
return
0
;
31
}