s390-ccw.img: replace while loop with a disabled wait on s390 bios
[qemu/agraf.git] / tests / tcg / mips / mips64-dsp / dextp.c
bloba469cc0366a8b898c4c3315d4953caca7f225d93
1 #include "io.h"
3 int main(void)
5 long long rt, dsp;
6 long long achi, acli;
7 long long res, resdsp;
8 int rs;
10 rs = 0xabcd1234;
12 achi = 0x12345678;
13 acli = 0x87654321;
14 res = 0xff;
15 resdsp = 0x0;
17 __asm
18 ("mthi %2, $ac1\n\t"
19 "mtlo %3, $ac1\n\t"
20 "wrdsp %4\n\t"
21 "dextp %0, $ac1, 0x7\n\t"
22 "rddsp %1\n\t"
23 : "=r"(rt), "=r"(dsp)
24 : "r"(achi), "r"(acli), "r"(rs)
26 dsp = (dsp >> 14) & 0x1;
27 if ((dsp != resdsp) || (rt != res)) {
28 printf("dextp error\n");
29 return -1;
32 rs = 0xabcd1200;
34 achi = 0x12345678;
35 acli = 0x87654321;
36 resdsp = 0x1;
38 __asm
39 ("mthi %2, $ac1\n\t"
40 "mtlo %3, $ac1\n\t"
41 "wrdsp %4\n\t"
42 "dextp %0, $ac1, 0x7\n\t"
43 "rddsp %1\n\t"
44 : "=r"(rt), "=r"(dsp)
45 : "r"(achi), "r"(acli), "r"(rs)
47 dsp = (dsp >> 14) & 0x1;
48 if (dsp != resdsp) {
49 printf("dextp error\n");
50 return -1;
53 return 0;