summaryrefslogtreecommitdiff
path: root/lib/libm/arch
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2002-05-22 20:55:57 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2002-05-22 20:55:57 +0000
commit425d37fb7bc54822402ff5adbf93bb07ba12d041 (patch)
treed39b49a740a72501327fc3b1f6c03c745dd2c5a7 /lib/libm/arch
parent1357893b2c6713c7e0daf7c20bf50a8fd4d8008c (diff)
md sqrt() implementation
Diffstat (limited to 'lib/libm/arch')
-rw-r--r--lib/libm/arch/hppa/e_sqrt.c16
-rw-r--r--lib/libm/arch/hppa/e_sqrtf.c16
2 files changed, 32 insertions, 0 deletions
diff --git a/lib/libm/arch/hppa/e_sqrt.c b/lib/libm/arch/hppa/e_sqrt.c
new file mode 100644
index 00000000000..1345f287269
--- /dev/null
+++ b/lib/libm/arch/hppa/e_sqrt.c
@@ -0,0 +1,16 @@
+/*
+ * Written by Michael Shalayeff. Public Domain
+ */
+
+#if defined(LIBM_SCCS) && !defined(lint)
+static char rcsid[] = "$OpenBSD: e_sqrt.c,v 1.1 2002/05/22 20:55:56 mickey Exp $";
+#endif
+
+#include "math.h"
+
+double
+__ieee754_sqrt(double x)
+{
+ __asm__ __volatile__ ("fsqrt,dbl %0, %0" : "+f" (x));
+ return (x);
+}
diff --git a/lib/libm/arch/hppa/e_sqrtf.c b/lib/libm/arch/hppa/e_sqrtf.c
new file mode 100644
index 00000000000..81ba8ba38f4
--- /dev/null
+++ b/lib/libm/arch/hppa/e_sqrtf.c
@@ -0,0 +1,16 @@
+/*
+ * Written by Michael Shalayeff. Public Domain
+ */
+
+#if defined(LIBM_SCCS) && !defined(lint)
+static char rcsid[] = "$OpenBSD: e_sqrtf.c,v 1.1 2002/05/22 20:55:56 mickey Exp $";
+#endif
+
+#include "math.h"
+
+float
+__ieee754_sqrtf(float x)
+{
+ __asm__ __volatile__ ("fsqrt,sgl %0, %0" : "+f" (x));
+ return (x);
+}