about summary refs log tree commit diff
path: root/sysdeps/i386/fpu/s_log1pl.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/i386/fpu/s_log1pl.S')
-rw-r--r--sysdeps/i386/fpu/s_log1pl.S10
1 files changed, 10 insertions, 0 deletions
diff --git a/sysdeps/i386/fpu/s_log1pl.S b/sysdeps/i386/fpu/s_log1pl.S
index 05a17b2831..26c407b606 100644
--- a/sysdeps/i386/fpu/s_log1pl.S
+++ b/sysdeps/i386/fpu/s_log1pl.S
@@ -41,7 +41,12 @@ ENTRY(__log1pl)
 	addl	$_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
 #endif
 
+	fxam
+	fnstsw
 	fld	%st
+	sahf
+	jc	3f		// in case x is NaN or ħInf
+4:
 	fabs
 #ifdef PIC
 	fldt	limit@GOTOFF(%edx)
@@ -64,5 +69,10 @@ ENTRY(__log1pl)
 2:	fyl2xp1
 	ret
 
+3:	jp	4b		// in case x is ħInf
+	fstp	%st(1)
+	fstp	%st(1)
+	ret
+
 END (__log1pl)
 weak_alias (__log1pl, log1pl)