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_qb.c
blob729716d626184caece39598ce67365766c46d1d9
1 #include<stdio.h>
2 #include<assert.h>
4 int main()
6 int rd, rt, dsp;
7 int result, resultdsp;
9 rt = 0x87654321;
10 result = 0x87654321;
11 resultdsp = 0x00;
13 __asm
14 ("wrdsp $0\n\t"
15 "shll.qb %0, %2, 0x00\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 = 0x87654321;
25 result = 0x38281808;
26 resultdsp = 0x01;
28 __asm
29 ("wrdsp $0\n\t"
30 "shll.qb %0, %2, 0x03\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 = 0x00000080;
41 resultdsp = 0x00;
43 __asm
44 ("wrdsp $0\n\t"
45 "shll.qb %0, %2, 0x07\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;