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
/
extp.c
blob
21a67af21656590132a9f8eabbff19f9b8326e34
1
#include<stdio.h>
2
#include<assert.h>
3
4
int
main
()
5
{
6
int
rt
,
ach
,
acl
,
dsp
;
7
int
result
;
8
9
ach
=
0x05
;
10
acl
=
0xB4CB
;
11
dsp
=
0x07
;
12
result
=
0x000C
;
13
14
__asm
15
(
"wrdsp %1, 0x01
\n\t
"
16
"mthi %2, $ac1
\n\t
"
17
"mtlo %3, $ac1
\n\t
"
18
"extp %0, $ac1, 0x03
\n\t
"
19
"rddsp %1
\n\t
"
20
:
"=r"
(
rt
),
"+r"
(
dsp
)
21
:
"r"
(
ach
),
"r"
(
acl
)
22
);
23
dsp
= (
dsp
>>
14
) &
0x01
;
24
assert
(
dsp
==
0
);
25
assert
(
result
==
rt
);
26
27
ach
=
0x05
;
28
acl
=
0xB4CB
;
29
dsp
=
0x01
;
30
31
__asm
32
(
"wrdsp %1, 0x01
\n\t
"
33
"mthi %2, $ac1
\n\t
"
34
"mtlo %3, $ac1
\n\t
"
35
"extp %0, $ac1, 0x03
\n\t
"
36
"rddsp %1
\n\t
"
37
:
"=r"
(
rt
),
"+r"
(
dsp
)
38
:
"r"
(
ach
),
"r"
(
acl
)
39
);
40
dsp
= (
dsp
>>
14
) &
0x01
;
41
assert
(
dsp
==
1
);
42
43
return
0
;
44
}