summaryrefslogtreecommitdiffstats
path: root/libgcc
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-05 20:12:14 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-05 20:12:14 +0000
commite9b46b498adb76f09f171d9463fd79e8d526d874 (patch)
tree77d460d8d56b319fade9b98a0b799c0597328876 /libgcc
parentdcf7024cca21bc0205e541c429b69b27b8095aae (diff)
downloadppe42-gcc-e9b46b498adb76f09f171d9463fd79e8d526d874.tar.gz
ppe42-gcc-e9b46b498adb76f09f171d9463fd79e8d526d874.zip
arm: Enable umull and ctz in longlong.h
* longlong.h [ARM] (umul_ppmm): Use umull for arm3m and later. [ARM] (count_trailing_zeros): Use the builtin. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184957 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgcc')
-rw-r--r--libgcc/ChangeLog5
-rw-r--r--libgcc/longlong.h27
2 files changed, 26 insertions, 6 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 8415fa78b06..e2452c1da3b 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,8 @@
+2012-03-05 Richard Henderson <rth@redhat.com>
+
+ * longlong.h [ARM] (umul_ppmm): Use umull for arm3m and later.
+ [ARM] (count_trailing_zeros): Use the builtin.
+
2012-03-01 Kai Tietz <ktietz@redhat.com>
* soft-fp: Imported from glibc upstream.
diff --git a/libgcc/longlong.h b/libgcc/longlong.h
index 30cc2e337f3..1a839dd0d30 100644
--- a/libgcc/longlong.h
+++ b/libgcc/longlong.h
@@ -220,9 +220,12 @@ UDItype __umulsidi3 (USItype, USItype);
"rI" ((USItype) (bh)), \
"r" ((USItype) (al)), \
"rI" ((USItype) (bl)) __CLOBBER_CC)
-#define umul_ppmm(xh, xl, a, b) \
-{register USItype __t0, __t1, __t2; \
- __asm__ ("%@ Inlined umul_ppmm\n" \
+# if defined(__ARM_ARCH_2__) || defined(__ARM_ARCH_2A__) \
+ || defined(__ARM_ARCH_3__)
+# define umul_ppmm(xh, xl, a, b) \
+ do { \
+ register USItype __t0, __t1, __t2; \
+ __asm__ ("%@ Inlined umul_ppmm\n" \
" mov %2, %5, lsr #16\n" \
" mov %0, %6, lsr #16\n" \
" bic %3, %5, %2, lsl #16\n" \
@@ -239,14 +242,26 @@ UDItype __umulsidi3 (USItype, USItype);
"=r" ((USItype) (xl)), \
"=&r" (__t0), "=&r" (__t1), "=r" (__t2) \
: "r" ((USItype) (a)), \
- "r" ((USItype) (b)) __CLOBBER_CC );}
-#define UMUL_TIME 20
-#define UDIV_TIME 100
+ "r" ((USItype) (b)) __CLOBBER_CC ); \
+ } while (0)
+# define UMUL_TIME 20
+# else
+# define umul_ppmm(xh, xl, a, b) \
+ do { \
+ /* Generate umull, under compiler control. */ \
+ register UDItype __t0 = (UDItype)(USItype)(a) * (USItype)(b); \
+ (xl) = (USItype)__t0; \
+ (xh) = (USItype)(__t0 >> 32); \
+ } while (0)
+# define UMUL_TIME 3
+# endif
+# define UDIV_TIME 100
#endif /* __arm__ */
#if defined(__arm__)
/* Let gcc decide how best to implement count_leading_zeros. */
#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
OpenPOWER on IntegriCloud