summary refs log tree commit diff
path: root/sysdeps/i386/fpu/e_log10.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/i386/fpu/e_log10.S')
-rw-r--r--sysdeps/i386/fpu/e_log10.S8
1 files changed, 7 insertions, 1 deletions
diff --git a/sysdeps/i386/fpu/e_log10.S b/sysdeps/i386/fpu/e_log10.S
index ce6a81abb6..17277084ca 100644
--- a/sysdeps/i386/fpu/e_log10.S
+++ b/sysdeps/i386/fpu/e_log10.S
@@ -46,7 +46,13 @@ ENTRY(__ieee754_log10)
 	fnstsw			// x-1 : x : log10(2)
 	andb	$0x45, %ah
 	jz	2f
-	fstp	%st(1)		// x-1 : log10(2)
+	fxam
+	fnstsw
+	andb	$0x45, %ah
+	cmpb	$0x40, %ah
+	jne	5f
+	fabs			// log10(1) is +0 in all rounding modes.
+5:	fstp	%st(1)		// x-1 : log10(2)
 	fyl2xp1			// log10(x)
 	ret