diff options
author | Yufeng Zhang <yufeng.zhang@arm.com> | 2014-04-22 16:31:45 +0000 |
---|---|---|
committer | Marcus Shawcroft <mshawcroft@gcc.gnu.org> | 2014-04-22 16:31:45 +0000 |
commit | 130a78598c61b8baa81a68586eb2bed9856df566 (patch) | |
tree | 8038ba4eafe8955ba36abd68514ee4a5d1ed43a6 /include | |
parent | e54c2dd3e2706a902b2587d73f0ab43aa587fb38 (diff) | |
download | gcc-130a78598c61b8baa81a68586eb2bed9856df566.zip gcc-130a78598c61b8baa81a68586eb2bed9856df566.tar.gz gcc-130a78598c61b8baa81a68586eb2bed9856df566.tar.bz2 |
Merge longlong.h from glibc tree.
From-SVN: r209649
Diffstat (limited to 'include')
-rw-r--r-- | include/ChangeLog | 4 | ||||
-rw-r--r-- | include/longlong.h | 18 |
2 files changed, 21 insertions, 1 deletions
diff --git a/include/ChangeLog b/include/ChangeLog index d83e6b7..9d28cea 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,7 @@ +2014-04-22 Yufeng Zhang <yufeng.zhang@arm.com> + + * longlong.h: Merge from glibc. + 2014-01-21 Tom Tromey <tromey@redhat.com> * ansidecl.h (ANSI_PROTOTYPES, PTRCONST, LONG_DOUBLE, PARAMS) diff --git a/include/longlong.h b/include/longlong.h index 5f00e54..d45dbe2 100644 --- a/include/longlong.h +++ b/include/longlong.h @@ -1,5 +1,5 @@ /* longlong.h -- definitions for mixed size 32/64 bit arithmetic. - Copyright (C) 1991-2013 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -122,6 +122,22 @@ extern const UQItype __clz_tab[256] attribute_hidden; #define __AND_CLOBBER_CC , "cc" #endif /* __GNUC__ < 2 */ +#if defined (__aarch64__) + +#if W_TYPE_SIZE == 32 +#define count_leading_zeros(COUNT, X) ((COUNT) = __builtin_clz (X)) +#define count_trailing_zeros(COUNT, X) ((COUNT) = __builtin_ctz (X)) +#define COUNT_LEADING_ZEROS_0 32 +#endif /* W_TYPE_SIZE == 32 */ + +#if W_TYPE_SIZE == 64 +#define count_leading_zeros(COUNT, X) ((COUNT) = __builtin_clzll (X)) +#define count_trailing_zeros(COUNT, X) ((COUNT) = __builtin_ctzll (X)) +#define COUNT_LEADING_ZEROS_0 64 +#endif /* W_TYPE_SIZE == 64 */ + +#endif /* __aarch64__ */ + #if defined (__alpha) && W_TYPE_SIZE == 64 #define umul_ppmm(ph, pl, m0, m1) \ do { \ |