s390-ccw.img: replace while loop with a disabled wait on s390 bios
[qemu/agraf.git] / tests / tcg / mips / mips32-dsp / extpdpv.c
blobf5774eed3cae547682fa142577c074adcd7eed72
1 #include<stdio.h>
2 #include<assert.h>
4 int main()
6 int rt, rs, ach, acl, dsp, pos, efi;
7 int result;
9 ach = 0x05;
10 acl = 0xB4CB;
11 dsp = 0x07;
12 rs = 0x03;
13 result = 0x000C;
15 __asm
16 ("wrdsp %1, 0x01\n\t"
17 "mthi %2, $ac1\n\t"
18 "mtlo %3, $ac1\n\t"
19 "extpdpv %0, $ac1, %4\n\t"
20 "rddsp %1\n\t"
21 : "=r"(rt), "+r"(dsp)
22 : "r"(ach), "r"(acl), "r"(rs)
24 pos = dsp & 0x3F;
25 efi = (dsp >> 14) & 0x01;
26 assert(pos == 3);
27 assert(efi == 0);
28 assert(result == rt);
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 "extpdpv %0, $ac1, %4\n\t"
39 "rddsp %1\n\t"
40 : "=r"(rt), "+r"(dsp)
41 : "r"(ach), "r"(acl), "r"(rs)
43 efi = (dsp >> 14) & 0x01;
44 assert(efi == 1);
46 return 0;