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