s390-ccw.img: replace while loop with a disabled wait on s390 bios
[qemu/agraf.git] / tests / tcg / mips / mips64-dsp / absq_s_pw.c
blob48fc763b4fdf89f4c068662d6058c0dcb8df2c2e
1 #include "io.h"
3 int main(void)
5 long long rd, rt, result, dspcontrol;
6 rd = 0;
7 rt = 0x7F7F7F7F7F7F7F7F;
8 result = 0x7F7F7F7F7F7F7F7F;
11 __asm
12 ("absq_s.pw %0, %1\n\t"
13 : "=r"(rd)
14 : "r"(rt)
17 if (result != rd) {
18 printf("absq_s.pw test 1 error\n");
20 return -1;
23 rd = 0;
24 __asm
25 ("rddsp %0\n\t"
26 : "=r"(rd)
28 rd >> 20;
29 rd = rd & 0x1;
30 if (rd != 0) {
31 printf("absq_s.pw test 1 dspcontrol overflow flag error\n");
33 return -1;
36 rd = 0;
37 rt = 0x80000000FFFFFFFF;
38 result = 0x7FFFFFFF00000001;
40 __asm
41 ("absq_s.pw %0, %1\n\t"
42 : "=r"(rd)
43 : "r"(rt)
45 if (result != rd) {
46 printf("absq_s.pw test 2 error\n");
48 return -1;
51 rd = 0;
52 __asm
53 ("rddsp %0\n\t"
54 : "=r"(rd)
56 rd = rd >> 20;
57 rd = rd & 0x1;
58 if (rd != 1) {
59 printf("absq_s.pw test 2 dspcontrol overflow flag error\n");
61 return -1;
64 return 0;