summaryrefslogtreecommitdiff
path: root/recipes/mpfr/dont_use_mips_h_constraint.patch
blob: 055e49449174f210ff6c61360da5138ecf29e8fb (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
Index: mpfr-2.3.1/mpfr-longlong.h
===================================================================
--- mpfr-2.3.1.orig/mpfr-longlong.h	2009-12-18 19:22:54.372096301 -0800
+++ mpfr-2.3.1/mpfr-longlong.h	2009-12-18 19:24:21.832074034 -0800
@@ -1011,7 +1011,15 @@ extern UWtype __MPN(udiv_qrnnd) _PROTO (
 #endif /* __m88000__ */
 
 #if defined (__mips) && W_TYPE_SIZE == 32
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
+#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
+#define umul_ppmm(w1, w0, u, v) \
+  do {                                                                 \
+    UDItype _r;                                                        \
+    _r = (UDItype) u * v;                                              \
+    (w1) = _r >> 32;                                                   \
+    (w0) = (USItype) _r;                                               \
+  } while (0)
+#elif __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
@@ -1024,7 +1032,16 @@ extern UWtype __MPN(udiv_qrnnd) _PROTO (
 #endif /* __mips */
 
 #if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
+#if (__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" (w0), "=h" (w1) : "d" (u), "d" (v))
 #else