s390-ccw.img: replace while loop with a disabled wait on s390 bios
[qemu/agraf.git] / tests / tcg / mips / mips64-dsp / extr_r_w.c
blob94572ad1546aa65bfa91941f7da0939c074daf7e
1 #include "io.h"
3 int main(void)
5 long long rt, ach, acl, dsp;
6 long long result;
8 ach = 0x05;
9 acl = 0xB4CB;
10 result = 0xFFFFFFFFA0001699;
11 __asm
12 ("mthi %2, $ac1\n\t"
13 "mtlo %3, $ac1\n\t"
14 "extr_r.w %0, $ac1, 0x03\n\t"
15 "rddsp %1\n\t"
16 : "=r"(rt), "=r"(dsp)
17 : "r"(ach), "r"(acl)
19 dsp = (dsp >> 23) & 0x01;
20 if ((dsp != 1) || (result != rt)) {
21 printf("1 extr_r.w wrong\n");
23 return -1;
26 /* Clear dspcontrol */
27 dsp = 0;
28 __asm
29 ("wrdsp %0\n\t"
31 : "r"(dsp)
34 ach = 0x01;
35 acl = 0xB4CB;
36 result = 0x10000B4D;
37 __asm
38 ("mthi %2, $ac1\n\t"
39 "mtlo %3, $ac1\n\t"
40 "extr_r.w %0, $ac1, 0x04\n\t"
41 "rddsp %1\n\t"
42 : "=r"(rt), "=r"(dsp)
43 : "r"(ach), "r"(acl)
45 dsp = (dsp >> 23) & 0x01;
46 if ((dsp != 0) || (result != rt)) {
47 printf("2 extr_r.w wrong\n");
49 return -1;
52 return 0;