1 --- _ldtoa.c.orig 2004-06-03 15:17:18.000000000 -0700
2 +++ _ldtoa.c 2005-10-08 22:43:25.000000000 -0700
6 uint32_t bits[(LDBL_MANT_DIG + 31) / 32];
7 +#if defined(__ppc__) || defined(__ppc64__)
9 +#endif /* defined(__ppc__) || defined(__ppc64__) */
12 +#if defined(__ppc__) || defined(__ppc64__)
14 + * Subnormal head-tail doubles don't seem to be converted correctly
15 + * by gdtoa. So we multiply by 10^32 to make them normal then
16 + * subtract 32 from the exponent later.
18 + if ((type = __fpclassify(u.e)) == FP_NORMAL && __fpclassifyd(u.d[1]) == FP_SUBNORMAL)
19 + type = FP_SUBNORMAL;
20 + if (type == FP_SUBNORMAL)
22 +#endif /* defined(__ppc__) || defined(__ppc64__) */
24 be = u.bits.exp - (LDBL_MAX_EXP - 1) - (LDBL_MANT_DIG - 1);
25 LDBL_TO_ARRAY32(u, bits);
27 +#if defined(__ppc__) || defined(__ppc64__)
30 +#else /* !defined(__ppc__) && !defined(__ppc64__) */
31 switch (fpclassify(u.e)) {
32 +#endif /* defined(__ppc__) || defined(__ppc64__) */
34 + case FP_SUPERNORMAL:
36 #ifdef LDBL_IMPLICIT_NBIT
37 bits[LDBL_MANT_DIG / 32] |= 1 << ((LDBL_MANT_DIG - 1) % 32);
42 +#if !defined(__ppc__) && !defined(__ppc64__)
44 kind = STRTOG_Denormal;
45 -#ifdef LDBL_IMPLICIT_NBIT
49 +#endif /* !defined(__ppc__) && !defined(__ppc64__) */
51 kind = STRTOG_Infinite;
54 ret = gdtoa(&fpi, be, (ULong *)bits, &kind, mode, ndigits, decpt, rve);
57 +#if defined(__ppc__) || defined(__ppc64__)
58 + else if (type == FP_SUBNORMAL)
60 +#endif /* defined(__ppc__) || defined(__ppc64__) */