summary refs log tree commit diff
path: root/sysdeps/i386/fpu/e_logl.S
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-10-14 23:41:47 -0400
committerUlrich Drepper <drepper@gmail.com>2011-10-14 23:41:47 -0400
commit38ad40ceca8ba35761e79cfce4aaef0d0f7583e6 (patch)
tree336de2d8f4b91a770418446fe2c322662d321bcd /sysdeps/i386/fpu/e_logl.S
parent396a21b1d016c52e011f8921e0728aa62a1e9df0 (diff)
downloadglibc-38ad40ceca8ba35761e79cfce4aaef0d0f7583e6.tar.gz
glibc-38ad40ceca8ba35761e79cfce4aaef0d0f7583e6.tar.xz
glibc-38ad40ceca8ba35761e79cfce4aaef0d0f7583e6.zip
Optimize x86-32 log
Diffstat (limited to 'sysdeps/i386/fpu/e_logl.S')
-rw-r--r--sysdeps/i386/fpu/e_logl.S20
1 files changed, 19 insertions, 1 deletions
diff --git a/sysdeps/i386/fpu/e_logl.S b/sysdeps/i386/fpu/e_logl.S
index ee1fb16bc4..bfb72a30e9 100644
--- a/sysdeps/i386/fpu/e_logl.S
+++ b/sysdeps/i386/fpu/e_logl.S
@@ -63,4 +63,22 @@ ENTRY(__ieee754_logl)
 	fstp	%st(1)
 	ret
 END (__ieee754_logl)
-strong_alias (__ieee754_logl, __logl_finite)
+
+ENTRY(__logl_finite)
+	fldln2			// log(2)
+	fldt	4(%esp)		// x : log(2)
+#ifdef PIC
+	LOAD_PIC_REG (dx)
+#endif
+	fld	%st		// x : x : log(2)
+	fsubl	MO(one)		// x-1 : x : log(2)
+	fld	%st		// x-1 : x-1 : x : log(2)
+	fabs			// |x-1| : x-1 : x : log(2)
+	fcompl	MO(limit)	// x-1 : x : log(2)
+	fnstsw			// x-1 : x : log(2)
+	andb	$0x45, %ah
+	jz	2b
+	fstp	%st(1)		// x-1 : log(2)
+	fyl2xp1			// log(x)
+	ret
+END(__logl_finite)