Merge tag 'qemu-macppc-20230206' of https://github.com/mcayland/qemu into staging
[qemu.git] / tests / tcg / mips / user / ase / dsp / test_dsp_r2_subu_ph.c
blob0d39a017c79db6a50959865146b643c4ea4de829
1 #include<stdio.h>
2 #include<assert.h>
4 int main()
6 int rd, rs, rt, dsp;
7 int result, resultdsp;
9 rs = 0x87654321;
10 rt = 0x11111111;
11 result = 0x76543210;
12 resultdsp = 0x00;
14 __asm
15 ("subu.ph %0, %2, %3\n\t"
16 "rddsp %1\n\t"
17 : "=r"(rd), "=r"(dsp)
18 : "r"(rs), "r"(rt)
20 dsp = (dsp >> 20) & 0x01;
21 assert(dsp == resultdsp);
22 assert(rd == result);
24 rs = 0x87654321;
25 rt = 0x12345678;
26 result = 0x7531ECA9;
27 resultdsp = 0x01;
29 __asm
30 ("subu.ph %0, %2, %3\n\t"
31 "rddsp %1\n\t"
32 : "=r"(rd), "=r"(dsp)
33 : "r"(rs), "r"(rt)
35 dsp = (dsp >> 20) & 0x01;
36 assert(dsp == resultdsp);
37 assert(rd == result);
39 return 0;