]> git.proxmox.com Git - mirror_qemu.git/blob - tests/tcg/mips/mips64-dsp/pick_ph.c
target-mips: Add ASE DSP testcases
[mirror_qemu.git] / tests / tcg / mips / mips64-dsp / pick_ph.c
1 #include "io.h"
2
3 int main(void)
4 {
5 long long rd, rs, rt, dsp;
6 long long result;
7
8 rs = 0x12345678;
9 rt = 0x87654321;
10 dsp = 0x0A000000;
11 result = 0x12344321;
12
13 __asm
14 ("wrdsp %3, 0x10\n\t"
15 "pick.ph %0, %1, %2\n\t"
16 : "=r"(rd)
17 : "r"(rs), "r"(rt), "r"(dsp)
18 );
19 if (rd != result) {
20 printf("1 pick.ph wrong\n");
21
22 return -1;
23 }
24
25 rs = 0x12345678;
26 rt = 0x87654321;
27 dsp = 0x03000000;
28 result = 0x12345678;
29
30 __asm
31 ("wrdsp %3, 0x10\n\t"
32 "pick.ph %0, %1, %2\n\t"
33 : "=r"(rd)
34 : "r"(rs), "r"(rt), "r"(dsp)
35 );
36 if (rd != result) {
37 printf("2 pick.ph wrong\n");
38
39 return -1;
40 }
41
42 rs = 0x12345678;
43 rt = 0x87654321;
44 dsp = 0x00000000;
45 result = 0xffffffff87654321;
46
47 __asm
48 ("wrdsp %3, 0x10\n\t"
49 "pick.ph %0, %1, %2\n\t"
50 : "=r"(rd)
51 : "r"(rs), "r"(rt), "r"(dsp)
52 );
53 if (rd != result) {
54 printf("3 pick.ph wrong\n");
55
56 return -1;
57 }
58
59 return 0;
60 }