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