Mercurial > dropbear
comparison 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 |
comparison
equal
deleted
inserted
replaced
644:ff5cc422ba40 | 645:8622ee48fab5 |
---|---|
45 /* anything you need at the end */ | 45 /* anything you need at the end */ |
46 #define COMBA_FINI | 46 #define COMBA_FINI |
47 | 47 |
48 /* this should multiply i and j */ | 48 /* this should multiply i and j */ |
49 #define MULADD(i, j) \ | 49 #define MULADD(i, j) \ |
50 do { fp_digit ti = (i); \ | |
51 fp_digit tj = (j); \ | |
50 asm( \ | 52 asm( \ |
51 "movl %6,%%eax \n\t" \ | 53 "movl %6,%%eax \n\t" \ |
52 "mull %7 \n\t" \ | 54 "mull %7 \n\t" \ |
53 "addl %%eax,%0 \n\t" \ | 55 "addl %%eax,%0 \n\t" \ |
54 "adcl %%edx,%1 \n\t" \ | 56 "adcl %%edx,%1 \n\t" \ |
55 "adcl $0,%2 \n\t" \ | 57 "adcl $0,%2 \n\t" \ |
56 :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) :"%eax","%edx","%cc"); | 58 :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(ti), "m"(tj) :"%eax","%edx","%cc"); } while (0); |
57 | 59 |
58 #elif defined(TFM_X86_64) | 60 #elif defined(TFM_X86_64) |
59 /* x86-64 optimized */ | 61 /* x86-64 optimized */ |
60 | 62 |
61 /* anything you need at the start */ | 63 /* anything you need at the start */ |