fix FETOX & FTWOTOX translations for x86_64

This commit is contained in:
gbeauche 2006-02-26 18:49:55 +00:00
parent c374d519a3
commit 91babf4bb5

View File

@ -1196,6 +1196,12 @@ LOWFUNC(WRITE,READ,0,raw_popfl,(void))
}
LENDFUNC(WRITE,READ,0,raw_popfl,(void))
/* Generate floating-point instructions */
static inline void x86_fadd_m(MEMR s)
{
FADDLm(s,X86_NOREG,X86_NOREG,1);
}
#else
const bool optimize_accum = true;
@ -2972,6 +2978,14 @@ LOWFUNC(WRITE,READ,0,raw_popfl,(void))
}
LENDFUNC(WRITE,READ,0,raw_popfl,(void))
/* Generate floating-point instructions */
static inline void x86_fadd_m(MEMR s)
{
emit_byte(0xdc);
emit_byte(0x05);
emit_long(s);
}
#endif
/*************************************************************************
@ -4299,7 +4313,7 @@ LOWFUNC(NONE,NONE,2,raw_fsin_rr,(FW d, FR s))
}
LENDFUNC(NONE,NONE,2,raw_fsin_rr,(FW d, FR s))
double one=1;
static const double one=1;
LOWFUNC(NONE,NONE,2,raw_ftwotox_rr,(FW d, FR s))
{
int ds;
@ -4319,9 +4333,7 @@ LOWFUNC(NONE,NONE,2,raw_ftwotox_rr,(FW d, FR s))
emit_byte(0xe1); /* subtract rounded from original */
emit_byte(0xd9);
emit_byte(0xf0); /* f2xm1 */
emit_byte(0xdc);
emit_byte(0x05);
emit_long((uintptr)&one); /* Add '1' without using extra stack space */
x86_fadd_m((uintptr)&one); /* Add '1' without using extra stack space */
emit_byte(0xd9);
emit_byte(0xfd); /* and scale it */
emit_byte(0xdd);
@ -4353,9 +4365,7 @@ LOWFUNC(NONE,NONE,2,raw_fetox_rr,(FW d, FR s))
emit_byte(0xe1); /* subtract rounded from original */
emit_byte(0xd9);
emit_byte(0xf0); /* f2xm1 */
emit_byte(0xdc);
emit_byte(0x05);
emit_long((uintptr)&one); /* Add '1' without using extra stack space */
x86_fadd_m((uintptr)&one); /* Add '1' without using extra stack space */
emit_byte(0xd9);
emit_byte(0xfd); /* and scale it */
emit_byte(0xdd);