diff options
author | Richard Lowe <richlowe@richlowe.net> | 2014-10-24 20:13:19 -0400 |
---|---|---|
committer | Richard Lowe <richlowe@richlowe.net> | 2014-11-26 17:05:42 -0500 |
commit | 1ec68d336ba97cd53f46053ac10401d16014d075 (patch) | |
tree | 2282af60548cda6c7a8c1d7b49ac6f6e25d39148 /usr/src/lib/libm/common | |
parent | 0b51021a5ac604aec4fe23e2cdcf97e3e886b9ec (diff) | |
download | illumos-gate-1ec68d336ba97cd53f46053ac10401d16014d075.tar.gz |
5262 libm needs to be carefully unifdef'd
5268 libm doesn't need to hide symbols which are already local
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Reviewed by: Gordon Ross <gwr@nexenta.com>
Approved by: Gordon Ross <gwr@nexenta.com>
Diffstat (limited to 'usr/src/lib/libm/common')
105 files changed, 33 insertions, 529 deletions
diff --git a/usr/src/lib/libm/common/C/copysign.c b/usr/src/lib/libm/common/C/copysign.c index bf8f0caf12..a42ca4eb9c 100644 --- a/usr/src/lib/libm/common/C/copysign.c +++ b/usr/src/lib/libm/common/C/copysign.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak copysign = __copysign -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/C/hypot.c b/usr/src/lib/libm/common/C/hypot.c index 47edfe923f..f476d65f0a 100644 --- a/usr/src/lib/libm/common/C/hypot.c +++ b/usr/src/lib/libm/common/C/hypot.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak hypot = __hypot -#endif /* INDENT OFF */ /* diff --git a/usr/src/lib/libm/common/C/ilogb.c b/usr/src/lib/libm/common/C/ilogb.c index e302bc74a6..7c8725299a 100644 --- a/usr/src/lib/libm/common/C/ilogb.c +++ b/usr/src/lib/libm/common/C/ilogb.c @@ -27,14 +27,12 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak ilogb = __ilogb -#endif #include "libm.h" #include "xpg6.h" /* __xpg6 */ -#if defined(USE_FPSCALE) || defined(__x86) +#if defined(__x86) static const double two52 = 4503599627370496.0; #else /* @@ -57,7 +55,7 @@ ilogb_subnormal(unsigned v, unsigned w) { v <<= 1; return (r + ((0xffffaa50 >> v) & 0x3)); } -#endif /* defined(USE_FPSCALE) */ +#endif /* defined(__x86) */ static int raise_invalid(int v) { /* SUSv3 requires ilogb(0,+/-Inf,NaN) raise invalid */ @@ -80,7 +78,7 @@ ilogb(double x) { if ((px[LOWORD] | k) == 0) return (raise_invalid(0x80000001)); else { -#if defined(USE_FPSCALE) || defined(__x86) +#if defined(__x86) x *= two52; return (((px[HIWORD] & 0x7ff00000) >> 20) - 1075); #else diff --git a/usr/src/lib/libm/common/C/libm_protos.h b/usr/src/lib/libm/common/C/libm_protos.h index 3dc248a63c..a039c2c07d 100644 --- a/usr/src/lib/libm/common/C/libm_protos.h +++ b/usr/src/lib/libm/common/C/libm_protos.h @@ -29,90 +29,15 @@ #ifndef _C_LIBM_PROTOS_H #define _C_LIBM_PROTOS_H -#ifdef LIBMOPT_BUILD -#define _TBL_cos __libmopt_TBL_cos -#define _TBL_exp2_512 __libmopt_TBL_exp2_512 -#define _TBL_ipio2_inf __libmopt_TBL_ipio2_inf -#define _TBL_jlog_n1 __libmopt_TBL_jlog_n1 -#define _TBL_jlog_n2 __libmopt_TBL_jlog_n2 -#define _TBL_jlog_p1 __libmopt_TBL_jlog_p1 -#define _TBL_jlog_p2 __libmopt_TBL_jlog_p2 -#define _TBL_log10 __libmopt_TBL_log10 -#define _TBL_log2_14 __libmopt_TBL_log2_14 -#define _TBL_log2_9 __libmopt_TBL_log2_9 -#define _TBL_sin __libmopt_TBL_sin -#define _TBL_sincosx __libmopt_TBL_sincosx -#define _TBL_xexp __libmopt_TBL_xexp -#define _TBL_xlog __libmopt_TBL_xlog -#define __k_cos_ __libmopt__k_cos_ -#define __k_sin_ __libmopt__k_sin_ -#define __k_sincos_ __libmopt__k_sincos_ -#define __reduction __libmopt__reduction -#define __rem_pio2 __libmopt__rem_pio2 -#define __rem_pio2m __libmopt__rem_pio2m -#else /* defined(LIBMOPT_BUILD) */ -#ifdef LIBM_BUILD -#define _SVID_libm_err __libm_SVID_libm_err /* not used by -lsunmath */ -#define _TBL_atan __libm_TBL_atan -#define _TBL_atan1 __libm_TBL_atan1 -#define _TBL_atan_hi __libm_TBL_atan_hi /* not used by -lsunmath */ -#define _TBL_atan_lo __libm_TBL_atan_lo /* not used by -lsunmath */ -#define _TBL_exp2_hi __libm_TBL_exp2_hi /* not used by -lsunmath */ -#define _TBL_exp2_lo __libm_TBL_exp2_lo /* not used by -lsunmath */ -#define _TBL_ipio2_inf __libm_TBL_ipio2_inf -#define _TBL_log __libm_TBL_log -#define _TBL_log2_hi __libm_TBL_log2_hi /* not used by -lsunmath */ -#define _TBL_log2_lo __libm_TBL_log2_lo /* not used by -lsunmath */ -#define _TBL_log_hi __libm_TBL_log_hi /* not used by -lsunmath */ -#define _TBL_log_lo __libm_TBL_log_lo /* not used by -lsunmath */ -#define _TBL_sincos __libm_TBL_sincos -#define _TBL_sincosx __libm_TBL_sincosx -#define _TBL_tan_hi __libm_TBL_tan_hi /* not used by -lsunmath */ -#define _TBL_tan_lo __libm_TBL_tan_lo /* not used by -lsunmath */ -#define __k_cexp __libm__k_cexp /* C99 libm */ -#define __k_cexpl __libm__k_cexpl /* C99 libm */ -#define __k_clog_r __libm__k_clog_r /* C99 libm */ -#define __k_clog_rl __libm__k_clog_rl /* C99 libm */ -#define __k_atan2 __libm__k_atan2 /* C99 libm */ -#define __k_atan2l __libm__k_atan2l /* C99 libm */ -#define __k_cos __libm__k_cos -#define __k_lgamma __libm__k_lgamma -#define __k_sin __libm__k_sin -#define __k_sincos __libm__k_sincos -#define __k_tan __libm__k_tan -#define __reduction __libm__reduction /* i386 only */ +/* + * Many symbols used to be namespaced with __libm to prevent collisions. All + * but these two were otherwise scoped local and directly bound, so that + * collision could not occur. + * + * For reasons unknown, these two are global (but private). + */ #define __rem_pio2 __libm__rem_pio2 #define __rem_pio2m __libm__rem_pio2m -#define __k_cosf __libm__k_cosf /* C99 libm */ -#define __k_cosl __libm__k_cosl /* C99 libm */ -#define __k_lgammal __libm__k_lgammal /* C99 libm */ -#define __k_sincosf __libm__k_sincosf /* C99 libm */ -#define __k_sincosl __libm__k_sincosl /* C99 libm */ -#define __k_sinf __libm__k_sinf /* C99 libm */ -#define __k_sinl __libm__k_sinl /* C99 libm */ -#define __k_tanf __libm__k_tanf /* C99 libm */ -#define __k_tanl __libm__k_tanl /* C99 libm */ -#define __poly_libmq __libm__poly_libmq /* C99 libm */ -#define __rem_pio2l __libm__rem_pio2l /* C99 libm */ -#define _TBL_atanl_hi __libm_TBL_atanl_hi /* C99 libm */ -#define _TBL_atanl_lo __libm_TBL_atanl_lo /* C99 libm */ -#define _TBL_cosl_hi __libm_TBL_cosl_hi /* C99 libm */ -#define _TBL_cosl_lo __libm_TBL_cosl_lo /* C99 libm */ -#define _TBL_expl_hi __libm_TBL_expl_hi /* C99 libm */ -#define _TBL_expl_lo __libm_TBL_expl_lo /* C99 libm */ -#define _TBL_expm1l __libm_TBL_expm1l /* C99 libm */ -#define _TBL_expm1lx __libm_TBL_expm1lx /* C99 libm */ -#define _TBL_ipio2l_inf __libm_TBL_ipio2l_inf /* C99 libm */ -#define _TBL_logl_hi __libm_TBL_logl_hi /* C99 libm */ -#define _TBL_logl_lo __libm_TBL_logl_lo /* C99 libm */ -#define _TBL_r_atan_hi __libm_TBL_r_atan_hi /* C99 libm */ -#define _TBL_r_atan_lo __libm_TBL_r_atan_lo /* C99 libm */ -#define _TBL_sinl_hi __libm_TBL_sinl_hi /* C99 libm */ -#define _TBL_sinl_lo __libm_TBL_sinl_lo /* C99 libm */ -#define _TBL_tanl_hi __libm_TBL_tanl_hi /* C99 libm */ -#define _TBL_tanl_lo __libm_TBL_tanl_lo /* C99 libm */ -#endif /* defined(LIBM_BUILD) */ -#endif /* defined(LIBMOPT_BUILD) */ #ifndef _ASM #ifdef __STDC__ diff --git a/usr/src/lib/libm/common/C/libm_synonyms.h b/usr/src/lib/libm/common/C/libm_synonyms.h index 0025a3dfe8..67271f1959 100644 --- a/usr/src/lib/libm/common/C/libm_synonyms.h +++ b/usr/src/lib/libm/common/C/libm_synonyms.h @@ -30,7 +30,7 @@ #ifndef _LIBM_SYNONYMS_H #define _LIBM_SYNONYMS_H -#if defined(ELFOBJ) && !defined(lint) +#if !defined(lint) #define cabs __cabs /* C99 <complex.h> */ #define cabsf __cabsf /* C99 <complex.h> */ @@ -744,6 +744,6 @@ #define thr_setspecific _thr_setspecific #endif -#endif /* defined(ELFOBJ) && !defined(lint) */ +#endif /* !defined(lint) */ #endif /* _LIBM_SYNONYMS_H */ diff --git a/usr/src/lib/libm/common/C/libm_thread.h b/usr/src/lib/libm/common/C/libm_thread.h deleted file mode 100644 index d22d3d5a5e..0000000000 --- a/usr/src/lib/libm/common/C/libm_thread.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* - * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - */ -/* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#ifndef _LIBM_THREAD_H -#define _LIBM_THREAD_H - -#include <synch.h> -#include <thread.h> - -/* - * -lthread function(s) not prototyped anywhere - */ -extern int thr_main(void); -/* - * function call(s) local to libsunmath - */ -extern void *__tsd_alloc(thread_key_t *, int, int); -#endif /* _LIBM_THREAD_H */ diff --git a/usr/src/lib/libm/common/C/logb.c b/usr/src/lib/libm/common/C/logb.c index 71c31e069c..11e0562643 100644 --- a/usr/src/lib/libm/common/C/logb.c +++ b/usr/src/lib/libm/common/C/logb.c @@ -27,16 +27,14 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak logb = __logb #pragma weak _logb = __logb -#endif #include "libm.h" #include "xpg6.h" /* __xpg6 */ #define _C99SUSv3_logb _C99SUSv3_logb_subnormal_is_like_ilogb -#if defined(USE_FPSCALE) || defined(__x86) +#if defined(__x86) static const double two52 = 4503599627370496.0; #else /* @@ -59,7 +57,7 @@ ilogb_subnormal(unsigned v, unsigned w) { v <<= 1; return (r + ((0xffffaa50 >> v) & 0x3)); } -#endif /* defined(USE_FPSCALE) */ +#endif /* defined(__x86) */ double logb(double x) { @@ -69,7 +67,7 @@ logb(double x) { if ((px[LOWORD] | k) == 0) return (_SVID_libm_err(x, x, 45)); else if ((__xpg6 & _C99SUSv3_logb) != 0) { -#if defined(USE_FPSCALE) || defined(__x86) +#if defined(__x86) x *= two52; return ((double) (((px[HIWORD] & 0x7ff00000) >> 20) - 1075)); diff --git a/usr/src/lib/libm/common/C/pow.c b/usr/src/lib/libm/common/C/pow.c index 2a790821b6..de38cd0bc9 100644 --- a/usr/src/lib/libm/common/C/pow.c +++ b/usr/src/lib/libm/common/C/pow.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak pow = __pow -#endif /* * pow(x,y) return x**y diff --git a/usr/src/lib/libm/common/C/scalbn.c b/usr/src/lib/libm/common/C/scalbn.c index 1d344b8cbe..34099383a9 100644 --- a/usr/src/lib/libm/common/C/scalbn.c +++ b/usr/src/lib/libm/common/C/scalbn.c @@ -36,7 +36,7 @@ static const double tiny = 1.0e-300, twom54 = 5.5511151231257827021181583404541015625e-17; -#if defined(USE_FPSCALE) || defined(__x86) +#if defined(__x86) static const double two52 = 4503599627370496.0; #else /* @@ -70,7 +70,7 @@ ilogb_biased(unsigned *px) { px[LOWORD] = w; return (1 - s); } -#endif /* defined(USE_FPSCALE) */ +#endif /* defined(__x86) */ double scalbn(double x, int n) { @@ -87,7 +87,7 @@ scalbn(double x, int n) { if (k == 0) { if ((hx | px[LOWORD]) == 0 || n == 0) return (x); -#if defined(USE_FPSCALE) || defined(__x86) +#if defined(__x86) x *= two52; ix = px[HIWORD]; k = ((ix & ~0x80000000) >> 20) - 52; diff --git a/usr/src/lib/libm/common/C/significand.c b/usr/src/lib/libm/common/C/significand.c index 4f2e3f95a6..3be409afeb 100644 --- a/usr/src/lib/libm/common/C/significand.c +++ b/usr/src/lib/libm/common/C/significand.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak significand = __significand -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/C/sqrt.c b/usr/src/lib/libm/common/C/sqrt.c index be196f3900..13d4afd927 100644 --- a/usr/src/lib/libm/common/C/sqrt.c +++ b/usr/src/lib/libm/common/C/sqrt.c @@ -30,7 +30,6 @@ #include "libm.h" -#ifdef __INLINE extern double __inline_sqrt(double); @@ -43,108 +42,3 @@ sqrt(double x) { return ((x < 0.0)? _SVID_libm_err(x, x, 26) : z); } -#else /* defined(__INLINE) */ - -/* - * Warning: This correctly rounded sqrt is extremely slow because it computes - * the sqrt bit by bit using integer arithmetic. - */ - -static const double big = 1.0e30, small = 1.0e-30; - -double -sqrt(double x) -{ - double z; - unsigned r, t1, s1, ix1, q1; - int ix0, s0, j, q, m, n, t; - int *px = (int *)&x, *pz = (int *)&z; - - ix0 = px[HIWORD]; - ix1 = px[LOWORD]; - if ((ix0 & 0x7ff00000) == 0x7ff00000) { /* x is inf or NaN */ - if (ix0 == 0xfff00000 && ix1 == 0) - return (_SVID_libm_err(x, x, 26)); - return (x + x); - } - if (((ix0 & 0x7fffffff) | ix1) == 0) /* x is zero */ - return (x); - - /* extract exponent and significand */ - m = ilogb(x); - z = scalbn(x, -m); - ix0 = (pz[HIWORD] & 0x000fffff) | 0x00100000; - ix1 = pz[LOWORD]; - n = m >> 1; - if (n + n != m) { - ix0 = (ix0 << 1) | (ix1 >> 31); - ix1 <<= 1; - m -= 1; - } - - /* generate sqrt(x) bit by bit */ - ix0 = (ix0 << 1) | (ix1 >> 31); - ix1 <<= 1; - q = q1 = s0 = s1 = 0; - r = 0x00200000; - - for (j = 1; j <= 22; j++) { - t = s0 + r; - if (t <= ix0) { - s0 = t + r; - ix0 -= t; - q += r; - } - ix0 = (ix0 << 1) | (ix1 >> 31); - ix1 <<= 1; - r >>= 1; - } - - r = 0x80000000; - for (j = 1; j <= 32; j++) { - t1 = s1 + r; - t = s0; - if (t < ix0 || (t == ix0 && t1 <= ix1)) { - s1 = t1 + r; - if ((t1 & 0x80000000) == 0x80000000 && - (s1 & 0x80000000) == 0) - s0 += 1; - ix0 -= t; - if (ix1 < t1) - ix0 -= 1; - ix1 -= t1; - q1 += r; - } - ix0 = (ix0 << 1) | (ix1 >> 31); - ix1 <<= 1; - r >>= 1; - } - - /* round */ - if ((ix0 | ix1) == 0) - goto done; - z = big - small; /* trigger inexact flag */ - if (z < big) - goto done; - if (q1 == 0xffffffff) { - q1 = 0; - q += 1; - goto done; - } - z = big + small; - if (z > big) { - if (q1 == 0xfffffffe) - q += 1; - q1 += 2; - goto done; - } - q1 += (q1 & 1); -done: - pz[HIWORD] = (q >> 1) + 0x3fe00000; - pz[LOWORD] = q1 >> 1; - if ((q & 1) == 1) - pz[LOWORD] |= 0x80000000; - return (scalbn(z, n)); -} - -#endif /* defined(__INLINE) */ diff --git a/usr/src/lib/libm/common/LD/acoshl.c b/usr/src/lib/libm/common/LD/acoshl.c index 8f6d155fae..60db08f395 100644 --- a/usr/src/lib/libm/common/LD/acoshl.c +++ b/usr/src/lib/libm/common/LD/acoshl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak acoshl = __acoshl -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/LD/asinhl.c b/usr/src/lib/libm/common/LD/asinhl.c index a8c1876ae1..453614d1e4 100644 --- a/usr/src/lib/libm/common/LD/asinhl.c +++ b/usr/src/lib/libm/common/LD/asinhl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak asinhl = __asinhl -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/LD/cbrtl.c b/usr/src/lib/libm/common/LD/cbrtl.c index 13fe181cc6..22f71388cd 100644 --- a/usr/src/lib/libm/common/LD/cbrtl.c +++ b/usr/src/lib/libm/common/LD/cbrtl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak cbrtl = __cbrtl -#endif #include "libm.h" #include "longdouble.h" diff --git a/usr/src/lib/libm/common/LD/coshl.c b/usr/src/lib/libm/common/LD/coshl.c index 5ff0c7d08f..b308cce4a2 100644 --- a/usr/src/lib/libm/common/LD/coshl.c +++ b/usr/src/lib/libm/common/LD/coshl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak coshl = __coshl -#endif #include "libm.h" #include "longdouble.h" diff --git a/usr/src/lib/libm/common/LD/finitel.c b/usr/src/lib/libm/common/LD/finitel.c index bbe255514f..51a4a147df 100644 --- a/usr/src/lib/libm/common/LD/finitel.c +++ b/usr/src/lib/libm/common/LD/finitel.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak finitel = __finitel -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/LD/hypotl.c b/usr/src/lib/libm/common/LD/hypotl.c index 4303eceb8e..411f4f809a 100644 --- a/usr/src/lib/libm/common/LD/hypotl.c +++ b/usr/src/lib/libm/common/LD/hypotl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak hypotl = __hypotl -#endif /* * hypotl(x,y) diff --git a/usr/src/lib/libm/common/LD/isnanl.c b/usr/src/lib/libm/common/LD/isnanl.c index eb94eb32b9..baad2e1b54 100644 --- a/usr/src/lib/libm/common/LD/isnanl.c +++ b/usr/src/lib/libm/common/LD/isnanl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak isnanl = __isnanl -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/LD/jnl.c b/usr/src/lib/libm/common/LD/jnl.c index dd63612e71..3e04c73c6a 100644 --- a/usr/src/lib/libm/common/LD/jnl.c +++ b/usr/src/lib/libm/common/LD/jnl.c @@ -27,10 +27,8 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak jnl = __jnl #pragma weak ynl = __ynl -#endif /* * floating point Bessel's function of the 1st and 2nd kind diff --git a/usr/src/lib/libm/common/LD/log1pl.c b/usr/src/lib/libm/common/LD/log1pl.c index 97dc4910c4..f2044e4586 100644 --- a/usr/src/lib/libm/common/LD/log1pl.c +++ b/usr/src/lib/libm/common/LD/log1pl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak log1pl = __log1pl -#endif /* * log1pl(x) diff --git a/usr/src/lib/libm/common/LD/logbl.c b/usr/src/lib/libm/common/LD/logbl.c index e8a7809cd5..f4362ddd4c 100644 --- a/usr/src/lib/libm/common/LD/logbl.c +++ b/usr/src/lib/libm/common/LD/logbl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak logbl = __logbl -#endif #include "libm.h" #include "xpg6.h" /* __xpg6 */ diff --git a/usr/src/lib/libm/common/LD/nextafterl.c b/usr/src/lib/libm/common/LD/nextafterl.c index 1f6e40d398..eefc8a1a04 100644 --- a/usr/src/lib/libm/common/LD/nextafterl.c +++ b/usr/src/lib/libm/common/LD/nextafterl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak nextafterl = __nextafterl -#endif #include "libm.h" #include <float.h> /* LDBL_MAX, LDBL_MIN */ diff --git a/usr/src/lib/libm/common/LD/significandl.c b/usr/src/lib/libm/common/LD/significandl.c index 8140463a2e..0aea2be40f 100644 --- a/usr/src/lib/libm/common/LD/significandl.c +++ b/usr/src/lib/libm/common/LD/significandl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak significandl = __significandl -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/LD/tanhl.c b/usr/src/lib/libm/common/LD/tanhl.c index 87ecfa705b..bd49020b5d 100644 --- a/usr/src/lib/libm/common/LD/tanhl.c +++ b/usr/src/lib/libm/common/LD/tanhl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak tanhl = __tanhl -#endif /* * tanhl(x) returns the hyperbolic tangent of x diff --git a/usr/src/lib/libm/common/Q/acoshl.c b/usr/src/lib/libm/common/Q/acoshl.c index 8f6d155fae..60db08f395 100644 --- a/usr/src/lib/libm/common/Q/acoshl.c +++ b/usr/src/lib/libm/common/Q/acoshl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak acoshl = __acoshl -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/Q/asinhl.c b/usr/src/lib/libm/common/Q/asinhl.c index 32f9d4b086..98d1f429d0 100644 --- a/usr/src/lib/libm/common/Q/asinhl.c +++ b/usr/src/lib/libm/common/Q/asinhl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak asinhl = __asinhl -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/Q/asinl.c b/usr/src/lib/libm/common/Q/asinl.c index 8594a2195b..d397cb8a07 100644 --- a/usr/src/lib/libm/common/Q/asinl.c +++ b/usr/src/lib/libm/common/Q/asinl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak asinl = __asinl -#endif /* * asinl(x) = atan2l(x,sqrt(1-x*x)); diff --git a/usr/src/lib/libm/common/Q/copysignl.c b/usr/src/lib/libm/common/Q/copysignl.c index 97c758d303..2f8d0501e7 100644 --- a/usr/src/lib/libm/common/Q/copysignl.c +++ b/usr/src/lib/libm/common/Q/copysignl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak copysignl = __copysignl -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/Q/expm1l.c b/usr/src/lib/libm/common/Q/expm1l.c index 155acbdc54..38463b9a48 100644 --- a/usr/src/lib/libm/common/Q/expm1l.c +++ b/usr/src/lib/libm/common/Q/expm1l.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak expm1l = __expm1l -#endif #if !defined(__sparc) #error Unsupported architecture #endif diff --git a/usr/src/lib/libm/common/Q/finitel.c b/usr/src/lib/libm/common/Q/finitel.c index bbe255514f..51a4a147df 100644 --- a/usr/src/lib/libm/common/Q/finitel.c +++ b/usr/src/lib/libm/common/Q/finitel.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak finitel = __finitel -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/Q/ieee_funcl.c b/usr/src/lib/libm/common/Q/ieee_funcl.c index 74e6cacfe8..a20578e50b 100644 --- a/usr/src/lib/libm/common/Q/ieee_funcl.c +++ b/usr/src/lib/libm/common/Q/ieee_funcl.c @@ -27,13 +27,11 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak isinfl = __isinfl #pragma weak isnormall = __isnormall #pragma weak issubnormall = __issubnormall #pragma weak iszerol = __iszerol #pragma weak signbitl = __signbitl -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/Q/ilogbl.c b/usr/src/lib/libm/common/Q/ilogbl.c index bdbe2dbd0f..6938f4c96d 100644 --- a/usr/src/lib/libm/common/Q/ilogbl.c +++ b/usr/src/lib/libm/common/Q/ilogbl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak ilogbl = __ilogbl -#endif #include "libm.h" #include "xpg6.h" /* __xpg6 */ diff --git a/usr/src/lib/libm/common/Q/isnanl.c b/usr/src/lib/libm/common/Q/isnanl.c index 0d3a853c8e..9ff7b58597 100644 --- a/usr/src/lib/libm/common/Q/isnanl.c +++ b/usr/src/lib/libm/common/Q/isnanl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak isnanl = __isnanl -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/Q/jnl.c b/usr/src/lib/libm/common/Q/jnl.c index 40d5d061e5..1fd0ee9a73 100644 --- a/usr/src/lib/libm/common/Q/jnl.c +++ b/usr/src/lib/libm/common/Q/jnl.c @@ -27,10 +27,8 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak jnl = __jnl #pragma weak ynl = __ynl -#endif /* * floating point Bessel's function of the 1st and 2nd kind diff --git a/usr/src/lib/libm/common/Q/log10l.c b/usr/src/lib/libm/common/Q/log10l.c index 9c83580531..700c9723b9 100644 --- a/usr/src/lib/libm/common/Q/log10l.c +++ b/usr/src/lib/libm/common/Q/log10l.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak log10l = __log10l -#endif /* * log10l(X) diff --git a/usr/src/lib/libm/common/Q/logbl.c b/usr/src/lib/libm/common/Q/logbl.c index 62bb59e6e8..bdcdc758ef 100644 --- a/usr/src/lib/libm/common/Q/logbl.c +++ b/usr/src/lib/libm/common/Q/logbl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak logbl = __logbl -#endif #include "libm.h" #include "xpg6.h" /* __xpg6 */ diff --git a/usr/src/lib/libm/common/Q/nextafterl.c b/usr/src/lib/libm/common/Q/nextafterl.c index 1f6e40d398..eefc8a1a04 100644 --- a/usr/src/lib/libm/common/Q/nextafterl.c +++ b/usr/src/lib/libm/common/Q/nextafterl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak nextafterl = __nextafterl -#endif #include "libm.h" #include <float.h> /* LDBL_MAX, LDBL_MIN */ diff --git a/usr/src/lib/libm/common/Q/powl.c b/usr/src/lib/libm/common/Q/powl.c index b88e42a1ca..d535e88747 100644 --- a/usr/src/lib/libm/common/Q/powl.c +++ b/usr/src/lib/libm/common/Q/powl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak powl = __powl -#endif #include "libm.h" #include "xpg6.h" /* __xpg6 */ diff --git a/usr/src/lib/libm/common/Q/scalbnl.c b/usr/src/lib/libm/common/Q/scalbnl.c index 9351040f0b..88885ccc2f 100644 --- a/usr/src/lib/libm/common/Q/scalbnl.c +++ b/usr/src/lib/libm/common/Q/scalbnl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak scalbnl = __scalbnl -#endif #include "libm.h" #include <float.h> /* LDBL_MAX, LDBL_MIN */ diff --git a/usr/src/lib/libm/common/Q/significandl.c b/usr/src/lib/libm/common/Q/significandl.c index 8140463a2e..0aea2be40f 100644 --- a/usr/src/lib/libm/common/Q/significandl.c +++ b/usr/src/lib/libm/common/Q/significandl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak significandl = __significandl -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/Q/tanhl.c b/usr/src/lib/libm/common/Q/tanhl.c index 08283bded9..2bdb2b5ff9 100644 --- a/usr/src/lib/libm/common/Q/tanhl.c +++ b/usr/src/lib/libm/common/Q/tanhl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak tanhl = __tanhl -#endif /* * tanhl(x) returns the hyperbolic tangent of x diff --git a/usr/src/lib/libm/common/R/copysignf.c b/usr/src/lib/libm/common/R/copysignf.c index 84ae2e31b4..1610d9520c 100644 --- a/usr/src/lib/libm/common/R/copysignf.c +++ b/usr/src/lib/libm/common/R/copysignf.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak copysignf = __copysignf -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/R/ilogbf.c b/usr/src/lib/libm/common/R/ilogbf.c index 2579d024ed..74d690d1ca 100644 --- a/usr/src/lib/libm/common/R/ilogbf.c +++ b/usr/src/lib/libm/common/R/ilogbf.c @@ -27,14 +27,12 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak ilogbf = __ilogbf -#endif #include "libm.h" #include "xpg6.h" /* __xpg6 */ -#if defined(USE_FPSCALE) || defined(__x86) +#if defined(__x86) static const float two25 = 33554432.0F; #else /* @@ -53,7 +51,7 @@ ilogbf_subnormal(unsigned v) { v <<= 1; return (r + ((0xffffaa50 >> v) & 0x3)); } -#endif /* defined(USE_FPSCALE) */ +#endif /* defined(__x86) */ static int raise_invalid(int v) { /* SUSv3 requires ilogbf(0,+/-Inf,NaN) raise invalid */ @@ -76,7 +74,7 @@ ilogbf(float x) { if (k == 0) return (raise_invalid(0x80000001)); else { -#if defined(USE_FPSCALE) || defined(__x86) +#if defined(__x86) x *= two25; return (((*((int *) &x) & 0x7f800000) >> 23) - 152); #else diff --git a/usr/src/lib/libm/common/R/isnanf.c b/usr/src/lib/libm/common/R/isnanf.c index b2dd090a19..0374824709 100644 --- a/usr/src/lib/libm/common/R/isnanf.c +++ b/usr/src/lib/libm/common/R/isnanf.c @@ -27,10 +27,8 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak isnanf = __isnanf #pragma weak _isnanf = __isnanf -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/R/logbf.c b/usr/src/lib/libm/common/R/logbf.c index bf6851ef68..c0f84b1fa7 100644 --- a/usr/src/lib/libm/common/R/logbf.c +++ b/usr/src/lib/libm/common/R/logbf.c @@ -27,15 +27,13 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak logbf = __logbf -#endif #include "libm.h" #include "xpg6.h" /* __xpg6 */ #define _C99SUSv3_logb _C99SUSv3_logb_subnormal_is_like_ilogb -#if defined(USE_FPSCALE) || defined(__x86) +#if defined(__x86) static const float two25 = 33554432.0F; #else /* @@ -54,7 +52,7 @@ ilogbf_subnormal(unsigned v) { v <<= 1; return (r + ((0xffffaa50 >> v) & 0x3)); } -#endif /* defined(USE_FPSCALE) */ +#endif /* defined(__x86) */ static float raise_division(float t) { @@ -71,7 +69,7 @@ logbf(float x) { if (k == 0) return (raise_division(-1.0F)); else if ((__xpg6 & _C99SUSv3_logb) != 0) { -#if defined(USE_FPSCALE) || defined(__x86) +#if defined(__x86) x *= two25; return ((float) (((*((int *) &x) & 0x7f800000) >> 23) - 152)); diff --git a/usr/src/lib/libm/common/R/nextafterf.c b/usr/src/lib/libm/common/R/nextafterf.c index 39db44b552..3f6c1c2fb2 100644 --- a/usr/src/lib/libm/common/R/nextafterf.c +++ b/usr/src/lib/libm/common/R/nextafterf.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak nextafterf = __nextafterf -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/R/remainderf.c b/usr/src/lib/libm/common/R/remainderf.c index e701902608..e25b545beb 100644 --- a/usr/src/lib/libm/common/R/remainderf.c +++ b/usr/src/lib/libm/common/R/remainderf.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak remainderf = __remainderf -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/R/rintf.c b/usr/src/lib/libm/common/R/rintf.c index c958dfd942..6475e612f7 100644 --- a/usr/src/lib/libm/common/R/rintf.c +++ b/usr/src/lib/libm/common/R/rintf.c @@ -27,13 +27,11 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak aintf = __aintf #pragma weak anintf = __anintf #pragma weak irintf = __irintf #pragma weak nintf = __nintf #pragma weak rintf = __rintf -#endif /* INDENT OFF */ /* diff --git a/usr/src/lib/libm/common/R/scalbnf.c b/usr/src/lib/libm/common/R/scalbnf.c index fab79011fc..f30a93a1ef 100644 --- a/usr/src/lib/libm/common/R/scalbnf.c +++ b/usr/src/lib/libm/common/R/scalbnf.c @@ -27,16 +27,14 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak scalbnf = __scalbnf -#endif #include "libm.h" #include <float.h> /* FLT_MAX, FLT_MIN */ #include <stdlib.h> /* abs */ static const float twom25f = 2.98023223876953125e-8F; -#if defined(USE_FPSCALE) || defined(__x86) +#if defined(__x86) static const float two23f = 8388608.0F; #else /* @@ -55,7 +53,7 @@ ilogbf_biased(unsigned v) { v <<= 1; return (r + ((0xffffaa50 >> v) & 0x3)); } -#endif /* defined(USE_FPSCALE) */ +#endif /* defined(__x86) */ float scalbnf(float x, int n) { @@ -72,7 +70,7 @@ scalbnf(float x, int n) { if (ix == 0 || n == 0) return (x); if (k == 0) { -#if defined(USE_FPSCALE) || defined(__x86) +#if defined(__x86) x *= two23f; k = ((*px & ~0x80000000) >> 23) - 23; #else diff --git a/usr/src/lib/libm/common/R/significandf.c b/usr/src/lib/libm/common/R/significandf.c index 1e9c81f7ec..d01c84054c 100644 --- a/usr/src/lib/libm/common/R/significandf.c +++ b/usr/src/lib/libm/common/R/significandf.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak significandf = __significandf -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/R/sqrtf.c b/usr/src/lib/libm/common/R/sqrtf.c index 125fd4b03d..b95818b40a 100644 --- a/usr/src/lib/libm/common/R/sqrtf.c +++ b/usr/src/lib/libm/common/R/sqrtf.c @@ -30,7 +30,6 @@ #include "libm.h" -#ifdef __INLINE extern float __inline_sqrtf(float); @@ -39,71 +38,3 @@ sqrtf(float x) { return (__inline_sqrtf(x)); } -#else /* defined(__INLINE) */ - -static const float huge = 1.0e35F, tiny = 1.0e-35F, zero = 0.0f; - -float -sqrtf(float x) { - float dz, w; - int *pw = (int *)&w; - int ix, j, r, q, m, n, s, t; - - w = x; - ix = pw[0]; - if (ix <= 0) { - /* x is <= 0 or nan */ - j = ix & 0x7fffffff; - if (j == 0) - return (w); - return ((w * zero) / zero); - } - - if ((ix & 0x7f800000) == 0x7f800000) { - /* x is +inf or nan */ - return (w * w); - } - - m = ir_ilogb_(&w); - n = -m; - w = r_scalbn_(&w, (int *)&n); - ix = (pw[0] & 0x007fffff) | 0x00800000; - n = m / 2; - if ((n + n) != m) { - ix = ix + ix; - m -= 1; - n = m / 2; - } - - /* generate sqrt(x) bit by bit */ - ix <<= 1; - q = s = 0; - r = 0x01000000; - for (j = 1; j <= 25; j++) { - t = s + r; - if (t <= ix) { - s = t + r; - ix -= t; - q += r; - } - ix <<= 1; - r >>= 1; - } - if (ix == 0) - goto done; - - /* raise inexact and determine the ambient rounding mode */ - dz = huge - tiny; - if (dz < huge) - goto done; - dz = huge + tiny; - if (dz > huge) - q += 1; - q += (q & 1); - -done: - pw[0] = (q >> 1) + 0x3f000000; - return (r_scalbn_(&w, (int *)&n)); -} - -#endif /* defined(__INLINE) */ diff --git a/usr/src/lib/libm/common/m9x/__fex_hdlr.c b/usr/src/lib/libm/common/m9x/__fex_hdlr.c index 737c53ff20..54cd90e11e 100644 --- a/usr/src/lib/libm/common/m9x/__fex_hdlr.c +++ b/usr/src/lib/libm/common/m9x/__fex_hdlr.c @@ -57,10 +57,8 @@ extern int sigismember(const sigset_t *, int); void (*__mt_fex_sync)() = NULL; /* for synchronization with libmtsk */ #pragma weak __mt_fex_sync -#ifdef LIBM_MT_FEX_SYNC void (*__libm_mt_fex_sync)() = NULL; /* new, improved version of above */ #pragma weak __libm_mt_fex_sync -#endif /* private variables */ static fex_handler_t main_handlers; @@ -145,7 +143,6 @@ __fex_sync_with_libmtsk(int begin, int master) __fex_update_te(); } -#ifdef LIBM_MT_FEX_SYNC /* * The following function may be used for synchronization with any * internal project that manages multiple threads @@ -204,7 +201,6 @@ __fex_sync_with_threads(enum __libm_mt_fex_sync_actions action, break; } } -#endif #if defined(__sparc) @@ -842,8 +838,6 @@ __fex_update_te() /* synchronize with libmtsk */ __mt_fex_sync = __fex_sync_with_libmtsk; -#ifdef LIBM_MT_FEX_SYNC /* synchronize with other projects */ __libm_mt_fex_sync = __fex_sync_with_threads; -#endif } diff --git a/usr/src/lib/libm/common/m9x/fdim.c b/usr/src/lib/libm/common/m9x/fdim.c index 405c9c8dc1..23010330c5 100644 --- a/usr/src/lib/libm/common/m9x/fdim.c +++ b/usr/src/lib/libm/common/m9x/fdim.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak fdim = __fdim -#endif /* * fdim(x,y) returns x - y if x > y, +0 if x <= y, and NaN if x and diff --git a/usr/src/lib/libm/common/m9x/fdimf.c b/usr/src/lib/libm/common/m9x/fdimf.c index db8524946b..559f75295e 100644 --- a/usr/src/lib/libm/common/m9x/fdimf.c +++ b/usr/src/lib/libm/common/m9x/fdimf.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak fdimf = __fdimf -#endif #include "libm.h" /* for islessequal macro */ diff --git a/usr/src/lib/libm/common/m9x/fdiml.c b/usr/src/lib/libm/common/m9x/fdiml.c index 967e8f03e3..d4aa72dd53 100644 --- a/usr/src/lib/libm/common/m9x/fdiml.c +++ b/usr/src/lib/libm/common/m9x/fdiml.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak fdiml = __fdiml -#endif #include "libm.h" /* for islessequal macro */ diff --git a/usr/src/lib/libm/common/m9x/fma.c b/usr/src/lib/libm/common/m9x/fma.c index f06349a2c4..ca50c203ca 100644 --- a/usr/src/lib/libm/common/m9x/fma.c +++ b/usr/src/lib/libm/common/m9x/fma.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak fma = __fma -#endif #include "libm.h" #include "fma.h" diff --git a/usr/src/lib/libm/common/m9x/fmaf.c b/usr/src/lib/libm/common/m9x/fmaf.c index ea925ba726..507fb2e9ef 100644 --- a/usr/src/lib/libm/common/m9x/fmaf.c +++ b/usr/src/lib/libm/common/m9x/fmaf.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak fmaf = __fmaf -#endif #include "libm.h" #include "fma.h" diff --git a/usr/src/lib/libm/common/m9x/fmal.c b/usr/src/lib/libm/common/m9x/fmal.c index b60e034139..0500a6ae20 100644 --- a/usr/src/lib/libm/common/m9x/fmal.c +++ b/usr/src/lib/libm/common/m9x/fmal.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak fmal = __fmal -#endif #include "libm.h" #include "fma.h" diff --git a/usr/src/lib/libm/common/m9x/fmax.c b/usr/src/lib/libm/common/m9x/fmax.c index f9a66d45d1..ac36d8f059 100644 --- a/usr/src/lib/libm/common/m9x/fmax.c +++ b/usr/src/lib/libm/common/m9x/fmax.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak fmax = __fmax -#endif /* * fmax(x,y) returns the larger of x and y. If just one of the diff --git a/usr/src/lib/libm/common/m9x/fmaxf.c b/usr/src/lib/libm/common/m9x/fmaxf.c index 370512c37c..4e86ca7779 100644 --- a/usr/src/lib/libm/common/m9x/fmaxf.c +++ b/usr/src/lib/libm/common/m9x/fmaxf.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak fmaxf = __fmaxf -#endif /* * fmax(x,y) returns the larger of x and y. If just one of the diff --git a/usr/src/lib/libm/common/m9x/fmaxl.c b/usr/src/lib/libm/common/m9x/fmaxl.c index f6de1d5ebe..218101240c 100644 --- a/usr/src/lib/libm/common/m9x/fmaxl.c +++ b/usr/src/lib/libm/common/m9x/fmaxl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak fmaxl = __fmaxl -#endif #include "libm.h" /* for isgreaterequal macro */ diff --git a/usr/src/lib/libm/common/m9x/fmin.c b/usr/src/lib/libm/common/m9x/fmin.c index 52c137187b..a969592f71 100644 --- a/usr/src/lib/libm/common/m9x/fmin.c +++ b/usr/src/lib/libm/common/m9x/fmin.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak fmin = __fmin -#endif /* * fmin(x,y) returns the smaller of x and y. If just one of the diff --git a/usr/src/lib/libm/common/m9x/fminf.c b/usr/src/lib/libm/common/m9x/fminf.c index 77ed8591d1..f0681cfb73 100644 --- a/usr/src/lib/libm/common/m9x/fminf.c +++ b/usr/src/lib/libm/common/m9x/fminf.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak fminf = __fminf -#endif #include "libm.h" /* for islessequal macro */ diff --git a/usr/src/lib/libm/common/m9x/fminl.c b/usr/src/lib/libm/common/m9x/fminl.c index 5dd2a430c7..9ff973b276 100644 --- a/usr/src/lib/libm/common/m9x/fminl.c +++ b/usr/src/lib/libm/common/m9x/fminl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak fminl = __fminl -#endif #include "libm.h" /* for islessequal macro */ diff --git a/usr/src/lib/libm/common/m9x/frexp.c b/usr/src/lib/libm/common/m9x/frexp.c index d13ebd907f..a0d8320393 100644 --- a/usr/src/lib/libm/common/m9x/frexp.c +++ b/usr/src/lib/libm/common/m9x/frexp.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak frexp = __frexp -#endif /* * frexp(x, exp) returns the normalized significand of x and sets diff --git a/usr/src/lib/libm/common/m9x/frexpf.c b/usr/src/lib/libm/common/m9x/frexpf.c index 7a89fbb428..e0d39f5e27 100644 --- a/usr/src/lib/libm/common/m9x/frexpf.c +++ b/usr/src/lib/libm/common/m9x/frexpf.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak frexpf = __frexpf -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/m9x/frexpl.c b/usr/src/lib/libm/common/m9x/frexpl.c index 69a2088974..d2639abc07 100644 --- a/usr/src/lib/libm/common/m9x/frexpl.c +++ b/usr/src/lib/libm/common/m9x/frexpl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak frexpl = __frexpl -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/m9x/ldexp.c b/usr/src/lib/libm/common/m9x/ldexp.c index ac0fcc8dd3..e6e845a7a0 100644 --- a/usr/src/lib/libm/common/m9x/ldexp.c +++ b/usr/src/lib/libm/common/m9x/ldexp.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak ldexp = __ldexp -#endif #include "libm.h" #include <errno.h> diff --git a/usr/src/lib/libm/common/m9x/ldexpf.c b/usr/src/lib/libm/common/m9x/ldexpf.c index 1655ea1996..19029b33f9 100644 --- a/usr/src/lib/libm/common/m9x/ldexpf.c +++ b/usr/src/lib/libm/common/m9x/ldexpf.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak ldexpf = __ldexpf -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/m9x/ldexpl.c b/usr/src/lib/libm/common/m9x/ldexpl.c index d3d9aa5a86..5b0c5810e3 100644 --- a/usr/src/lib/libm/common/m9x/ldexpl.c +++ b/usr/src/lib/libm/common/m9x/ldexpl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak ldexpl = __ldexpl -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/m9x/llrint.c b/usr/src/lib/libm/common/m9x/llrint.c index fce2e970d6..a73490ac2c 100644 --- a/usr/src/lib/libm/common/m9x/llrint.c +++ b/usr/src/lib/libm/common/m9x/llrint.c @@ -27,13 +27,11 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak llrint = __llrint #if defined(__sparcv9) || defined(__amd64) #pragma weak lrint = __llrint #pragma weak __lrint = __llrint #endif -#endif /* * llrint(x) rounds its argument to the nearest integer according diff --git a/usr/src/lib/libm/common/m9x/llrintf.c b/usr/src/lib/libm/common/m9x/llrintf.c index abdc3772b8..a33ef953f0 100644 --- a/usr/src/lib/libm/common/m9x/llrintf.c +++ b/usr/src/lib/libm/common/m9x/llrintf.c @@ -27,13 +27,11 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak llrintf = __llrintf #if defined(__sparcv9) || defined(__amd64) #pragma weak lrintf = __llrintf #pragma weak __lrintf = __llrintf #endif -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/m9x/llrintl.c b/usr/src/lib/libm/common/m9x/llrintl.c index e58a6a83ca..c389bbd9f3 100644 --- a/usr/src/lib/libm/common/m9x/llrintl.c +++ b/usr/src/lib/libm/common/m9x/llrintl.c @@ -27,13 +27,11 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak llrintl = __llrintl #if defined(__sparcv9) || defined(__amd64) #pragma weak lrintl = __llrintl #pragma weak __lrintl = __llrintl #endif -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/m9x/llround.c b/usr/src/lib/libm/common/m9x/llround.c index 77fd84a084..99a94d2187 100644 --- a/usr/src/lib/libm/common/m9x/llround.c +++ b/usr/src/lib/libm/common/m9x/llround.c @@ -27,13 +27,11 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak llround = __llround #if defined(__sparcv9) || defined(__amd64) #pragma weak lround = __llround #pragma weak __lround = __llround #endif -#endif /* * llround(x) rounds its argument to the nearest integer, rounding diff --git a/usr/src/lib/libm/common/m9x/llroundf.c b/usr/src/lib/libm/common/m9x/llroundf.c index a1756b5b32..53da36bb67 100644 --- a/usr/src/lib/libm/common/m9x/llroundf.c +++ b/usr/src/lib/libm/common/m9x/llroundf.c @@ -27,13 +27,11 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak llroundf = __llroundf #if defined(__sparcv9) || defined(__amd64) #pragma weak lroundf = __llroundf #pragma weak __lroundf = __llroundf #endif -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/m9x/llroundl.c b/usr/src/lib/libm/common/m9x/llroundl.c index a8f5984ab8..ddb24909a9 100644 --- a/usr/src/lib/libm/common/m9x/llroundl.c +++ b/usr/src/lib/libm/common/m9x/llroundl.c @@ -27,13 +27,11 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak llroundl = __llroundl #if defined(__sparcv9) || defined(__amd64) #pragma weak lroundl = __llroundl #pragma weak __lroundl = __llroundl #endif -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/m9x/lrint.c b/usr/src/lib/libm/common/m9x/lrint.c index c3e4ed495d..fc9f5f9f1c 100644 --- a/usr/src/lib/libm/common/m9x/lrint.c +++ b/usr/src/lib/libm/common/m9x/lrint.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak lrint = __lrint -#endif /* * lrint(x) rounds its argument to the nearest integer according diff --git a/usr/src/lib/libm/common/m9x/lrintf.c b/usr/src/lib/libm/common/m9x/lrintf.c index 06d5754853..1b66da7d78 100644 --- a/usr/src/lib/libm/common/m9x/lrintf.c +++ b/usr/src/lib/libm/common/m9x/lrintf.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak lrintf = __lrintf -#endif #include <sys/isa_defs.h> /* _ILP32 */ #include "libm.h" diff --git a/usr/src/lib/libm/common/m9x/lrintl.c b/usr/src/lib/libm/common/m9x/lrintl.c index 00d29926a0..1f387ec91c 100644 --- a/usr/src/lib/libm/common/m9x/lrintl.c +++ b/usr/src/lib/libm/common/m9x/lrintl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak lrintl = __lrintl -#endif #include <sys/isa_defs.h> /* _ILP32 */ #include "libm.h" diff --git a/usr/src/lib/libm/common/m9x/lround.c b/usr/src/lib/libm/common/m9x/lround.c index f09463f35e..b6738ab21c 100644 --- a/usr/src/lib/libm/common/m9x/lround.c +++ b/usr/src/lib/libm/common/m9x/lround.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak lround = __lround -#endif /* * lround(x) rounds its argument to the nearest integer, rounding ties diff --git a/usr/src/lib/libm/common/m9x/lroundf.c b/usr/src/lib/libm/common/m9x/lroundf.c index 552316411f..8a08cec8e6 100644 --- a/usr/src/lib/libm/common/m9x/lroundf.c +++ b/usr/src/lib/libm/common/m9x/lroundf.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak lroundf = __lroundf -#endif #include <sys/isa_defs.h> /* _ILP32 */ #include "libm.h" diff --git a/usr/src/lib/libm/common/m9x/lroundl.c b/usr/src/lib/libm/common/m9x/lroundl.c index d2536a83be..7ba0b32e7a 100644 --- a/usr/src/lib/libm/common/m9x/lroundl.c +++ b/usr/src/lib/libm/common/m9x/lroundl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak lroundl = __lroundl -#endif #include <sys/isa_defs.h> /* _ILP32 */ #include "libm.h" diff --git a/usr/src/lib/libm/common/m9x/modf.c b/usr/src/lib/libm/common/m9x/modf.c index 636bb2967d..4269a66074 100644 --- a/usr/src/lib/libm/common/m9x/modf.c +++ b/usr/src/lib/libm/common/m9x/modf.c @@ -27,10 +27,8 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak modf = __modf #pragma weak _modf = __modf -#endif /* * modf(x, iptr) decomposes x into an integral part and a fractional diff --git a/usr/src/lib/libm/common/m9x/modff.c b/usr/src/lib/libm/common/m9x/modff.c index 1add78a7c5..e6e6456bdd 100644 --- a/usr/src/lib/libm/common/m9x/modff.c +++ b/usr/src/lib/libm/common/m9x/modff.c @@ -27,10 +27,8 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak modff = __modff #pragma weak _modff = __modff -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/m9x/modfl.c b/usr/src/lib/libm/common/m9x/modfl.c index 000b03d41f..0e58e4d268 100644 --- a/usr/src/lib/libm/common/m9x/modfl.c +++ b/usr/src/lib/libm/common/m9x/modfl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak modfl = __modfl -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/m9x/nan.c b/usr/src/lib/libm/common/m9x/nan.c index da153ad515..206f102bb5 100644 --- a/usr/src/lib/libm/common/m9x/nan.c +++ b/usr/src/lib/libm/common/m9x/nan.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak nan = __nan -#endif /* * nan(c) returns a NaN. This implementation ignores c. diff --git a/usr/src/lib/libm/common/m9x/nanf.c b/usr/src/lib/libm/common/m9x/nanf.c index 0e580b9923..78820a31d8 100644 --- a/usr/src/lib/libm/common/m9x/nanf.c +++ b/usr/src/lib/libm/common/m9x/nanf.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak nanf = __nanf -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/m9x/nanl.c b/usr/src/lib/libm/common/m9x/nanl.c index f1f7a52e43..9e701712ca 100644 --- a/usr/src/lib/libm/common/m9x/nanl.c +++ b/usr/src/lib/libm/common/m9x/nanl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak nanl = __nanl -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/m9x/nearbyint.c b/usr/src/lib/libm/common/m9x/nearbyint.c index 5f988fb818..ecba9eef55 100644 --- a/usr/src/lib/libm/common/m9x/nearbyint.c +++ b/usr/src/lib/libm/common/m9x/nearbyint.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak nearbyint = __nearbyint -#endif /* * nearbyint(x) returns the nearest fp integer to x in the direction diff --git a/usr/src/lib/libm/common/m9x/nearbyintf.c b/usr/src/lib/libm/common/m9x/nearbyintf.c index 99377c187e..54b7db5104 100644 --- a/usr/src/lib/libm/common/m9x/nearbyintf.c +++ b/usr/src/lib/libm/common/m9x/nearbyintf.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak nearbyintf = __nearbyintf -#endif #include "libm.h" #include "fenv_synonyms.h" diff --git a/usr/src/lib/libm/common/m9x/nearbyintl.c b/usr/src/lib/libm/common/m9x/nearbyintl.c index 0c1148728b..cf8013378e 100644 --- a/usr/src/lib/libm/common/m9x/nearbyintl.c +++ b/usr/src/lib/libm/common/m9x/nearbyintl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak nearbyintl = __nearbyintl -#endif #include "libm.h" #include "fma.h" diff --git a/usr/src/lib/libm/common/m9x/nexttoward.c b/usr/src/lib/libm/common/m9x/nexttoward.c index ceb9969eef..5c59e39217 100644 --- a/usr/src/lib/libm/common/m9x/nexttoward.c +++ b/usr/src/lib/libm/common/m9x/nexttoward.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak nexttoward = __nexttoward -#endif /* * nexttoward(x, y) delivers the next representable number after x diff --git a/usr/src/lib/libm/common/m9x/nexttowardf.c b/usr/src/lib/libm/common/m9x/nexttowardf.c index 55ad74d106..613042b10b 100644 --- a/usr/src/lib/libm/common/m9x/nexttowardf.c +++ b/usr/src/lib/libm/common/m9x/nexttowardf.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak nexttowardf = __nexttowardf -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/m9x/nexttowardl.c b/usr/src/lib/libm/common/m9x/nexttowardl.c index 87dfc13e66..7ca08d1614 100644 --- a/usr/src/lib/libm/common/m9x/nexttowardl.c +++ b/usr/src/lib/libm/common/m9x/nexttowardl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak nexttowardl = __nexttowardl -#endif #include "libm.h" #include <float.h> /* LDBL_MAX, LDBL_MIN */ diff --git a/usr/src/lib/libm/common/m9x/round.c b/usr/src/lib/libm/common/m9x/round.c index f4f5a48f2f..61f1f54b5c 100644 --- a/usr/src/lib/libm/common/m9x/round.c +++ b/usr/src/lib/libm/common/m9x/round.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak round = __round -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/m9x/roundf.c b/usr/src/lib/libm/common/m9x/roundf.c index acb6d840d3..a736d593cb 100644 --- a/usr/src/lib/libm/common/m9x/roundf.c +++ b/usr/src/lib/libm/common/m9x/roundf.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak roundf = __roundf -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/m9x/roundl.c b/usr/src/lib/libm/common/m9x/roundl.c index 957b93251b..09769e4fc6 100644 --- a/usr/src/lib/libm/common/m9x/roundl.c +++ b/usr/src/lib/libm/common/m9x/roundl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak roundl = __roundl -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/m9x/scalbln.c b/usr/src/lib/libm/common/m9x/scalbln.c index eb11e56a54..6260a26686 100644 --- a/usr/src/lib/libm/common/m9x/scalbln.c +++ b/usr/src/lib/libm/common/m9x/scalbln.c @@ -27,15 +27,13 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak scalbln = __scalbln -#endif #include "libm.h" #include <float.h> /* DBL_MAX, DBL_MIN */ static const double twom54 = 5.5511151231257827021181583404541015625e-17; -#if defined(USE_FPSCALE) || defined(__x86) +#if defined(__x86) static const double two52 = 4503599627370496.0; #else /* @@ -69,7 +67,7 @@ ilogb_biased(unsigned *px) { px[LOWORD] = w; return (1 - s); } -#endif /* defined(USE_FPSCALE) */ +#endif /* defined(__x86) */ double scalbln(double x, long n) { @@ -87,7 +85,7 @@ scalbln(double x, long n) { if ((px[LOWORD] | ix) == 0 || n == 0) return (x); if (k == 0) { -#if defined(USE_FPSCALE) || defined(__x86) +#if defined(__x86) x *= two52; k = ((px[HIWORD] & ~0x80000000) >> 20) - 52; #else diff --git a/usr/src/lib/libm/common/m9x/scalblnf.c b/usr/src/lib/libm/common/m9x/scalblnf.c index dc0132378c..8317495cf3 100644 --- a/usr/src/lib/libm/common/m9x/scalblnf.c +++ b/usr/src/lib/libm/common/m9x/scalblnf.c @@ -27,15 +27,13 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak scalblnf = __scalblnf -#endif #include "libm.h" #include <float.h> /* FLT_MAX, FLT_MIN */ static const float twom25f = 2.98023223876953125e-8F; -#if defined(USE_FPSCALE) || defined(__x86) +#if defined(__x86) static const float two23f = 8388608.0F; #else /* @@ -54,7 +52,7 @@ ilogbf_biased(unsigned v) { v <<= 1; return (r + ((0xffffaa50 >> v) & 0x3)); } -#endif /* defined(USE_FPSCALE) */ +#endif /* defined(__x86) */ float scalblnf(float x, long n) { @@ -71,7 +69,7 @@ scalblnf(float x, long n) { if (ix == 0 || n == 0) return (x); if (k == 0) { -#if defined(USE_FPSCALE) || defined(__x86) +#if defined(__x86) x *= two23f; k = ((*px & ~0x80000000) >> 23) - 23; #else diff --git a/usr/src/lib/libm/common/m9x/scalblnl.c b/usr/src/lib/libm/common/m9x/scalblnl.c index d5ffc989c6..acdd94a7f9 100644 --- a/usr/src/lib/libm/common/m9x/scalblnl.c +++ b/usr/src/lib/libm/common/m9x/scalblnl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak scalblnl = __scalblnl -#endif #include "libm.h" #include <float.h> /* LDBL_MAX, LDBL_MIN */ diff --git a/usr/src/lib/libm/common/m9x/tgamma.c b/usr/src/lib/libm/common/m9x/tgamma.c index 651fa7d125..ffa93d63d0 100644 --- a/usr/src/lib/libm/common/m9x/tgamma.c +++ b/usr/src/lib/libm/common/m9x/tgamma.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak tgamma = __tgamma -#endif /* INDENT OFF */ /* diff --git a/usr/src/lib/libm/common/m9x/tgammal.c b/usr/src/lib/libm/common/m9x/tgammal.c index 9901532e8e..d26d78b7e5 100644 --- a/usr/src/lib/libm/common/m9x/tgammal.c +++ b/usr/src/lib/libm/common/m9x/tgammal.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak tgammal = __tgammal -#endif #include "libm.h" #include <sys/isa_defs.h> diff --git a/usr/src/lib/libm/common/m9x/trunc.c b/usr/src/lib/libm/common/m9x/trunc.c index 381000bbd8..7673ae2afa 100644 --- a/usr/src/lib/libm/common/m9x/trunc.c +++ b/usr/src/lib/libm/common/m9x/trunc.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak trunc = __trunc -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/m9x/truncf.c b/usr/src/lib/libm/common/m9x/truncf.c index a81b16c09e..a2cb2e0272 100644 --- a/usr/src/lib/libm/common/m9x/truncf.c +++ b/usr/src/lib/libm/common/m9x/truncf.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak truncf = __truncf -#endif #include "libm.h" diff --git a/usr/src/lib/libm/common/m9x/truncl.c b/usr/src/lib/libm/common/m9x/truncl.c index 29f1d6a3a0..d433e3cb9b 100644 --- a/usr/src/lib/libm/common/m9x/truncl.c +++ b/usr/src/lib/libm/common/m9x/truncl.c @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#if defined(ELFOBJ) #pragma weak truncl = __truncl -#endif #include "libm.h" |