diff options
| author | cvs2svn <cvs2svn@FreeBSD.org> | 1997-02-22 22:50:58 +0000 |
|---|---|---|
| committer | cvs2svn <cvs2svn@FreeBSD.org> | 1997-02-22 22:50:58 +0000 |
| commit | dd99818c307d07cfba061e4a45e0167038b5a6a3 (patch) | |
| tree | d345f6b110134837712799187b2b18f1f0676beb /lib/msun | |
| parent | 974c0777cc01f35b0fc8b228dc044f4a116f0fed (diff) | |
Notes
Diffstat (limited to 'lib/msun')
| -rw-r--r-- | lib/msun/src/get_hw_float.c | 50 | ||||
| -rw-r--r-- | lib/msun/src/w_y0.c | 50 | ||||
| -rw-r--r-- | lib/msun/src/w_y0f.c | 54 | ||||
| -rw-r--r-- | lib/msun/src/w_y1.c | 50 | ||||
| -rw-r--r-- | lib/msun/src/w_y1f.c | 54 | ||||
| -rw-r--r-- | lib/msun/src/w_yn.c | 50 | ||||
| -rw-r--r-- | lib/msun/src/w_ynf.c | 50 |
7 files changed, 358 insertions, 0 deletions
diff --git a/lib/msun/src/get_hw_float.c b/lib/msun/src/get_hw_float.c new file mode 100644 index 000000000000..fea5c89a81ec --- /dev/null +++ b/lib/msun/src/get_hw_float.c @@ -0,0 +1,50 @@ +/*- + * Copyright (c) 1997 Bruce D. Evans + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $Id$ + */ + +#include <sys/types.h> +#include <sys/sysctl.h> + +int __get_hw_float __P((void)); + +static int hw_float = -1; + +int +__get_hw_float() +{ + size_t len; + int mib[2]; + + if (hw_float == -1) { + len = sizeof(hw_float); + mib[0] = CTL_HW; + mib[1] = HW_FLOATINGPT; + if (__sysctl(mib, 2, &hw_float, &len, (void *)0, 0) == -1) + hw_float = 0; /* shouldn't happen; assume the worst */ + } + return (hw_float); +} diff --git a/lib/msun/src/w_y0.c b/lib/msun/src/w_y0.c new file mode 100644 index 000000000000..91b9760a1d8b --- /dev/null +++ b/lib/msun/src/w_y0.c @@ -0,0 +1,50 @@ +/* from: @(#)w_j0.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#ifndef lint +static char rcsid[] = "$Id$"; +#endif + +/* + * wrapper y0(double x) + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ + double y0(double x) /* wrapper y0 */ +#else + double y0(x) /* wrapper y0 */ + double x; +#endif +{ +#ifdef _IEEE_LIBM + return __ieee754_y0(x); +#else + double z; + z = __ieee754_y0(x); + if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z; + if(x <= 0.0){ + if(x==0.0) + /* d= -one/(x-x); */ + return __kernel_standard(x,x,8); + else + /* d = zero/(x-x); */ + return __kernel_standard(x,x,9); + } + if(x>X_TLOSS) { + return __kernel_standard(x,x,35); /* y0(x>X_TLOSS) */ + } else + return z; +#endif +} diff --git a/lib/msun/src/w_y0f.c b/lib/msun/src/w_y0f.c new file mode 100644 index 000000000000..52ed04113bb0 --- /dev/null +++ b/lib/msun/src/w_y0f.c @@ -0,0 +1,54 @@ +/* w_y0f.c -- float version of w_y0.c. + * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#ifndef lint +static char rcsid[] = "$Id$"; +#endif + +/* + * wrapper y0f(float x) + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ + float y0f(float x) /* wrapper y0f */ +#else + float y0f(x) /* wrapper y0f */ + float x; +#endif +{ +#ifdef _IEEE_LIBM + return __ieee754_y0f(x); +#else + float z; + z = __ieee754_y0f(x); + if(_LIB_VERSION == _IEEE_ || isnanf(x) ) return z; + if(x <= (float)0.0){ + if(x==(float)0.0) + /* d= -one/(x-x); */ + return (float)__kernel_standard((double)x,(double)x,108); + else + /* d = zero/(x-x); */ + return (float)__kernel_standard((double)x,(double)x,109); + } + if(x>(float)X_TLOSS) { + /* y0(x>X_TLOSS) */ + return (float)__kernel_standard((double)x,(double)x,135); + } else + return z; +#endif +} diff --git a/lib/msun/src/w_y1.c b/lib/msun/src/w_y1.c new file mode 100644 index 000000000000..b46d81e9282c --- /dev/null +++ b/lib/msun/src/w_y1.c @@ -0,0 +1,50 @@ +/* from: @(#)w_j1.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#ifndef lint +static char rcsid[] = "$Id$"; +#endif + +/* + * wrapper of y1 + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ + double y1(double x) /* wrapper y1 */ +#else + double y1(x) /* wrapper y1 */ + double x; +#endif +{ +#ifdef _IEEE_LIBM + return __ieee754_y1(x); +#else + double z; + z = __ieee754_y1(x); + if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z; + if(x <= 0.0){ + if(x==0.0) + /* d= -one/(x-x); */ + return __kernel_standard(x,x,10); + else + /* d = zero/(x-x); */ + return __kernel_standard(x,x,11); + } + if(x>X_TLOSS) { + return __kernel_standard(x,x,37); /* y1(x>X_TLOSS) */ + } else + return z; +#endif +} diff --git a/lib/msun/src/w_y1f.c b/lib/msun/src/w_y1f.c new file mode 100644 index 000000000000..b4e4633d68ac --- /dev/null +++ b/lib/msun/src/w_y1f.c @@ -0,0 +1,54 @@ +/* w_y1f.c -- float version of w_y1.c. + * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#ifndef lint +static char rcsid[] = "$Id$"; +#endif + +/* + * wrapper of y1f + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ + float y1f(float x) /* wrapper y1f */ +#else + float y1f(x) /* wrapper y1f */ + float x; +#endif +{ +#ifdef _IEEE_LIBM + return __ieee754_y1f(x); +#else + float z; + z = __ieee754_y1f(x); + if(_LIB_VERSION == _IEEE_ || isnanf(x) ) return z; + if(x <= (float)0.0){ + if(x==(float)0.0) + /* d= -one/(x-x); */ + return (float)__kernel_standard((double)x,(double)x,110); + else + /* d = zero/(x-x); */ + return (float)__kernel_standard((double)x,(double)x,111); + } + if(x>(float)X_TLOSS) { + /* y1(x>X_TLOSS) */ + return (float)__kernel_standard((double)x,(double)x,137); + } else + return z; +#endif +} diff --git a/lib/msun/src/w_yn.c b/lib/msun/src/w_yn.c new file mode 100644 index 000000000000..af0337657bdd --- /dev/null +++ b/lib/msun/src/w_yn.c @@ -0,0 +1,50 @@ +/* from: @(#)w_jn.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#ifndef lint +static char rcsid[] = "$Id$"; +#endif + +/* + * wrapper yn(int n, double x) + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ + double yn(int n, double x) /* wrapper yn */ +#else + double yn(n,x) /* wrapper yn */ + double x; int n; +#endif +{ +#ifdef _IEEE_LIBM + return __ieee754_yn(n,x); +#else + double z; + z = __ieee754_yn(n,x); + if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z; + if(x <= 0.0){ + if(x==0.0) + /* d= -one/(x-x); */ + return __kernel_standard((double)n,x,12); + else + /* d = zero/(x-x); */ + return __kernel_standard((double)n,x,13); + } + if(x>X_TLOSS) { + return __kernel_standard((double)n,x,39); /* yn(x>X_TLOSS,n) */ + } else + return z; +#endif +} diff --git a/lib/msun/src/w_ynf.c b/lib/msun/src/w_ynf.c new file mode 100644 index 000000000000..0597b92ce2de --- /dev/null +++ b/lib/msun/src/w_ynf.c @@ -0,0 +1,50 @@ +/* w_ynf.c -- float version of w_yn.c. + * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#ifndef lint +static char rcsid[] = "$Id$"; +#endif + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ + float ynf(int n, float x) /* wrapper ynf */ +#else + float ynf(n,x) /* wrapper ynf */ + float x; int n; +#endif +{ +#ifdef _IEEE_LIBM + return __ieee754_ynf(n,x); +#else + float z; + z = __ieee754_ynf(n,x); + if(_LIB_VERSION == _IEEE_ || isnanf(x) ) return z; + if(x <= (float)0.0){ + if(x==(float)0.0) + /* d= -one/(x-x); */ + return (float)__kernel_standard((double)n,(double)x,112); + else + /* d = zero/(x-x); */ + return (float)__kernel_standard((double)n,(double)x,113); + } + if(x>(float)X_TLOSS) { + /* yn(x>X_TLOSS,n) */ + return (float)__kernel_standard((double)n,(double)x,139); + } else + return z; +#endif +} |
