diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 3405b828b..415a9166e 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,9 @@ +2009-08-31 Takaki Makino + + * libm/machine/i386/f_pow.c(_f_pow): Alter ASM so it works with + newer gcc versions. + * libm/maachine/i386/f_powf.c(_f_powf): Ditto. + 2009-08-25 Andy Koppe * libc/stdlib/sb_charsets.c (__micro_atoi): Allow five-digit codepage diff --git a/newlib/libm/machine/i386/f_pow.c b/newlib/libm/machine/i386/f_pow.c index 050faa371..d1ef4213b 100644 --- a/newlib/libm/machine/i386/f_pow.c +++ b/newlib/libm/machine/i386/f_pow.c @@ -35,9 +35,9 @@ double _f_pow (double x, double y) /* calculate x ** y as 2 ** (y log2(x)). On Intel, can only raise 2 to an integer or a small fraction, thus, we have to perform two steps 2**integer portion * 2**fraction. */ - asm ("fldl 8(%%ebp); fyl2x; fld %%st; frndint; fsub %%st,%%st(1);" \ + asm ("fyl2x; fld %%st; frndint; fsub %%st,%%st(1);"\ "fxch; fchs; f2xm1; fld1; faddp; fxch; fld1; fscale; fstp %%st(1);"\ - "fmulp" : "=t" (result) : "0" (y)); + "fmulp" : "=t" (result) : "0" (x), "u" (y) : "st(1)" ); return result; } else /* all other strange cases, defer to normal pow() */ diff --git a/newlib/libm/machine/i386/f_powf.c b/newlib/libm/machine/i386/f_powf.c index ca3ef60c7..a778f46a7 100644 --- a/newlib/libm/machine/i386/f_powf.c +++ b/newlib/libm/machine/i386/f_powf.c @@ -35,9 +35,9 @@ float _f_powf (float x, float y) /* calculate x ** y as 2 ** (y log2(x)). On Intel, can only raise 2 to an integer or a small fraction, thus, we have to perform two steps 2**integer portion * 2**fraction. */ - asm ("flds 8(%%ebp); fyl2x; fld %%st; frndint; fsub %%st,%%st(1);" \ + asm ("fyl2x; fld %%st; frndint; fsub %%st,%%st(1);"\ "fxch; fchs; f2xm1; fld1; faddp; fxch; fld1; fscale; fstp %%st(1);"\ - "fmulp" : "=t" (result) : "0" (y)); + "fmulp" : "=t" (result) : "0" (x), "u" (y) : "st(1)" ); return result; } else /* all other strange cases, defer to normal pow() */