2 typedef int DItype __attribute__ ((mode (DI)));
3 typedef unsigned int UDItype __attribute__ ((mode (DI)));
4 typedef unsigned int USItype __attribute__ ((mode (SI)));
5 typedef float SFtype __attribute__ ((mode (SF)));
6 typedef float DFtype __attribute__ ((mode (DF)));
8 SFtype __floatundisf (UDItype);
11 __floatundisf (UDItype u)
13 /* Protect against double-rounding error.
14 Represent any low-order bits, that might be truncated by a bit that
15 won't be lost. The bit can go in anywhere below the rounding position
16 of SFTYPE. A fixed mask and bit position handles all usual
18 if (53 < (sizeof (DItype) * 8)
19 && 53 > ((sizeof (DItype) * 8) - 53 + 24))
21 if (u >= ((UDItype) 1 << 53))
23 if ((UDItype) u & (((UDItype) 1 << (sizeof (DItype) * 8 - 53)) - 1))
25 u &= ~ (((UDItype) 1 << (sizeof (DItype) * 8 - 53)) - 1);
26 u |= (UDItype) 1 << (sizeof (DItype) * 8 - 53);
30 /* Do the calculation in a wider type so that we don't lose any of
31 the precision of the high word while multiplying it. */
32 DFtype f = (USItype) (u >> (sizeof (USItype) * 8));