s390-ccw.img: replace while loop with a disabled wait on s390 bios
[qemu/agraf.git] / tests / tcg / mips / mips64-dsp / dpsq_sa_l_w.c
blobf55afc9095e81731a1d42093525341d548378099
1 #include "io.h"
3 int main(void)
5 long long rs, rt, dsp;
6 long long ach = 5, acl = 5;
7 long long resulth, resultl, resultdsp;
9 rs = 0xBC0123AD;
10 rt = 0x01643721;
12 resulth = 0xfffffffffdf4cbe0;
13 resultl = 0xFFFFFFFFd138776b;
14 resultdsp = 0x00;
15 __asm
16 ("mthi %0, $ac1\n\t"
17 "mtlo %1, $ac1\n\t"
18 "dpsq_sa.l.w $ac1, %3, %4\n\t"
19 "mfhi %0, $ac1\n\t"
20 "mflo %1, $ac1\n\t"
21 "rddsp %2\n\t"
22 : "+r"(ach), "+r"(acl), "=r"(dsp)
23 : "r"(rs), "r"(rt)
25 dsp = (dsp >> 17) & 0x01;
26 if ((dsp != resultdsp) || (ach != resulth) || (acl != resultl)) {
27 printf("1 dpsq_sa.l.w wrong\n");
29 return -1;
32 ach = 0x54321123;
33 acl = 5;
34 rs = 0x80000000;
35 rt = 0x80000000;
37 resulth = 0xffffffffd4321123;
38 resultl = 0x06;
39 resultdsp = 0x01;
41 __asm
42 ("mthi %0, $ac1\n\t"
43 "mtlo %1, $ac1\n\t"
44 "dpsq_sa.l.w $ac1, %3, %4\n\t"
45 "mfhi %0, $ac1\n\t"
46 "mflo %1, $ac1\n\t"
47 "rddsp %2\n\t"
48 : "+r"(ach), "+r"(acl), "=r"(dsp)
49 : "r"(rs), "r"(rt)
51 dsp = (dsp >> 17) & 0x01;
52 if ((dsp != resultdsp) || (ach != resulth) || (acl != resultl)) {
53 printf("2 dpsq_sa.l.w wrong\n");
55 return -1;
58 return 0;