Merge tag 'qemu-macppc-20230206' of https://github.com/mcayland/qemu into staging
[qemu.git] / tests / tcg / mips / user / ase / dsp / test_dsp_r1_addq_ph.c
blob96a549637b41aadba9030bd15e39ca20fd922af2
1 #include<stdio.h>
2 #include<assert.h>
4 int main()
6 int rd, rs, rt;
7 int dsp;
8 int result;
10 rs = 0xFFFFFFFF;
11 rt = 0x10101010;
12 result = 0x100F100F;
13 __asm
14 ("addq.ph %0, %1, %2\n\t"
15 : "=r"(rd)
16 : "r"(rs), "r"(rt)
18 assert(result == rd);
20 rs = 0x3712847D;
21 rt = 0x0031AF2D;
22 result = 0x374333AA;
23 __asm
24 ("addq.ph %0, %1, %2\n\t"
25 : "=r"(rd)
26 : "r"(rs), "r"(rt)
28 assert(result == rd);
30 rs = 0x7fff847D;
31 rt = 0x0031AF2D;
32 result = 0x803033AA;
33 __asm
34 ("addq.ph %0, %1, %2\n\t"
35 : "=r"(rd)
36 : "r"(rs), "r"(rt)
38 assert(result == rd);
40 __asm("rddsp %0\n\t"
41 : "=r"(dsp)
43 assert(((dsp >> 20) & 0x01) == 1);
45 return 0;