PPC: Fix rldcl
[qemu/agraf.git] / tests / tcg / mips / mips32-dsp / extpdp.c
blob15ba0828fb6fe5a5a48c9c90015be70a14d7321b
1 #include<stdio.h>
2 #include<assert.h>
4 int main()
6 int rt, ach, acl, dsp, pos, efi;
7 int result;
9 ach = 0x05;
10 acl = 0xB4CB;
11 dsp = 0x07;
12 result = 0x000C;
14 __asm
15 ("wrdsp %1, 0x01\n\t"
16 "mthi %2, $ac1\n\t"
17 "mtlo %3, $ac1\n\t"
18 "extpdp %0, $ac1, 0x03\n\t"
19 "rddsp %1\n\t"
20 : "=r"(rt), "+r"(dsp)
21 : "r"(ach), "r"(acl)
23 pos = dsp & 0x3F;
24 efi = (dsp >> 14) & 0x01;
25 assert(pos == 3);
26 assert(efi == 0);
27 assert(result == rt);
29 ach = 0x05;
30 acl = 0xB4CB;
31 dsp = 0x01;
33 __asm
34 ("wrdsp %1, 0x01\n\t"
35 "mthi %2, $ac1\n\t"
36 "mtlo %3, $ac1\n\t"
37 "extpdp %0, $ac1, 0x03\n\t"
38 "rddsp %1\n\t"
39 : "=r"(rt), "+r"(dsp)
40 : "r"(ach), "r"(acl)
42 efi = (dsp >> 14) & 0x01;
43 assert(efi == 1);
45 return 0;