PPC: Fix rldcl
[qemu/agraf.git] / tests / tcg / mips / mips64-dsp / wrdsp.c
blob3033fd88d1abfca923e4cd3b18d5489db4d19580
1 #include "io.h"
3 int main(void)
5 long long dsp_i, dsp_o;
6 long long ccond_i, outflag_i, efi_i, c_i, scount_i, pos_i;
7 long long ccond_o, outflag_o, efi_o, c_o, scount_o, pos_o;
8 long long ccond_r, outflag_r, efi_r, c_r, scount_r, pos_r;
10 ccond_i = 0x000000BC;/* 4 */
11 outflag_i = 0x0000001B;/* 3 */
12 efi_i = 0x00000001;/* 5 */
13 c_i = 0x00000001;/* 2 */
14 scount_i = 0x0000000F;/* 1 */
15 pos_i = 0x0000000C;/* 0 */
17 dsp_i = (ccond_i << 24) | (outflag_i << 16) | (efi_i << 14) | (c_i << 13)
18 | (scount_i << 7) | pos_i;
20 ccond_r = ccond_i;
21 outflag_r = outflag_i;
22 efi_r = efi_i;
23 c_r = c_i;
24 scount_r = scount_i;
25 pos_r = pos_i;
27 __asm
28 ("wrdsp %1, 0x3F\n\t"
29 "rddsp %0, 0x3F\n\t"
30 : "=r"(dsp_o)
31 : "r"(dsp_i)
34 ccond_o = (dsp_o >> 24) & 0xFF;
35 outflag_o = (dsp_o >> 16) & 0xFF;
36 efi_o = (dsp_o >> 14) & 0x01;
37 c_o = (dsp_o >> 14) & 0x01;
38 scount_o = (dsp_o >> 7) & 0x3F;
39 pos_o = dsp_o & 0x1F;
41 if ((ccond_o != ccond_r) || (outflag_o != outflag_r) || (efi_o != efi_r) \
42 || (c_o != c_r) || (scount_o != scount_r) || (pos_o != pos_r)) {
43 printf("wrddsp wrong\n");
45 return -1;
47 return 0;