summaryrefslogtreecommitdiff
path: root/lib/libm/arch/i387/s_log1p.S
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libm/arch/i387/s_log1p.S')
-rw-r--r--lib/libm/arch/i387/s_log1p.S22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/libm/arch/i387/s_log1p.S b/lib/libm/arch/i387/s_log1p.S
new file mode 100644
index 00000000000..561841fc1b0
--- /dev/null
+++ b/lib/libm/arch/i387/s_log1p.S
@@ -0,0 +1,22 @@
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ */
+
+#include <machine/asm.h>
+
+RCSID("$NetBSD: s_log1p.S,v 1.7 1995/05/09 00:10:58 jtc Exp $")
+
+/*
+ * Since the fyl2xp1 instruction has such a limited range:
+ * -(1 - (sqrt(2) / 2)) <= x <= sqrt(2) - 1
+ * it's not worth trying to use it.
+ */
+
+ENTRY(log1p)
+ fldln2
+ fldl 4(%esp)
+ fld1
+ faddp
+ fyl2x
+ ret