PPC: Fix rldcl
[qemu/agraf.git] / tests / tcg / mips / mips64-dsp / maq_s_w_phl.c
blob7dba8746e50c21b3e54cba3457dbb14b34287b1d
1 #include "io.h"
3 int main(void)
5 long long rt, rs;
6 long long achi, acli;
7 long long dsp;
8 long long acho, aclo;
9 long long resulth, resultl;
10 long long resdsp;
12 achi = 0x05;
13 acli = 0xB4CB;
14 rs = 0xFF060000;
15 rt = 0xCB000000;
16 resulth = 0x04;
17 resultl = 0xffffffff947438CB;
19 __asm
20 ("mthi %2, $ac1\n\t"
21 "mtlo %3, $ac1\n\t"
22 "maq_s.w.phl $ac1, %4, %5\n\t"
23 "mfhi %0, $ac1\n\t"
24 "mflo %1, $ac1\n\t"
25 : "=r"(acho), "=r"(aclo)
26 : "r"(achi), "r"(acli), "r"(rs), "r"(rt)
28 if ((resulth != acho) || (resultl != aclo)) {
29 printf("1 maq_s.w.phl error\n");
31 return -1;
34 achi = 0x06;
35 acli = 0xB4CB;
36 rs = 0x80000000;
37 rt = 0x80000000;
38 resulth = 0x6;
39 resultl = 0xffffffff8000b4ca;
40 resdsp = 1;
42 __asm
43 ("mthi %3, $ac1\n\t"
44 "mtlo %4, $ac1\n\t"
45 "maq_s.w.phl $ac1, %5, %6\n\t"
46 "mfhi %0, $ac1\n\t"
47 "mflo %1, $ac1\n\t"
48 "rddsp %2\n\t"
49 : "=r"(acho), "=r"(aclo), "=r"(dsp)
50 : "r"(achi), "r"(acli), "r"(rs), "r"(rt)
52 if ((resulth != acho) || (resultl != aclo) ||
53 (((dsp >> 17) & 0x01) != resdsp)) {
54 printf("2 maq_s.w.phl error\n");
56 return -1;
59 return 0;