summaryrefslogtreecommitdiff
path: root/sysdeps/i386/fpu/e_logf.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/i386/fpu/e_logf.S')
-rw-r--r--sysdeps/i386/fpu/e_logf.S8
1 files changed, 7 insertions, 1 deletions
diff --git a/sysdeps/i386/fpu/e_logf.S b/sysdeps/i386/fpu/e_logf.S
index ca83d39cef..de967a31f5 100644
--- a/sysdeps/i386/fpu/e_logf.S
+++ b/sysdeps/i386/fpu/e_logf.S
@@ -81,7 +81,13 @@ ENTRY(__logf_finite)
fnstsw // x-1 : x : log(2)
andb $0x45, %ah
jz 2b
- fstp %st(1) // x-1 : log(2)
+ fxam
+ fnstsw
+ andb $0x45, %ah
+ cmpb $0x40, %ah
+ jne 6f
+ fabs // log(1) is +0 in all rounding modes.
+6: fstp %st(1) // x-1 : log(2)
fyl2xp1 // log(x)
ret
END(__logf_finite)