PATCH: Use __builtin_clzll in 64-bit __logb

H.J. Lu hongjiu.lu@intel.com
Fri May 11 12:22:00 GMT 2012


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?

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);



More information about the Libc-alpha mailing list