s390-ccw.img: replace while loop with a disabled wait on s390 bios
[qemu/agraf.git] / tests / tcg / mips / mips64-dsp / extpv.c
blob158472bf938f6da21453f06e2d33a83eaf20f6d6
1 #include "io.h"
3 int main(void)
5 long long rt, ac, ach, acl, dsp;
6 long long result;
8 ach = 0x05;
9 acl = 0xB4CB;
10 dsp = 0x07;
11 ac = 0x03;
12 result = 0x000C;
14 __asm
15 ("wrdsp %1, 0x01\n\t"
16 "mthi %2, $ac1\n\t"
17 "mtlo %3, $ac1\n\t"
18 "extpv %0, $ac1, %4\n\t"
19 "rddsp %1\n\t"
20 : "=r"(rt), "+r"(dsp)
21 : "r"(ach), "r"(acl), "r"(ac)
23 dsp = (dsp >> 14) & 0x01;
24 if ((dsp != 0) || (result != rt)) {
25 printf("extpv wrong\n");
27 return -1;
30 ach = 0x05;
31 acl = 0xB4CB;
32 dsp = 0x01;
34 __asm
35 ("wrdsp %1, 0x01\n\t"
36 "mthi %2, $ac1\n\t"
37 "mtlo %3, $ac1\n\t"
38 "extpv %0, $ac1, %4\n\t"
39 "rddsp %1\n\t"
40 : "=r"(rt), "+r"(dsp)
41 : "r"(ach), "r"(acl), "r"(ac)
43 dsp = (dsp >> 14) & 0x01;
44 if (dsp != 1) {
45 printf("extpv wrong\n");
47 return -1;
50 return 0;