s390-ccw.img: replace while loop with a disabled wait on s390 bios
[qemu/agraf.git] / tests / tcg / mips / mips64-dsp / extrv_s_h.c
blobb6dcaebcbc29eb44204344953c97665ac4129475
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 = 0x00007FFF;
14 __asm
15 ("wrdsp %1, 0x01\n\t"
16 "mthi %3, $ac1\n\t"
17 "mtlo %4, $ac1\n\t"
18 "extrv_s.h %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_s.h wrong\n");
27 return -1;
30 rs = 0x08;
31 ach = 0xffffffff;
32 acl = 0x12344321;
33 result = 0xffffffffFFFF8000;
34 __asm
35 ("wrdsp %1, 0x01\n\t"
36 "mthi %3, $ac1\n\t"
37 "mtlo %4, $ac1\n\t"
38 "extrv_s.h %0, $ac1, %2\n\t"
39 "rddsp %1\n\t"
40 : "=r"(rt), "+r"(dsp)
41 : "r"(rs), "r"(ach), "r"(acl)
43 dsp = (dsp >> 23) & 0x01;
44 if ((dsp != 1) || (result != rt)) {
45 printf("extrv_s.h wrong\n");
47 return -1;
50 /* Clear dsp */
51 dsp = 0;
52 __asm
53 ("wrdsp %0\n\t"
55 : "r"(dsp)
58 rs = 0x04;
59 ach = 0x00;
60 acl = 0x4321;
61 result = 0x432;
62 __asm
63 ("wrdsp %1, 0x01\n\t"
64 "mthi %3, $ac1\n\t"
65 "mtlo %4, $ac1\n\t"
66 "extrv_s.h %0, $ac1, %2\n\t"
67 "rddsp %1\n\t"
68 : "=r"(rt), "+r"(dsp)
69 : "r"(rs), "r"(ach), "r"(acl)
71 dsp = (dsp >> 23) & 0x01;
72 if ((dsp != 0) || (result != rt)) {
73 printf("extrv_s.h wrong\n");
75 return -1;
78 return 0;