s390-ccw.img: replace while loop with a disabled wait on s390 bios
[qemu/agraf.git] / tests / tcg / mips / mips32-dsp / subq_s_ph.c
blob64c89ebd511438def2e28f0ae325da0ea4343b98
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 = 0x7FFF1357;
12 resultdsp = 0x01;
14 __asm
15 ("wrdsp $0\n\t"
16 "subq_s.ph %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 = 0x12348000;
26 rt = 0x87657000;
27 result = 0x7FFF8000;
28 resultdsp = 0x01;
30 __asm
31 ("wrdsp $0\n\t"
32 "subq_s.ph %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 = 0x12340000;
42 rt = 0x87658000;
43 result = 0x7FFF7FFF;
44 resultdsp = 0x01;
46 __asm
47 ("wrdsp $0\n\t"
48 "subq_s.ph %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 return 0;