diff tomsfastmath/src/mul/fp_mul_comba.c @ 645:8622ee48fab5 dropbear-tfm

- Work around broken asm constraint behaviour on 32bit x86 OS X
author Matt Johnston <matt@ucc.asn.au>
date Wed, 30 Nov 2011 22:27:26 +0800
parents a362b62d38b2
children
line wrap: on
line diff
--- a/tomsfastmath/src/mul/fp_mul_comba.c	Wed Nov 23 18:11:51 2011 +0700
+++ b/tomsfastmath/src/mul/fp_mul_comba.c	Wed Nov 30 22:27:26 2011 +0800
@@ -47,13 +47,15 @@
 
 /* this should multiply i and j  */
 #define MULADD(i, j)                                      \
+	do { fp_digit ti = (i); \
+		fp_digit tj = (j); \
 asm(                                                      \
      "movl  %6,%%eax     \n\t"                            \
      "mull  %7           \n\t"                            \
      "addl  %%eax,%0     \n\t"                            \
      "adcl  %%edx,%1     \n\t"                            \
      "adcl  $0,%2        \n\t"                            \
-     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j)  :"%eax","%edx","%cc");
+     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(ti), "m"(tj)  :"%eax","%edx","%cc"); } while (0);
 
 #elif defined(TFM_X86_64)
 /* x86-64 optimized */