PPC: Fix rldcl
[qemu/agraf.git] / tests / tcg / mips / mips64-dspr2 / mul_s_ph.c
blob7c8b2c718f52dc559667bd89efbd536dd8bbf4ce
1 #include"io.h"
3 int main(void)
5 long long rd, rs, rt, dsp;
6 long long result, resultdsp;
8 rs = 0x03FB1234;
9 rt = 0x0BCC4321;
10 result = 0x7fff7FFF;
11 resultdsp = 1;
13 __asm
14 ("mul_s.ph %0, %2, %3\n\t"
15 "rddsp %1\n\t"
16 : "=r"(rd), "=r"(dsp)
17 : "r"(rs), "r"(rt)
19 dsp = (dsp >> 21) & 0x01;
20 if (rd != result || dsp != resultdsp) {
21 printf("1 mul_s.ph error\n");
22 return -1;
25 rs = 0x7fffff00;
26 rt = 0xff007fff;
27 result = 0xffffffff80008000;
28 resultdsp = 1;
30 __asm
31 ("mul_s.ph %0, %2, %3\n\t"
32 "rddsp %1\n\t"
33 : "=r"(rd), "=r"(dsp)
34 : "r"(rs), "r"(rt)
36 dsp = (dsp >> 21) & 0x01;
37 if (rd != result || dsp != resultdsp) {
38 printf("2 mul_s.ph error\n");
39 return -1;
42 dsp = 0;
43 __asm
44 ("wrdsp %0\n\t"
46 : "r"(dsp)
49 rs = 0x00320001;
50 rt = 0x00210002;
51 result = 0x06720002;
52 resultdsp = 0;
54 __asm
55 ("mul_s.ph %0, %2, %3\n\t"
56 "rddsp %1\n\t"
57 : "=r"(rd), "=r"(dsp)
58 : "r"(rs), "r"(rt)
60 dsp = (dsp >> 21) & 0x01;
61 if (rd != result || dsp != resultdsp) {
62 printf("3 mul_s.ph error\n");
63 return -1;
66 return 0;