This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: PATCH: Use __builtin_clzll in 64-bit __logb
- From: Andreas Jaeger <aj at suse dot com>
- To: libc-alpha at sourceware dot org, "H.J. Lu" <hjl dot tools at gmail dot com>
- Date: Mon, 14 May 2012 10:20:34 +0200
- Subject: Re: PATCH: Use __builtin_clzll in 64-bit __logb
- References: <20120511122204.GA3854@intel.com>
On Friday, May 11, 2012 14:22:04 H.J. Lu wrote:
> Hi,
>
> X32 uses 64-bit math function. But its long is 32bit. 64-bit __logb
> should use __builtin_clzll instead of __builtin_clzl. Testd on
> Linux/x32 and Linux/x86-64. OK to install?
If this was tested on both x86-64 and x86, it's ok to commit.
Andreas
> Thanks.
>
> H.J.
> ---
> * sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c (__logb): Replace
> __builtin_clzl with __builtin_clzll.
>
> diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c
> b/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c index 474eeef..185dd05
> 100644
> --- a/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c
> +++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c
> @@ -36,7 +36,7 @@ __logb (double x)
> return x * x;
> if (__builtin_expect (ex == 0, 0))
> {
> - int m = (ix == 0) ? 0 : __builtin_clzl (ix);
> + int m = (ix == 0) ? 0 : __builtin_clzll (ix);
> return -1022.0 + (double)(11 -m);
> }
> return (double) (ex - 1023);
--
Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126