]> git.proxmox.com Git - mirror_qemu.git/blob - tests/tcg/mips/mips64-dsp/pick_qb.c
target-mips: Add ASE DSP testcases
[mirror_qemu.git] / tests / tcg / mips / mips64-dsp / pick_qb.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 = 0x0f000000;
11 result = 0x12345678;
12
13 __asm
14 ("wrdsp %3, 0x10\n\t"
15 "pick.qb %0, %1, %2\n\t"
16 : "=r"(rd)
17 : "r"(rs), "r"(rt), "r"(dsp)
18 );
19 if (rd != result) {
20 printf("pick.qb wrong\n");
21
22 return -1;
23 }
24
25 rs = 0x12345678;
26 rt = 0x87654321;
27 dsp = 0x00000000;
28 result = 0xffffffff87654321;
29
30 __asm
31 ("wrdsp %3, 0x10\n\t"
32 "pick.qb %0, %1, %2\n\t"
33 : "=r"(rd)
34 : "r"(rs), "r"(rt), "r"(dsp)
35 );
36 if (rd != result) {
37 printf("pick.qb wrong\n");
38
39 return -1;
40 }
41
42 return 0;
43 }