PPC: Fix rldcl
[qemu/agraf.git] / tests / tcg / mips / mips32-dsp / dpaq_sa_l_w.c
blobce864844d96d0ca97ef30ee721db09d597261c2d
1 #include<stdio.h>
2 #include<assert.h>
4 int main()
6 int rs, rt, dsp;
7 int ach = 0, acl = 0;
8 int resulth, resultl, resultdsp;
10 rs = 0x80000000;
11 rt = 0x80000000;
12 resulth = 0x7FFFFFFF;
13 resultl = 0xFFFFFFFF;
14 resultdsp = 0x01;
15 __asm
16 ("mthi %0, $ac1\n\t"
17 "mtlo %0, $ac1\n\t"
18 "dpaq_sa.l.w $ac1, %3, %4\n\t"
19 "mfhi %0, $ac1\n\t"
20 "mflo %1, $ac1\n\t"
21 "rddsp %2\n\t"
22 : "+r"(ach), "+r"(acl), "=r"(dsp)
23 : "r"(rs), "r"(rt)
25 dsp = (dsp >> 17) & 0x01;
26 assert(dsp == resultdsp);
27 assert(ach == resulth);
28 assert(acl == resultl);
30 ach = 0x12;
31 acl = 0x48;
32 rs = 0x80000000;
33 rt = 0x80000000;
35 resulth = 0x7FFFFFFF;
36 resultl = 0xFFFFFFFF;
37 resultdsp = 0x01;
38 __asm
39 ("mthi %0, $ac1\n\t"
40 "mtlo %0, $ac1\n\t"
41 "dpaq_sa.l.w $ac1, %3, %4\n\t"
42 "mfhi %0, $ac1\n\t"
43 "mflo %1, $ac1\n\t"
44 "rddsp %2\n\t"
45 : "+r"(ach), "+r"(acl), "=r"(dsp)
46 : "r"(rs), "r"(rt)
48 dsp = (dsp >> 17) & 0x01;
49 assert(dsp == resultdsp);
50 assert(ach == resulth);
51 assert(acl == resultl);
53 ach = 0x741532A0;
54 acl = 0xfceabb08;
55 rs = 0x80000000;
56 rt = 0x80000000;
58 resulth = 0x7fffffff;
59 resultl = 0xffffffff;
60 resultdsp = 0x01;
61 __asm
62 ("mthi %0, $ac1\n\t"
63 "mtlo %0, $ac1\n\t"
64 "dpaq_sa.l.w $ac1, %3, %4\n\t"
65 "mfhi %0, $ac1\n\t"
66 "mflo %1, $ac1\n\t"
67 "rddsp %2\n\t"
68 : "+r"(ach), "+r"(acl), "=r"(dsp)
69 : "r"(rs), "r"(rt)
71 dsp = (dsp >> 17) & 0x01;
72 assert(dsp == resultdsp);
73 assert(ach == resulth);
74 assert(acl == resultl);
76 return 0;