This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
PATCH: Update longlong.h from GCC 4.7.0
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 16 Mar 2012 10:44:15 -0700
- Subject: PATCH: Update longlong.h from GCC 4.7.0
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
This patch updates longlong.h from GCC 4.7.0 so that we always use
__builtin_clzll and __builtin_ctzll for x86-64 DImode to support x32.
OK to install?
Thanks.
H.J.
---
2012-03-16 H.J. Lu <hongjiu.lu@intel.com>
* stdlib/longlong.h (count_leading_zeros): Use long long builtin
for x86-64.
(count_trailing_zeros): Likewise.
diff --git a/stdlib/longlong.h b/stdlib/longlong.h
index 6571207..f6b55b9 100644
--- a/stdlib/longlong.h
+++ b/stdlib/longlong.h
@@ -430,8 +430,8 @@ UDItype __umulsidi3 (USItype, USItype);
: "0" ((UDItype) (n0)), \
"1" ((UDItype) (n1)), \
"rm" ((UDItype) (dv)))
-#define count_leading_zeros(count, x) ((count) = __builtin_clzl (x))
-#define count_trailing_zeros(count, x) ((count) = __builtin_ctzl (x))
+#define count_leading_zeros(count, x) ((count) = __builtin_clzll (x))
+#define count_trailing_zeros(count, x) ((count) = __builtin_ctzll (x))
#define UMUL_TIME 40
#define UDIV_TIME 40
#endif /* x86_64 */
--
1.7.6.5