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
/
mips32-dspr2
/
dpax_w_ph.c
blob
514797cfd1b454ae54ebc8c74447743a51c1cc48
1
#include<stdio.h>
2
#include<assert.h>
3
4
int
main
()
5
{
6
int
rs
,
rt
;
7
int
ach
=
5
,
acl
=
5
;
8
int
resulth
,
resultl
;
9
10
rs
=
0x00FF00FF
;
11
rt
=
0x00010002
;
12
resulth
=
0x05
;
13
resultl
=
0x0302
;
14
__asm
15
(
"mthi %0, $ac1
\n\t
"
16
"mtlo %1, $ac1
\n\t
"
17
"dpax.w.ph $ac1, %2, %3
\n\t
"
18
"mfhi %0, $ac1
\n\t
"
19
"mflo %1, $ac1
\n\t
"
20
:
"+r"
(
ach
),
"+r"
(
acl
)
21
:
"r"
(
rs
),
"r"
(
rt
)
22
);
23
assert
(
ach
==
resulth
);
24
assert
(
acl
==
resultl
);
25
26
ach
=
6
,
acl
=
7
;
27
rs
=
0xFFFF00FF
;
28
rt
=
0xFFFF0002
;
29
resulth
=
0x05
;
30
resultl
=
0xFFFFFF06
;
31
__asm
32
(
"mthi %0, $ac1
\n\t
"
33
"mtlo %1, $ac1
\n\t
"
34
"dpax.w.ph $ac1, %2, %3
\n\t
"
35
"mfhi %0, $ac1
\n\t
"
36
"mflo %1, $ac1
\n\t
"
37
:
"+r"
(
ach
),
"+r"
(
acl
)
38
:
"r"
(
rs
),
"r"
(
rt
)
39
);
40
assert
(
ach
==
resulth
);
41
assert
(
acl
==
resultl
);
42
43
return
0
;
44
}