patch-mpfr-longlong_h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. $Id: update-patches 24 2008-08-31 14:56:13Z wbx $
  2. --- mpfr-2.4.1.orig/mpfr-longlong.h 2009-02-20 10:43:17.000000000 +0100
  3. +++ mpfr-2.4.1/mpfr-longlong.h 2009-05-29 15:11:21.000000000 +0200
  4. @@ -1011,10 +1011,19 @@ extern UWtype __MPN(udiv_qrnnd) _PROTO (
  5. #endif /* __m88000__ */
  6. #if defined (__mips) && W_TYPE_SIZE == 32
  7. -#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
  8. +#if __GMP_GNUC_PREREQ (4,4)
  9. +#define umul_ppmm(w1, w0, u, v) \
  10. + do { \
  11. + UDItype __ll = (UDItype)(u) * (v); \
  12. + w1 = __ll >> 32; \
  13. + w0 = __ll; \
  14. + } while (0)
  15. +#endif
  16. +#if !defined (umul_ppmm) && __GMP_GNUC_PREREQ (2,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. +#endif
  21. +#if !defined (umul_ppmm)
  22. #define umul_ppmm(w1, w0, u, v) \
  23. __asm__ ("multu %2,%3\n\tmflo %0\n\tmfhi %1" \
  24. : "=d" (w0), "=d" (w1) : "d" (u), "d" (v))
  25. @@ -1024,10 +1033,20 @@ extern UWtype __MPN(udiv_qrnnd) _PROTO (
  26. #endif /* __mips */
  27. #if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64
  28. -#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
  29. +#if __GMP_GNUC_PREREQ (4,4)
  30. +#define umul_ppmm(w1, w0, u, v) \
  31. + do { \
  32. + typedef unsigned int __ll_UTItype __attribute__((mode(TI))); \
  33. + __ll_UTItype __ll = (__ll_UTItype)(u) * (v); \
  34. + w1 = __ll >> 64; \
  35. + w0 = __ll; \
  36. + } while (0)
  37. +#endif
  38. +#if !defined (umul_ppmm) && __GMP_GNUC_PREREQ (2,7)
  39. #define umul_ppmm(w1, w0, u, v) \
  40. __asm__ ("dmultu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
  41. -#else
  42. +#endif
  43. +#if !defined (umul_ppmm)
  44. #define umul_ppmm(w1, w0, u, v) \
  45. __asm__ ("dmultu %2,%3\n\tmflo %0\n\tmfhi %1" \
  46. : "=d" (w0), "=d" (w1) : "d" (u), "d" (v))