disas/nanomips: Replace proprietary by POSIX data types
[qemu/ar7.git] / tests / tcg / mips / mips64-dsp / dmsub.c
blob16be6170e4fe3da5114323527a5918d95b5df389
1 #include "io.h"
3 int main(void)
5 long long rt, rs;
6 long long achi, acli;
7 long long acho, aclo;
8 long long resh, resl;
9 achi = 0x1;
10 acli = 0x8;
12 rs = 0x0000000100000001;
13 rt = 0x0000000200000002;
15 resh = 0x1;
16 resl = 0x4;
18 __asm
19 ("mthi %2, $ac1 \t\n"
20 "mtlo %3, $ac1 \t\n"
21 "dmsub $ac1, %4, %5\t\n"
22 "mfhi %0, $ac1 \t\n"
23 "mflo %1, $ac1 \t\n"
24 : "=r"(acho), "=r"(aclo)
25 : "r"(achi), "r"(acli), "r"(rs), "r"(rt)
27 if ((acho != resh) || (aclo != resl)) {
28 printf("1 dmsub error\n");
30 return -1;
33 achi = 0xfffffffF;
34 acli = 0xfffffffF;
36 rs = 0x8888999977776666;
37 rt = 0x9999888877776666;
39 resh = 0xffffffffffffffff;
40 resl = 0x789aae13;
42 __asm
43 ("mthi %2, $ac1 \t\n"
44 "mtlo %3, $ac1 \t\n"
45 "dmsub $ac1, %4, %5\t\n"
46 "mfhi %0, $ac1 \t\n"
47 "mflo %1, $ac1 \t\n"
48 : "=r"(acho), "=r"(aclo)
49 : "r"(achi), "r"(acli), "r"(rs), "r"(rt)
52 if ((acho != resh) || (aclo != resl)) {
53 printf("2 dmsub error\n");
55 return -1;
58 return 0;