summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2011-11-30 23:03:47 +0800
committerMatt Johnston <matt@ucc.asn.au>2011-11-30 23:03:47 +0800
commitfa4450bee6fd8e613aa7cfc62214f4373205d422 (patch)
tree3e0f6d97af660956d6bcdf9fb36a113326ddbb2c
parenta5cc5391e0eac9f3fbbdd38df57e8aaec5bcccae (diff)
downloaddropbear-fa4450bee6fd8e613aa7cfc62214f4373205d422.tar.gz
- More asm constraint fixes. Now seems to build OK on 32-bit OS X.
-rw-r--r--tomsfastmath/src/sqr/fp_sqr_comba.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/tomsfastmath/src/sqr/fp_sqr_comba.c b/tomsfastmath/src/sqr/fp_sqr_comba.c
index c75f773..0c79f62 100644
--- a/tomsfastmath/src/sqr/fp_sqr_comba.c
+++ b/tomsfastmath/src/sqr/fp_sqr_comba.c
@@ -35,15 +35,18 @@
#define COMBA_FINI
#define SQRADD(i, j) \
+ do { fp_digit ti = (i); \
asm( \
"movl %6,%%eax \n\t" \
"mull %%eax \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) :"%eax","%edx","%cc");
+ :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(ti) :"%eax","%edx","%cc"); } while (0);
#define SQRADD2(i, j) \
+ do { fp_digit ti = (i); \
+ fp_digit tj = (j); \
asm( \
"movl %6,%%eax \n\t" \
"mull %7 \n\t" \
@@ -53,27 +56,34 @@ asm( \
"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);
#define SQRADDSC(i, j) \
+ do { \
asm( \
- "movl %6,%%eax \n\t" \
- "mull %7 \n\t" \
+ "movl %2,%%eax \n\t" \
+ "mull %3 \n\t" \
"movl %%eax,%0 \n\t" \
"movl %%edx,%1 \n\t" \
- "xorl %2,%2 \n\t" \
- :"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) :"%eax","%edx","%cc");
+ :"=r"(sc0), "=r"(sc1): "g"(i), "g"(j) :"%eax","%edx","%cc"); \
+ sc2 = 0; } while (0);
#define SQRADDAC(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"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) :"%eax","%edx","%cc");
+ :"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "m"(ti), "m"(tj) :"%eax","%edx","%cc"); \
+ } while (0);
#define SQRADDDB \
+ do { fp_digit tsc0 = (sc0); \
+ fp_digit tsc1 = (sc1); \
+ fp_digit tsc2 = (sc2); \
asm( \
"addl %6,%0 \n\t" \
"adcl %7,%1 \n\t" \
@@ -81,7 +91,7 @@ asm( \
"addl %6,%0 \n\t" \
"adcl %7,%1 \n\t" \
"adcl %8,%2 \n\t" \
- :"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) : "%cc");
+ :"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "m"(tsc0), "m"(tsc1), "m"(tsc2) : "%cc"); } while (0);
#elif defined(TFM_X86_64)
/* x86-64 optimized */