summaryrefslogtreecommitdiff
blob: f14df455588aaa75ada7e81ae248483620964913 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
--- a/mpfr-gmp.h	2008-11-28 03:03:22.000000000 +0800
+++ b/mpfr-gmp.h	2008-11-28 03:04:29.000000000 +0800
@@ -179,6 +179,10 @@
 typedef unsigned int USItype    __attribute__ ((mode (SI)));
 typedef          int DItype     __attribute__ ((mode (DI)));
 typedef unsigned int UDItype    __attribute__ ((mode (DI)));
+#if BITS_PER_MP_LIMB == 64
+typedef          int TItype     __attribute__ ((mode (TI)));
+typedef unsigned int UTItype    __attribute__ ((mode (TI)));
+#endif
 #else
 typedef unsigned char UQItype;
 typedef          long SItype;
diff --git a/mpfr-longlong.h b/mpfr-longlong.h
index 111b36c..57eba49 100644
--- a/mpfr-longlong.h
+++ b/mpfr-longlong.h
@@ -1011,27 +1011,23 @@ extern UWtype __MPN(udiv_qrnnd) _PROTO ((UWtype *, UWtype, UWtype, UWtype));
 #endif /* __m88000__ */
 
 #if defined (__mips) && W_TYPE_SIZE == 32
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
 #define umul_ppmm(w1, w0, u, v) \
-  __asm__ ("multu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
-#else
-#define umul_ppmm(w1, w0, u, v) \
-  __asm__ ("multu %2,%3\n\tmflo %0\n\tmfhi %1"				\
-	   : "=d" (w0), "=d" (w1) : "d" (u), "d" (v))
-#endif
+  do {									\
+    UDItype __x = (UDItype) (USItype) (u) * (USItype) (v);		\
+    (w1) = (USItype) (__x >> 32);					\
+    (w0) = (USItype) (__x);						\
+  } while (0)
 #define UMUL_TIME 10
 #define UDIV_TIME 100
 #endif /* __mips */
 
 #if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
 #define umul_ppmm(w1, w0, u, v) \
-  __asm__ ("dmultu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
-#else
-#define umul_ppmm(w1, w0, u, v) \
-  __asm__ ("dmultu %2,%3\n\tmflo %0\n\tmfhi %1"				\
-	   : "=d" (w0), "=d" (w1) : "d" (u), "d" (v))
-#endif
+  do {									\
+    UTItype __x = (UTItype) (UDItype) (u) * (UDItype) (v);		\
+    (w1) = (UDItype) (__x >> 64);					\
+    (w0) = (UDItype) (__x);						\
+  } while (0)
 #define UMUL_TIME 20
 #define UDIV_TIME 140
 #endif /* __mips */