OSDN Git Service

* gcc.dg/ppc-bitfield1.c: Skip if not LP64, don't specify -m64.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / ppc-mov-1.c
1 /* { dg-do compile { target powerpc64-*-* } } */
2 /* { dg-require-effective-target lp64 } */
3 /* { dg-options "-O2" } */
4
5 /* { dg-final { scan-assembler-not "fmr \[0-9\]+,\[0-9\]+" } }
6
7 /* Origin:Pete Steinmetz <steinmtz@us.ibm.com> */
8
9 /* PR 16796: Extraneous move.  */
10
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__)));
14
15 double __floor(double x)
16 {
17   union {
18     double dbl_val;
19     long int long_val;
20   } temp;
21
22   int64_t i0,j0;
23   u_int64_t i;
24   temp.dbl_val = x;
25   i0 = temp.long_val;
26
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;}
34       }
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);
41       }
42     }
43   } else {
44     if (j0==0x400)
45       return x+x;
46     else
47       return x;
48   }
49   temp.long_val = i0;
50   x = temp.dbl_val;
51   return x;
52 }
53