PPC: Fix rldcl
[qemu/agraf.git] / tests / tcg / mips / mips32-dspr2 / absq_s_qb.c
blobaf4683f30475862069aaa511c06b7b4e2c8e2b12
1 #include<stdio.h>
2 #include<assert.h>
4 int main()
6 int input, result, dsp;
7 int hope;
9 input = 0x701BA35E;
10 hope = 0x701B5D5E;
12 __asm
13 ("absq_s.qb %0, %1\n\t"
14 : "=r"(result)
15 : "r"(input)
17 assert(result == hope);
20 input = 0x801BA35E;
21 hope = 0x7F1B5D5E;
23 __asm
24 ("absq_s.qb %0, %2\n\t"
25 "rddsp %1\n\t"
26 : "=r"(result), "=r"(dsp)
27 : "r"(input)
29 dsp = dsp >> 20;
30 dsp &= 0x01;
31 assert(dsp == 1);
32 assert(result == hope);
34 return 0;