PPC: Fix rldcl
[qemu/agraf.git] / tests / tcg / mips / mips64-dsp / dextr_w.c
blob79bed5da35f4c82f67a7772d7dd15b78a3fc8d15
1 #include "io.h"
3 int main(void)
5 long long rt;
6 long long achi, acli;
7 long long res;
9 achi = 0x87654321;
10 acli = 0x12345678;
12 res = 0x123456;
14 __asm
15 ("mthi %1, $ac1\n\t"
16 "mtlo %2, $ac1\n\t"
17 "dextr.w %0, $ac1, 0x8\n\t"
18 : "=r"(rt)
19 : "r"(achi), "r"(acli)
21 if (rt != res) {
22 printf("dextr.w error\n");
23 return -1;
26 achi = 0x87654321;
27 acli = 0x12345678;
29 res = 0x12345678;
31 __asm
32 ("mthi %1, $ac1\n\t"
33 "mtlo %2, $ac1\n\t"
34 "dextr.w %0, $ac1, 0x0\n\t"
35 : "=r"(rt)
36 : "r"(achi), "r"(acli)
38 if (rt != res) {
39 printf("dextr.w error\n");
40 return -1;
43 return 0;