fixed --enable-debug issue on Intel MULX, asm.c

This commit is contained in:
Takashi Kojo
2015-04-01 16:19:29 +09:00
parent 6243c6244a
commit 3aeedcf092

View File

@ -1232,12 +1232,13 @@ __asm__( \
/* anything you need at the end */ /* anything you need at the end */
#define COMBA_FINI #define COMBA_FINI
#define MULADD_MULX(b0, c0, c1)\ #define MULADD_MULX(b0, c0, c1, rdx)\
__asm__ volatile ( \ __asm__ volatile ( \
"movq %3, %%rdx\n\t" \
"mulx %2,%%r9, %%r8 \n\t" \ "mulx %2,%%r9, %%r8 \n\t" \
"adoxq %%r9,%0 \n\t" \ "adoxq %%r9,%0 \n\t" \
"adcxq %%r8,%1 \n\t" \ "adcxq %%r8,%1 \n\t" \
:"+r"(c0),"+r"(c1):"r"(b0):"%r8","%r9","%r10","%rdx"\ :"+r"(c0),"+r"(c1):"r"(b0), "r"(rdx):"%r8","%r9","%r10","%rdx"\
) )
@ -1251,34 +1252,39 @@ __asm__( \
#define MULADD_SET_A(a0)\ #define MULADD_SET_A(a0)\
__asm__ volatile("add $0, %%r8\n\t" \ __asm__ volatile("add $0, %%r8\n\t" \
"movq %0,%%rdx\n\t"::"r"(a0):"%r8","%r9","%r10","%rdx") ; \ "movq %0,%%rdx\n\t" \
::"r"(a0):"%r8","%r9","%r10","%rdx") ;
#define MULADD_BODY(a,b,c)\ #define MULADD_BODY(a,b,c)\
{ word64 rdx = a->dp[ix] ; \
cp = &(c->dp[iz]) ; \ cp = &(c->dp[iz]) ; \
c0 = cp[0] ; c1 = cp[1]; \ c0 = cp[0] ; c1 = cp[1]; \
MULADD_SET_A(a->dp[ix]) ;\ MULADD_SET_A(rdx) ; \
MULADD_MULX(b0, c0, c1) ;\ MULADD_MULX(b0, c0, c1, rdx) ;\
cp[0]=c0; c0=cp[2]; cp++ ;\ cp[0]=c0; c0=cp[2]; \
MULADD_MULX(b1, c1, c0) ;\ MULADD_MULX(b1, c1, c0, rdx) ;\
cp[0]=c1; c1=cp[2]; cp++ ; \ cp[1]=c1; c1=cp[3]; \
MULADD_MULX(b2, c0, c1) ;\ MULADD_MULX(b2, c0, c1, rdx) ;\
cp[0]=c0; c0=cp[2]; cp++ ; \ cp[2]=c0; c0=cp[4]; \
MULADD_MULX(b3, c1, c0) ;\ MULADD_MULX(b3, c1, c0, rdx) ;\
cp[0]=c1; c1=cp[2]; cp++ ; \ cp[3]=c1; c1=cp[5]; \
MULADD_MULX_ADD_CARRY(c0, c1);\ MULADD_MULX_ADD_CARRY(c0, c1);\
cp[0]=c0; cp[1]=c1; cp[4]=c0; cp[5]=c1; \
}
#define TFM_INTEL_MUL_COMBA(a, b, c)\ #define TFM_INTEL_MUL_COMBA(a, b, c)\
for(ix=0; ix<pa; ix++)c->dp[ix]=0 ; \ for(ix=0; ix<pa; ix++)c->dp[ix]=0 ; \
for(iy=0; (iy<b->used); iy+=4) { \ for(iy=0; (iy<b->used); iy+=4) { \
fp_digit *bp ; \ fp_digit *bp ; \
bp = &(b->dp[iy+0]) ; \ bp = &(b->dp[iy+0]) ; \
fp_digit b0 = bp[0] , b1= bp[1], b2= bp[2], b3= bp[3];\ fp_digit b0 = bp[0] , b1= bp[1], \
b2= bp[2], b3= bp[3]; \
ix=0, iz=iy; \ ix=0, iz=iy; \
while(ix<a->used) { \ while(ix<a->used) { \
fp_digit c0, c1; \ fp_digit c0, c1; \
fp_digit *cp ; \ fp_digit *cp ; \
MULADD_BODY(a,b,c); ix++ ; iz++ ; \ MULADD_BODY(a,b,c); \
ix++ ; iz++ ; \
} \ } \
}; };