summaryrefslogtreecommitdiff
path: root/longlong.h
diff options
context:
space:
mode:
authorTorbjorn Granlund <tege@gmplib.org>2013-04-07 22:44:18 +0200
committerTorbjorn Granlund <tege@gmplib.org>2013-04-07 22:44:18 +0200
commitb7eefc8b7d07020a637937c7038d4fdba6bc594f (patch)
tree31166dfe90f102ea55b516426daf2e3fb6fe8ac5 /longlong.h
parent31b5e4dba657db4e661a320265d04d2660b6b95f (diff)
downloadgmp-b7eefc8b7d07020a637937c7038d4fdba6bc594f.tar.gz
(sparc64): Define umul_ppmm, add_ssaaaa, and count_leading_zeros conditionally under the symbol__sparc_vis3.
Diffstat (limited to 'longlong.h')
-rw-r--r--longlong.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/longlong.h b/longlong.h
index ca9d54c39..45474d195 100644
--- a/longlong.h
+++ b/longlong.h
@@ -1757,6 +1757,25 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
: "rJ" (ah), "rI" (bh), "rJ" (al), "rI" (bl), \
"rJ" ((al) >> 32), "rI" ((bl) >> 32) \
__CLOBBER_CC)
+#ifdef __sparc_vis3
+#undef add_ssaaaa
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ( \
+ "addcc %r4, %5, %1\n" \
+ " addxc %r2, %r3, %0" \
+ : "=r" (sh), "=&r" (sl) \
+ : "rJ" (ah), "rJ" (bh), "%rJ" (al), "rI" (bl) __CLOBBER_CC)
+#define umul_ppmm(ph, pl, m0, m1) \
+ do { \
+ UDItype __m0 = (m0), __m1 = (m1); \
+ (pl) = __m0 * __m1; \
+ __asm__ ("umulxhi\t%2, %1, %0" \
+ : "=r" (ph) \
+ : "%r" (__m0), "r" (__m1)); \
+ } while (0)
+#define count_leading_zeros(count, x) \
+ __asm__ ("lzd\t%1,%0" : "=r" (count) : "r" (x))
+#endif
#endif
#if (defined (__vax) || defined (__vax__)) && W_TYPE_SIZE == 32