aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authormshawcroft <mshawcroft@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-22 16:31:45 +0000
committermshawcroft <mshawcroft@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-22 16:31:45 +0000
commita95d3a28130403ba1bed70d2375f7d7452d4bb02 (patch)
tree8038ba4eafe8955ba36abd68514ee4a5d1ed43a6 /include
parentd91e962253f953e24a955e0fdb9e0af7c771c168 (diff)
Merge longlong.h from glibc tree.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209649 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog4
-rw-r--r--include/longlong.h18
2 files changed, 21 insertions, 1 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index d83e6b74720..9d28cea1bbd 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 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 { \