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