summaryrefslogtreecommitdiff
path: root/libc/sysdeps/x86_64/fpu/e_log10l.S
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2011-10-25 00:37:10 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2011-10-25 00:37:10 +0000
commit4bbe4e2185c5484328182720ff7b3bb4f9593bff (patch)
treecd67e40a74928c0f58d4f5b79d2e260e4099fee7 /libc/sysdeps/x86_64/fpu/e_log10l.S
parent91b4be71461f78cabe1fb5f164cea71b60e9e98a (diff)
downloadeglibc2-4bbe4e2185c5484328182720ff7b3bb4f9593bff.tar.gz
Merge changes between r15223 and r15532 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@15545 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/sysdeps/x86_64/fpu/e_log10l.S')
-rw-r--r--libc/sysdeps/x86_64/fpu/e_log10l.S27
1 files changed, 21 insertions, 6 deletions
diff --git a/libc/sysdeps/x86_64/fpu/e_log10l.S b/libc/sysdeps/x86_64/fpu/e_log10l.S
index 633234b74..50c58757a 100644
--- a/libc/sysdeps/x86_64/fpu/e_log10l.S
+++ b/libc/sysdeps/x86_64/fpu/e_log10l.S
@@ -10,14 +10,12 @@
#include <machine/asm.h>
-RCSID("$NetBSD: $")
-
#ifdef __ELF__
- .section .rodata
+ .section .rodata.cst8,"aM",@progbits,8
#else
.text
#endif
- .align ALIGNARG(4)
+ .p2align 3
ASM_TYPE_DIRECTIVE(one,@object)
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
@@ -30,9 +28,9 @@ limit: .double 0.29
#ifdef PIC
-#define MO(op) op##(%rip)
+# define MO(op) op##(%rip)
#else
-#define MO(op) op
+# define MO(op) op
#endif
.text
@@ -65,3 +63,20 @@ ENTRY(__ieee754_log10l)
fstp %st(1)
ret
END(__ieee754_log10l)
+
+
+ENTRY(__log10l_finite)
+ fldlg2 // log10(2)
+ fldt 8(%rsp) // x : log10(2)
+ fld %st // x : x : log10(2)
+4: fsubl MO(one) // x-1 : x : log10(2)
+ fld %st // x-1 : x-1 : x : log10(2)
+ fabs // |x-1| : x-1 : x : log10(2)
+ fcompl MO(limit) // x-1 : x : log10(2)
+ fnstsw // x-1 : x : log10(2)
+ andb $0x45, %ah
+ jz 2b
+ fstp %st(1) // x-1 : log10(2)
+ fyl2xp1 // log10(x)
+ ret
+END(__log10l_finite)