s390-ccw.img: replace while loop with a disabled wait on s390 bios
[qemu/agraf.git] / tests / tcg / mips / mips64-dsp / dextpdpv.c
blob09c0b5b412cea0fdf13d2a2677e6ab9dbc27cc99
1 #include "io.h"
3 int main(void)
5 long long rt, rs, dsp;
6 long long achi, acli;
7 long long res, resdsp, resdsppos;
8 int rsdsp;
9 int tmp1, tmp2;
11 rsdsp = 0xabcd1234;
12 rs = 0x7;
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, 0x1\n\t"
23 "wrdsp %4\n\t"
24 "dextpdpv %0, $ac1, %5\n\t"
25 "rddsp %1\n\t"
26 : "=r"(rt), "=r"(dsp)
27 : "r"(achi), "r"(acli), "r"(rsdsp), "r"(rs)
30 tmp1 = (dsp >> 14) & 0x1;
31 tmp2 = dsp & 0x3f;
33 if ((tmp1 != resdsp) || (rt != res) || (tmp2 != resdsppos)) {
34 printf("dextpdpv error\n");
35 return -1;
38 rsdsp = 0xabcd1200;
39 rs = 0x7;
40 achi = 0x12345678;
41 acli = 0x87654321;
42 resdsp = 0x1;
44 __asm
45 ("mthi %2, $ac1\n\t"
46 "mtlo %3, $ac1\n\t"
47 "wrdsp %4, 0x1\n\t"
48 "wrdsp %4\n\t"
49 "dextpdpv %0, $ac1, %5\n\t"
50 "rddsp %1\n\t"
51 : "=r"(rt), "=r"(dsp)
52 : "r"(achi), "r"(acli), "r"(rsdsp), "r"(rs)
55 tmp1 = (dsp >> 14) & 0x1;
57 if (tmp1 != resdsp) {
58 printf("dextpdpv error\n");
59 return -1;
62 return 0;