PPC: Fix rldcl
[qemu/agraf.git] / tests / tcg / mips / mips32-dspr2 / dpaqx_sa_w_ph.c
blob798c4da5cab09c5c19de145b6429056885342ed5
1 #include<stdio.h>
2 #include<assert.h>
4 int main()
6 int rs, rt, dsp;
7 int ach = 5, acl = 5;
8 int resulth, resultl, resultdsp;
10 rs = 0x00FF00FF;
11 rt = 0x00010002;
12 resulth = 0x00;
13 resultl = 0x7FFFFFFF;
14 resultdsp = 0x01;
15 __asm
16 ("wrdsp %2\n\t"
17 "mthi %0, $ac1\n\t"
18 "mtlo %1, $ac1\n\t"
19 "dpaqx_sa.w.ph $ac1, %3, %4\n\t"
20 "mfhi %0, $ac1\n\t"
21 "mflo %1, $ac1\n\t"
22 "rddsp %2\n\t"
23 : "+r"(ach), "+r"(acl), "+r"(dsp)
24 : "r"(rs), "r"(rt)
26 assert(dsp >> (16 + 1) == resultdsp);
27 assert(ach == resulth);
28 assert(acl == resultl);
30 ach = 9;
31 acl = 0xb;
32 rs = 0x800000FF;
33 rt = 0x00018000;
34 resulth = 0x00;
35 resultl = 0x7fffffff;
36 resultdsp = 0x01;
37 __asm
38 ("wrdsp %2\n\t"
39 "mthi %0, $ac1\n\t"
40 "mtlo %1, $ac1\n\t"
41 "dpaqx_sa.w.ph $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 assert(dsp >> (16 + 1) == resultdsp);
49 assert(ach == resulth);
50 assert(acl == resultl);
52 return 0;