PPC: Fix rldcl
[qemu/agraf.git] / tests / tcg / mips / mips32-dsp / subq_s_w.c
blob9d456a90f417a060acebb2c18a7f4039680a7629
1 #include<stdio.h>
2 #include<assert.h>
4 int main()
6 int rd, rs, rt, dsp;
7 int result, resultdsp;
9 rs = 0x12345678;
10 rt = 0x87654321;
11 result = 0x7FFFFFFF;
12 resultdsp = 0x01;
14 __asm
15 ("wrdsp $0\n\t"
16 "subq_s.w %0, %2, %3\n\t"
17 "rddsp %1\n\t"
18 : "=r"(rd), "=r"(dsp)
19 : "r"(rs), "r"(rt)
21 dsp = (dsp >> 20) & 0x01;
22 assert(dsp == resultdsp);
23 assert(rd == result);
25 rs = 0x66666;
26 rt = 0x55555;
27 result = 0x11111;
28 resultdsp = 0x0;
30 __asm
31 ("wrdsp $0\n\t"
32 "subq_s.w %0, %2, %3\n\t"
33 "rddsp %1\n\t"
34 : "=r"(rd), "=r"(dsp)
35 : "r"(rs), "r"(rt)
37 dsp = (dsp >> 20) & 0x01;
38 assert(dsp == resultdsp);
39 assert(rd == result);
41 rs = 0x0;
42 rt = 0x80000000;
43 result = 0x7FFFFFFF;
44 resultdsp = 0x01;
46 __asm
47 ("wrdsp $0\n\t"
48 "subq_s.w %0, %2, %3\n\t"
49 "rddsp %1\n\t"
50 : "=r"(rd), "=r"(dsp)
51 : "r"(rs), "r"(rt)
53 dsp = (dsp >> 20) & 0x01;
54 assert(dsp == resultdsp);
55 assert(rd == result);
57 rs = 0x80000000;
58 rt = 0x80000000;
59 result = 0;
60 resultdsp = 0x00;
62 __asm
63 ("wrdsp $0\n\t"
64 "subq_s.w %0, %2, %3\n\t"
65 "rddsp %1\n\t"
66 : "=r"(rd), "=r"(dsp)
67 : "r"(rs), "r"(rt)
69 dsp = (dsp >> 20) & 0x01;
70 assert(dsp == resultdsp);
71 assert(rd == result);
73 return 0;