aboutsummaryrefslogtreecommitdiff
path: root/newlib/libm/machine/i386
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2009-08-31 22:12:41 +0000
committerJeff Johnston <jjohnstn@redhat.com>2009-08-31 22:12:41 +0000
commita9dd63246134c04419cfd42ff22d2e8c46069beb (patch)
tree550b926e5a92672a447c62f41c1f87843e7191ee /newlib/libm/machine/i386
parentdd5b8f6c1715e5f12fe1c865ec7896445b15b6a0 (diff)
downloadnewlib-a9dd63246134c04419cfd42ff22d2e8c46069beb.zip
newlib-a9dd63246134c04419cfd42ff22d2e8c46069beb.tar.gz
newlib-a9dd63246134c04419cfd42ff22d2e8c46069beb.tar.bz2
2009-08-31 Takaki Makino <t@snowelm.com>
* 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.
Diffstat (limited to 'newlib/libm/machine/i386')
-rw-r--r--newlib/libm/machine/i386/f_pow.c4
-rw-r--r--newlib/libm/machine/i386/f_powf.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/newlib/libm/machine/i386/f_pow.c b/newlib/libm/machine/i386/f_pow.c
index 050faa3..d1ef421 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 ca3ef60..a778f46 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() */