Merge tag 'qemu-macppc-20230206' of https://github.com/mcayland/qemu into staging
[qemu.git] / tests / tcg / mips / user / ase / dsp / test_dsp_r1_shll_ph.c
blob5fa58ccf63744bae1dd25da618980bae21b99e09
1 #include<stdio.h>
2 #include<assert.h>
4 int main()
6 int rd, rt, dsp;
7 int result, resultdsp;
9 rt = 0x12345678;
10 result = 0xA000C000;
11 resultdsp = 1;
13 __asm
14 ("wrdsp $0\n\t"
15 "shll.ph %0, %2, 0x0B\n\t"
16 "rddsp %1\n\t"
17 : "=r"(rd), "=r"(dsp)
18 : "r"(rt)
20 dsp = (dsp >> 22) & 0x01;
21 assert(dsp == resultdsp);
22 assert(rd == result);
24 rt = 0x7fff8000;
25 result = 0xfffe0000;
26 resultdsp = 1;
28 __asm
29 ("wrdsp $0\n\t"
30 "shll.ph %0, %2, 0x01\n\t"
31 "rddsp %1\n\t"
32 : "=r"(rd), "=r"(dsp)
33 : "r"(rt)
35 dsp = (dsp >> 22) & 0x01;
36 assert(dsp == resultdsp);
37 assert(rd == result);
39 rt = 0x00000001;
40 result = 0x00008000;
41 resultdsp = 1;
43 __asm
44 ("wrdsp $0\n\t"
45 "shll.ph %0, %2, 0x0F\n\t"
46 "rddsp %1\n\t"
47 : "=r"(rd), "=r"(dsp)
48 : "r"(rt)
50 dsp = (dsp >> 22) & 0x01;
51 assert(dsp == resultdsp);
52 assert(rd == result);
54 return 0;