Add 469782 to NEWS
[valgrind.git] / none / tests / ppc32 / mcrfs.c
blob984ea5787f8a7e061f11e9b8042552bc202a395a
2 #include <stdio.h>
4 typedef unsigned int UInt;
6 void set_fpscr ( UInt x )
8 UInt d[2];
9 d[0] = 0;
10 d[1] = x;
11 __asm__ __volatile__(
12 "lfd %%f0,0(%0)\n\t"
13 "mtfsf 255,%%f0"
14 : /*out*/
15 : /*in*/ "b"(&d[0])
16 : /*trash*/ "fr0", "cc", "memory"
21 int main ( void )
23 int i;
24 UInt r;
25 for (i = 0; i < 16; i++) {
26 set_fpscr(i);
27 __asm__ __volatile__(
28 "li %0,0\n\t"
29 "mtcr %0\n\t"
30 "mcrfs 1,7\n\t"
31 "mfcr %0"
32 : /*out*/ "=b"(r)
33 : /*in*/
34 : /*trash*/ "cc"
36 printf("0x%x -> 0x%08x\n", i, r);
38 for (i = 0; i < 16; i++) {
39 set_fpscr(i);
40 __asm__ __volatile__(
41 "li %0,-1\n\t"
42 "mtcr %0\n\t"
43 "mcrfs 1,7\n\t"
44 "mfcr %0"
45 : /*out*/ "=b"(r)
46 : /*in*/
47 : /*trash*/ "cc"
49 printf("0x%x -> 0x%08x\n", i, r);
51 return 0;