This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] PowerPC - logb[f|l] optimization for POWER7
Adhemerval Zanella <azanella@linux.vnet.ibm.com> writes:
> + else if (__builtin_expect (ret == two10m1, 0))
> + {
> + int64_t lx, hx;
> + int m1, m2, ma;
> +
> + GET_LDOUBLE_WORDS64 (hx, lx, x);
> + m1 = (hx == 0) ? 0 : __builtin_clzll (hx);
> + m2 = (lx == 0) ? 0 : __builtin_clzll (lx);
> + ma = (m1 == 0) ? m2 + 64 : m1;
> + return -1022.0 + (double)(11 - ma);
That doesn't look correct. The upper double only provides 53 bits of
the full mantissa. On the other hand, if hx is zero, doesn't that mean
that the whole number is zero?
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."