diff --git a/fixed.h b/fixed.h index b6adec6..dba12e0 100644 --- a/fixed.h +++ b/fixed.h @@ -307,11 +307,13 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y) * This MIPS version is fast and accurate; the disposition of the least * 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) \ - : "%r" (x), "r" (y)) - + 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) # if defined(HAVE_MADD_ASM) # define MAD_F_MLA(hi, lo, x, y) \ asm ("madd %2,%3" \ diff --git a/mad.h b/mad.h index 119ac96..99e6537 100644 --- a/mad.h +++ b/mad.h @@ -353,11 +353,13 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y) * This MIPS version is fast and accurate; the disposition of the least * 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) \ - : "%r" (x), "r" (y)) - + 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) # if defined(HAVE_MADD_ASM) # define MAD_F_MLA(hi, lo, x, y) \ asm ("madd %2,%3" \