[PATCH v2 31/32] mpi: Remove the 64-bit MIPS umul_ppmm.

Matt Turner mattst88 at gmail.com
Wed Nov 25 21:20:08 CET 2026


* mpi/longlong.h [__mips >= 3 && W_TYPE_SIZE == 64] (umul_ppmm):
Remove.

--

The generic umul_ppmm using UDWtype gives the same dmultu with GCC
and Clang.  Keep UMUL_TIME and UDIV_TIME so that mpih-div still
pre-inverts the divisor.

Signed-off-by: Matt Turner <mattst88 at gmail.com>
---
 mpi/longlong.h | 27 ---------------------------
 1 file changed, 27 deletions(-)

diff --git a/mpi/longlong.h b/mpi/longlong.h
index d7e17c47..bc2d4952 100644
--- a/mpi/longlong.h
+++ b/mpi/longlong.h
@@ -728,33 +728,6 @@ extern USItype __udiv_qrnnd (USItype *, USItype, USItype, USItype);
 #endif /* __mips__ */
 
 #if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64
-# if defined (__clang__) || (__GNUC__ >= 5) || (__GNUC__ == 4 && \
-                                               __GNUC_MINOR__ >= 4)
-typedef unsigned int UTItype __attribute__ ((mode (TI)));
-#  define umul_ppmm(w1, w0, u, v) \
-  do {                                                                  \
-    UTItype __r;                                                        \
-    __r = (UTItype)(u) * (v);                                           \
-    (w1) = __r >> 64;                                                   \
-    (w0) = (UDItype) __r;                                               \
-  } while (0)
-# elif __GNUC__ > 2 || __GNUC_MINOR__ >= 7
-#  define umul_ppmm(w1, w0, u, v) \
-  __asm__ ("dmultu %2,%3"                                               \
-	   : "=l" __ll_check_output (UDItype, w0),                      \
-	     "=h" __ll_check_output (UDItype, w1)                       \
-	   : "d" ((UDItype)(u)),                                        \
-	     "d" ((UDItype)(v)))
-# else
-#  define umul_ppmm(w1, w0, u, v) \
-  __asm__ ("dmultu %2,%3 \n"    \
-	   "mflo %0 \n"         \
-	   "mfhi %1"                                                    \
-	   : "=d" __ll_check_output (UDItype, w0),                      \
-	     "=d" __ll_check_output (UDItype, w1)                       \
-	   : "d" ((UDItype)(u)),                                        \
-	     "d" ((UDItype)(v)))
-# endif
 # define UMUL_TIME 20
 # define UDIV_TIME 140
 #endif /* __mips__ */

-- 
2.56.1



More information about the Gcrypt-devel mailing list