root / tests / tcg / mips / mips32-dsp / mulq_rs_ph.c @ 4877866e
History | View | Annotate | Download (800 Bytes)
1 |
#include<stdio.h> |
---|---|
2 |
#include<assert.h> |
3 |
|
4 |
int main()
|
5 |
{ |
6 |
int rd, rs, rt, dsp;
|
7 |
int result, resultdsp;
|
8 |
|
9 |
rs = 0x80001234;
|
10 |
rt = 0x80004321;
|
11 |
result = 0x7FFF098C;
|
12 |
resultdsp = 1;
|
13 |
|
14 |
__asm |
15 |
("wrdsp $0\n\t"
|
16 |
"mulq_rs.ph %0, %2, %3\n\t"
|
17 |
"rddsp %1\n\t"
|
18 |
: "=r"(rd), "=r"(dsp) |
19 |
: "r"(rs), "r"(rt) |
20 |
); |
21 |
dsp = (dsp >> 21) & 0x01; |
22 |
assert(rd == result); |
23 |
assert(dsp == resultdsp); |
24 |
|
25 |
rs = 0x80011234;
|
26 |
rt = 0x80024321;
|
27 |
result = 0x7FFD098C;
|
28 |
resultdsp = 0;
|
29 |
|
30 |
__asm |
31 |
("wrdsp $0\n\t"
|
32 |
"mulq_rs.ph %0, %2, %3\n\t"
|
33 |
"rddsp %1\n\t"
|
34 |
: "=r"(rd), "=r"(dsp) |
35 |
: "r"(rs), "r"(rt) |
36 |
); |
37 |
dsp = (dsp >> 21) & 0x01; |
38 |
assert(rd == result); |
39 |
assert(dsp == resultdsp); |
40 |
|
41 |
return 0; |
42 |
} |