diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-05-22 20:55:57 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-05-22 20:55:57 +0000 |
commit | 425d37fb7bc54822402ff5adbf93bb07ba12d041 (patch) | |
tree | d39b49a740a72501327fc3b1f6c03c745dd2c5a7 /lib/libm | |
parent | 1357893b2c6713c7e0daf7c20bf50a8fd4d8008c (diff) |
md sqrt() implementation
Diffstat (limited to 'lib/libm')
-rw-r--r-- | lib/libm/Makefile | 5 | ||||
-rw-r--r-- | lib/libm/arch/hppa/e_sqrt.c | 16 | ||||
-rw-r--r-- | lib/libm/arch/hppa/e_sqrtf.c | 16 |
3 files changed, 36 insertions, 1 deletions
diff --git a/lib/libm/Makefile b/lib/libm/Makefile index 8047943dfca..9a1eff58f21 100644 --- a/lib/libm/Makefile +++ b/lib/libm/Makefile @@ -1,5 +1,5 @@ # $NetBSD: Makefile,v 1.28 1995/11/20 22:06:19 jtc Exp $ -# $OpenBSD: Makefile,v 1.26 2002/01/30 15:09:42 naddy Exp $ +# $OpenBSD: Makefile,v 1.27 2002/05/22 20:55:55 mickey Exp $ # # @(#)Makefile 5.1beta 93/09/24 # @@ -69,6 +69,9 @@ ARCH_SRCS = e_acos.S e_asin.S e_atanh.S e_cosh.S e_exp.S e_log.S e_log10.S \ e_remainder.S e_scalb.S e_sinh.S e_sqrt.S s_atan.S s_ceil.S \ s_copysign.S s_cos.S s_expm1.S s_finite.S s_floor.S s_log1p.S \ s_logb.S s_rint.S s_scalbn.S s_sin.S s_tan.S s_tanh.S +.elif (${MACHINE_ARCH} == "hppa") +.PATH: ${.CURDIR}/arch/hppa +ARCH_SRCS = e_sqrt.c e_sqrtf.c .elif (${MACHINE_ARCH} == "vax") .PATH: ${.CURDIR}/arch/vax NOIEEE_ARCH=n_infnan.S n_argred.S n_sqrt.S 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); +} |