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/longlong.h | |
parent | e54c2dd3e2706a902b2587d73f0ab43aa587fb38 (diff) | |
download | gcc-130a78598c61b8baa81a68586eb2bed9856df566.tar.gz |
Merge longlong.h from glibc tree.
From-SVN: r209649
Diffstat (limited to 'include/longlong.h')
-rw-r--r-- | include/longlong.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/include/longlong.h b/include/longlong.h index 5f00e548a70..d45dbe2b73b 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 { \ |