2014-05-23 Yvan Roux <yvan.roux@linaro.org>
authoryroux <yroux@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 12 Jun 2014 11:45:47 +0000 (11:45 +0000)
committeryroux <yroux@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 12 Jun 2014 11:45:47 +0000 (11:45 +0000)
       Backport from trunk r209649.
       2014-04-22  Yufeng Zhang  <yufeng.zhang@arm.com>

       * longlong.h: Merge from glibc.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@211518 138bc75d-0d04-0410-961f-82ee72b054a4

include/ChangeLog.linaro
include/longlong.h

index 9be3700..639a818 100644 (file)
@@ -1,3 +1,10 @@
+2014-05-23  Yvan Roux  <yvan.roux@linaro.org>
+
+       Backport from trunk r209649.
+       2014-04-22  Yufeng Zhang  <yufeng.zhang@arm.com>
+
+       * longlong.h: Merge from glibc.
+
 2014-05-14  Yvan Roux  <yvan.roux@linaro.org>
 
        GCC Linaro 4.9-2014.05 released.
index 5f00e54..d45dbe2 100644 (file)
@@ -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 {                                                                 \