Merge tag 'qemu-macppc-20230206' of https://github.com/mcayland/qemu into staging
[qemu.git] / tests / tcg / mips / user / ase / dsp / test_dsp_r1_shilov.c
blobe1d6cea4b6de538f907dc756c71df35615c5178a
1 #include<stdio.h>
2 #include<assert.h>
4 int main()
6 int rs, ach, acl;
7 int resulth, resultl;
9 rs = 0x0F;
10 ach = 0xBBAACCFF;
11 acl = 0x1C3B001D;
13 resulth = 0x17755;
14 resultl = 0x99fe3876;
16 __asm
17 ("mthi %0, $ac1\n\t"
18 "mtlo %1, $ac1\n\t"
19 "shilov $ac1, %2\n\t"
20 "mfhi %0, $ac1\n\t"
21 "mflo %1, $ac1\n\t"
22 : "+r"(ach), "+r"(acl)
23 : "r"(rs)
25 assert(ach == resulth);
26 assert(acl == resultl);
29 rs = 0xffffffff;
30 ach = 0x1;
31 acl = 0x80000000;
33 resulth = 0x3;
34 resultl = 0x0;
36 __asm
37 ("mthi %0, $ac1\n\t"
38 "mtlo %1, $ac1\n\t"
39 "shilov $ac1, %2\n\t"
40 "mfhi %0, $ac1\n\t"
41 "mflo %1, $ac1\n\t"
42 : "+r"(ach), "+r"(acl)
43 : "r"(rs)
45 assert(ach == resulth);
46 assert(acl == resultl);
48 return 0;