1
0

001-mips_removal_h_constraint.patch 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. diff -ur libmad-0.15.1b-orig/fixed.h libmad-0.15.1b/fixed.h
  2. --- libmad-0.15.1b-orig/fixed.h 2004-02-17 12:32:03.000000000 +1030
  3. +++ libmad-0.15.1b/fixed.h 2009-08-05 10:46:30.000000000 +0930
  4. @@ -299,6 +299,23 @@
  5. # elif defined(FPM_MIPS)
  6. +/* Test for gcc >= maj.min, as per __GNUC_PREREQ in glibc */
  7. +#if defined (__GNUC__) && defined (__GNUC_MINOR__)
  8. +#define __GNUC_PREREQ(maj, min) \
  9. + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
  10. +#else
  11. +#define __GNUC_PREREQ(maj, min) 0
  12. +#endif
  13. +
  14. +#if __GNUC_PREREQ(4,4)
  15. + typedef unsigned int u64_di_t __attribute__ ((mode (DI)));
  16. +# define MAD_F_MLX(hi, lo, x, y) \
  17. + do { \
  18. + u64_di_t __ll = (u64_di_t) (x) * (y); \
  19. + hi = __ll >> 32; \
  20. + lo = __ll; \
  21. + } while (0)
  22. +#else
  23. /*
  24. * This MIPS version is fast and accurate; the disposition of the least
  25. * significant bit depends on OPT_ACCURACY via mad_f_scale64().
  26. @@ -328,6 +345,7 @@
  27. : "%r" ((x) >> 12), "r" ((y) >> 16))
  28. # define MAD_F_MLZ(hi, lo) ((mad_fixed_t) (lo))
  29. # endif
  30. +#endif /* __GNU_PREREQ(4,4) */
  31. # if defined(OPT_SPEED)
  32. # define mad_f_scale64(hi, lo) \
  33. diff -ur libmad-0.15.1b-orig/mad.h libmad-0.15.1b/mad.h
  34. --- libmad-0.15.1b-orig/mad.h 2004-02-17 13:25:44.000000000 +1030
  35. +++ libmad-0.15.1b/mad.h 2009-08-05 10:42:40.000000000 +0930
  36. @@ -344,6 +344,23 @@
  37. # elif defined(FPM_MIPS)
  38. +/* Test for gcc >= maj.min, as per __GNUC_PREREQ in glibc */
  39. +#if defined (__GNUC__) && defined (__GNUC_MINOR__)
  40. +#define __GNUC_PREREQ(maj, min) \
  41. + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
  42. +#else
  43. +#define __GNUC_PREREQ(maj, min) 0
  44. +#endif
  45. +
  46. +#if __GNUC_PREREQ(4,4)
  47. + typedef unsigned int u64_di_t __attribute__ ((mode (DI)));
  48. +# define MAD_F_MLX(hi, lo, x, y) \
  49. + do { \
  50. + u64_di_t __ll = (u64_di_t) (x) * (y); \
  51. + hi = __ll >> 32; \
  52. + lo = __ll; \
  53. + } while (0)
  54. +#else
  55. /*
  56. * This MIPS version is fast and accurate; the disposition of the least
  57. * significant bit depends on OPT_ACCURACY via mad_f_scale64().
  58. @@ -373,6 +390,7 @@
  59. : "%r" ((x) >> 12), "r" ((y) >> 16))
  60. # define MAD_F_MLZ(hi, lo) ((mad_fixed_t) (lo))
  61. # endif
  62. +#endif /* __GNU_PREREQ(4,4) */
  63. # if defined(OPT_SPEED)
  64. # define mad_f_scale64(hi, lo) \