* gcc.dg/ucnid-[23456].c: XFAIL on AIX.
[official-gcc.git] / gcc / testsuite / gcc.dg / ppc-mov-1.c
blob7b541e258a8347c5ec008a4985fcee0f3d85d109
1 /* { dg-do compile { target powerpc64-*-* } } */
2 /* { dg-require-effective-target lp64 } */
3 /* { dg-options "-O2" } */
5 /* { dg-final { scan-assembler-not "fmr \[0-9\]+,\[0-9\]+" } }
7 /* Origin:Pete Steinmetz <steinmtz@us.ibm.com> */
9 /* PR 16796: Extraneous move. */
11 static const double huge = 1.0e300;
12 typedef int int64_t __attribute__ ((__mode__ (__DI__)));
13 typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));
15 double __floor(double x)
17 union {
18 double dbl_val;
19 long int long_val;
20 } temp;
22 int64_t i0,j0;
23 u_int64_t i;
24 temp.dbl_val = x;
25 i0 = temp.long_val;
27 j0 = ((i0>>52)&0x7ff)-0x3ff;
28 if(j0<52) {
29 if(j0<0) {
30 if(huge+x>0.0) {
31 if(i0>=0) {i0=0;}
32 else if((i0&0x7fffffffffffffff)!=0)
33 { i0=0xbff0000000000000;}
35 } else {
36 i = (0x000fffffffffffff)>>j0;
37 if((i0&i)==0) return x;
38 if(huge+x>0.0) {
39 if(i0<0) i0 += (0x0010000000000000)>>j0;
40 i0 &= (~i);
43 } else {
44 if (j0==0x400)
45 return x+x;
46 else
47 return x;
49 temp.long_val = i0;
50 x = temp.dbl_val;
51 return x;