Add qemu 2.4.0
[kvmfornfv.git] / qemu / tests / tcg / mips / mips64-dsp / precrq_rs_ph_w.c
1 #include "io.h"
2
3 int main(void)
4 {
5     long long rd, rs, rt;
6     long long dsp;
7     long long result;
8
9     rs = 0x12345678;
10     rt = 0x87654321;
11     result = 0x12348765;
12
13     __asm
14         ("precrq_rs.ph.w %0, %1, %2\n\t"
15          : "=r"(rd)
16          : "r"(rs), "r"(rt)
17         );
18     if (result != rd) {
19         printf("1 precrq_rs.ph.w wrong\n");
20
21         return -1;
22     }
23
24     rs = 0x7fffC678;
25     rt = 0x865432A0;
26     result = 0x7fff8654;
27
28     __asm
29         ("precrq_rs.ph.w %0, %2, %3\n\t"
30          "rddsp %1\n\t"
31          : "=r"(rd), "=r"(dsp)
32          : "r"(rs), "r"(rt)
33         );
34     if ((result != rd) || (((dsp >> 22) & 0x01) != 1)) {
35         printf("2 precrq_rs.ph.w wrong\n");
36
37         return -1;
38     }
39
40     return 0;
41 }