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