aboutsummaryrefslogtreecommitdiff
path: root/gcc/longlong.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/longlong.h')
-rw-r--r--gcc/longlong.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/gcc/longlong.h b/gcc/longlong.h
index 45a95c40eb5..fe9d6f4de93 100644
--- a/gcc/longlong.h
+++ b/gcc/longlong.h
@@ -173,6 +173,29 @@ extern UDItype __udiv_qrnnd (UDItype *, UDItype, UDItype, UDItype);
"rIJ" ((USItype) (bh)), \
"r" ((USItype) (al)), \
"rIJ" ((USItype) (bl)))
+#ifdef __ARC_NORM__
+#define count_leading_zeros(count, x) \
+ do \
+ { \
+ SItype c_; \
+ \
+ __asm__ ("norm.f\t%0,%1\n\tmov.mi\t%0,-1" : "=r" (c_) : "r" (x) : "cc");\
+ (count) = c_ + 1; \
+ } \
+ while (0)
+#define COUNT_LEADING_ZEROS_0 32
+#endif
+#ifdef __ARC700__
+#define umul_ppmm(w1, w0, u, v) \
+ __asm__ ( \
+ "mpyu\t%1,%2,%3\n\tmpyhu\t%0,%2,%3" \
+ : "=r" ((USItype)(w1)), \
+ "=r" ((USItype)(w0)) \
+ : "r" ((USItype)(u)), \
+ "r" ((USItype)(v)))
+#define UMUL_TIME 7
+#define __umulsidi3(u,v) ((UDItype)(USItype)u*(USItype)v)
+#else /* ! __ARC700__ */
/* Call libgcc routine. */
#define umul_ppmm(w1, w0, u, v) \
do { \
@@ -184,6 +207,7 @@ do { \
#define __umulsidi3 __umulsidi3
UDItype __umulsidi3 (USItype, USItype);
#endif
+#endif
#if defined (__arm__) && !defined (__thumb__) && W_TYPE_SIZE == 32
#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
@@ -1451,7 +1475,10 @@ UDItype __umulsidi3 (USItype, USItype);
count_leading_zeros (__ctz_c, __ctz_x & -__ctz_x); \
(count) = W_TYPE_SIZE - 1 - __ctz_c; \
} while (0)
-#endif
+#ifdef COUNT_LEADING_ZEROS_0
+#define COUNT_TRAILING_ZEROS_0 (W_TYPE_SIZE - 1 - COUNT_LEADING_ZEROS_0)
+#endif /* COUNT_LEADING_ZEROS_0 */
+#endif /* !defined (count_trailing_zeros) */
#ifndef UDIV_NEEDS_NORMALIZATION
#define UDIV_NEEDS_NORMALIZATION 0