about summary refs log tree commit diff
path: root/sysdeps/i386/fpu/e_logf.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_logf.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_logf.S')
-rw-r--r--sysdeps/i386/fpu/e_logf.S20
1 files changed, 19 insertions, 1 deletions
diff --git a/sysdeps/i386/fpu/e_logf.S b/sysdeps/i386/fpu/e_logf.S
index b683e13853..1992cc2f82 100644
--- a/sysdeps/i386/fpu/e_logf.S
+++ b/sysdeps/i386/fpu/e_logf.S
@@ -63,4 +63,22 @@ ENTRY(__ieee754_logf)
 	fstp	%st(1)
 	ret
 END (__ieee754_logf)
-strong_alias (__ieee754_logf, __logf_finite)
+
+ENTRY(__logf_finite)
+	fldln2			// log(2)
+	flds	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(__logf_finite)