about summary refs log tree commit diff
path: root/sysdeps/i386/fpu/s_log1pf.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/i386/fpu/s_log1pf.S')
-rw-r--r--sysdeps/i386/fpu/s_log1pf.S11
1 files changed, 10 insertions, 1 deletions
diff --git a/sysdeps/i386/fpu/s_log1pf.S b/sysdeps/i386/fpu/s_log1pf.S
index df9fdcbcfc..d5283fcfee 100644
--- a/sysdeps/i386/fpu/s_log1pf.S
+++ b/sysdeps/i386/fpu/s_log1pf.S
@@ -36,8 +36,12 @@ ENTRY(__log1pf)
 	addl	$_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
 #endif
 
+	fxam
+	fnstsw
 	fld	%st
-	fabs
+	sahf
+	jc	3f		// in case x is NaN or ħInf
+4:	fabs
 #ifdef PIC
 	fcomps	limit@GOTOFF(%edx)
 #else
@@ -58,5 +62,10 @@ ENTRY(__log1pf)
 2:	fyl2xp1
 	ret
 
+3:	jp	4b		// in case x is ħInf
+	fstp	%st(1)
+	fstp	%st(1)
+	ret
+
 END (__log1pf)
 weak_alias (__log1pf, log1pf)