s390-ccw.img: replace while loop with a disabled wait on s390 bios
[qemu/agraf.git] / tests / tcg / mips / mips32-dspr2 / dpsqx_sa_w_ph.c
blob7da278eacc0ecfd9208448d724dc0b2ea36c41db
1 #include<stdio.h>
2 #include<assert.h>
4 int main()
6 int rs, rt, dsp;
7 int ach = 5, acl = 5;
8 int resulth, resultl, resultdsp;
10 rs = 0xBC0123AD;
11 rt = 0x01643721;
12 resulth = 0x00;
13 resultl = 0x7FFFFFFF;
14 resultdsp = 0x01;
15 __asm
16 ("mthi %0, $ac1\n\t"
17 "mtlo %1, $ac1\n\t"
18 "dpsqx_sa.w.ph $ac1, %3, %4\n\t"
19 "mfhi %0, $ac1\n\t"
20 "mflo %1, $ac1\n\t"
21 "rddsp %2\n\t"
22 : "+r"(ach), "+r"(acl), "=r"(dsp)
23 : "r"(rs), "r"(rt)
25 dsp = (dsp >> 17) & 0x01;
26 assert(dsp == resultdsp);
27 assert(ach == resulth);
28 assert(acl == resultl);
30 ach = 0x8c0b354A;
31 acl = 0xbbc02249;
32 rs = 0x800023AD;
33 rt = 0x01648000;
34 resulth = 0xffffffff;
35 resultl = 0x80000000;
36 resultdsp = 0x01;
37 __asm
38 ("mthi %0, $ac1\n\t"
39 "mtlo %1, $ac1\n\t"
40 "dpsqx_sa.w.ph $ac1, %3, %4\n\t"
41 "mfhi %0, $ac1\n\t"
42 "mflo %1, $ac1\n\t"
43 "rddsp %2\n\t"
44 : "+r"(ach), "+r"(acl), "=r"(dsp)
45 : "r"(rs), "r"(rt)
47 dsp = (dsp >> 17) & 0x01;
48 assert(dsp == resultdsp);
49 assert(ach == resulth);
50 assert(acl == resultl);
52 return 0;