about summary refs log tree commit diff
path: root/sysdeps/i386/fpu/e_powf.S
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2013-11-16 12:45:11 +0000
committerJoseph Myers <joseph@codesourcery.com>2013-11-16 12:45:11 +0000
commit66294491665029eff0cf3ebd5fb6f04582da6c1e (patch)
tree5d398338d64b21bba5eb702a543cfd456c46418a /sysdeps/i386/fpu/e_powf.S
parentb46d046e7bf7e0f96e41e522da731b89177e31ab (diff)
downloadglibc-66294491665029eff0cf3ebd5fb6f04582da6c1e.tar.gz
glibc-66294491665029eff0cf3ebd5fb6f04582da6c1e.tar.xz
glibc-66294491665029eff0cf3ebd5fb6f04582da6c1e.zip
Fix spurious "inexact" exceptions from x86 pow with NaN argument (bug 16167).
Diffstat (limited to 'sysdeps/i386/fpu/e_powf.S')
-rw-r--r--sysdeps/i386/fpu/e_powf.S5
1 files changed, 4 insertions, 1 deletions
diff --git a/sysdeps/i386/fpu/e_powf.S b/sysdeps/i386/fpu/e_powf.S
index 7fad90f6cb..90d3d0ca6a 100644
--- a/sysdeps/i386/fpu/e_powf.S
+++ b/sysdeps/i386/fpu/e_powf.S
@@ -95,6 +95,9 @@ ENTRY(__ieee754_powf)
 	cmpb	$0x05, %ah
 	je	15f		// x is ħinf
 
+	cmpb	$0x01, %ah
+	je	32f		// x is NaN
+
 	fxch			// y : x
 
 	/* fistpl raises invalid exception for |y| >= 1L<<31.  */
@@ -180,7 +183,7 @@ ENTRY(__ieee754_powf)
 	f2xm1			// 2^fract(y*log2(x))-1 : int(y*log2(x))
 	faddl	MO(one)		// 2^fract(y*log2(x)) : int(y*log2(x))
 	fscale			// 2^fract(y*log2(x))*2^int(y*log2(x)) : int(y*log2(x))
-	addl	$4, %esp
+32:	addl	$4, %esp
 	cfi_adjust_cfa_offset (-4)
 	fstp	%st(1)		// 2^fract(y*log2(x))*2^int(y*log2(x))
 	ret