Merge tag 'qemu-macppc-20230206' of https://github.com/mcayland/qemu into staging
[qemu.git] / tests / tcg / mips / user / ase / dsp / test_dsp_r1_insv.c
blob9d674697ccaa9f5001b39ed511ef1f1c5cad1c5b
1 #include<stdio.h>
2 #include<assert.h>
4 int main()
6 int rt, rs, dsp;
7 int result;
9 /* msb = 10, lsb = 5 */
10 dsp = 0x305;
11 rt = 0x12345678;
12 rs = 0x87654321;
13 result = 0x12345438;
14 __asm
15 ("wrdsp %2, 0x03\n\t"
16 "insv %0, %1\n\t"
17 : "+r"(rt)
18 : "r"(rs), "r"(dsp)
20 assert(rt == result);
22 dsp = 0x1000;
23 rt = 0xF0F0F0F0;
24 rs = 0xA5A5A5A5;
25 result = 0xA5A5A5A5;
27 __asm
28 ("wrdsp %2\n\t"
29 "insv %0, %1\n\t"
30 : "+r"(rt)
31 : "r"(rs), "r"(dsp)
33 assert(rt == result);
35 return 0;