aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/x86_64/fpu/e_logl.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/x86_64/fpu/e_logl.S')
-rw-r--r--sysdeps/x86_64/fpu/e_logl.S8
1 files changed, 7 insertions, 1 deletions
diff --git a/sysdeps/x86_64/fpu/e_logl.S b/sysdeps/x86_64/fpu/e_logl.S
index 047b8db88a..dbe6fd59dc 100644
--- a/sysdeps/x86_64/fpu/e_logl.S
+++ b/sysdeps/x86_64/fpu/e_logl.S
@@ -81,7 +81,13 @@ ENTRY(__logl_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 7f
+ fabs // log(1) is +0 in all rounding modes.
+7: fstp %st(1) // x-1 : log(2)
fyl2xp1 // log(x)
ret
END (__logl_finite)