changeset 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 ff5cc422ba40
children f10335e5e42f
files tomsfastmath/src/mul/fp_mul_comba.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
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 */