s390-ccw.img: replace while loop with a disabled wait on s390 bios
[qemu/agraf.git] / tests / tcg / mips / mips32-dsp / maq_s_w_phr.c
blob7b2ef2ab714fe9436e6cf68ece3bfa70ba3ebeff
1 #include<stdio.h>
2 #include<assert.h>
4 int main()
6 int rt, rs;
7 int achi, acli;
8 int dsp;
9 int acho, aclo;
10 int resulth, resultl;
11 int resdsp;
13 achi = 0x05;
14 acli = 0xB4CB;
15 rs = 0xFF06;
16 rt = 0xCB00;
17 resulth = 0x04;
18 resultl = 0x947438CB;
20 __asm
21 ("mthi %2, $ac1\n\t"
22 "mtlo %3, $ac1\n\t"
23 "maq_s.w.phr $ac1, %4, %5\n\t"
24 "mfhi %0, $ac1\n\t"
25 "mflo %1, $ac1\n\t"
26 : "=r"(acho), "=r"(aclo)
27 : "r"(achi), "r"(acli), "r"(rs), "r"(rt)
29 assert(resulth == acho);
30 assert(resultl == aclo);
32 achi = 0x06;
33 acli = 0xB4CB;
34 rs = 0x8000;
35 rt = 0x8000;
36 resulth = 0x6;
37 resultl = 0x8000b4ca;
38 resdsp = 1;
40 __asm
41 ("mthi %3, $ac1\n\t"
42 "mtlo %4, $ac1\n\t"
43 "maq_s.w.phr $ac1, %5, %6\n\t"
44 "mfhi %0, $ac1\n\t"
45 "mflo %1, $ac1\n\t"
46 "rddsp %2\n\t"
47 : "=r"(acho), "=r"(aclo), "=r"(dsp)
48 : "r"(achi), "r"(acli), "r"(rs), "r"(rt)
50 assert(resulth == acho);
51 assert(resultl == aclo);
52 assert(((dsp >> 17) & 0x01) == resdsp);
54 return 0;