s390-ccw.img: replace while loop with a disabled wait on s390 bios
[qemu/agraf.git] / tests / tcg / mips / mips64-dsp / mthlip.c
blob957cd426f0012c9f912375c833b528b53df75ff3
1 #include "io.h"
3 int main(void)
5 long long rs, ach, acl, dsp;
6 long long result, resulth, resultl;
8 dsp = 0x07;
9 ach = 0x05;
10 acl = 0xB4CB;
11 rs = 0x00FFBBAA;
12 resulth = 0xB4CB;
13 resultl = 0x00FFBBAA;
14 result = 0x27;
16 __asm
17 ("wrdsp %0, 0x01\n\t"
18 "mthi %1, $ac1\n\t"
19 "mtlo %2, $ac1\n\t"
20 "mthlip %3, $ac1\n\t"
21 "mfhi %1, $ac1\n\t"
22 "mflo %2, $ac1\n\t"
23 "rddsp %0\n\t"
24 : "+r"(dsp), "+r"(ach), "+r"(acl)
25 : "r"(rs)
27 dsp = dsp & 0x3F;
28 if ((dsp != result) || (ach != resulth) || (acl != resultl)) {
29 printf("mthlip wrong\n");
31 return -1;
34 dsp = 0x3f;
35 ach = 0x05;
36 acl = 0xB4CB;
37 rs = 0x00FFBBAA;
38 resulth = 0xB4CB;
39 resultl = 0x00FFBBAA;
40 result = 0x3f;
42 __asm
43 ("wrdsp %0, 0x01\n\t"
44 "mthi %1, $ac1\n\t"
45 "mtlo %2, $ac1\n\t"
46 "mthlip %3, $ac1\n\t"
47 "mfhi %1, $ac1\n\t"
48 "mflo %2, $ac1\n\t"
49 "rddsp %0\n\t"
50 : "+r"(dsp), "+r"(ach), "+r"(acl)
51 : "r"(rs)
53 dsp = dsp & 0x3F;
54 if ((dsp != result) || (ach != resulth) || (acl != resultl)) {
55 printf("mthlip wrong\n");
57 return -1;
60 return 0;