summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjorn Granlund <tg@gmplib.org>2022-03-30 23:11:05 +0200
committerTorbjorn Granlund <tg@gmplib.org>2022-03-30 23:11:05 +0200
commit58818388634ac42301e50c9b2dbd65340fb3ab70 (patch)
treea6d8c8b1ac4fc68f8121c8d636e755b5be6c1664
parentd5caa8705dd5b86cf1d20b29cf955847ff31572c (diff)
downloadgmp-58818388634ac42301e50c9b2dbd65340fb3ab70.tar.gz
(loongarch64 umul_ppmm): New #define.
-rw-r--r--longlong.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/longlong.h b/longlong.h
index bf35f5389..be1c3cbc6 100644
--- a/longlong.h
+++ b/longlong.h
@@ -1156,6 +1156,17 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
#endif /* i960mx */
#endif /* i960 */
+
+#if defined (__loongarch64) && W_TYPE_SIZE == 64
+#define umul_ppmm(w1, w0, u, v) \
+ do { \
+ UDItype __u = (u), __v = (v); \
+ (w0) = __u * __v; \
+ (w1) = (unsigned __int128__) __u * __v >> 64; \
+ } while (0)
+#endif
+
+
#if (defined (__mc68000__) || defined (__mc68020__) || defined(mc68020) \
|| defined (__m68k__) || defined (__mc5200__) || defined (__mc5206e__) \
|| defined (__mc5307__)) && W_TYPE_SIZE == 32