1
0

003-mpfr-longlong-mips.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. diff -Naurd mpfr-2.4.2-a/mpfr-longlong.h mpfr-2.4.2-b/mpfr-longlong.h
  2. --- -a/mpfr-2.4.2/mpfr-longlong.h 2009-11-30 02:43:08.000000000 +0000
  3. +++ -b/mpfr-2.4.2/mpfr-longlong.h 2009-12-18 12:04:29.000000000 +0000
  4. @@ -1011,7 +1011,15 @@
  5. #endif /* __m88000__ */
  6. #if defined (__mips) && W_TYPE_SIZE == 32
  7. -#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
  8. +#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
  9. +#define umul_ppmm(w1, w0, u, v) \
  10. + do { \
  11. + UDItype _r; \
  12. + _r = (UDItype) u * v; \
  13. + (w1) = _r >> 32; \
  14. + (w0) = (USItype) _r; \
  15. + } while (0)
  16. +#elif __GNUC__ > 2 || __GNUC_MINOR__ >= 7
  17. #define umul_ppmm(w1, w0, u, v) \
  18. __asm__ ("multu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
  19. #else
  20. @@ -1024,7 +1032,16 @@
  21. #endif /* __mips */
  22. #if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64
  23. -#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
  24. +#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
  25. +typedef unsigned int UTItype __attribute__ ((mode (TI)));
  26. +#define umul_ppmm(w1, w0, u, v) \
  27. + do { \
  28. + UTItype _r; \
  29. + _r = (UTItype) u * v; \
  30. + (w1) = _r >> 64; \
  31. + (w0) = (UDItype) _r; \
  32. + } while (0)
  33. +#elif __GNUC__ > 2 || __GNUC_MINOR__ >= 7
  34. #define umul_ppmm(w1, w0, u, v) \
  35. __asm__ ("dmultu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
  36. #else