Merge tag 'qemu-macppc-20230206' of https://github.com/mcayland/qemu into staging
[qemu.git] / tests / tcg / mips / user / ase / dsp / test_dsp_r1_pick_ph.c
blob929a002e75448b3fd50c1bfcb043e3ed98994283
1 #include<stdio.h>
2 #include<assert.h>
4 int main()
6 int rd, rs, rt, dsp;
7 int result;
9 rs = 0x12345678;
10 rt = 0x87654321;
11 dsp = 0x0A000000;
12 result = 0x12344321;
14 __asm
15 ("wrdsp %3, 0x10\n\t"
16 "pick.ph %0, %1, %2\n\t"
17 : "=r"(rd)
18 : "r"(rs), "r"(rt), "r"(dsp)
20 assert(rd == result);
22 rs = 0x12345678;
23 rt = 0x87654321;
24 dsp = 0x03000000;
25 result = 0x12345678;
27 __asm
28 ("wrdsp %3, 0x10\n\t"
29 "pick.ph %0, %1, %2\n\t"
30 : "=r"(rd)
31 : "r"(rs), "r"(rt), "r"(dsp)
33 assert(rd == result);
35 rs = 0x12345678;
36 rt = 0x87654321;
37 dsp = 0x00000000;
38 result = 0x87654321;
40 __asm
41 ("wrdsp %3, 0x10\n\t"
42 "pick.ph %0, %1, %2\n\t"
43 : "=r"(rd)
44 : "r"(rs), "r"(rt), "r"(dsp)
46 assert(rd == result);
48 return 0;