]> git.proxmox.com Git - mirror_qemu.git/blob - tests/tcg/mips/mips64-dsp/dpsq_s_w_ph.c
target-mips: Add ASE DSP testcases
[mirror_qemu.git] / tests / tcg / mips / mips64-dsp / dpsq_s_w_ph.c
1 #include "io.h"
2
3 int main(void)
4 {
5 long long rs, rt;
6 long long ach = 5, acl = 5;
7 long long resulth, resultl;
8
9 rs = 0xBC0123AD;
10 rt = 0x01643721;
11 resulth = 0x04;
12 resultl = 0xFFFFFFFFEE9794A3;
13 __asm
14 ("mthi %0, $ac1\n\t"
15 "mtlo %1, $ac1\n\t"
16 "dpsq_s.w.ph $ac1, %2, %3\n\t"
17 "mfhi %0, $ac1\n\t"
18 "mflo %1, $ac1\n\t"
19 : "+r"(ach), "+r"(acl)
20 : "r"(rs), "r"(rt)
21 );
22 if ((ach != resulth) || (acl != resultl)) {
23 printf("1 dpsq_s.w.ph wrong\n");
24
25 return -1;
26 }
27
28 ach = 0x1424Ef1f;
29 acl = 0x1035219A;
30 rs = 0x800083AD;
31 rt = 0x80003721;
32 resulth = 0x1424ef1e;
33 resultl = 0x577ed901;
34
35 __asm
36 ("mthi %0, $ac1\n\t"
37 "mtlo %1, $ac1\n\t"
38 "dpsq_s.w.ph $ac1, %2, %3\n\t"
39 "mfhi %0, $ac1\n\t"
40 "mflo %1, $ac1\n\t"
41 : "+r"(ach), "+r"(acl)
42 : "r"(rs), "r"(rt)
43 );
44 if ((ach != resulth) || (acl != resultl)) {
45 printf("2 dpsq_s.w.ph wrong\n");
46
47 return -1;
48 }
49
50 return 0;
51 }