s390-ccw.img: replace while loop with a disabled wait on s390 bios
[qemu/agraf.git] / tests / tcg / mips / mips64-dsp / addwc.c
blob5929cd2f5cae36d0da4e0afa0410032c4d361322
1 #include "io.h"
3 int main(void)
5 long long rd, rs, rt;
6 long long dspi, dspo;
7 long long result;
9 rs = 0x10FF01FF;
10 rt = 0x10010001;
11 dspi = 0x00002000;
12 result = 0x21000201;
13 __asm
14 ("wrdsp %3\n"
15 "addwc %0, %1, %2\n\t"
16 : "=r"(rd)
17 : "r"(rs), "r"(rt), "r"(dspi)
19 if (rd != result) {
20 printf("1 addwc wrong\n");
22 return -1;
25 rs = 0xFFFF1111;
26 rt = 0x00020001;
27 dspi = 0x00;
28 result = 0x00011112;
29 __asm
30 ("wrdsp %3\n"
31 "addwc %0, %1, %2\n\t"
32 : "=r"(rd)
33 : "r"(rs), "r"(rt), "r"(dspi)
35 if (rd != result) {
36 printf("2 addwc wrong\n");
38 return -1;
41 rs = 0x8FFF1111;
42 rt = 0x80020001;
43 dspi = 0x00;
44 result = 0x10011112;
45 __asm
46 ("wrdsp %4\n"
47 "addwc %0, %2, %3\n\t"
48 "rddsp %1\n\t"
49 : "=r"(rd), "=r"(dspo)
50 : "r"(rs), "r"(rt), "r"(dspi)
52 if ((rd != result) || (((dspo >> 20) & 0x01) != 1)) {
53 printf("3 addwc wrong\n");
55 return -1;
58 return 0;