PPC: Fix rldcl
[qemu/agraf.git] / tests / tcg / mips / mips32-dsp / dpsq_sa_l_w.c
blobb7b73fdb660d96734d442f803a70102aec8839c9
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 = 0xBC0123AD;
11 rt = 0x01643721;
12 resulth = 0xfdf4cbe0;
13 resultl = 0xd138776b;
14 resultdsp = 0x00;
15 __asm
16 ("mthi %0, $ac1\n\t"
17 "mtlo %1, $ac1\n\t"
18 "dpsq_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 = 0x54321123;
31 acl = 5;
32 rs = 0x80000000;
33 rt = 0x80000000;
35 resulth = 0xd4321123;
36 resultl = 0x06;
37 resultdsp = 0x01;
39 __asm
40 ("mthi %0, $ac1\n\t"
41 "mtlo %1, $ac1\n\t"
42 "dpsq_sa.l.w $ac1, %3, %4\n\t"
43 "mfhi %0, $ac1\n\t"
44 "mflo %1, $ac1\n\t"
45 "rddsp %2\n\t"
46 : "+r"(ach), "+r"(acl), "=r"(dsp)
47 : "r"(rs), "r"(rt)
49 dsp = (dsp >> 17) & 0x01;
50 assert(dsp == resultdsp);
51 assert(ach == resulth);
52 assert(acl == resultl);
54 return 0;