Use long long builtins of zero counting for x86-64.
2011-06-18 H.J. Lu <hongjiu.lu@intel.com>
* longlong.h (count_leading_zeros): Use long long builtin for
x86-64.
(count_trailing_zeros): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@175183 138bc75d-0d04-0410-961f-82ee72b054a4
R=halyavin@google.com
BUG=
Review URL: https://codereview.chromium.org/22638012
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e49443d..31ab179 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -4,6 +4,12 @@
If __GLIBC__ is defined, refer to __pthread_key_create instead of
pthread_cancel.
+2011-06-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ * longlong.h (count_leading_zeros): Use long long builtin for
+ x86-64.
+ (count_trailing_zeros): Likewise.
+
2010-01-21 Release Manager
* GCC 4.4.3 released.
diff --git a/gcc/longlong.h b/gcc/longlong.h
index 11e7013..9522e2a 100644
--- a/gcc/longlong.h
+++ b/gcc/longlong.h
@@ -1,6 +1,6 @@
/* longlong.h -- definitions for mixed size 32/64 bit arithmetic.
Copyright (C) 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -407,8 +407,8 @@
: "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 */