diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2011-06-18 15:35:10 +0000 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2011-06-18 08:35:10 -0700 |
commit | 10937b0c3a75d7f639bccbcf9917c81ae3133d98 (patch) | |
tree | 7f1811a36f1f12e986891d1b920521330843cbbc | |
parent | ffe5104599c7a16adff14cf4c8f7238cd1799da0 (diff) | |
download | gcc-10937b0c3a75d7f639bccbcf9917c81ae3133d98.zip gcc-10937b0c3a75d7f639bccbcf9917c81ae3133d98.tar.gz gcc-10937b0c3a75d7f639bccbcf9917c81ae3133d98.tar.bz2 |
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.
From-SVN: r175183
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/longlong.h | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 57789e3..31f23a2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 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. + +2011-06-18 H.J. Lu <hongjiu.lu@intel.com> + PR other/49325 * acinclude.m4 (gcc_AC_INITFINI_ARRAY): Properly check if .init_array can be used with .ctors on targets. diff --git a/gcc/longlong.h b/gcc/longlong.h index 576247f..7d11e10 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, 2010 + 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -436,8 +436,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 */ |