From d6270972f79fe89a96fa7a3909991dad2e317033 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 28 Mar 2012 14:57:58 +0000 Subject: Fix pow of negative numbers to integer exponents (bugs 369, 2678, 3866). --- sysdeps/i386/fpu/e_powf.S | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'sysdeps/i386/fpu/e_powf.S') diff --git a/sysdeps/i386/fpu/e_powf.S b/sysdeps/i386/fpu/e_powf.S index aa58ed2b67..529a96f953 100644 --- a/sysdeps/i386/fpu/e_powf.S +++ b/sysdeps/i386/fpu/e_powf.S @@ -114,7 +114,7 @@ ENTRY(__ieee754_powf) fucomp %st(1) // y : x fnstsw sahf - jne 2f + jne 3f /* OK, we have an integer value for y. */ popl %edx @@ -151,7 +151,12 @@ ENTRY(__ieee754_powf) cfi_adjust_cfa_offset (4) .align ALIGNARG(4) -2: /* y is a real number. */ +2: /* y is a large integer (so even). */ + fxch // x : y + fabs // |x| : y + fxch // y : x + .align ALIGNARG(4) +3: /* y is a real number. */ fxch // x : y fldl MO(one) // 1.0 : x : y fldl MO(limit) // 0.29 : 1.0 : x : y -- cgit 1.4.1