Add qemu 2.4.0
[kvmfornfv.git] / qemu / tests / tcg / mips / mips64-dsp / dpsq_s_w_qh.c
1 #include "io.h"
2
3 int main(void)
4 {
5     long long rs, rt;
6     long long achi, acli;
7     long long acho, aclo;
8     long long resh, resl;
9
10     rs = 0xffffeeeeddddcccc;
11     rt = 0x9999888877776666;
12     achi = 0x67576;
13     acli = 0x98878;
14
15     resh = 0x67576;
16     resl = 0x5b1682c4;
17     __asm
18         ("mthi  %2, $ac1\n\t"
19          "mtlo  %3, $ac1\n\t"
20          "dpsq_s.w.qh $ac1, %4, %5\n\t"
21          "mfhi  %0, $ac1\n\t"
22          "mflo  %1, $ac1\n\t"
23          : "=r"(acho), "=r"(aclo)
24          : "r"(achi), "r"(acli), "r"(rs), "r"(rt)
25         );
26     if ((acho != resh) || (aclo != resl)) {
27         printf("1 dpsq_s.w.qh wrong\n");
28
29         return -1;
30     }
31
32     rs = 0x8000800080008000;
33     rt = 0x8000800080008000;
34     achi = 0x67576;
35     acli = 0x98878;
36
37     resh = 0x67575;
38     resl = 0x0009887c;
39
40     __asm
41         ("mthi  %2, $ac1\n\t"
42          "mtlo  %3, $ac1\n\t"
43          "dpsq_s.w.qh $ac1, %4, %5\n\t"
44          "mfhi  %0, $ac1\n\t"
45          "mflo  %1, $ac1\n\t"
46          : "=r"(acho), "=r"(aclo)
47          : "r"(achi), "r"(acli), "r"(rs), "r"(rt)
48         );
49     if ((acho != resh) || (aclo != resl)) {
50         printf("2 dpsq_s.w.qh wrong\n");
51
52         return -1;
53     }
54
55     return 0;
56 }