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_pow.S | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'sysdeps/i386/fpu/e_pow.S') diff --git a/sysdeps/i386/fpu/e_pow.S b/sysdeps/i386/fpu/e_pow.S index 1abedf6284..b61a946082 100644 --- a/sysdeps/i386/fpu/e_pow.S +++ b/sysdeps/i386/fpu/e_pow.S @@ -114,7 +114,7 @@ ENTRY(__ieee754_pow) fucomp %st(1) // y : x fnstsw sahf - jne 2f + jne 3f /* OK, we have an integer value for y. */ popl %eax @@ -157,7 +157,12 @@ ENTRY(__ieee754_pow) cfi_adjust_cfa_offset (8) .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