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
s390-ccw.img: replace while loop with a disabled wait on s390 bios
[qemu/agraf.git]
/
tests
/
tcg
/
mips
/
mips64-dsp
/
extp.c
blob
c72f54bace8788b364d604325674824565f609dd
1
#include
"io.h"
2
3
int
main
(
void
)
4
{
5
long long
rt
,
ach
,
acl
,
dsp
;
6
long long
result
;
7
8
ach
=
0x05
;
9
acl
=
0xB4CB
;
10
dsp
=
0x07
;
11
result
=
0x000C
;
12
13
__asm
14
(
"wrdsp %1, 0x01
\n\t
"
15
"mthi %2, $ac1
\n\t
"
16
"mtlo %3, $ac1
\n\t
"
17
"extp %0, $ac1, 0x03
\n\t
"
18
"rddsp %1
\n\t
"
19
:
"=r"
(
rt
),
"+r"
(
dsp
)
20
:
"r"
(
ach
),
"r"
(
acl
)
21
);
22
dsp
= (
dsp
>>
14
) &
0x01
;
23
if
((
dsp
!=
0
) || (
result
!=
rt
)) {
24
printf
(
"extp wrong
\n
"
);
25
26
return
-
1
;
27
}
28
29
ach
=
0x05
;
30
acl
=
0xB4CB
;
31
dsp
=
0x01
;
32
33
__asm
34
(
"wrdsp %1, 0x01
\n\t
"
35
"mthi %2, $ac1
\n\t
"
36
"mtlo %3, $ac1
\n\t
"
37
"extp %0, $ac1, 0x03
\n\t
"
38
"rddsp %1
\n\t
"
39
:
"=r"
(
rt
),
"+r"
(
dsp
)
40
:
"r"
(
ach
),
"r"
(
acl
)
41
);
42
dsp
= (
dsp
>>
14
) &
0x01
;
43
if
(
dsp
!=
1
) {
44
printf
(
"extp wrong
\n
"
);
45
46
return
-
1
;
47
}
48
49
return
0
;
50
}