PPC: Fix rldcl
[qemu/agraf.git] / tests / tcg / mips / mips64-dsp / extrv_r_w.c
blob8379729787d806eaa180732cfe7309f624b23229
1 #include "io.h"
3 int main(void)
5 long long rt, rs, ach, acl, dsp;
6 long long result;
8 ach = 0x05;
9 acl = 0xB4CB;
10 dsp = 0x07;
11 rs = 0x03;
12 result = 0xFFFFFFFFA0001699;
14 __asm
15 ("wrdsp %1, 0x01\n\t"
16 "mthi %3, $ac1\n\t"
17 "mtlo %4, $ac1\n\t"
18 "extrv_r.w %0, $ac1, %2\n\t"
19 "rddsp %1\n\t"
20 : "=r"(rt), "+r"(dsp)
21 : "r"(rs), "r"(ach), "r"(acl)
23 dsp = (dsp >> 23) & 0x01;
24 if ((dsp != 1) || (result != rt)) {
25 printf("extrv_r.w wrong\n");
27 return -1;
30 /* Clear dspcontrol */
31 dsp = 0;
32 __asm
33 ("wrdsp %0\n\t"
35 : "r"(dsp)
38 rs = 4;
39 ach = 0x01;
40 acl = 0xB4CB;
41 result = 0x10000B4D;
42 __asm
43 ("wrdsp %1, 0x01\n\t"
44 "mthi %3, $ac1\n\t"
45 "mtlo %4, $ac1\n\t"
46 "extrv_r.w %0, $ac1, %2\n\t"
47 "rddsp %1\n\t"
48 : "=r"(rt), "+r"(dsp)
49 : "r"(rs), "r"(ach), "r"(acl)
51 dsp = (dsp >> 23) & 0x01;
52 if ((dsp != 0) || (result != rt)) {
53 printf("extrv_r.w wrong\n");
55 return -1;
58 return 0;