PPC: Fix rldcl
[qemu/agraf.git] / tests / tcg / mips / mips32-dsp / extp.c
blob21a67af21656590132a9f8eabbff19f9b8326e34
1 #include<stdio.h>
2 #include<assert.h>
4 int main()
6 int rt, ach, acl, dsp;
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 "extp %0, $ac1, 0x03\n\t"
19 "rddsp %1\n\t"
20 : "=r"(rt), "+r"(dsp)
21 : "r"(ach), "r"(acl)
23 dsp = (dsp >> 14) & 0x01;
24 assert(dsp == 0);
25 assert(result == rt);
27 ach = 0x05;
28 acl = 0xB4CB;
29 dsp = 0x01;
31 __asm
32 ("wrdsp %1, 0x01\n\t"
33 "mthi %2, $ac1\n\t"
34 "mtlo %3, $ac1\n\t"
35 "extp %0, $ac1, 0x03\n\t"
36 "rddsp %1\n\t"
37 : "=r"(rt), "+r"(dsp)
38 : "r"(ach), "r"(acl)
40 dsp = (dsp >> 14) & 0x01;
41 assert(dsp == 1);
43 return 0;