This patch fixes the MIPS assembly code to work with recent versions of GCC, where the "=h" constraint is no longer supported.
Regards, Mark
--- libmad/fixed.h.orig 2004-02-16 21:02:03.000000000 -0500 +++ libmad/fixed.h 2011-10-29 18:47:21.000000000 -0400 @@ -304,8 +304,8 @@ * significant bit depends on OPT_ACCURACY via mad_f_scale64(). */ # define MAD_F_MLX(hi, lo, x, y) \ - asm ("mult %2,%3" \ - : "=l" (lo), "=h" (hi) \ + asm ("mult %2,%3\n\tmfhi %1" \ + : "=l" (lo), "=r" (hi) \ : "%r" (x), "r" (y))
# if defined(HAVE_MADD_ASM)
On Thu, Nov 07, 2013 at 01:41:01AM -0500, Mark H Weaver wrote:
This patch fixes the MIPS assembly code to work with recent versions of GCC, where the "=h" constraint is no longer supported.
I've been using this patch: --- libmad-0.15.1b.orig/fixed.h +++ libmad-0.15.1b/fixed.h @@ -297,6 +297,14 @@
/* --- MIPS * ---------------------------------------------------------------- * */
+# elif defined(FPM_MIPS) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) + typedef unsigned int u64_di_t __attribute__ ((mode (DI))); +# define MAD_F_MLX(hi, lo, x, y) \ + do { \ + u64_di_t __ll = (u64_di_t) (x) * (y); \ + hi = __ll >> 32; \ + lo = __ll; \ + } while (0) # elif defined(FPM_MIPS)
/*