PPC: Fix rldcl
[qemu/agraf.git] / tests / tcg / mips / mips32-dsp / addwc.c
blob8a8d81fab4caa339b7db8439a6eb0ba123d1ce42
1 #include<stdio.h>
2 #include<assert.h>
4 int main()
6 int rd, rs, rt;
7 int dspi, dspo;
8 int result;
10 rs = 0x10FF01FF;
11 rt = 0x10010001;
12 dspi = 0x00002000;
13 result = 0x21000201;
14 __asm
15 ("wrdsp %3\n"
16 "addwc %0, %1, %2\n\t"
17 : "=r"(rd)
18 : "r"(rs), "r"(rt), "r"(dspi)
20 assert(rd == result);
22 rs = 0xFFFF1111;
23 rt = 0x00020001;
24 dspi = 0x00;
25 result = 0x00011112;
26 __asm
27 ("wrdsp %3\n"
28 "addwc %0, %1, %2\n\t"
29 : "=r"(rd)
30 : "r"(rs), "r"(rt), "r"(dspi)
32 assert(rd == result);
34 rs = 0x8FFF1111;
35 rt = 0x80020001;
36 dspi = 0x00;
37 result = 0x10011112;
38 __asm
39 ("wrdsp %4\n"
40 "addwc %0, %2, %3\n\t"
41 "rddsp %1\n\t"
42 : "=r"(rd), "=r"(dspo)
43 : "r"(rs), "r"(rt), "r"(dspi)
45 assert(rd == result);
46 assert(((dspo >> 20) & 0x01) == 1);
48 return 0;