OSDN Git Service

2006-05-15 Mircea Namolaru <namolaru@il.ibm.com>
[pf3gnuchains/gcc-fork.git] / gcc / config / floatunditf.c
1 /* Public domain.  */
2 #if __LDBL_MANT_DIG__ == 106 || __LDBL_MANT_DIG__ == 113
3 typedef int DItype __attribute__ ((mode (DI)));
4 typedef int SItype __attribute__ ((mode (SI)));
5 typedef unsigned int UDItype __attribute__ ((mode (DI)));
6 typedef unsigned int USItype __attribute__ ((mode (SI)));
7 typedef float DFtype __attribute__ ((mode (DF)));
8 typedef float TFtype __attribute__ ((mode (TF)));
9
10 TFtype __floatunditf (UDItype);
11
12 TFtype
13 __floatunditf (UDItype u)
14 {
15   DFtype dh, dl;
16
17   dh = (USItype) (u >> (sizeof (SItype) * 8));
18   dh *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1));
19   dl = (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1));
20
21   return (TFtype) dh + (TFtype) dl;
22 }
23
24 #endif
25