diff options
293 files changed, 1511 insertions, 563 deletions
diff --git a/lib/libm/Makefile b/lib/libm/Makefile index d60b769d138..3854bb395fe 100644 --- a/lib/libm/Makefile +++ b/lib/libm/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.113 2016/09/01 10:08:03 tedu Exp $ +# $OpenBSD: Makefile,v 1.114 2016/09/12 19:47:01 guenther Exp $ # $NetBSD: Makefile,v 1.28 1995/11/20 22:06:19 jtc Exp $ # # @(#)Makefile 5.1beta 93/09/24 @@ -140,6 +140,11 @@ CPPFLAGS+= -I${.CURDIR}/src -I${.CURDIR}/src/ld128 SRCS+= ${LONG_SRCS} .endif +CPPFLAGS+=-I${.CURDIR}/hidden -include namespace.h \ + -Werror-implicit-function-declaration + +VERSION_SCRIPT= ${.CURDIR}/Symbols.map + # Substitute common sources with any arch specific sources .for i in ${ARCH_SRCS} SRCS:=${SRCS:S/${i:S/.S/.c/}/$i/} @@ -158,3 +163,5 @@ MAN+= cacos.3 cacosh.3 carg.3 casin.3 casinh.3 catan.3 catanh.3 \ creal.3 csin.3 csinh.3 csqrt.3 ctan.3 ctanh.3 .include <bsd.lib.mk> + +${OBJS} ${GOBJS} ${POBJS} ${SOBJS} ${DOBJS}: ${.CURDIR}/hidden/namespace.h diff --git a/lib/libm/Symbols.map b/lib/libm/Symbols.map new file mode 100644 index 00000000000..1f741356388 --- /dev/null +++ b/lib/libm/Symbols.map @@ -0,0 +1,287 @@ +/* + * In order to guarantee that static and shared archs see the same "public" + * symbols, this file should always include all the non-static symbols that + * are in the application namespace. So, if a symbol starts with a letter, + * don't delete it from here without either making it static or renaming it + * to have a leading underbar. + */ + +{ + global: + __fe_dfl_env; + acos; + acosf; + acosh; + acoshf; + acoshl; + acosl; + asin; + asinf; + asinh; + asinhf; + asinhl; + asinl; + atan; + atan2; + atan2f; + atan2l; + atanf; + atanh; + atanhf; + atanhl; + atanl; + cabs; + cabsf; + cabsl; + cacos; + cacosf; + cacosh; + cacoshf; + cacoshl; + cacosl; + carg; + cargf; + cargl; + casin; + casinf; + casinh; + casinhf; + casinhl; + casinl; + catan; + catanf; + catanh; + catanhf; + catanhl; + catanl; + cbrt; + cbrtf; + cbrtl; + ccos; + ccosf; + ccosh; + ccoshf; + ccoshl; + ccosl; + ceil; + ceilf; + ceill; + cexp; + cexpf; + cexpl; + cimag; + cimagf; + cimagl; + clog; + clogf; + clogl; + conj; + conjf; + conjl; + copysign; + copysignf; + copysignl; + cos; + cosf; + cosh; + coshf; + coshl; + cosl; + cpow; + cpowf; + cpowl; + cproj; + cprojf; + cprojl; + creal; + crealf; + creall; + csin; + csinf; + csinh; + csinhf; + csinhl; + csinl; + csqrt; + csqrtf; + csqrtl; + ctan; + ctanf; + ctanh; + ctanhf; + ctanhl; + ctanl; + drem; + dremf; + erf; + erfc; + erfcf; + erfcl; + erff; + erfl; + exp; + exp2; + exp2f; + exp2l; + expf; + expl; + expm1; + expm1f; + expm1l; + fabsf; + fabsl; + fdim; + fdimf; + fdiml; + feclearexcept; + fedisableexcept; + feenableexcept; + fegetenv; + fegetexcept; + fegetexceptflag; + fegetround; + feholdexcept; + feraiseexcept; + fesetenv; + fesetexceptflag; + fesetround; + fetestexcept; + feupdateenv; + floor; + floorf; + floorl; + fma; + fmaf; + fmal; + fmax; + fmaxf; + fmaxl; + fmin; + fminf; + fminl; + fmod; + fmodf; + fmodl; + frexpf; + frexpl; + gamma; + gamma_r; + gammaf; + gammaf_r; + hypot; + hypotf; + hypotl; + ilogb; + ilogbf; + ilogbl; + j0; + j0f; + j1; + j1f; + jn; + jnf; + ldexpf; + ldexpl; + lgamma; + lgamma_r; + lgammaf; + lgammaf_r; + lgammal; + llrint; + llrintf; + llrintl; + llround; + llroundf; + llroundl; + log; + log10; + log10f; + log10l; + log1p; + log1pf; + log1pl; + log2; + log2f; + log2l; + logb; + logbf; + logbl; + logf; + logl; + lrint; + lrintf; + lrintl; + lround; + lroundf; + lroundl; + modff; + modfl; + nan; + nanf; + nanl; + nearbyint; + nearbyintf; + nearbyintl; + nextafter; + nextafterf; + nextafterl; + nexttoward; + nexttowardf; + nexttowardl; + pow; + powf; + powl; + remainder; + remainderf; + remainderl; + remquo; + remquof; + remquol; + rint; + rintf; + rintl; + round; + roundf; + roundl; + scalb; + scalbf; + scalbln; + scalblnf; + scalblnl; + scalbn; + scalbnf; + scalbnl; + signgam; + significand; + significandf; + sin; + sinf; + sinh; + sinhf; + sinhl; + sinl; + sqrt; + sqrtf; + sqrtl; + tan; + tanf; + tanh; + tanhf; + tanhl; + tanl; + tgamma; + tgammaf; + tgammal; + trunc; + truncf; + truncl; + y0; + y0f; + y1; + y1f; + yn; + ynf; + + local: + *; +}; diff --git a/lib/libm/arch/alpha/fenv.c b/lib/libm/arch/alpha/fenv.c index 348638b7dc0..d9ea53d564d 100644 --- a/lib/libm/arch/alpha/fenv.c +++ b/lib/libm/arch/alpha/fenv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fenv.c,v 1.3 2014/04/18 15:09:52 guenther Exp $ */ +/* $OpenBSD: fenv.c,v 1.4 2016/09/12 19:47:01 guenther Exp $ */ /* * Copyright (c) 2011 Martynas Venckus <martynas@openbsd.org> @@ -22,6 +22,13 @@ #include <fenv.h> /* + * Call sysarch(2) via its alias in the reserved namespace: + * _thread_sys_sysarch() + */ +typeof(sysarch) sysarch asm("_thread_sys_sysarch"); + + +/* * The following constant represents the default floating-point environment * (that is, the one installed at program startup) and has type pointer to * const-qualified fenv_t. @@ -60,6 +67,7 @@ feclearexcept(int excepts) return (0); } +DEF_STD(feclearexcept); /* * The fegetexceptflag() function stores an implementation-defined @@ -95,6 +103,7 @@ feraiseexcept(int excepts) return (0); } +DEF_STD(feraiseexcept); /* * This function sets the floating-point status flags indicated by the argument @@ -122,6 +131,7 @@ fesetexceptflag(const fexcept_t *flagp, int excepts) return (0); } +DEF_STD(fesetexceptflag); /* * The fetestexcept() function determines which of a specified subset of the @@ -140,6 +150,7 @@ fetestexcept(int excepts) return (fpsticky & excepts); } +DEF_STD(fetestexcept); /* * The fegetround() function gets the current rounding direction. @@ -156,6 +167,7 @@ fegetround(void) return ((fpcr >> _ROUND_SHIFT) & _ROUND_MASK); } +DEF_STD(fegetround); /* * The fesetround() function establishes the rounding direction represented by @@ -187,6 +199,7 @@ fesetround(int round) return (0); } +DEF_STD(fesetround); /* * The fegetenv() function attempts to store the current floating-point @@ -211,6 +224,7 @@ fegetenv(fenv_t *envp) return (0); } +DEF_STD(fegetenv); /* * The feholdexcept() function saves the current floating-point environment @@ -236,6 +250,7 @@ feholdexcept(fenv_t *envp) return (0); } +DEF_STD(feholdexcept); /* * The fesetenv() function attempts to establish the floating-point environment @@ -275,6 +290,7 @@ fesetenv(const fenv_t *envp) return (0); } +DEF_STD(fesetenv); /* * The feupdateenv() function saves the currently raised floating-point @@ -300,6 +316,7 @@ feupdateenv(const fenv_t *envp) return (0); } +DEF_STD(feupdateenv); /* * The following functions are extentions to the standard diff --git a/lib/libm/arch/amd64/abi.h b/lib/libm/arch/amd64/abi.h index 53b40f196eb..a94d7961b36 100644 --- a/lib/libm/arch/amd64/abi.h +++ b/lib/libm/arch/amd64/abi.h @@ -1,4 +1,4 @@ -/* $OpenBSD: abi.h,v 1.4 2010/06/03 16:38:50 deraadt Exp $ */ +/* $OpenBSD: abi.h,v 1.5 2016/09/12 19:47:01 guenther Exp $ */ /* $NetBSD: abi.h,v 1.2 2003/09/14 21:26:14 fvdl Exp $ */ /* @@ -44,3 +44,25 @@ #define FLDL_VAR(x) fldl x(%rip) + +/* + * We define a hidden alias with the prefix "_libm_" for each global symbol + * that may be used internally. By referencing _libm_x instead of x, other + * parts of libm prevent overriding by the application and avoid unnecessary + * relocations. + */ +#define _HIDDEN(x) _libm_##x +#define _HIDDEN_ALIAS(x,y) \ + STRONG_ALIAS(_HIDDEN(x),y); \ + .hidden _HIDDEN(x) +#define _HIDDEN_FALIAS(x,y) \ + _HIDDEN_ALIAS(x,y); \ + .type _HIDDEN(x),@function + +/* + * For functions implemented in ASM that are used internally + * END_STD(x) Like DEF_STD() in C; for standard/reserved C names + * END_NONSTD(x) Like DEF_NONSTD() in C; for non-ISO C names + */ +#define END_STD(x) END(x); _HIDDEN_FALIAS(x,x); END(_HIDDEN(x)) +#define END_NONSTD(x) END_STD(x); .weak x diff --git a/lib/libm/arch/amd64/e_acos.S b/lib/libm/arch/amd64/e_acos.S index 5b493c291e8..01231e67c50 100644 --- a/lib/libm/arch/amd64/e_acos.S +++ b/lib/libm/arch/amd64/e_acos.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_acos.S,v 1.4 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_acos.S,v 1.5 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -21,3 +21,4 @@ ENTRY(acos) fpatan XMM_DOUBLE_EPILOGUE ret +END(acos) diff --git a/lib/libm/arch/amd64/e_asin.S b/lib/libm/arch/amd64/e_asin.S index 3e337c88453..44eb4b87256 100644 --- a/lib/libm/arch/amd64/e_asin.S +++ b/lib/libm/arch/amd64/e_asin.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_asin.S,v 1.3 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_asin.S,v 1.4 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -20,3 +20,4 @@ ENTRY(asin) fpatan XMM_DOUBLE_EPILOGUE ret +END_STD(asin) diff --git a/lib/libm/arch/amd64/e_atan2.S b/lib/libm/arch/amd64/e_atan2.S index ac7c6bb627d..6fbcc6bcd4f 100644 --- a/lib/libm/arch/amd64/e_atan2.S +++ b/lib/libm/arch/amd64/e_atan2.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_atan2.S,v 1.3 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_atan2.S,v 1.4 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -15,3 +15,4 @@ ENTRY(atan2) fpatan XMM_DOUBLE_EPILOGUE ret +END_STD(atan2) diff --git a/lib/libm/arch/amd64/e_atan2f.S b/lib/libm/arch/amd64/e_atan2f.S index 77bd7cd4199..af9f9bb26f6 100644 --- a/lib/libm/arch/amd64/e_atan2f.S +++ b/lib/libm/arch/amd64/e_atan2f.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_atan2f.S,v 1.3 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_atan2f.S,v 1.4 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -15,3 +15,4 @@ ENTRY(atan2f) fpatan XMM_FLOAT_EPILOGUE ret +END_STD(atan2f) diff --git a/lib/libm/arch/amd64/e_exp.S b/lib/libm/arch/amd64/e_exp.S index 101e3c74804..61df362b078 100644 --- a/lib/libm/arch/amd64/e_exp.S +++ b/lib/libm/arch/amd64/e_exp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_exp.S,v 1.5 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_exp.S,v 1.6 2016/09/12 19:47:01 guenther Exp $ */ /* $NetBSD: e_exp.S,v 1.12 2002/02/27 16:32:46 christos Exp $ */ /* @@ -99,3 +99,4 @@ x_Inf_or_NaN: x_not_minus_Inf: movsd ARG_DOUBLE_ONE,%xmm0 ret +END_STD(exp) diff --git a/lib/libm/arch/amd64/e_fmod.S b/lib/libm/arch/amd64/e_fmod.S index 71c8f9c3349..62777f170ac 100644 --- a/lib/libm/arch/amd64/e_fmod.S +++ b/lib/libm/arch/amd64/e_fmod.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_fmod.S,v 1.3 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_fmod.S,v 1.4 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -20,3 +20,4 @@ ENTRY(fmod) fstp %st(1) XMM_DOUBLE_EPILOGUE ret +END(fmod) diff --git a/lib/libm/arch/amd64/e_log.S b/lib/libm/arch/amd64/e_log.S index e0293b2c05d..16c7a77598e 100644 --- a/lib/libm/arch/amd64/e_log.S +++ b/lib/libm/arch/amd64/e_log.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_log.S,v 1.3 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_log.S,v 1.4 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -15,3 +15,4 @@ ENTRY(log) fyl2x XMM_DOUBLE_EPILOGUE ret +END_STD(log) diff --git a/lib/libm/arch/amd64/e_log10.S b/lib/libm/arch/amd64/e_log10.S index d0439b55b03..6774d928a65 100644 --- a/lib/libm/arch/amd64/e_log10.S +++ b/lib/libm/arch/amd64/e_log10.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_log10.S,v 1.3 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_log10.S,v 1.4 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -15,3 +15,4 @@ ENTRY(log10) fyl2x XMM_DOUBLE_EPILOGUE ret +END(log10) diff --git a/lib/libm/arch/amd64/e_remainder.S b/lib/libm/arch/amd64/e_remainder.S index 1971538cf05..31290dfd9c6 100644 --- a/lib/libm/arch/amd64/e_remainder.S +++ b/lib/libm/arch/amd64/e_remainder.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_remainder.S,v 1.3 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_remainder.S,v 1.4 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -19,3 +19,4 @@ ENTRY(remainder) fstp %st(1) XMM_DOUBLE_EPILOGUE ret +END_STD(remainder) diff --git a/lib/libm/arch/amd64/e_remainderf.S b/lib/libm/arch/amd64/e_remainderf.S index c739332cb68..39bd10f0d33 100644 --- a/lib/libm/arch/amd64/e_remainderf.S +++ b/lib/libm/arch/amd64/e_remainderf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_remainderf.S,v 1.3 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_remainderf.S,v 1.4 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -19,3 +19,4 @@ ENTRY(remainderf) fstp %st(1) XMM_FLOAT_EPILOGUE ret +END_STD(remainderf) diff --git a/lib/libm/arch/amd64/e_scalb.S b/lib/libm/arch/amd64/e_scalb.S index ac5549999d2..0b509bd8d90 100644 --- a/lib/libm/arch/amd64/e_scalb.S +++ b/lib/libm/arch/amd64/e_scalb.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_scalb.S,v 1.3 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_scalb.S,v 1.4 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -16,3 +16,4 @@ ENTRY(scalb) fstp %st(1) /* bug fix for fp stack overflow */ XMM_DOUBLE_EPILOGUE ret +END_NONSTD(scalb) diff --git a/lib/libm/arch/amd64/e_sqrt.S b/lib/libm/arch/amd64/e_sqrt.S index 5b014868c9f..07d121a531f 100644 --- a/lib/libm/arch/amd64/e_sqrt.S +++ b/lib/libm/arch/amd64/e_sqrt.S @@ -1,11 +1,13 @@ -/* $OpenBSD: e_sqrt.S,v 1.4 2009/04/08 22:30:41 martynas Exp $ */ +/* $OpenBSD: e_sqrt.S,v 1.5 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. */ #include <machine/asm.h> +#include "abi.h" ENTRY(sqrt) sqrtsd %xmm0,%xmm0 ret +END_STD(sqrt) diff --git a/lib/libm/arch/amd64/e_sqrtf.S b/lib/libm/arch/amd64/e_sqrtf.S index 50fd81b84a2..1a8a5616127 100644 --- a/lib/libm/arch/amd64/e_sqrtf.S +++ b/lib/libm/arch/amd64/e_sqrtf.S @@ -1,11 +1,13 @@ -/* $OpenBSD: e_sqrtf.S,v 1.4 2009/04/08 22:30:41 martynas Exp $ */ +/* $OpenBSD: e_sqrtf.S,v 1.5 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. */ #include <machine/asm.h> +#include "abi.h" ENTRY(sqrtf) sqrtss %xmm0,%xmm0 ret +END_STD(sqrtf) diff --git a/lib/libm/arch/amd64/e_sqrtl.S b/lib/libm/arch/amd64/e_sqrtl.S index 37bc91cf8bd..71ab6bdd5f2 100644 --- a/lib/libm/arch/amd64/e_sqrtl.S +++ b/lib/libm/arch/amd64/e_sqrtl.S @@ -1,12 +1,14 @@ -/* $OpenBSD: e_sqrtl.S,v 1.1 2009/11/06 23:30:21 kettenis Exp $ */ +/* $OpenBSD: e_sqrtl.S,v 1.2 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. */ #include <machine/asm.h> +#include "abi.h" ENTRY(sqrtl) fldt 8(%rsp) fsqrt ret +END_STD(sqrtl) diff --git a/lib/libm/arch/amd64/fenv.c b/lib/libm/arch/amd64/fenv.c index 708259d4d35..d6088075c8e 100644 --- a/lib/libm/arch/amd64/fenv.c +++ b/lib/libm/arch/amd64/fenv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fenv.c,v 1.4 2014/04/18 15:09:52 guenther Exp $ */ +/* $OpenBSD: fenv.c,v 1.5 2016/09/12 19:47:01 guenther Exp $ */ /* $NetBSD: fenv.c,v 1.1 2010/07/31 21:47:53 joerg Exp $ */ /*- @@ -86,6 +86,7 @@ feclearexcept(int excepts) return (0); } +DEF_STD(feclearexcept); /* * The fegetexceptflag() function stores an implementation-defined @@ -132,6 +133,7 @@ feraiseexcept(int excepts) return (0); } +DEF_STD(feraiseexcept); /* * This function sets the floating-point status flags indicated by the argument @@ -164,6 +166,7 @@ fesetexceptflag(const fexcept_t *flagp, int excepts) return (0); } +DEF_STD(fesetexceptflag); /* * The fetestexcept() function determines which of a specified subset of the @@ -186,6 +189,7 @@ fetestexcept(int excepts) return ((status | mxcsr) & excepts); } +DEF_STD(fetestexcept); /* * The fegetround() function gets the current rounding direction. @@ -205,6 +209,7 @@ fegetround(void) return (control & _X87_ROUND_MASK); } +DEF_STD(fegetround); /* * The fesetround() function establishes the rounding direction represented by @@ -239,6 +244,7 @@ fesetround(int round) return (0); } +DEF_STD(fesetround); /* * The fegetenv() function attempts to store the current floating-point @@ -265,6 +271,7 @@ fegetenv(fenv_t *envp) return (0); } +DEF_STD(fegetenv); /* * The feholdexcept() function saves the current floating-point environment @@ -298,6 +305,7 @@ feholdexcept(fenv_t *envp) return (0); } +DEF_STD(feholdexcept); /* * The fesetenv() function attempts to establish the floating-point environment @@ -318,6 +326,7 @@ fesetenv(const fenv_t *envp) return (0); } +DEF_STD(fesetenv); /* * The feupdateenv() function saves the currently raised floating-point @@ -347,6 +356,7 @@ feupdateenv(const fenv_t *envp) return (0); } +DEF_STD(feupdateenv); /* * The following functions are extentions to the standard diff --git a/lib/libm/arch/amd64/s_atan.S b/lib/libm/arch/amd64/s_atan.S index 5b66329af3e..9c2ac3bbd2f 100644 --- a/lib/libm/arch/amd64/s_atan.S +++ b/lib/libm/arch/amd64/s_atan.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_atan.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_atan.S,v 1.3 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -15,3 +15,4 @@ ENTRY(atan) fpatan XMM_DOUBLE_EPILOGUE ret +END(atan) diff --git a/lib/libm/arch/amd64/s_atanf.S b/lib/libm/arch/amd64/s_atanf.S index 5b5dccefed8..d36843d41dd 100644 --- a/lib/libm/arch/amd64/s_atanf.S +++ b/lib/libm/arch/amd64/s_atanf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_atanf.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_atanf.S,v 1.3 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -15,3 +15,4 @@ ENTRY(atanf) fpatan XMM_FLOAT_EPILOGUE ret +END_STD(atanf) diff --git a/lib/libm/arch/amd64/s_ceil.S b/lib/libm/arch/amd64/s_ceil.S index 0208581bf4b..3cb26b6cde9 100644 --- a/lib/libm/arch/amd64/s_ceil.S +++ b/lib/libm/arch/amd64/s_ceil.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_ceil.S,v 1.3 2009/04/08 22:30:41 martynas Exp $ */ +/* $OpenBSD: s_ceil.S,v 1.4 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -22,3 +22,4 @@ ENTRY(ceil) fstpl -8(%rsp) movsd -8(%rsp),%xmm0 ret +END_STD(ceil) diff --git a/lib/libm/arch/amd64/s_ceilf.S b/lib/libm/arch/amd64/s_ceilf.S index a02291eed29..12f7f2cf37e 100644 --- a/lib/libm/arch/amd64/s_ceilf.S +++ b/lib/libm/arch/amd64/s_ceilf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_ceilf.S,v 1.4 2009/04/08 22:30:41 martynas Exp $ */ +/* $OpenBSD: s_ceilf.S,v 1.5 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -20,3 +20,4 @@ ENTRY(ceilf) fstps -4(%rsp) movss -4(%rsp),%xmm0 ret +END(ceilf) diff --git a/lib/libm/arch/amd64/s_copysign.S b/lib/libm/arch/amd64/s_copysign.S index 7f8c98c3b6c..1d8040ecf11 100644 --- a/lib/libm/arch/amd64/s_copysign.S +++ b/lib/libm/arch/amd64/s_copysign.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_copysign.S,v 1.4 2011/07/09 18:00:53 martynas Exp $ */ +/* $OpenBSD: s_copysign.S,v 1.5 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -18,3 +18,4 @@ ENTRY(copysign) pand %xmm3,%xmm0 por %xmm1,%xmm0 ret +END(copysign) diff --git a/lib/libm/arch/amd64/s_copysignf.S b/lib/libm/arch/amd64/s_copysignf.S index 618203b46af..be3e9ec9a87 100644 --- a/lib/libm/arch/amd64/s_copysignf.S +++ b/lib/libm/arch/amd64/s_copysignf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_copysignf.S,v 1.4 2011/07/09 18:00:53 martynas Exp $ */ +/* $OpenBSD: s_copysignf.S,v 1.5 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -18,3 +18,4 @@ ENTRY(copysignf) pand %xmm3,%xmm0 por %xmm1,%xmm0 ret +END(copysignf) diff --git a/lib/libm/arch/amd64/s_cos.S b/lib/libm/arch/amd64/s_cos.S index c9d191d4576..cb382696914 100644 --- a/lib/libm/arch/amd64/s_cos.S +++ b/lib/libm/arch/amd64/s_cos.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_cos.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_cos.S,v 1.3 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -28,3 +28,4 @@ ENTRY(cos) fcos XMM_DOUBLE_EPILOGUE ret +END_STD(cos) diff --git a/lib/libm/arch/amd64/s_cosf.S b/lib/libm/arch/amd64/s_cosf.S index 55c8307248b..15fe9afcf89 100644 --- a/lib/libm/arch/amd64/s_cosf.S +++ b/lib/libm/arch/amd64/s_cosf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_cosf.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_cosf.S,v 1.3 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -15,3 +15,4 @@ ENTRY(cosf) fcos XMM_FLOAT_EPILOGUE ret +END_STD(cosf) diff --git a/lib/libm/arch/amd64/s_floor.S b/lib/libm/arch/amd64/s_floor.S index aa611f76940..adff8b4e7c8 100644 --- a/lib/libm/arch/amd64/s_floor.S +++ b/lib/libm/arch/amd64/s_floor.S @@ -1,10 +1,11 @@ -/* $OpenBSD: s_floor.S,v 1.3 2009/04/08 22:30:41 martynas Exp $ */ +/* $OpenBSD: s_floor.S,v 1.4 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. */ #include <machine/asm.h> +#include "abi.h" ENTRY(floor) movsd %xmm0, -8(%rsp) @@ -20,3 +21,4 @@ ENTRY(floor) fstpl -8(%rsp) movsd -8(%rsp),%xmm0 ret +END_STD(floor) diff --git a/lib/libm/arch/amd64/s_floorf.S b/lib/libm/arch/amd64/s_floorf.S index 66bef665dd0..4c161831d1b 100644 --- a/lib/libm/arch/amd64/s_floorf.S +++ b/lib/libm/arch/amd64/s_floorf.S @@ -1,10 +1,11 @@ -/* $OpenBSD: s_floorf.S,v 1.4 2009/04/08 22:30:41 martynas Exp $ */ +/* $OpenBSD: s_floorf.S,v 1.5 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. */ #include <machine/asm.h> +#include "abi.h" ENTRY(floorf) movss %xmm0, -4(%rsp) @@ -20,3 +21,4 @@ ENTRY(floorf) fstps -4(%rsp) movss -4(%rsp),%xmm0 ret +END_STD(floorf) diff --git a/lib/libm/arch/amd64/s_ilogb.S b/lib/libm/arch/amd64/s_ilogb.S index e8a512e3604..e516d1e197d 100644 --- a/lib/libm/arch/amd64/s_ilogb.S +++ b/lib/libm/arch/amd64/s_ilogb.S @@ -1,10 +1,11 @@ -/* $OpenBSD: s_ilogb.S,v 1.3 2009/04/08 22:30:41 martynas Exp $ */ +/* $OpenBSD: s_ilogb.S,v 1.4 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. */ #include <machine/asm.h> +#include "abi.h" ENTRY(ilogb) movsd %xmm0,-8(%rsp) @@ -14,3 +15,4 @@ ENTRY(ilogb) fistpl -8(%rsp) movl -8(%rsp),%eax ret +END_STD(ilogb) diff --git a/lib/libm/arch/amd64/s_ilogbf.S b/lib/libm/arch/amd64/s_ilogbf.S index be0809536b9..b943f850ecd 100644 --- a/lib/libm/arch/amd64/s_ilogbf.S +++ b/lib/libm/arch/amd64/s_ilogbf.S @@ -1,10 +1,11 @@ -/* $OpenBSD: s_ilogbf.S,v 1.3 2009/04/08 22:30:41 martynas Exp $ */ +/* $OpenBSD: s_ilogbf.S,v 1.4 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. */ #include <machine/asm.h> +#include "abi.h" ENTRY(ilogbf) movss %xmm0,-4(%rsp) @@ -14,3 +15,4 @@ ENTRY(ilogbf) fistpl -4(%rsp) movl -4(%rsp),%eax ret +END_STD(ilogbf) diff --git a/lib/libm/arch/amd64/s_llrint.S b/lib/libm/arch/amd64/s_llrint.S index aeb13478f1f..aea32600ffe 100644 --- a/lib/libm/arch/amd64/s_llrint.S +++ b/lib/libm/arch/amd64/s_llrint.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_llrint.S,v 1.1 2009/04/10 11:30:33 martynas Exp $ */ +/* $OpenBSD: s_llrint.S,v 1.2 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by Martynas Venckus. Public domain @@ -9,4 +9,4 @@ ENTRY(llrint) cvtsd2si %xmm0, %rax ret - +END(llrint) diff --git a/lib/libm/arch/amd64/s_llrintf.S b/lib/libm/arch/amd64/s_llrintf.S index 6d06da485e3..a800178a532 100644 --- a/lib/libm/arch/amd64/s_llrintf.S +++ b/lib/libm/arch/amd64/s_llrintf.S @@ -1,12 +1,13 @@ -/* $OpenBSD: s_llrintf.S,v 1.1 2009/04/10 11:30:33 martynas Exp $ */ +/* $OpenBSD: s_llrintf.S,v 1.2 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by Martynas Venckus. Public domain */ #include <machine/asm.h> +#include "abi.h" ENTRY(llrintf) cvtss2si %xmm0, %rax ret - +END_STD(llrintf) diff --git a/lib/libm/arch/amd64/s_log1p.S b/lib/libm/arch/amd64/s_log1p.S index 6fa75bd9ff7..b792531681e 100644 --- a/lib/libm/arch/amd64/s_log1p.S +++ b/lib/libm/arch/amd64/s_log1p.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_log1p.S,v 1.3 2009/04/08 23:31:34 martynas Exp $ */ +/* $OpenBSD: s_log1p.S,v 1.4 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -73,3 +73,4 @@ use_fyl2xp1: fyl2xp1 XMM_DOUBLE_EPILOGUE ret +END_STD(log1p) diff --git a/lib/libm/arch/amd64/s_log1pf.S b/lib/libm/arch/amd64/s_log1pf.S index 51805172625..9bd2d504ee0 100644 --- a/lib/libm/arch/amd64/s_log1pf.S +++ b/lib/libm/arch/amd64/s_log1pf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_log1pf.S,v 1.3 2009/04/08 23:31:34 martynas Exp $ */ +/* $OpenBSD: s_log1pf.S,v 1.4 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -73,3 +73,4 @@ use_fyl2xp1: fyl2xp1 XMM_FLOAT_EPILOGUE ret +END_STD(log1pf) diff --git a/lib/libm/arch/amd64/s_logb.S b/lib/libm/arch/amd64/s_logb.S index 90f2a83fba1..0703a1278e2 100644 --- a/lib/libm/arch/amd64/s_logb.S +++ b/lib/libm/arch/amd64/s_logb.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_logb.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_logb.S,v 1.3 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -15,3 +15,4 @@ ENTRY(logb) fstp %st XMM_DOUBLE_EPILOGUE ret +END_STD(logb) diff --git a/lib/libm/arch/amd64/s_logbf.S b/lib/libm/arch/amd64/s_logbf.S index f5548cc011e..c1cd84b1c20 100644 --- a/lib/libm/arch/amd64/s_logbf.S +++ b/lib/libm/arch/amd64/s_logbf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_logbf.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_logbf.S,v 1.3 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -15,3 +15,4 @@ ENTRY(logbf) fstp %st XMM_FLOAT_EPILOGUE ret +END_STD(logbf) diff --git a/lib/libm/arch/amd64/s_lrint.S b/lib/libm/arch/amd64/s_lrint.S index 5cc27122fad..662b2b5046a 100644 --- a/lib/libm/arch/amd64/s_lrint.S +++ b/lib/libm/arch/amd64/s_lrint.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_lrint.S,v 1.1 2009/04/10 11:30:33 martynas Exp $ */ +/* $OpenBSD: s_lrint.S,v 1.2 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by Martynas Venckus. Public domain @@ -9,4 +9,4 @@ ENTRY(lrint) cvtsd2si %xmm0, %rax ret - +END(lrint) diff --git a/lib/libm/arch/amd64/s_lrintf.S b/lib/libm/arch/amd64/s_lrintf.S index 912e6b62064..3e84734d4a6 100644 --- a/lib/libm/arch/amd64/s_lrintf.S +++ b/lib/libm/arch/amd64/s_lrintf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_lrintf.S,v 1.1 2009/04/10 11:30:33 martynas Exp $ */ +/* $OpenBSD: s_lrintf.S,v 1.2 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by Martynas Venckus. Public domain @@ -9,4 +9,4 @@ ENTRY(lrintf) cvtss2si %xmm0, %rax ret - +END(lrintf) diff --git a/lib/libm/arch/amd64/s_rint.S b/lib/libm/arch/amd64/s_rint.S index c279782b7ef..e1716eb52ff 100644 --- a/lib/libm/arch/amd64/s_rint.S +++ b/lib/libm/arch/amd64/s_rint.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_rint.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_rint.S,v 1.3 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -14,3 +14,4 @@ ENTRY(rint) frndint XMM_DOUBLE_EPILOGUE ret +END_STD(rint) diff --git a/lib/libm/arch/amd64/s_rintf.S b/lib/libm/arch/amd64/s_rintf.S index d702e5ce7e9..53a40725bcc 100644 --- a/lib/libm/arch/amd64/s_rintf.S +++ b/lib/libm/arch/amd64/s_rintf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_rintf.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_rintf.S,v 1.3 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -14,3 +14,4 @@ ENTRY(rintf) frndint XMM_FLOAT_EPILOGUE ret +END_STD(rintf) diff --git a/lib/libm/arch/amd64/s_scalbnf.S b/lib/libm/arch/amd64/s_scalbnf.S index b5a92e2a7ff..1faecbec78a 100644 --- a/lib/libm/arch/amd64/s_scalbnf.S +++ b/lib/libm/arch/amd64/s_scalbnf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_scalbnf.S,v 1.4 2009/04/25 11:03:35 martynas Exp $ */ +/* $OpenBSD: s_scalbnf.S,v 1.5 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -21,4 +21,4 @@ ENTRY(scalbnf) fstps -8(%rsp) movss -8(%rsp),%xmm0 ret - +END_STD(scalbnf) diff --git a/lib/libm/arch/amd64/s_significand.S b/lib/libm/arch/amd64/s_significand.S index 6128eed7f68..ca5e516088a 100644 --- a/lib/libm/arch/amd64/s_significand.S +++ b/lib/libm/arch/amd64/s_significand.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_significand.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_significand.S,v 1.3 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -15,3 +15,4 @@ ENTRY(significand) fstp %st(1) XMM_DOUBLE_EPILOGUE ret +END(significand) diff --git a/lib/libm/arch/amd64/s_significandf.S b/lib/libm/arch/amd64/s_significandf.S index 86c1ea07ac0..9dc01b85130 100644 --- a/lib/libm/arch/amd64/s_significandf.S +++ b/lib/libm/arch/amd64/s_significandf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_significandf.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_significandf.S,v 1.3 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -15,3 +15,4 @@ ENTRY(significandf) fstp %st(1) XMM_FLOAT_EPILOGUE ret +END(significandf) diff --git a/lib/libm/arch/amd64/s_sin.S b/lib/libm/arch/amd64/s_sin.S index cccea47089c..6f21144001e 100644 --- a/lib/libm/arch/amd64/s_sin.S +++ b/lib/libm/arch/amd64/s_sin.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_sin.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_sin.S,v 1.3 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -28,3 +28,4 @@ ENTRY(sin) fsin XMM_DOUBLE_EPILOGUE ret +END_STD(sin) diff --git a/lib/libm/arch/amd64/s_sinf.S b/lib/libm/arch/amd64/s_sinf.S index 4b707ccf957..d145f8c39db 100644 --- a/lib/libm/arch/amd64/s_sinf.S +++ b/lib/libm/arch/amd64/s_sinf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_sinf.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_sinf.S,v 1.3 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -15,3 +15,4 @@ ENTRY(sinf) fsin XMM_FLOAT_EPILOGUE ret +END_STD(sinf) diff --git a/lib/libm/arch/amd64/s_tan.S b/lib/libm/arch/amd64/s_tan.S index acbd10d762a..0e891fe2ee9 100644 --- a/lib/libm/arch/amd64/s_tan.S +++ b/lib/libm/arch/amd64/s_tan.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_tan.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_tan.S,v 1.3 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -30,3 +30,4 @@ ENTRY(tan) fstp %st(0) XMM_DOUBLE_EPILOGUE ret +END(tan) diff --git a/lib/libm/arch/amd64/s_tanf.S b/lib/libm/arch/amd64/s_tanf.S index e62e6d32398..94b7a6d6028 100644 --- a/lib/libm/arch/amd64/s_tanf.S +++ b/lib/libm/arch/amd64/s_tanf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_tanf.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_tanf.S,v 1.3 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -16,3 +16,4 @@ ENTRY(tanf) fstp %st(0) XMM_FLOAT_EPILOGUE ret +END(tanf) diff --git a/lib/libm/arch/arm/fenv.c b/lib/libm/arch/arm/fenv.c index 9700af4b36d..73160c4be0b 100644 --- a/lib/libm/arch/arm/fenv.c +++ b/lib/libm/arch/arm/fenv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fenv.c,v 1.3 2012/12/05 23:20:02 deraadt Exp $ */ +/* $OpenBSD: fenv.c,v 1.4 2016/09/12 19:47:01 guenther Exp $ */ /* * Copyright (c) 2011 Martynas Venckus <martynas@openbsd.org> @@ -53,6 +53,7 @@ feclearexcept(int excepts) return (0); } +DEF_STD(feclearexcept); /* * The fegetexceptflag() function stores an implementation-defined @@ -84,6 +85,7 @@ feraiseexcept(int excepts) return (0); } +DEF_STD(feraiseexcept); /* * This function sets the floating-point status flags indicated by the argument @@ -101,6 +103,7 @@ fesetexceptflag(const fexcept_t *flagp, int excepts) return (0); } +DEF_STD(fesetexceptflag); /* * The fetestexcept() function determines which of a specified subset of the @@ -114,6 +117,7 @@ fetestexcept(int excepts) return (_softfloat_float_exception_flags & excepts); } +DEF_STD(fetestexcept); /* * The fegetround() function gets the current rounding direction. @@ -123,6 +127,7 @@ fegetround(void) { return (_softfloat_float_rounding_mode & _ROUND_MASK); } +DEF_STD(fegetround); /* * The fesetround() function establishes the rounding direction represented by @@ -142,6 +147,7 @@ fesetround(int round) return (0); } +DEF_STD(fesetround); /* * The fegetenv() function attempts to store the current floating-point @@ -161,6 +167,7 @@ fegetenv(fenv_t *envp) return (0); } +DEF_STD(fegetenv); /* * The feholdexcept() function saves the current floating-point environment @@ -182,6 +189,7 @@ feholdexcept(fenv_t *envp) return (0); } +DEF_STD(feholdexcept); /* * The fesetenv() function attempts to establish the floating-point environment @@ -205,6 +213,7 @@ fesetenv(const fenv_t *envp) return (0); } +DEF_STD(fesetenv); /* * The feupdateenv() function saves the currently raised floating-point @@ -227,6 +236,7 @@ feupdateenv(const fenv_t *envp) return (0); } +DEF_STD(feupdateenv); /* * The following functions are extentions to the standard diff --git a/lib/libm/arch/hppa/e_remainder.c b/lib/libm/arch/hppa/e_remainder.c index 4378752fb1c..efd59e2aabb 100644 --- a/lib/libm/arch/hppa/e_remainder.c +++ b/lib/libm/arch/hppa/e_remainder.c @@ -11,5 +11,5 @@ remainder(double x, double p) return (x); } - -__strong_alias(remainderl, remainder); +DEF_STD(remainder); +LDBL_UNUSED_CLONE(remainder); diff --git a/lib/libm/arch/hppa/e_remainderf.c b/lib/libm/arch/hppa/e_remainderf.c index 0c5a8a4d608..bdcf7facf4d 100644 --- a/lib/libm/arch/hppa/e_remainderf.c +++ b/lib/libm/arch/hppa/e_remainderf.c @@ -11,3 +11,4 @@ remainderf(float x, float p) return (x); } +DEF_STD(remainderf); diff --git a/lib/libm/arch/hppa/e_sqrt.c b/lib/libm/arch/hppa/e_sqrt.c index b2b07ca8880..ab8247fe302 100644 --- a/lib/libm/arch/hppa/e_sqrt.c +++ b/lib/libm/arch/hppa/e_sqrt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_sqrt.c,v 1.11 2015/01/20 04:41:01 krw Exp $ */ +/* $OpenBSD: e_sqrt.c,v 1.12 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by Michael Shalayeff. Public Domain */ @@ -12,5 +12,5 @@ sqrt(double x) __asm__ volatile ("fsqrt,dbl %0, %0" : "+f" (x)); return (x); } - -__strong_alias(sqrtl, sqrt); +DEF_STD(sqrt); +LDBL_CLONE(sqrt); diff --git a/lib/libm/arch/hppa/e_sqrtf.c b/lib/libm/arch/hppa/e_sqrtf.c index e522ac9c181..2269d018f80 100644 --- a/lib/libm/arch/hppa/e_sqrtf.c +++ b/lib/libm/arch/hppa/e_sqrtf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_sqrtf.c,v 1.5 2015/01/20 04:41:01 krw Exp $ */ +/* $OpenBSD: e_sqrtf.c,v 1.6 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by Michael Shalayeff. Public Domain */ @@ -11,3 +11,4 @@ sqrtf(float x) __asm__ volatile ("fsqrt,sgl %0, %0" : "+f" (x)); return (x); } +DEF_STD(sqrtf); diff --git a/lib/libm/arch/hppa/fenv.c b/lib/libm/arch/hppa/fenv.c index 2cd20e30bd2..6fccf79eba6 100644 --- a/lib/libm/arch/hppa/fenv.c +++ b/lib/libm/arch/hppa/fenv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fenv.c,v 1.4 2014/04/18 15:09:52 guenther Exp $ */ +/* $OpenBSD: fenv.c,v 1.5 2016/09/12 19:47:01 guenther Exp $ */ /* * Copyright (c) 2011 Martynas Venckus <martynas@openbsd.org> @@ -57,6 +57,7 @@ feclearexcept(int excepts) return (0); } +DEF_STD(feclearexcept); /* * The fegetexceptflag() function stores an implementation-defined @@ -122,6 +123,7 @@ feraiseexcept(int excepts) return (0); } +DEF_STD(feraiseexcept); /* * This function sets the floating-point status flags indicated by the argument @@ -148,6 +150,7 @@ fesetexceptflag(const fexcept_t *flagp, int excepts) return (0); } +DEF_STD(fesetexceptflag); /* * The fetestexcept() function determines which of a specified subset of the @@ -167,6 +170,7 @@ fetestexcept(int excepts) return ((u.bits[0] >> _MASK_SHIFT) & excepts); } +DEF_STD(fetestexcept); /* * The fegetround() function gets the current rounding direction. @@ -182,6 +186,7 @@ fegetround(void) return (u.bits[0] & _ROUND_MASK); } +DEF_STD(fegetround); /* * The fesetround() function establishes the rounding direction represented by @@ -210,6 +215,7 @@ fesetround(int round) return (0); } +DEF_STD(fesetround); /* * The fegetenv() function attempts to store the current floating-point @@ -228,6 +234,7 @@ fegetenv(fenv_t *envp) return (0); } +DEF_STD(fegetenv); /* * The feholdexcept() function saves the current floating-point environment @@ -255,6 +262,7 @@ feholdexcept(fenv_t *envp) return (0); } +DEF_STD(feholdexcept); /* * The fesetenv() function attempts to establish the floating-point environment @@ -284,6 +292,7 @@ fesetenv(const fenv_t *envp) return (0); } +DEF_STD(fesetenv); /* * The feupdateenv() function saves the currently raised floating-point @@ -310,6 +319,7 @@ feupdateenv(const fenv_t *envp) return (0); } +DEF_STD(feupdateenv); /* * The following functions are extentions to the standard diff --git a/lib/libm/arch/hppa/s_ceil.c b/lib/libm/arch/hppa/s_ceil.c index 0c6ee3076d3..7844ccf1533 100644 --- a/lib/libm/arch/hppa/s_ceil.c +++ b/lib/libm/arch/hppa/s_ceil.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_ceil.c,v 1.9 2015/01/20 04:41:01 krw Exp $ */ +/* $OpenBSD: s_ceil.c,v 1.10 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by Michael Shalayeff. Public Domain */ @@ -22,5 +22,5 @@ ceil(double x) __asm__ volatile("fldds 0(%0), %%fr0" :: "r" (&ofpsr) : "memory"); return (x); } - -__strong_alias(ceill, ceil); +DEF_STD(ceil); +LDBL_UNUSED_CLONE(ceil); diff --git a/lib/libm/arch/hppa/s_ceilf.c b/lib/libm/arch/hppa/s_ceilf.c index f09ab33ba91..516b8af61b9 100644 --- a/lib/libm/arch/hppa/s_ceilf.c +++ b/lib/libm/arch/hppa/s_ceilf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_ceilf.c,v 1.7 2015/01/20 04:41:01 krw Exp $ */ +/* $OpenBSD: s_ceilf.c,v 1.8 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by Michael Shalayeff. Public Domain */ @@ -22,3 +22,4 @@ ceilf(float x) __asm__ volatile("fldds 0(%0), %%fr0" :: "r" (&ofpsr) : "memory"); return (x); } +DEF_STD(ceilf); diff --git a/lib/libm/arch/hppa/s_floor.c b/lib/libm/arch/hppa/s_floor.c index a0b92a17720..f925b896157 100644 --- a/lib/libm/arch/hppa/s_floor.c +++ b/lib/libm/arch/hppa/s_floor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_floor.c,v 1.11 2015/01/20 04:41:01 krw Exp $ */ +/* $OpenBSD: s_floor.c,v 1.12 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by Michael Shalayeff. Public Domain */ @@ -21,5 +21,5 @@ floor(double x) __asm__ volatile("fldds 0(%0), %%fr0" :: "r" (&ofpsr) : "memory"); return (x); } - -__strong_alias(floorl, floor); +DEF_STD(floor); +LDBL_CLONE(floor); diff --git a/lib/libm/arch/hppa/s_floorf.c b/lib/libm/arch/hppa/s_floorf.c index adea9ecd553..533f7361b8c 100644 --- a/lib/libm/arch/hppa/s_floorf.c +++ b/lib/libm/arch/hppa/s_floorf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_floorf.c,v 1.9 2015/01/20 04:41:01 krw Exp $ */ +/* $OpenBSD: s_floorf.c,v 1.10 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by Michael Shalayeff. Public Domain */ @@ -21,3 +21,4 @@ floorf(float x) __asm__ volatile("fldds 0(%0), %%fr0" :: "r" (&ofpsr) : "memory"); return (x); } +DEF_STD(floorf); diff --git a/lib/libm/arch/hppa/s_rint.c b/lib/libm/arch/hppa/s_rint.c index d1c41416f51..cbc56cc4881 100644 --- a/lib/libm/arch/hppa/s_rint.c +++ b/lib/libm/arch/hppa/s_rint.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_rint.c,v 1.11 2015/01/20 04:41:01 krw Exp $ */ +/* $OpenBSD: s_rint.c,v 1.12 2016/09/12 19:47:01 guenther Exp $ */ /* * Written by Michael Shalayeff. Public Domain */ @@ -13,5 +13,5 @@ rint(double x) return (x); } - -__strong_alias(rintl, rint); +DEF_STD(rint); +LDBL_CLONE(rint); diff --git a/lib/libm/arch/hppa/s_rintf.c b/lib/libm/arch/hppa/s_rintf.c index 773c8921f5b..ffb02ea6c17 100644 --- a/lib/libm/arch/hppa/s_rintf.c +++ b/lib/libm/arch/hppa/s_rintf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_rintf.c,v 1.5 2015/01/20 04:41:01 krw Exp $ */ +/* $OpenBSD: s_rintf.c,v 1.6 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by Michael Shalayeff. Public Domain */ @@ -12,3 +12,4 @@ rintf(float x) return (x); } +DEF_STD(rintf); diff --git a/lib/libm/arch/hppa/s_round.c b/lib/libm/arch/hppa/s_round.c index 07a3bf34053..f634781b660 100644 --- a/lib/libm/arch/hppa/s_round.c +++ b/lib/libm/arch/hppa/s_round.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_round.c,v 1.7 2015/01/20 04:41:01 krw Exp $ */ +/* $OpenBSD: s_round.c,v 1.8 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by Michael Shalayeff. Public Domain */ @@ -22,5 +22,5 @@ round(double x) __asm__ volatile("fldds 0(%0), %%fr0" :: "r" (&ofpsr) : "memory"); return (x); } - -__strong_alias(roundl, round); +DEF_STD(round); +LDBL_CLONE(round); diff --git a/lib/libm/arch/hppa/s_trunc.c b/lib/libm/arch/hppa/s_trunc.c index bb702dbbb1c..7c4dcd4348b 100644 --- a/lib/libm/arch/hppa/s_trunc.c +++ b/lib/libm/arch/hppa/s_trunc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_trunc.c,v 1.7 2015/01/20 04:41:01 krw Exp $ */ +/* $OpenBSD: s_trunc.c,v 1.8 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by Michael Shalayeff. Public Domain */ @@ -22,5 +22,5 @@ trunc(double x) __asm__ volatile("fldds 0(%0), %%fr0" :: "r" (&ofpsr) : "memory"); return (x); } - -__strong_alias(truncl, trunc); +DEF_STD(trunc); +LDBL_UNUSED_CLONE(trunc); diff --git a/lib/libm/arch/i387/DEFS.h b/lib/libm/arch/i387/DEFS.h new file mode 100644 index 00000000000..b892612254a --- /dev/null +++ b/lib/libm/arch/i387/DEFS.h @@ -0,0 +1,29 @@ +/* $OpenBSD: DEFS.h,v 1.1 2016/09/12 19:47:02 guenther Exp $ */ + +/* + * Written by Philip Guenther <guenther@openbsd.org> + */ + +#include <machine/asm.h> + +/* + * We define a hidden alias with the prefix "_libm_" for each global symbol + * that may be used internally. By referencing _libm_x instead of x, other + * parts of libm prevent overriding by the application and avoid unnecessary + * relocations. + */ +#define _HIDDEN(x) _libm_##x +#define _HIDDEN_ALIAS(x,y) \ + STRONG_ALIAS(_HIDDEN(x),y); \ + .hidden _HIDDEN(x) +#define _HIDDEN_FALIAS(x,y) \ + _HIDDEN_ALIAS(x,y); \ + .type _HIDDEN(x),@function + +/* + * For functions implemented in ASM that are used internally + * END_STD(x) Like DEF_STD() in C; for standard/reserved C names + * END_NONSTD(x) Like DEF_NONSTD() in C; for non-ISO C names + */ +#define END_STD(x) END(x); _HIDDEN_FALIAS(x,x); END(_HIDDEN(x)) +#define END_NONSTD(x) END_STD(x); .weak x diff --git a/lib/libm/arch/i387/e_acos.S b/lib/libm/arch/i387/e_acos.S index d85aaad3e26..2492b065897 100644 --- a/lib/libm/arch/i387/e_acos.S +++ b/lib/libm/arch/i387/e_acos.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_acos.S,v 1.3 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_acos.S,v 1.4 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. @@ -17,3 +17,4 @@ ENTRY(acos) fxch %st(1) fpatan ret +END(acos) diff --git a/lib/libm/arch/i387/e_asin.S b/lib/libm/arch/i387/e_asin.S index bb3d0f95bfa..23200acd63e 100644 --- a/lib/libm/arch/i387/e_asin.S +++ b/lib/libm/arch/i387/e_asin.S @@ -1,10 +1,10 @@ -/* $OpenBSD: e_asin.S,v 1.3 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_asin.S,v 1.4 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. */ -#include <machine/asm.h> +#include "DEFS.h" /* asin = atan (x / sqrt(1 - x^2)) */ ENTRY(asin) @@ -16,3 +16,4 @@ ENTRY(asin) fsqrt /* sqrt (1 - x^2) */ fpatan ret +END_STD(asin) diff --git a/lib/libm/arch/i387/e_atan2.S b/lib/libm/arch/i387/e_atan2.S index 9057bd97eea..a93162fa1cf 100644 --- a/lib/libm/arch/i387/e_atan2.S +++ b/lib/libm/arch/i387/e_atan2.S @@ -1,13 +1,14 @@ -/* $OpenBSD: e_atan2.S,v 1.3 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_atan2.S,v 1.4 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. */ -#include <machine/asm.h> +#include "DEFS.h" ENTRY(atan2) fldl 4(%esp) fldl 12(%esp) fpatan ret +END_STD(atan2) diff --git a/lib/libm/arch/i387/e_atan2f.S b/lib/libm/arch/i387/e_atan2f.S index 734d101c977..962952d7274 100644 --- a/lib/libm/arch/i387/e_atan2f.S +++ b/lib/libm/arch/i387/e_atan2f.S @@ -1,13 +1,14 @@ -/* $OpenBSD: e_atan2f.S,v 1.3 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_atan2f.S,v 1.4 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. */ -#include <machine/asm.h> +#include "DEFS.h" ENTRY(atan2f) flds 4(%esp) flds 8(%esp) fpatan ret +END_STD(atan2f) diff --git a/lib/libm/arch/i387/e_exp.S b/lib/libm/arch/i387/e_exp.S index 2d085df48d9..d747010de8c 100644 --- a/lib/libm/arch/i387/e_exp.S +++ b/lib/libm/arch/i387/e_exp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_exp.S,v 1.8 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_exp.S,v 1.9 2016/09/12 19:47:02 guenther Exp $ */ /* $NetBSD: e_exp.S,v 1.12 2002/02/27 16:32:46 christos Exp $ */ /* @@ -36,7 +36,7 @@ * J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc. */ -#include <machine/asm.h> +#include "DEFS.h" /* e^x = 2^(x * log2(e)) */ ENTRY(exp) @@ -95,3 +95,4 @@ x_Inf_or_NaN: x_not_minus_Inf: fldl 4(%esp) ret +END_STD(exp) diff --git a/lib/libm/arch/i387/e_fmod.S b/lib/libm/arch/i387/e_fmod.S index daa1dfa34a7..e8ba4fd8f31 100644 --- a/lib/libm/arch/i387/e_fmod.S +++ b/lib/libm/arch/i387/e_fmod.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_fmod.S,v 1.4 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_fmod.S,v 1.5 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. @@ -15,3 +15,4 @@ ENTRY(fmod) jp 1b fstp %st(1) ret +END(fmod) diff --git a/lib/libm/arch/i387/e_log.S b/lib/libm/arch/i387/e_log.S index 54e9423f03c..2f42d285c63 100644 --- a/lib/libm/arch/i387/e_log.S +++ b/lib/libm/arch/i387/e_log.S @@ -1,13 +1,14 @@ -/* $OpenBSD: e_log.S,v 1.3 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_log.S,v 1.4 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. */ -#include <machine/asm.h> +#include "DEFS.h" ENTRY(log) fldln2 fldl 4(%esp) fyl2x ret +END_STD(log) diff --git a/lib/libm/arch/i387/e_log10.S b/lib/libm/arch/i387/e_log10.S index 4045a56ee6a..d84941572a4 100644 --- a/lib/libm/arch/i387/e_log10.S +++ b/lib/libm/arch/i387/e_log10.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_log10.S,v 1.3 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_log10.S,v 1.4 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. @@ -11,3 +11,4 @@ ENTRY(log10) fldl 4(%esp) fyl2x ret +END(log10) diff --git a/lib/libm/arch/i387/e_remainder.S b/lib/libm/arch/i387/e_remainder.S index a9f31df1b17..cfb397ffd52 100644 --- a/lib/libm/arch/i387/e_remainder.S +++ b/lib/libm/arch/i387/e_remainder.S @@ -1,10 +1,10 @@ -/* $OpenBSD: e_remainder.S,v 1.4 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_remainder.S,v 1.5 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. */ -#include <machine/asm.h> +#include "DEFS.h" ENTRY(remainder) fldl 12(%esp) @@ -15,3 +15,4 @@ ENTRY(remainder) jp 1b fstp %st(1) ret +END_STD(remainder) diff --git a/lib/libm/arch/i387/e_remainderf.S b/lib/libm/arch/i387/e_remainderf.S index dc92ee23dfd..5e1d5393c37 100644 --- a/lib/libm/arch/i387/e_remainderf.S +++ b/lib/libm/arch/i387/e_remainderf.S @@ -1,10 +1,10 @@ -/* $OpenBSD: e_remainderf.S,v 1.4 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_remainderf.S,v 1.5 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. */ -#include <machine/asm.h> +#include "DEFS.h" ENTRY(remainderf) flds 8(%esp) @@ -15,3 +15,4 @@ ENTRY(remainderf) jp 1b fstp %st(1) ret +END_STD(remainderf) diff --git a/lib/libm/arch/i387/e_scalb.S b/lib/libm/arch/i387/e_scalb.S index b515d76e713..e020fcf58b3 100644 --- a/lib/libm/arch/i387/e_scalb.S +++ b/lib/libm/arch/i387/e_scalb.S @@ -1,10 +1,10 @@ -/* $OpenBSD: e_scalb.S,v 1.4 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_scalb.S,v 1.5 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. */ -#include <machine/asm.h> +#include "DEFS.h" ENTRY(scalb) fldl 12(%esp) @@ -12,3 +12,4 @@ ENTRY(scalb) fscale fstp %st(1) /* bug fix for fp stack overflow */ ret +END_NONSTD(scalb) diff --git a/lib/libm/arch/i387/e_sqrt.S b/lib/libm/arch/i387/e_sqrt.S index 9e9e5854679..a0dee4c96e8 100644 --- a/lib/libm/arch/i387/e_sqrt.S +++ b/lib/libm/arch/i387/e_sqrt.S @@ -1,12 +1,13 @@ -/* $OpenBSD: e_sqrt.S,v 1.3 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_sqrt.S,v 1.4 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. */ -#include <machine/asm.h> +#include "DEFS.h" ENTRY(sqrt) fldl 4(%esp) fsqrt ret +END_STD(sqrt) diff --git a/lib/libm/arch/i387/e_sqrtf.S b/lib/libm/arch/i387/e_sqrtf.S index f6e30ef258f..e4fd3dc9440 100644 --- a/lib/libm/arch/i387/e_sqrtf.S +++ b/lib/libm/arch/i387/e_sqrtf.S @@ -1,12 +1,13 @@ -/* $OpenBSD: e_sqrtf.S,v 1.3 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_sqrtf.S,v 1.4 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. */ -#include <machine/asm.h> +#include "DEFS.h" ENTRY(sqrtf) flds 4(%esp) fsqrt ret +END_STD(sqrtf) diff --git a/lib/libm/arch/i387/e_sqrtl.S b/lib/libm/arch/i387/e_sqrtl.S index d18d25f6dd6..73a18c5180e 100644 --- a/lib/libm/arch/i387/e_sqrtl.S +++ b/lib/libm/arch/i387/e_sqrtl.S @@ -1,12 +1,13 @@ -/* $OpenBSD: e_sqrtl.S,v 1.1 2009/11/05 20:14:32 kettenis Exp $ */ +/* $OpenBSD: e_sqrtl.S,v 1.2 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. */ -#include <machine/asm.h> +#include "DEFS.h" ENTRY(sqrtl) fldt 4(%esp) fsqrt ret +END_STD(sqrtl) diff --git a/lib/libm/arch/i387/fenv.c b/lib/libm/arch/i387/fenv.c index 7e5e5e38383..eac830d5117 100644 --- a/lib/libm/arch/i387/fenv.c +++ b/lib/libm/arch/i387/fenv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fenv.c,v 1.4 2014/04/18 15:09:52 guenther Exp $ */ +/* $OpenBSD: fenv.c,v 1.5 2016/09/12 19:47:02 guenther Exp $ */ /* $NetBSD: fenv.c,v 1.3 2010/08/01 06:34:38 taca Exp $ */ /*- @@ -117,6 +117,7 @@ feclearexcept(int excepts) return (0); } +DEF_STD(feclearexcept); /* * The fegetexceptflag() function stores an implementation-defined @@ -164,6 +165,7 @@ feraiseexcept(int excepts) return (0); } +DEF_STD(feraiseexcept); /* * This function sets the floating-point status flags indicated by the argument @@ -198,6 +200,7 @@ fesetexceptflag(const fexcept_t *flagp, int excepts) return (0); } +DEF_STD(fesetexceptflag); /* * The fetestexcept() function determines which of a specified subset of the @@ -221,6 +224,7 @@ fetestexcept(int excepts) return ((status | mxcsr) & excepts); } +DEF_STD(fetestexcept); /* * The fegetround() function gets the current rounding direction. @@ -240,6 +244,7 @@ fegetround(void) return (control & _X87_ROUND_MASK); } +DEF_STD(fegetround); /* * The fesetround() function establishes the rounding direction represented by @@ -276,6 +281,7 @@ fesetround(int round) return (0); } +DEF_STD(fesetround); /* * The fegetenv() function attempts to store the current floating-point @@ -303,6 +309,7 @@ fegetenv(fenv_t *envp) return (0); } +DEF_STD(fegetenv); /* * The feholdexcept() function saves the current floating-point environment @@ -338,6 +345,7 @@ feholdexcept(fenv_t *envp) return (0); } +DEF_STD(feholdexcept); /* * The fesetenv() function attempts to establish the floating-point environment @@ -359,6 +367,7 @@ fesetenv(const fenv_t *envp) return (0); } +DEF_STD(fesetenv); /* * The feupdateenv() function saves the currently raised floating-point @@ -389,6 +398,7 @@ feupdateenv(const fenv_t *envp) return (0); } +DEF_STD(feupdateenv); /* * The following functions are extentions to the standard diff --git a/lib/libm/arch/i387/s_atan.S b/lib/libm/arch/i387/s_atan.S index 610f21683be..fdf3f8a15b8 100644 --- a/lib/libm/arch/i387/s_atan.S +++ b/lib/libm/arch/i387/s_atan.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_atan.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_atan.S,v 1.3 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. @@ -11,3 +11,4 @@ ENTRY(atan) fld1 fpatan ret +END(atan) diff --git a/lib/libm/arch/i387/s_atanf.S b/lib/libm/arch/i387/s_atanf.S index f4c9212cf1b..d63c3705520 100644 --- a/lib/libm/arch/i387/s_atanf.S +++ b/lib/libm/arch/i387/s_atanf.S @@ -1,13 +1,14 @@ -/* $OpenBSD: s_atanf.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_atanf.S,v 1.3 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. */ -#include <machine/asm.h> +#include "DEFS.h" ENTRY(atanf) flds 4(%esp) fld1 fpatan ret +END_STD(atanf) diff --git a/lib/libm/arch/i387/s_ceil.S b/lib/libm/arch/i387/s_ceil.S index 52aa9224f19..235ddd5673b 100644 --- a/lib/libm/arch/i387/s_ceil.S +++ b/lib/libm/arch/i387/s_ceil.S @@ -1,10 +1,10 @@ -/* $OpenBSD: s_ceil.S,v 1.3 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_ceil.S,v 1.4 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. */ -#include <machine/asm.h> +#include "DEFS.h" ENTRY(ceil) subl $8,%esp @@ -23,3 +23,4 @@ ENTRY(ceil) addl $8,%esp ret +END_STD(ceil) diff --git a/lib/libm/arch/i387/s_ceilf.S b/lib/libm/arch/i387/s_ceilf.S index a8018f97146..7e19af6adb0 100644 --- a/lib/libm/arch/i387/s_ceilf.S +++ b/lib/libm/arch/i387/s_ceilf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_ceilf.S,v 1.3 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_ceilf.S,v 1.4 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. @@ -23,3 +23,4 @@ ENTRY(ceilf) addl $8,%esp ret +END(ceilf) diff --git a/lib/libm/arch/i387/s_copysign.S b/lib/libm/arch/i387/s_copysign.S index eeb1627626f..91f027c1646 100644 --- a/lib/libm/arch/i387/s_copysign.S +++ b/lib/libm/arch/i387/s_copysign.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_copysign.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_copysign.S,v 1.3 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. @@ -15,3 +15,4 @@ ENTRY(copysign) movl %eax,8(%esp) fldl 4(%esp) ret +END(copysign) diff --git a/lib/libm/arch/i387/s_copysignf.S b/lib/libm/arch/i387/s_copysignf.S index ecd2dfa1137..c9d2186274e 100644 --- a/lib/libm/arch/i387/s_copysignf.S +++ b/lib/libm/arch/i387/s_copysignf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_copysignf.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_copysignf.S,v 1.3 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. @@ -15,3 +15,4 @@ ENTRY(copysignf) movl %eax,4(%esp) flds 4(%esp) ret +END(copysignf) diff --git a/lib/libm/arch/i387/s_cos.S b/lib/libm/arch/i387/s_cos.S index a336e43cd78..cd22d5d2770 100644 --- a/lib/libm/arch/i387/s_cos.S +++ b/lib/libm/arch/i387/s_cos.S @@ -1,10 +1,10 @@ -/* $OpenBSD: s_cos.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_cos.S,v 1.3 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. */ -#include <machine/asm.h> +#include "DEFS.h" ENTRY(cos) fldl 4(%esp) @@ -23,3 +23,4 @@ ENTRY(cos) fstp %st(1) fcos ret +END_STD(cos) diff --git a/lib/libm/arch/i387/s_cosf.S b/lib/libm/arch/i387/s_cosf.S index 29ed8b4637f..e68621965a2 100644 --- a/lib/libm/arch/i387/s_cosf.S +++ b/lib/libm/arch/i387/s_cosf.S @@ -1,13 +1,14 @@ -/* $OpenBSD: s_cosf.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_cosf.S,v 1.3 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. */ -#include <machine/asm.h> +#include "DEFS.h" /* A float's domain isn't large enough to require argument reduction. */ ENTRY(cosf) flds 4(%esp) fcos ret +END_STD(cosf) diff --git a/lib/libm/arch/i387/s_floor.S b/lib/libm/arch/i387/s_floor.S index df6158fa433..40453132178 100644 --- a/lib/libm/arch/i387/s_floor.S +++ b/lib/libm/arch/i387/s_floor.S @@ -1,10 +1,10 @@ -/* $OpenBSD: s_floor.S,v 1.3 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_floor.S,v 1.4 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. */ -#include <machine/asm.h> +#include "DEFS.h" ENTRY(floor) subl $8,%esp @@ -23,3 +23,4 @@ ENTRY(floor) addl $8,%esp ret +END_STD(floor) diff --git a/lib/libm/arch/i387/s_floorf.S b/lib/libm/arch/i387/s_floorf.S index 73715860356..ee02d2be4e7 100644 --- a/lib/libm/arch/i387/s_floorf.S +++ b/lib/libm/arch/i387/s_floorf.S @@ -1,10 +1,10 @@ -/* $OpenBSD: s_floorf.S,v 1.3 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_floorf.S,v 1.4 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. */ -#include <machine/asm.h> +#include "DEFS.h" ENTRY(floorf) subl $8,%esp @@ -23,3 +23,4 @@ ENTRY(floorf) addl $8,%esp ret +END_STD(floorf) diff --git a/lib/libm/arch/i387/s_ilogb.S b/lib/libm/arch/i387/s_ilogb.S index 3a2368d1dbc..7400ebc2b84 100644 --- a/lib/libm/arch/i387/s_ilogb.S +++ b/lib/libm/arch/i387/s_ilogb.S @@ -1,10 +1,10 @@ -/* $OpenBSD: s_ilogb.S,v 1.5 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_ilogb.S,v 1.6 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. */ -#include <machine/asm.h> +#include "DEFS.h" ENTRY(ilogb) pushl %ebp @@ -20,3 +20,4 @@ ENTRY(ilogb) leave ret +END_STD(ilogb) diff --git a/lib/libm/arch/i387/s_ilogbf.S b/lib/libm/arch/i387/s_ilogbf.S index 68a00b079a6..c7fd4606ad6 100644 --- a/lib/libm/arch/i387/s_ilogbf.S +++ b/lib/libm/arch/i387/s_ilogbf.S @@ -1,10 +1,10 @@ -/* $OpenBSD: s_ilogbf.S,v 1.5 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_ilogbf.S,v 1.6 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. */ -#include <machine/asm.h> +#include "DEFS.h" ENTRY(ilogbf) pushl %ebp @@ -20,3 +20,4 @@ ENTRY(ilogbf) leave ret +END_STD(ilogbf) diff --git a/lib/libm/arch/i387/s_llrint.S b/lib/libm/arch/i387/s_llrint.S index 6a801834b0c..0e754830303 100644 --- a/lib/libm/arch/i387/s_llrint.S +++ b/lib/libm/arch/i387/s_llrint.S @@ -33,3 +33,4 @@ ENTRY(llrint) popl %eax popl %edx ret +END(llrint) diff --git a/lib/libm/arch/i387/s_llrintf.S b/lib/libm/arch/i387/s_llrintf.S index 7d3e9500150..4c21839e332 100644 --- a/lib/libm/arch/i387/s_llrintf.S +++ b/lib/libm/arch/i387/s_llrintf.S @@ -24,7 +24,7 @@ * SUCH DAMAGE. */ -#include <machine/asm.h> +#include "DEFS.h" ENTRY(llrintf) flds 4(%esp) @@ -33,3 +33,4 @@ ENTRY(llrintf) popl %eax popl %edx ret +END_STD(llrintf) diff --git a/lib/libm/arch/i387/s_log1p.S b/lib/libm/arch/i387/s_log1p.S index 78c3bb69eb9..e8467b1127f 100644 --- a/lib/libm/arch/i387/s_log1p.S +++ b/lib/libm/arch/i387/s_log1p.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_log1p.S,v 1.4 2009/04/08 23:31:34 martynas Exp $ */ +/* $OpenBSD: s_log1p.S,v 1.5 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -9,7 +9,7 @@ * Still public domain. */ -#include <machine/asm.h> +#include "DEFS.h" /* * The log1p() function is provided to compute an accurate value of @@ -66,3 +66,4 @@ use_fyl2xp1: fldl 4(%esp) fyl2xp1 ret +END_STD(log1p) diff --git a/lib/libm/arch/i387/s_log1pf.S b/lib/libm/arch/i387/s_log1pf.S index 67662ab37bb..3f6ac2942d8 100644 --- a/lib/libm/arch/i387/s_log1pf.S +++ b/lib/libm/arch/i387/s_log1pf.S @@ -1,10 +1,10 @@ -/* $OpenBSD: s_log1pf.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_log1pf.S,v 1.3 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. */ -#include <machine/asm.h> +#include "DEFS.h" /* * Since the fyl2xp1 instruction has such a limited range: @@ -19,3 +19,4 @@ ENTRY(log1pf) faddp fyl2x ret +END_STD(log1pf) diff --git a/lib/libm/arch/i387/s_logb.S b/lib/libm/arch/i387/s_logb.S index 71bd7dab3f6..9edd26bc91d 100644 --- a/lib/libm/arch/i387/s_logb.S +++ b/lib/libm/arch/i387/s_logb.S @@ -1,13 +1,14 @@ -/* $OpenBSD: s_logb.S,v 1.3 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_logb.S,v 1.4 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. */ -#include <machine/asm.h> +#include "DEFS.h" ENTRY(logb) fldl 4(%esp) fxtract fstp %st ret +END_STD(logb) diff --git a/lib/libm/arch/i387/s_logbf.S b/lib/libm/arch/i387/s_logbf.S index cec270329ec..b83e4744e15 100644 --- a/lib/libm/arch/i387/s_logbf.S +++ b/lib/libm/arch/i387/s_logbf.S @@ -1,13 +1,14 @@ -/* $OpenBSD: s_logbf.S,v 1.3 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_logbf.S,v 1.4 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. */ -#include <machine/asm.h> +#include "DEFS.h" ENTRY(logbf) flds 4(%esp) fxtract fstp %st ret +END_STD(logbf) diff --git a/lib/libm/arch/i387/s_lrint.S b/lib/libm/arch/i387/s_lrint.S index fb43e6b57fb..848f6d2cbb1 100644 --- a/lib/libm/arch/i387/s_lrint.S +++ b/lib/libm/arch/i387/s_lrint.S @@ -32,3 +32,4 @@ ENTRY(lrint) fistpl (%esp) popl %eax ret +END(lrint) diff --git a/lib/libm/arch/i387/s_lrintf.S b/lib/libm/arch/i387/s_lrintf.S index 07e1ff4d2af..329bb3c61d9 100644 --- a/lib/libm/arch/i387/s_lrintf.S +++ b/lib/libm/arch/i387/s_lrintf.S @@ -32,3 +32,4 @@ ENTRY(lrintf) fistpl (%esp) popl %eax ret +END(lrintf) diff --git a/lib/libm/arch/i387/s_rint.S b/lib/libm/arch/i387/s_rint.S index 6a17267f944..a5606325fa3 100644 --- a/lib/libm/arch/i387/s_rint.S +++ b/lib/libm/arch/i387/s_rint.S @@ -1,12 +1,13 @@ -/* $OpenBSD: s_rint.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_rint.S,v 1.3 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. */ -#include <machine/asm.h> +#include "DEFS.h" ENTRY(rint) fldl 4(%esp) frndint ret +END_STD(rint) diff --git a/lib/libm/arch/i387/s_rintf.S b/lib/libm/arch/i387/s_rintf.S index 56d1c852431..f6439fd4860 100644 --- a/lib/libm/arch/i387/s_rintf.S +++ b/lib/libm/arch/i387/s_rintf.S @@ -1,12 +1,13 @@ -/* $OpenBSD: s_rintf.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_rintf.S,v 1.3 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. */ -#include <machine/asm.h> +#include "DEFS.h" ENTRY(rintf) flds 4(%esp) frndint ret +END_STD(rintf) diff --git a/lib/libm/arch/i387/s_scalbnf.S b/lib/libm/arch/i387/s_scalbnf.S index fe602460956..01191a5f770 100644 --- a/lib/libm/arch/i387/s_scalbnf.S +++ b/lib/libm/arch/i387/s_scalbnf.S @@ -1,10 +1,10 @@ -/* $OpenBSD: s_scalbnf.S,v 1.4 2009/04/21 23:02:23 martynas Exp $ */ +/* $OpenBSD: s_scalbnf.S,v 1.5 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. */ -#include <machine/asm.h> +#include "DEFS.h" .global ldexpf ldexpf = scalbnf @@ -15,3 +15,4 @@ ENTRY(scalbnf) fscale fstp %st(1) /* bug fix for fp stack overflow */ ret +END_STD(scalbnf) diff --git a/lib/libm/arch/i387/s_significand.S b/lib/libm/arch/i387/s_significand.S index a4246a7912f..c24291ff421 100644 --- a/lib/libm/arch/i387/s_significand.S +++ b/lib/libm/arch/i387/s_significand.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_significand.S,v 1.3 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_significand.S,v 1.4 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. @@ -11,3 +11,4 @@ ENTRY(significand) fxtract fstp %st(1) ret +END(significand) diff --git a/lib/libm/arch/i387/s_significandf.S b/lib/libm/arch/i387/s_significandf.S index 6159621322b..dd851075670 100644 --- a/lib/libm/arch/i387/s_significandf.S +++ b/lib/libm/arch/i387/s_significandf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_significandf.S,v 1.3 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_significandf.S,v 1.4 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. @@ -11,3 +11,4 @@ ENTRY(significandf) fxtract fstp %st(1) ret +END(significandf) diff --git a/lib/libm/arch/i387/s_sin.S b/lib/libm/arch/i387/s_sin.S index 82956f653a5..f0f7cc3c219 100644 --- a/lib/libm/arch/i387/s_sin.S +++ b/lib/libm/arch/i387/s_sin.S @@ -1,10 +1,10 @@ -/* $OpenBSD: s_sin.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_sin.S,v 1.3 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. */ -#include <machine/asm.h> +#include "DEFS.h" ENTRY(sin) fldl 4(%esp) @@ -23,3 +23,4 @@ ENTRY(sin) fstp %st(1) fsin ret +END_STD(sin) diff --git a/lib/libm/arch/i387/s_sinf.S b/lib/libm/arch/i387/s_sinf.S index 61a2e936659..8f4641aa9d7 100644 --- a/lib/libm/arch/i387/s_sinf.S +++ b/lib/libm/arch/i387/s_sinf.S @@ -1,13 +1,14 @@ -/* $OpenBSD: s_sinf.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_sinf.S,v 1.3 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. */ -#include <machine/asm.h> +#include "DEFS.h" /* A float's domain isn't large enough to require argument reduction. */ ENTRY(sinf) flds 4(%esp) fsin ret +END_STD(sinf) diff --git a/lib/libm/arch/i387/s_tan.S b/lib/libm/arch/i387/s_tan.S index d3f683777fa..eaa2a92d6d4 100644 --- a/lib/libm/arch/i387/s_tan.S +++ b/lib/libm/arch/i387/s_tan.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_tan.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_tan.S,v 1.3 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. @@ -25,3 +25,4 @@ ENTRY(tan) fptan fstp %st(0) ret +END(tan) diff --git a/lib/libm/arch/i387/s_tanf.S b/lib/libm/arch/i387/s_tanf.S index 0ee490c14e7..bad716c4809 100644 --- a/lib/libm/arch/i387/s_tanf.S +++ b/lib/libm/arch/i387/s_tanf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_tanf.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_tanf.S,v 1.3 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. @@ -12,3 +12,4 @@ ENTRY(tanf) fptan fstp %st(0) ret +END(tanf) diff --git a/lib/libm/arch/m88k/fenv.c b/lib/libm/arch/m88k/fenv.c index 814f9def17b..0b1a93c7a66 100644 --- a/lib/libm/arch/m88k/fenv.c +++ b/lib/libm/arch/m88k/fenv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fenv.c,v 1.6 2014/04/18 15:09:52 guenther Exp $ */ +/* $OpenBSD: fenv.c,v 1.7 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2011 Martynas Venckus <martynas@openbsd.org> @@ -54,6 +54,7 @@ feclearexcept(int excepts) return (0); } +DEF_STD(feclearexcept); /* * The fegetexceptflag() function stores an implementation-defined @@ -116,6 +117,7 @@ feraiseexcept(int excepts) } return (0); } +DEF_STD(feraiseexcept); /* * This function sets the floating-point status flags indicated by the argument @@ -141,6 +143,7 @@ fesetexceptflag(const fexcept_t *flagp, int excepts) return (0); } +DEF_STD(fesetexceptflag); /* * The fetestexcept() function determines which of a specified subset of the @@ -159,6 +162,7 @@ fetestexcept(int excepts) return (fpsr & excepts); } +DEF_STD(fetestexcept); /* * The fegetround() function gets the current rounding direction. @@ -173,6 +177,7 @@ fegetround(void) return (fpcr & _ROUND_MASK); } +DEF_STD(fegetround); /* * The fesetround() function establishes the rounding direction represented by @@ -200,6 +205,7 @@ fesetround(int round) return (0); } +DEF_STD(fesetround); /* * The fegetenv() function attempts to store the current floating-point @@ -214,6 +220,7 @@ fegetenv(fenv_t *envp) return (0); } +DEF_STD(fegetenv); /* * The feholdexcept() function saves the current floating-point environment @@ -242,6 +249,7 @@ feholdexcept(fenv_t *envp) return (0); } +DEF_STD(feholdexcept); /* * The fesetenv() function attempts to establish the floating-point environment @@ -274,6 +282,7 @@ fesetenv(const fenv_t *envp) return (0); } +DEF_STD(fesetenv); /* * The feupdateenv() function saves the currently raised floating-point @@ -299,6 +308,7 @@ feupdateenv(const fenv_t *envp) return (0); } +DEF_STD(feupdateenv); /* * The following functions are extentions to the standard diff --git a/lib/libm/arch/mips64/fenv.c b/lib/libm/arch/mips64/fenv.c index 5611ef38b84..c2480b30e72 100644 --- a/lib/libm/arch/mips64/fenv.c +++ b/lib/libm/arch/mips64/fenv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fenv.c,v 1.4 2014/04/18 15:09:52 guenther Exp $ */ +/* $OpenBSD: fenv.c,v 1.5 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2011 Martynas Venckus <martynas@openbsd.org> @@ -51,6 +51,7 @@ feclearexcept(int excepts) return (0); } +DEF_STD(feclearexcept); /* * The fegetexceptflag() function stores an implementation-defined @@ -94,6 +95,7 @@ feraiseexcept(int excepts) return (0); } +DEF_STD(feraiseexcept); /* * This function sets the floating-point status flags indicated by the argument @@ -119,6 +121,7 @@ fesetexceptflag(const fexcept_t *flagp, int excepts) return (0); } +DEF_STD(fesetexceptflag); /* * The fetestexcept() function determines which of a specified subset of the @@ -137,6 +140,7 @@ fetestexcept(int excepts) return (fcsr & excepts); } +DEF_STD(fetestexcept); /* * The fegetround() function gets the current rounding direction. @@ -151,6 +155,7 @@ fegetround(void) return (fcsr & _ROUND_MASK); } +DEF_STD(fegetround); /* * The fesetround() function establishes the rounding direction represented by @@ -178,6 +183,7 @@ fesetround(int round) return (0); } +DEF_STD(fesetround); /* * The fegetenv() function attempts to store the current floating-point @@ -191,6 +197,7 @@ fegetenv(fenv_t *envp) return (0); } +DEF_STD(fegetenv); /* * The feholdexcept() function saves the current floating-point environment @@ -216,6 +223,7 @@ feholdexcept(fenv_t *envp) return (0); } +DEF_STD(feholdexcept); /* * The fesetenv() function attempts to establish the floating-point environment @@ -233,6 +241,7 @@ fesetenv(const fenv_t *envp) return (0); } +DEF_STD(fesetenv); /* * The feupdateenv() function saves the currently raised floating-point @@ -258,6 +267,7 @@ feupdateenv(const fenv_t *envp) return (0); } +DEF_STD(feupdateenv); /* * The following functions are extentions to the standard diff --git a/lib/libm/arch/powerpc/fenv.c b/lib/libm/arch/powerpc/fenv.c index 28e628b47e0..5ebe465b535 100644 --- a/lib/libm/arch/powerpc/fenv.c +++ b/lib/libm/arch/powerpc/fenv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fenv.c,v 1.4 2014/04/18 15:09:52 guenther Exp $ */ +/* $OpenBSD: fenv.c,v 1.5 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2011 Martynas Venckus <martynas@openbsd.org> @@ -57,6 +57,7 @@ feclearexcept(int excepts) return (0); } +DEF_STD(feclearexcept); /* * The fegetexceptflag() function stores an implementation-defined @@ -92,6 +93,7 @@ feraiseexcept(int excepts) return (0); } +DEF_STD(feraiseexcept); /* * This function sets the floating-point status flags indicated by the argument @@ -123,6 +125,7 @@ fesetexceptflag(const fexcept_t *flagp, int excepts) return (0); } +DEF_STD(fesetexceptflag); /* * The fetestexcept() function determines which of a specified subset of the @@ -141,6 +144,7 @@ fetestexcept(int excepts) return (u.bits[1] & excepts); } +DEF_STD(fetestexcept); /* * The fegetround() function gets the current rounding direction. @@ -155,6 +159,7 @@ fegetround(void) return (u.bits[1] & _ROUND_MASK); } +DEF_STD(fegetround); /* * The fesetround() function establishes the rounding direction represented by @@ -182,6 +187,7 @@ fesetround(int round) return (0); } +DEF_STD(fesetround); /* * The fegetenv() function attempts to store the current floating-point @@ -199,6 +205,7 @@ fegetenv(fenv_t *envp) return (0); } +DEF_STD(fegetenv); /* * The feholdexcept() function saves the current floating-point environment @@ -225,6 +232,7 @@ feholdexcept(fenv_t *envp) return (0); } +DEF_STD(feholdexcept); /* * The fesetenv() function attempts to establish the floating-point environment @@ -247,6 +255,7 @@ fesetenv(const fenv_t *envp) return (0); } +DEF_STD(fesetenv); /* * The feupdateenv() function saves the currently raised floating-point @@ -272,6 +281,7 @@ feupdateenv(const fenv_t *envp) return (0); } +DEF_STD(feupdateenv); /* * The following functions are extentions to the standard diff --git a/lib/libm/arch/sh/e_sqrt.c b/lib/libm/arch/sh/e_sqrt.c index fdf1515bbe7..4dfba32ce3e 100644 --- a/lib/libm/arch/sh/e_sqrt.c +++ b/lib/libm/arch/sh/e_sqrt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_sqrt.c,v 1.6 2014/04/18 15:09:52 guenther Exp $ */ +/* $OpenBSD: e_sqrt.c,v 1.7 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by Martynas Venckus. Public domain @@ -31,5 +31,5 @@ sqrt(double d) return (d); } - -__strong_alias(sqrtl,sqrt); +DEF_STD(sqrt); +LDBL_CLONE(sqrt); diff --git a/lib/libm/arch/sh/e_sqrtf.c b/lib/libm/arch/sh/e_sqrtf.c index 8c4db4ef55c..6f7475b3838 100644 --- a/lib/libm/arch/sh/e_sqrtf.c +++ b/lib/libm/arch/sh/e_sqrtf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_sqrtf.c,v 1.2 2014/04/18 15:09:52 guenther Exp $ */ +/* $OpenBSD: e_sqrtf.c,v 1.3 2016/09/12 19:47:02 guenther Exp $ */ /* * Written by Martynas Venckus. Public domain @@ -27,4 +27,4 @@ sqrtf(float f) return (f); } - +DEF_STD(sqrtf); diff --git a/lib/libm/arch/sh/fenv.c b/lib/libm/arch/sh/fenv.c index 1a057dd2be2..9c77c142f92 100644 --- a/lib/libm/arch/sh/fenv.c +++ b/lib/libm/arch/sh/fenv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fenv.c,v 1.4 2014/04/18 15:09:52 guenther Exp $ */ +/* $OpenBSD: fenv.c,v 1.5 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2011 Martynas Venckus <martynas@openbsd.org> @@ -55,6 +55,7 @@ feclearexcept(int excepts) return (0); } +DEF_STD(feclearexcept); /* * The fegetexceptflag() function stores an implementation-defined @@ -118,6 +119,7 @@ feraiseexcept(int excepts) return (0); } +DEF_STD(feraiseexcept); /* * This function sets the floating-point status flags indicated by the argument @@ -148,6 +150,7 @@ fesetexceptflag(const fexcept_t *flagp, int excepts) return (0); } +DEF_STD(fesetexceptflag); /* * The fetestexcept() function determines which of a specified subset of the @@ -166,6 +169,7 @@ fetestexcept(int excepts) return (fpscr & excepts); } +DEF_STD(fetestexcept); /* * The fegetround() function gets the current rounding direction. @@ -180,6 +184,7 @@ fegetround(void) return (fpscr & _ROUND_MASK); } +DEF_STD(fegetround); /* * The fesetround() function establishes the rounding direction represented by @@ -212,6 +217,7 @@ fesetround(int round) return (0); } +DEF_STD(fesetround); /* * The fegetenv() function attempts to store the current floating-point @@ -225,6 +231,7 @@ fegetenv(fenv_t *envp) return (0); } +DEF_STD(fegetenv); /* * The feholdexcept() function saves the current floating-point environment @@ -257,6 +264,7 @@ feholdexcept(fenv_t *envp) return (0); } +DEF_STD(feholdexcept); /* * The fesetenv() function attempts to establish the floating-point environment @@ -294,6 +302,7 @@ fesetenv(const fenv_t *envp) return (0); } +DEF_STD(fesetenv); /* * The feupdateenv() function saves the currently raised floating-point @@ -319,6 +328,7 @@ feupdateenv(const fenv_t *envp) return (0); } +DEF_STD(feupdateenv); /* * The following functions are extentions to the standard diff --git a/lib/libm/arch/sparc64/e_sqrtl.c b/lib/libm/arch/sparc64/e_sqrtl.c index 95a2a4f043f..c1ce0fc633d 100644 --- a/lib/libm/arch/sparc64/e_sqrtl.c +++ b/lib/libm/arch/sparc64/e_sqrtl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_sqrtl.c,v 1.1 2014/09/12 22:07:24 kettenis Exp $ */ +/* $OpenBSD: e_sqrtl.c,v 1.2 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2014 Mark Kettenis * @@ -27,3 +27,4 @@ sqrtl(long double x) _Qp_sqrt(&y, &x); return y; } +DEF_STD(sqrtl); diff --git a/lib/libm/arch/sparc64/fenv.c b/lib/libm/arch/sparc64/fenv.c index 5bc948df81b..61c7063d335 100644 --- a/lib/libm/arch/sparc64/fenv.c +++ b/lib/libm/arch/sparc64/fenv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fenv.c,v 1.5 2014/04/18 15:09:52 guenther Exp $ */ +/* $OpenBSD: fenv.c,v 1.6 2016/09/12 19:47:02 guenther Exp $ */ /* $NetBSD: fenv.c,v 1.1 2011/01/31 00:19:33 christos Exp $ */ /*- @@ -59,6 +59,7 @@ feclearexcept(int excepts) return 0; } +DEF_STD(feclearexcept); /* * The fegetexceptflag() function stores an implementation-defined @@ -104,6 +105,7 @@ fesetexceptflag(const fexcept_t *flagp, int excepts) return 0; } +DEF_STD(fesetexceptflag); /* * The feraiseexcept() function raises the supported floating-point exceptions @@ -148,6 +150,7 @@ feraiseexcept(int excepts) return 0; } +DEF_STD(feraiseexcept); /* * The fetestexcept() function determines which of a specified subset of the @@ -166,6 +169,7 @@ fetestexcept(int excepts) return r & excepts; } +DEF_STD(fetestexcept); /* * The fegetround() function gets the current rounding direction. @@ -180,6 +184,7 @@ fegetround(void) return (r >> _ROUND_SHIFT) & _ROUND_MASK; } +DEF_STD(fegetround); /* * The fesetround() function establishes the rounding direction represented by @@ -205,6 +210,7 @@ fesetround(int round) return 0; } +DEF_STD(fesetround); /* * The fegetenv() function attempts to store the current floating-point @@ -218,6 +224,7 @@ fegetenv(fenv_t *envp) return 0; } +DEF_STD(fegetenv); /* @@ -242,6 +249,7 @@ feholdexcept(fenv_t *envp) return 0; } +DEF_STD(feholdexcept); /* * The fesetenv() function attempts to establish the floating-point environment @@ -259,6 +267,7 @@ fesetenv(const fenv_t *envp) return 0; } +DEF_STD(fesetenv); /* @@ -284,6 +293,7 @@ feupdateenv(const fenv_t *envp) return 0; } +DEF_STD(feupdateenv); /* * The following functions are extentions to the standard diff --git a/lib/libm/hidden/complex.h b/lib/libm/hidden/complex.h new file mode 100644 index 00000000000..10430399fdb --- /dev/null +++ b/lib/libm/hidden/complex.h @@ -0,0 +1,75 @@ +#ifndef _LIBM_COMPLEX_H_ +#define _LIBM_COMPLEX_H_ + +#include_next <complex.h> + +PROTO_NORMAL(cacos); +PROTO_NORMAL(casin); +PROTO_NORMAL(catan); +PROTO_NORMAL(ccos); +PROTO_NORMAL(csin); +PROTO_NORMAL(ctan); +PROTO_NORMAL(cacosh); +PROTO_NORMAL(casinh); +PROTO_NORMAL(catanh); +PROTO_NORMAL(ccosh); +PROTO_NORMAL(csinh); +PROTO_NORMAL(ctanh); +PROTO_NORMAL(cexp); +PROTO_NORMAL(clog); +PROTO_NORMAL(cabs); +PROTO_NORMAL(cpow); +PROTO_NORMAL(csqrt); +PROTO_NORMAL(carg); +PROTO_NORMAL(cimag); +PROTO_NORMAL(conj); +PROTO_NORMAL(cproj); +PROTO_NORMAL(creal); + +PROTO_STD_DEPRECATED(cacosf); +PROTO_NORMAL(casinf); +PROTO_NORMAL(catanf); +PROTO_STD_DEPRECATED(ccosf); +PROTO_STD_DEPRECATED(csinf); +PROTO_STD_DEPRECATED(ctanf); +PROTO_STD_DEPRECATED(cacoshf); +PROTO_STD_DEPRECATED(casinhf); +PROTO_STD_DEPRECATED(catanhf); +PROTO_STD_DEPRECATED(ccoshf); +PROTO_STD_DEPRECATED(csinhf); +PROTO_STD_DEPRECATED(ctanhf); +PROTO_STD_DEPRECATED(cexpf); +PROTO_NORMAL(clogf); +PROTO_NORMAL(cabsf); +PROTO_STD_DEPRECATED(cpowf); +PROTO_NORMAL(csqrtf); +PROTO_NORMAL(cargf); +PROTO_NORMAL(cimagf); +PROTO_STD_DEPRECATED(conjf); +PROTO_STD_DEPRECATED(cprojf); +PROTO_NORMAL(crealf); + +LDBL_PROTO_STD_DEPRECATED(cacosl); +LDBL_PROTO_NORMAL(casinl); +LDBL_PROTO_NORMAL(catanl); +LDBL_PROTO_STD_DEPRECATED(ccosl); +LDBL_PROTO_STD_DEPRECATED(csinl); +LDBL_PROTO_STD_DEPRECATED(ctanl); +LDBL_PROTO_STD_DEPRECATED(cacoshl); +LDBL_PROTO_STD_DEPRECATED(casinhl); +LDBL_PROTO_STD_DEPRECATED(catanhl); +LDBL_PROTO_STD_DEPRECATED(ccoshl); +LDBL_PROTO_STD_DEPRECATED(csinhl); +LDBL_PROTO_STD_DEPRECATED(ctanhl); +LDBL_PROTO_STD_DEPRECATED(cexpl); +LDBL_PROTO_NORMAL(clogl); +LDBL_PROTO_NORMAL(cabsl); +LDBL_PROTO_STD_DEPRECATED(cpowl); +LDBL_PROTO_NORMAL(csqrtl); +LDBL_PROTO_NORMAL(cargl); +LDBL_PROTO_NORMAL(cimagl); +LDBL_PROTO_STD_DEPRECATED(conjl); +LDBL_PROTO_STD_DEPRECATED(cprojl); +LDBL_PROTO_NORMAL(creall); + +#endif /* _LIBM_COMPLEX_H_ */ diff --git a/lib/libm/hidden/fenv.h b/lib/libm/hidden/fenv.h new file mode 100644 index 00000000000..bc96a1ff035 --- /dev/null +++ b/lib/libm/hidden/fenv.h @@ -0,0 +1,22 @@ + +#ifndef _LIBM_FENV_H_ +#define _LIBM_FENV_H_ + +#include_next <fenv.h> + +PROTO_NORMAL(feclearexcept); +PROTO_STD_DEPRECATED(fedisableexcept); +PROTO_STD_DEPRECATED(feenableexcept); +PROTO_NORMAL(fegetenv); +PROTO_STD_DEPRECATED(fegetexcept); +PROTO_STD_DEPRECATED(fegetexceptflag); +PROTO_NORMAL(fegetround); +PROTO_NORMAL(feholdexcept); +PROTO_NORMAL(feraiseexcept); +PROTO_NORMAL(fesetenv); +PROTO_NORMAL(fesetexceptflag); +PROTO_NORMAL(fesetround); +PROTO_NORMAL(fetestexcept); +PROTO_NORMAL(feupdateenv); + +#endif /* ! _LIBM_FENV_H_ */ diff --git a/lib/libm/hidden/math.h b/lib/libm/hidden/math.h new file mode 100644 index 00000000000..dcf64c038c6 --- /dev/null +++ b/lib/libm/hidden/math.h @@ -0,0 +1,202 @@ + +#ifndef _LIBM_MATH_H_ +#define _LIBM_MATH_H_ + +#include_next <math.h> + +#if 0 +extern PROTO_NORMAL(signgam); +#endif + +PROTO_NORMAL(acos); +PROTO_STD_DEPRECATED(acosf); +PROTO_NORMAL(acosh); +PROTO_STD_DEPRECATED(acoshf); +LDBL_PROTO_STD_DEPRECATED(acoshl); +LDBL_PROTO_STD_DEPRECATED(acosl); +PROTO_NORMAL(asin); +PROTO_NORMAL(asinf); +PROTO_NORMAL(asinh); +PROTO_STD_DEPRECATED(asinhf); +LDBL_PROTO_STD_DEPRECATED(asinhl); +LDBL_PROTO_NORMAL(asinl); +PROTO_NORMAL(atan); +PROTO_NORMAL(atan2); +PROTO_NORMAL(atan2f); +LDBL_PROTO_NORMAL(atan2l); +PROTO_NORMAL(atanf); +PROTO_NORMAL(atanh); +PROTO_STD_DEPRECATED(atanhf); +LDBL_PROTO_STD_DEPRECATED(atanhl); +LDBL_PROTO_NORMAL(atanl); +PROTO_NORMAL(cbrt); +PROTO_STD_DEPRECATED(cbrtf); +LDBL_PROTO_STD_DEPRECATED(cbrtl); +PROTO_NORMAL(ceil); +PROTO_NORMAL(ceilf); +PROTO_STD_DEPRECATED(ceill); +PROTO_NORMAL(copysign); +PROTO_NORMAL(copysignf); +LDBL_PROTO_NORMAL(copysignl); +PROTO_NORMAL(cos); +PROTO_NORMAL(cosf); +PROTO_NORMAL(cosh); +PROTO_NORMAL(coshf); +LDBL_PROTO_NORMAL(coshl); +LDBL_PROTO_NORMAL(cosl); +PROTO_DEPRECATED(drem); +PROTO_DEPRECATED(dremf); +PROTO_NORMAL(erf); +PROTO_NORMAL(erfc); +PROTO_STD_DEPRECATED(erfcf); +PROTO_NORMAL(erfcl); +PROTO_STD_DEPRECATED(erff); +LDBL_PROTO_NORMAL(erfl); +PROTO_NORMAL(exp); +PROTO_NORMAL(exp2); +PROTO_STD_DEPRECATED(exp2f); +LDBL_PROTO_STD_DEPRECATED(exp2l); +PROTO_NORMAL(expf); +PROTO_NORMAL(expl); +PROTO_NORMAL(expm1); +PROTO_NORMAL(expm1f); +LDBL_PROTO_NORMAL(expm1l); +PROTO_NORMAL(fabsf); +PROTO_STD_DEPRECATED(fdim); +PROTO_STD_DEPRECATED(fdimf); +PROTO_STD_DEPRECATED(fdiml); +PROTO_NORMAL(floor); +PROTO_NORMAL(floorf); +PROTO_NORMAL(floorl); +PROTO_NORMAL(fma); +PROTO_STD_DEPRECATED(fmaf); +LDBL_PROTO_STD_DEPRECATED(fmal); +PROTO_NORMAL(fmax); +PROTO_STD_DEPRECATED(fmaxf); +LDBL_PROTO_STD_DEPRECATED(fmaxl); +PROTO_NORMAL(fmin); +PROTO_STD_DEPRECATED(fminf); +LDBL_PROTO_STD_DEPRECATED(fminl); +PROTO_NORMAL(fmod); +PROTO_NORMAL(fmodf); +LDBL_PROTO_STD_DEPRECATED(fmodl); +PROTO_STD_DEPRECATED(frexpf); +LDBL_PROTO_NORMAL(frexpl); +PROTO_DEPRECATED(gamma); +PROTO_DEPRECATED(gamma_r); +PROTO_DEPRECATED(gammaf); +PROTO_DEPRECATED(gammaf_r); +PROTO_NORMAL(hypot); +PROTO_NORMAL(hypotf); +LDBL_PROTO_NORMAL(hypotl); +PROTO_NORMAL(ilogb); +PROTO_NORMAL(ilogbf); +LDBL_PROTO_NORMAL(ilogbl); +PROTO_NORMAL(j0); +PROTO_NORMAL(j0f); +PROTO_NORMAL(j1); +PROTO_NORMAL(j1f); +PROTO_DEPRECATED(jn); +PROTO_DEPRECATED(jnf); +PROTO_STD_DEPRECATED(ldexpf); +LDBL_PROTO_NORMAL(ldexpl); +PROTO_NORMAL(lgamma); +PROTO_NORMAL(lgamma_r); +PROTO_STD_DEPRECATED(lgammaf); +PROTO_NORMAL(lgammaf_r); +LDBL_PROTO_NORMAL(lgammal); +PROTO_NORMAL(llrint); +PROTO_NORMAL(llrintf); +LDBL_PROTO_STD_DEPRECATED(llrintl); +PROTO_NORMAL(llround); +PROTO_STD_DEPRECATED(llroundf); +PROTO_STD_DEPRECATED(llroundl); +PROTO_NORMAL(log); +PROTO_NORMAL(log10); +PROTO_STD_DEPRECATED(log10f); +LDBL_PROTO_STD_DEPRECATED(log10l); +PROTO_NORMAL(log1p); +PROTO_NORMAL(log1pf); +PROTO_NORMAL(log1pl); +PROTO_NORMAL(log2); +PROTO_STD_DEPRECATED(log2f); +LDBL_PROTO_STD_DEPRECATED(log2l); +PROTO_NORMAL(logb); +PROTO_NORMAL(logbf); +LDBL_PROTO_STD_DEPRECATED(logbl); +PROTO_NORMAL(logf); +LDBL_PROTO_NORMAL(logl); +PROTO_NORMAL(lrint); +PROTO_NORMAL(lrintf); +LDBL_PROTO_STD_DEPRECATED(lrintl); +PROTO_NORMAL(lround); +PROTO_STD_DEPRECATED(lroundf); +PROTO_STD_DEPRECATED(lroundl); +PROTO_STD_DEPRECATED(modff); +LDBL_PROTO_STD_DEPRECATED(modfl); +PROTO_NORMAL(nan); +PROTO_STD_DEPRECATED(nanf); +LDBL_PROTO_STD_DEPRECATED(nanl); +PROTO_STD_DEPRECATED(nearbyint); +PROTO_STD_DEPRECATED(nearbyintf); +PROTO_STD_DEPRECATED(nearbyintl); +PROTO_NORMAL(nextafter); +PROTO_STD_DEPRECATED(nextafterf); +PROTO_NORMAL(nextafterl); +PROTO_STD_DEPRECATED(nexttoward); +PROTO_STD_DEPRECATED(nexttowardf); +PROTO_STD_DEPRECATED(nexttowardl); +PROTO_NORMAL(pow); +PROTO_NORMAL(powf); +LDBL_PROTO_NORMAL(powl); +PROTO_NORMAL(remainder); +PROTO_NORMAL(remainderf); +LDBL_PROTO_STD_DEPRECATED(remainderl); +PROTO_NORMAL(remquo); +PROTO_STD_DEPRECATED(remquof); +LDBL_PROTO_NORMAL(remquol); +PROTO_NORMAL(rint); +PROTO_NORMAL(rintf); +PROTO_NORMAL(rintl); +PROTO_NORMAL(round); +PROTO_STD_DEPRECATED(roundf); +LDBL_PROTO_NORMAL(roundl); +PROTO_NORMAL(scalb); +PROTO_NORMAL(scalbf); +PROTO_STD_DEPRECATED(scalbln); +PROTO_STD_DEPRECATED(scalblnf); +PROTO_STD_DEPRECATED(scalblnl); +PROTO_NORMAL(scalbn); +PROTO_NORMAL(scalbnf); +PROTO_NORMAL(scalbnl); +PROTO_DEPRECATED(significand); +PROTO_DEPRECATED(significandf); +PROTO_NORMAL(sin); +PROTO_NORMAL(sinf); +PROTO_NORMAL(sinh); +PROTO_NORMAL(sinhf); +LDBL_PROTO_NORMAL(sinhl); +LDBL_PROTO_NORMAL(sinl); +PROTO_NORMAL(sqrt); +PROTO_NORMAL(sqrtf); +LDBL_PROTO_NORMAL(sqrtl); +PROTO_NORMAL(tan); +PROTO_STD_DEPRECATED(tanf); +PROTO_NORMAL(tanh); +PROTO_STD_DEPRECATED(tanhf); +LDBL_PROTO_STD_DEPRECATED(tanhl); +LDBL_PROTO_STD_DEPRECATED(tanl); +PROTO_NORMAL(tgamma); +PROTO_STD_DEPRECATED(tgammaf); +LDBL_PROTO_STD_DEPRECATED(tgammal); +PROTO_NORMAL(trunc); +PROTO_STD_DEPRECATED(truncf); +LDBL_PROTO_STD_DEPRECATED(truncl); +PROTO_NORMAL(y0); +PROTO_NORMAL(y0f); +PROTO_NORMAL(y1); +PROTO_NORMAL(y1f); +PROTO_DEPRECATED(yn); +PROTO_DEPRECATED(ynf); + +#endif /* !_LIBM_MATH_H_ */ diff --git a/lib/libm/hidden/namespace.h b/lib/libm/hidden/namespace.h new file mode 100644 index 00000000000..88bb46dfacd --- /dev/null +++ b/lib/libm/hidden/namespace.h @@ -0,0 +1,121 @@ +/* $OpenBSD: namespace.h,v 1.1 2016/09/12 19:47:02 guenther Exp $ */ + +#ifndef _LIBM_NAMESPACE_H_ +#define _LIBM_NAMESPACE_H_ + +/* + * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * The goal: calls from inside libc to other libc functions should be via + * identifiers that are of hidden visibility and--to avoid confusion--are + * in the reserved namespace. By doing this these calls are protected + * from overriding by applications and on many platforms can avoid creation + * or use of GOT or PLT entries. I've chosen a prefix of "_libm_" for this. + * These will not be declared directly; instead, the gcc "asm labels" + * extension will be used rename the function. + * + * In order to actually set up the desired asm labels, we use these in + * the internal .h files: + * PROTO_NORMAL(x) Symbols used both internally and externally + * This makes gcc convert use of x to use _libm_x instead. Use + * DEF_STD(x) or DEF_NONSTD(x) to create the external alias. + * ex: PROTO_NORMAL(ceil) + * + * PROTO_STD_DEPRECATED(x) Standard C symbols that are not used internally + * This just marks the symbol as deprecated, with no renaming. + * Do not use DEF_*(x) with this. + * ex: PROTO_STD_DEPRECATED(tgammal) + * + * PROTO_DEPRECATED(x) Symbols not in C that are not used internally + * This marks the symbol as deprecated and, in the static lib, weak. + * No renaming is done. Do not use DEF_*(x) with this. + * ex: PROTO_DEPRECATED(creat) + * + * Finally, to create the expected aliases, we use these in the .c files + * where the definitions are: + * DEF_STD(x) Symbols reserved to or specified by ISO C + * This defines x as a strong alias for _libm_x; this must only + * be used for symbols that are reserved by the C standard + * (or reserved in the external identifier namespace). + * Matches with PROTO_NORMAL() + * ex: DEF_STD(fopen) + * + * DEF_NONSTD(x) Symbols used internally and not in ISO C + * This defines x as a alias for _libm_x, weak in the static version + * Matches with PROTO_NORMAL() + * ex: DEF_NONSTD(lseek) + * + * LDBL_CLONE(x) long double aliases that are used + * This defines xl and _libm_xl as aliases for _libm_x. + * Matches with LDBL_PROTO_NORMAL() + * + * LDBL_UNUSED_CLONE(x) long double aliases that are unused + * This defines xl as an alias for _libm_x. + * Matches with LDBL_PROTO_STD_DEPRECATED() + * + * LDBL_MAYBE_CLONE(x) + * LDBL_MAYBE_UNUSED_CLONE(x) + * Like LDBL_CLONE() and LDBL_UNUSED_CLONE(), except they do nothing + * if LDBL_MANT_DIG != DBL_MANT_DIG + * + * MAKE_UNUSED_CLONE(dst, src) Unused symbols that are exact clones + * of other symbols + * This declares dst as being the same type as dst, and makes + * _libm_dst a strong, hidden alias for _libm_src. You still need to + * DEF_STD(dst) or DEF_NONSTD(dst) to alias dst itself + * ex: MAKE_UNUSED_CLONE(nexttoward, nextafter); + */ + +#include <sys/cdefs.h> /* for __dso_hidden and __{weak,strong}_alias */ + +#ifndef PIC +# define WEAK_IN_STATIC_ALIAS(x,y) __weak_alias(x,y) +# define WEAK_IN_STATIC __attribute__((weak)) +#else +# define WEAK_IN_STATIC_ALIAS(x,y) __strong_alias(x,y) +# define WEAK_IN_STATIC /* nothing */ +#endif + +#define HIDDEN(x) _libm_##x +#define HIDDEN_STRING(x) "_libm_" __STRING(x) + +#define PROTO_NORMAL(x) __dso_hidden typeof(x) HIDDEN(x), x asm(HIDDEN_STRING(x)) +#define PROTO_STD_DEPRECATED(x) typeof(x) HIDDEN(x), x __attribute__((deprecated)) +#define PROTO_DEPRECATED(x) PROTO_STD_DEPRECATED(x) WEAK_IN_STATIC + +#define DEF_STD(x) __strong_alias(x, HIDDEN(x)) +#define DEF_NONSTD(x) WEAK_IN_STATIC_ALIAS(x, HIDDEN(x)) + +#define MAKE_UNUSED_CLONE(dst, src) __strong_alias(dst, src) +#define LDBL_UNUSED_CLONE(x) __strong_alias(x##l, HIDDEN(x)) +#define LDBL_CLONE(x) LDBL_UNUSED_CLONE(x); \ + __dso_hidden typeof(HIDDEN(x##l)) HIDDEN(x##l) \ + __attribute__((alias (HIDDEN_STRING(x)))) + +#if __LDBL_MANT_DIG__ == __DBL_MANT_DIG__ +# define LDBL_PROTO_NORMAL(x) typeof(x) HIDDEN(x) +# define LDBL_PROTO_STD_DEPRECATED(x) typeof(x) HIDDEN(x) +# define LDBL_MAYBE_CLONE(x) LDBL_CLONE(x) +# define LDBL_MAYBE_UNUSED_CLONE(x) LDBL_UNUSED_CLONE(x) +#else +# define LDBL_PROTO_NORMAL(x) PROTO_NORMAL(x) +# define LDBL_PROTO_STD_DEPRECATED(x) PROTO_STD_DEPRECATED(x) +# define LDBL_MAYBE_CLONE(x) __asm("") +# define LDBL_MAYBE_UNUSED_CLONE(x) __asm("") +#endif + +#endif /* _LIBM_NAMESPACE_H_ */ diff --git a/lib/libm/noieee_src/n_asincos.c b/lib/libm/noieee_src/n_asincos.c index f0b5fb3b7a4..a6fe371d39a 100644 --- a/lib/libm/noieee_src/n_asincos.c +++ b/lib/libm/noieee_src/n_asincos.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_asincos.c,v 1.14 2013/03/28 18:09:38 martynas Exp $ */ +/* $OpenBSD: n_asincos.c,v 1.15 2016/09/12 19:47:02 guenther Exp $ */ /* $NetBSD: n_asincos.c,v 1.1 1995/10/10 23:36:34 ragge Exp $ */ /* * Copyright (c) 1985, 1993 @@ -100,8 +100,8 @@ asin(double x) { t=one-s; s=t+t; return(atan2(x,sqrt(s-t*t))); } } - -__strong_alias(asinl, asin); +DEF_STD(asin); +LDBL_CLONE(asin); /* ACOS(X) * RETURNS ARC COS OF X @@ -169,5 +169,5 @@ acos(double x) t=atan2(one,0.0); /* t = PI/2 */ return(t+t); } - -__strong_alias(acosl, acos); +DEF_STD(acos); +LDBL_UNUSED_CLONE(acos); diff --git a/lib/libm/noieee_src/n_atan.c b/lib/libm/noieee_src/n_atan.c index 37d1b881f48..79747e2c170 100644 --- a/lib/libm/noieee_src/n_atan.c +++ b/lib/libm/noieee_src/n_atan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_atan.c,v 1.13 2013/07/15 04:09:44 espie Exp $ */ +/* $OpenBSD: n_atan.c,v 1.14 2016/09/12 19:47:02 guenther Exp $ */ /* $NetBSD: n_atan.c,v 1.1 1995/10/10 23:36:36 ragge Exp $ */ /* * Copyright (c) 1985, 1993 @@ -81,8 +81,8 @@ atan(double x) double one=1.0; return(atan2(x,one)); } - -__strong_alias(atanl, atan); +DEF_STD(atan); +LDBL_CLONE(atan); float atanf(float x) @@ -90,3 +90,4 @@ atanf(float x) float one=1.0f; return(atan2f(x,one)); } +DEF_STD(atanf); diff --git a/lib/libm/noieee_src/n_atan2.c b/lib/libm/noieee_src/n_atan2.c index 27eed2d7022..e99441349bc 100644 --- a/lib/libm/noieee_src/n_atan2.c +++ b/lib/libm/noieee_src/n_atan2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_atan2.c,v 1.19 2016/09/12 04:39:47 guenther Exp $ */ +/* $OpenBSD: n_atan2.c,v 1.20 2016/09/12 19:47:02 guenther Exp $ */ /* $NetBSD: n_atan2.c,v 1.1 1995/10/10 23:36:37 ragge Exp $ */ /* * Copyright (c) 1985, 1993 @@ -243,5 +243,5 @@ begin: return(copysign((signx>zero)?z:PI-z,signy)); } - -__strong_alias(atan2l, atan2); +DEF_STD(atan2); +LDBL_CLONE(atan2); diff --git a/lib/libm/noieee_src/n_erf.c b/lib/libm/noieee_src/n_erf.c index dcdf10a08e4..00f2df2483e 100644 --- a/lib/libm/noieee_src/n_erf.c +++ b/lib/libm/noieee_src/n_erf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_erf.c,v 1.8 2016/09/12 04:39:47 guenther Exp $ */ +/* $OpenBSD: n_erf.c,v 1.9 2016/09/12 19:47:02 guenther Exp $ */ /* $NetBSD: n_erf.c,v 1.1 1995/10/10 23:36:43 ragge Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -308,6 +308,7 @@ erf(double x) else return (z-one); } +DEF_STD(erf); double erfc(double x) @@ -384,3 +385,4 @@ erfc(double x) else return two-r; } +DEF_STD(erfc); diff --git a/lib/libm/noieee_src/n_exp.c b/lib/libm/noieee_src/n_exp.c index dd0a168daec..986ff59b8f5 100644 --- a/lib/libm/noieee_src/n_exp.c +++ b/lib/libm/noieee_src/n_exp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_exp.c,v 1.11 2016/09/12 04:39:47 guenther Exp $ */ +/* $OpenBSD: n_exp.c,v 1.12 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -126,6 +126,7 @@ exp(double x) /* exp(INF) is INF, exp(+big#) overflows to INF */ return( isfinite(x) ? scalbn(1.0,5000) : x); } +DEF_STD(exp); /* returns exp(r = x + c) for |c| < |x| with no overlap. */ diff --git a/lib/libm/noieee_src/n_floor.c b/lib/libm/noieee_src/n_floor.c index 7e77d02fa69..6c3888fee02 100644 --- a/lib/libm/noieee_src/n_floor.c +++ b/lib/libm/noieee_src/n_floor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_floor.c,v 1.20 2016/09/12 04:39:47 guenther Exp $ */ +/* $OpenBSD: n_floor.c,v 1.21 2016/09/12 19:47:02 guenther Exp $ */ /* $NetBSD: n_floor.c,v 1.1 1995/10/10 23:36:48 ragge Exp $ */ /* * Copyright (c) 1985, 1993 @@ -58,8 +58,8 @@ floor(double x) return x < y ? y-(double)1 : y; } } - -__strong_alias(floorl, floor); +DEF_STD(floor); +LDBL_CLONE(floor); double ceil(double x) @@ -76,8 +76,8 @@ ceil(double x) return x > y ? y+(double)1 : y; } } - -__strong_alias(ceill, ceil); +DEF_STD(ceil); +LDBL_UNUSED_CLONE(ceil); float floorf(float x) @@ -94,6 +94,7 @@ floorf(float x) return x < y ? y-(float)1 : y; } } +DEF_STD(floorf); float ceilf(float x) @@ -110,6 +111,8 @@ ceilf(float x) return x > y ? y+(float)1 : y; } } +DEF_STD(ceilf); + /* * algorithm for rint(x) in pseudo-pascal form ... * @@ -148,8 +151,8 @@ rint(double x) t = x + s; /* x+s rounded to integer */ return (t - s); } - -__strong_alias(rintl, rint); +DEF_STD(rint); +LDBL_CLONE(rint); float rintf(float x) @@ -168,4 +171,4 @@ rintf(float x) t = x + s; /* x+s rounded to integer */ return (t - s); } - +DEF_STD(rintf); diff --git a/lib/libm/noieee_src/n_hypot.c b/lib/libm/noieee_src/n_hypot.c index d326add64bf..6653e956844 100644 --- a/lib/libm/noieee_src/n_hypot.c +++ b/lib/libm/noieee_src/n_hypot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_hypot.c,v 1.5 2016/09/12 04:39:47 guenther Exp $ */ +/* $OpenBSD: n_hypot.c,v 1.6 2016/09/12 19:47:02 guenther Exp $ */ /* $NetBSD: n_cabs.c,v 1.1 1995/10/10 23:36:39 ragge Exp $ */ /* * Copyright (c) 1985, 1993 @@ -147,8 +147,8 @@ hypot(double x, double y) return (y); else return(copysign(y,one)); /* y is INF */ } - -__strong_alias(hypotl, hypot); +DEF_STD(hypot); +LDBL_CLONE(hypot); /* A faster but less accurate version of cabs(x,y) */ #if 0 diff --git a/lib/libm/noieee_src/n_log.c b/lib/libm/noieee_src/n_log.c index 64a93609d90..ce5a9f40801 100644 --- a/lib/libm/noieee_src/n_log.c +++ b/lib/libm/noieee_src/n_log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_log.c,v 1.9 2016/09/12 04:39:47 guenther Exp $ */ +/* $OpenBSD: n_log.c,v 1.10 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -429,6 +429,7 @@ log(double x) u2 += logF_tail[N]*m; return (u1 + u2); } +DEF_STD(log); /* * Extra precision variant, returning struct {double a, b;}; diff --git a/lib/libm/noieee_src/n_lrint.c b/lib/libm/noieee_src/n_lrint.c index 9ef81478577..a0feab5313f 100644 --- a/lib/libm/noieee_src/n_lrint.c +++ b/lib/libm/noieee_src/n_lrint.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_lrint.c,v 1.1 2013/08/07 12:45:59 espie Exp $ */ +/* $OpenBSD: n_lrint.c,v 1.2 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2013 Marc Espie. * @@ -31,26 +31,27 @@ lrint(double x) { return (long)rint(x); } - -__strong_alias(lrintl, lrint); +DEF_STD(lrint); +LDBL_UNUSED_CLONE(lrint); long lrintf(float x) { return (long)rintf(x); } +DEF_STD(lrintf); long long llrint(double x) { return (long long)rint(x); } - -__strong_alias(llrintl, llrint); +DEF_STD(llrint); +LDBL_UNUSED_CLONE(llrint); long long llrintf(float x) { return (long long)rintf(x); } - +DEF_STD(llrintf); diff --git a/lib/libm/noieee_src/n_sincos.c b/lib/libm/noieee_src/n_sincos.c index a5ee9ed5c13..a3da96c6b9e 100644 --- a/lib/libm/noieee_src/n_sincos.c +++ b/lib/libm/noieee_src/n_sincos.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_sincos.c,v 1.15 2016/09/12 04:39:47 guenther Exp $ */ +/* $OpenBSD: n_sincos.c,v 1.16 2016/09/12 19:47:02 guenther Exp $ */ /* $NetBSD: n_sincos.c,v 1.1 1995/10/10 23:37:04 ragge Exp $ */ /* * Copyright (c) 1987, 1993 @@ -38,6 +38,7 @@ sinf(float x) { return (float)sin((double) x); } +DEF_STD(sinf); double sin(double x) @@ -67,8 +68,8 @@ sin(double x) } return x+x*sin__S(x*x); } - -__strong_alias(sinl, sin); +DEF_STD(sin); +LDBL_CLONE(sin); float cosf(float x) @@ -105,5 +106,5 @@ cos(double x) a = (z >= thresh ? half-((z-half)-c) : one-(z-c)); return copysign(a,s); } - -__strong_alias(cosl, cos); +END_STD(cos); +LDBL_CLONE(cos); diff --git a/lib/libm/noieee_src/n_support.c b/lib/libm/noieee_src/n_support.c index ae54f830173..7f310f3339f 100644 --- a/lib/libm/noieee_src/n_support.c +++ b/lib/libm/noieee_src/n_support.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_support.c,v 1.24 2016/09/12 04:39:47 guenther Exp $ */ +/* $OpenBSD: n_support.c,v 1.25 2016/09/12 19:47:02 guenther Exp $ */ /* $NetBSD: n_support.c,v 1.1 1995/10/10 23:37:06 ragge Exp $ */ /* * Copyright (c) 1985, 1993 @@ -115,8 +115,8 @@ scalbn(double x, int N) } return(x); } - -__strong_alias(scalbnl, scalbn); +DEF_STD(scalbn); +LDBL_CLONE(scalbn); double copysign(double x, double y) @@ -131,8 +131,8 @@ copysign(double x, double y) *px = ( *px & msign ) | ( *py & ~msign ); return(x); } - -__strong_alias(copysignl, copysign); +DEF_STD(copysign); +LDBL_CLONE(copysign); double logb(double x) @@ -156,8 +156,8 @@ logb(double x) {*px &= msign; return(x);} #endif /* defined(__vax__) */ } - -__strong_alias(logbl, logb); +DEF_STD(logb); +LDBL_UNUSED_CLONE(logb); double remainder(double x, double p) @@ -230,6 +230,7 @@ remainder(double x, double p) } } +DEF_STD(remainder); /* The drem() function is a deprecated alias for remainder(). */ @@ -244,6 +245,7 @@ sqrtf(float x) { return (float)sqrt((double) x); } +DEF_STD(sqrtf); double sqrt(double x) @@ -313,8 +315,8 @@ sqrt(double x) end: return(scalbn(q,n)); } - -__strong_alias(sqrtl, sqrt); +DEF_STD(sqrt); +LDBL_CLONE(sqrt); #if 0 /* REMAINDER(X,Y) @@ -406,6 +408,7 @@ loop: return(x); } +DEF_STD(remainder); #endif #if 0 diff --git a/lib/libm/noieee_src/n_tan.c b/lib/libm/noieee_src/n_tan.c index b36dd16d379..971ebe7a89f 100644 --- a/lib/libm/noieee_src/n_tan.c +++ b/lib/libm/noieee_src/n_tan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_tan.c,v 1.15 2016/09/12 04:39:47 guenther Exp $ */ +/* $OpenBSD: n_tan.c,v 1.16 2016/09/12 19:47:02 guenther Exp $ */ /* $NetBSD: n_tan.c,v 1.1 1995/10/10 23:37:07 ragge Exp $ */ /* * Copyright (c) 1987, 1993 @@ -70,5 +70,5 @@ tan(double x) else return c/(x+x*ss); /* ... cos/sin */ } - -__strong_alias(tanl, tan); +DEF_STD(tan); +LDBL_UNUSED_CLONE(tan); diff --git a/lib/libm/shlib_version b/lib/libm/shlib_version index 1c5d96eb2aa..c10074d52ae 100644 --- a/lib/libm/shlib_version +++ b/lib/libm/shlib_version @@ -1,2 +1,2 @@ -major=9 +major=10 minor=0 diff --git a/lib/libm/src/b_tgamma.c b/lib/libm/src/b_tgamma.c index 2a7e564986e..2c2c05cd3be 100644 --- a/lib/libm/src/b_tgamma.c +++ b/lib/libm/src/b_tgamma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: b_tgamma.c,v 1.9 2016/09/12 04:39:47 guenther Exp $ */ +/* $OpenBSD: b_tgamma.c,v 1.10 2016/09/12 19:47:02 guenther Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -143,6 +143,8 @@ tgamma(double x) } else return (neg_gam(x)); } +DEF_STD(tgamma); +LDBL_MAYBE_UNUSED_CLONE(tgamma); /* * We simply call tgamma() rather than bloating the math library @@ -332,7 +334,3 @@ neg_gam(double x) if (sgn < 0) y = -y; return (M_PI / (y*z)); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(tgammal, tgamma); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ diff --git a/lib/libm/src/e_acos.c b/lib/libm/src/e_acos.c index 2cd62374cd6..e79fe297781 100644 --- a/lib/libm/src/e_acos.c +++ b/lib/libm/src/e_acos.c @@ -99,7 +99,5 @@ acos(double x) return 2.0*(df+w); } } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(acosl, acos); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(acos); +LDBL_MAYBE_UNUSED_CLONE(acos); diff --git a/lib/libm/src/e_acosh.c b/lib/libm/src/e_acosh.c index a03127dbf20..54f7a46e432 100644 --- a/lib/libm/src/e_acosh.c +++ b/lib/libm/src/e_acosh.c @@ -57,7 +57,5 @@ acosh(double x) return log1p(t+sqrt(2.0*t+t*t)); } } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(acoshl, acosh); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(acosh); +LDBL_MAYBE_UNUSED_CLONE(acosh); diff --git a/lib/libm/src/e_asin.c b/lib/libm/src/e_asin.c index 226addc9749..946431d3a91 100644 --- a/lib/libm/src/e_asin.c +++ b/lib/libm/src/e_asin.c @@ -107,7 +107,5 @@ asin(double x) } if(hx>0) return t; else return -t; } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(asinl, asin); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(asin); +LDBL_MAYBE_CLONE(asin); diff --git a/lib/libm/src/e_asinf.c b/lib/libm/src/e_asinf.c index 05b32927183..248baa65067 100644 --- a/lib/libm/src/e_asinf.c +++ b/lib/libm/src/e_asinf.c @@ -78,3 +78,4 @@ asinf(float x) } if(hx>0) return t; else return -t; } +DEF_STD(asinf); diff --git a/lib/libm/src/e_asinl.c b/lib/libm/src/e_asinl.c index 316eed55ff7..b281ba45635 100644 --- a/lib/libm/src/e_asinl.c +++ b/lib/libm/src/e_asinl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_asinl.c,v 1.1 2008/12/09 20:00:35 martynas Exp $ */ +/* $OpenBSD: e_asinl.c,v 1.2 2016/09/12 19:47:02 guenther Exp $ */ /* @(#)e_asin.c 1.3 95/01/18 */ /* FreeBSD: head/lib/msun/src/e_asin.c 176451 2008-02-22 02:30:36Z das */ /* @@ -98,3 +98,4 @@ asinl(long double x) } if(expsign>0) return t; else return -t; } +DEF_STD(asinl); diff --git a/lib/libm/src/e_atan2.c b/lib/libm/src/e_atan2.c index e4006021f82..0d489e1e696 100644 --- a/lib/libm/src/e_atan2.c +++ b/lib/libm/src/e_atan2.c @@ -118,7 +118,5 @@ atan2(double y, double x) return (z-pi_lo)-pi;/* atan(-,-) */ } } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(atan2l, atan2); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(atan2); +LDBL_MAYBE_CLONE(atan2); diff --git a/lib/libm/src/e_atan2f.c b/lib/libm/src/e_atan2f.c index 155a36cab99..c14752b8782 100644 --- a/lib/libm/src/e_atan2f.c +++ b/lib/libm/src/e_atan2f.c @@ -91,3 +91,4 @@ atan2f(float y, float x) return (z-pi_lo)-pi;/* atan(-,-) */ } } +DEF_STD(atan2f); diff --git a/lib/libm/src/e_atan2l.c b/lib/libm/src/e_atan2l.c index 94bdfa8e2f3..5261c0eb35e 100644 --- a/lib/libm/src/e_atan2l.c +++ b/lib/libm/src/e_atan2l.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_atan2l.c,v 1.1 2008/12/09 20:00:35 martynas Exp $ */ +/* $OpenBSD: e_atan2l.c,v 1.2 2016/09/12 19:47:02 guenther Exp $ */ /* @(#)e_atan2.c 1.3 95/01/18 */ /* FreeBSD: head/lib/msun/src/e_atan2.c 176451 2008-02-22 02:30:36Z das */ /* @@ -161,3 +161,4 @@ atan2l(long double y, long double x) return (z-pi_lo)-pi;/* atan(-,-) */ } } +DEF_STD(atan2l); diff --git a/lib/libm/src/e_atanh.c b/lib/libm/src/e_atanh.c index 0c469da65eb..80da1b36bff 100644 --- a/lib/libm/src/e_atanh.c +++ b/lib/libm/src/e_atanh.c @@ -57,7 +57,5 @@ atanh(double x) t = 0.5*log1p((x+x)/(one-x)); if(hx>=0) return t; else return -t; } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(atanhl, atanh); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(atanh); +LDBL_MAYBE_UNUSED_CLONE(atanh); diff --git a/lib/libm/src/e_cosh.c b/lib/libm/src/e_cosh.c index 4e2c2c23897..dcf6fa626f3 100644 --- a/lib/libm/src/e_cosh.c +++ b/lib/libm/src/e_cosh.c @@ -81,7 +81,5 @@ cosh(double x) /* |x| > overflowthresold, cosh(x) overflow */ return huge*huge; } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(coshl, cosh); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(cosh); +LDBL_MAYBE_CLONE(cosh); diff --git a/lib/libm/src/e_coshf.c b/lib/libm/src/e_coshf.c index 10bf05380a8..9c6436070a3 100644 --- a/lib/libm/src/e_coshf.c +++ b/lib/libm/src/e_coshf.c @@ -58,3 +58,4 @@ coshf(float x) /* |x| > overflowthresold, cosh(x) overflow */ return huge*huge; } +DEF_STD(coshf); diff --git a/lib/libm/src/e_exp.c b/lib/libm/src/e_exp.c index 6551047ab9b..d158468e08b 100644 --- a/lib/libm/src/e_exp.c +++ b/lib/libm/src/e_exp.c @@ -155,7 +155,5 @@ exp(double x) /* default IEEE double exp */ return y*twom1000; } } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(expl, exp); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(exp); +LDBL_MAYBE_CLONE(exp); diff --git a/lib/libm/src/e_expf.c b/lib/libm/src/e_expf.c index 67e8fc49f1d..1d749c3ee0d 100644 --- a/lib/libm/src/e_expf.c +++ b/lib/libm/src/e_expf.c @@ -90,3 +90,4 @@ expf(float x) /* default IEEE double exp */ return y*twom100; } } +DEF_STD(expf); diff --git a/lib/libm/src/e_fmod.c b/lib/libm/src/e_fmod.c index ef511901f81..8c8d52fa954 100644 --- a/lib/libm/src/e_fmod.c +++ b/lib/libm/src/e_fmod.c @@ -128,7 +128,5 @@ fmod(double x, double y) } return x; /* exact output */ } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(fmodl, fmod); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(fmod); +LDBL_MAYBE_UNUSED_CLONE(fmod); diff --git a/lib/libm/src/e_fmodf.c b/lib/libm/src/e_fmodf.c index cca2f6f63fd..28a86d50dba 100644 --- a/lib/libm/src/e_fmodf.c +++ b/lib/libm/src/e_fmodf.c @@ -99,3 +99,4 @@ fmodf(float x, float y) } return x; /* exact output */ } +DEF_STD(fmodf); diff --git a/lib/libm/src/e_hypot.c b/lib/libm/src/e_hypot.c index 8e9eb61917a..cd74752bc48 100644 --- a/lib/libm/src/e_hypot.c +++ b/lib/libm/src/e_hypot.c @@ -120,7 +120,5 @@ hypot(double x, double y) return t1*w; } else return w; } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(hypotl, hypot); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(hypot); +LDBL_MAYBE_CLONE(hypot); diff --git a/lib/libm/src/e_hypotf.c b/lib/libm/src/e_hypotf.c index f9e5327e99d..8b07b2965f3 100644 --- a/lib/libm/src/e_hypotf.c +++ b/lib/libm/src/e_hypotf.c @@ -77,3 +77,4 @@ hypotf(float x, float y) return t1*w; } else return w; } +DEF_STD(hypotf); diff --git a/lib/libm/src/e_j0.c b/lib/libm/src/e_j0.c index 138d90c055b..50bcdbd00ba 100644 --- a/lib/libm/src/e_j0.c +++ b/lib/libm/src/e_j0.c @@ -124,6 +124,7 @@ j0(double x) return((one+u)*(one-u)+z*(r/s)); } } +DEF_NONSTD(j0); static const double u00 = -7.38042951086872317523e-02, /* 0xBFB2E4D6, 0x99CBD01F */ @@ -190,6 +191,7 @@ y0(double x) v = one+z*(v01+z*(v02+z*(v03+z*v04))); return(u/v + tpi*(j0(x)*log(x))); } +DEF_NONSTD(y0); /* The asymptotic expansions of pzero is * 1 - 9/128 s^2 + 11025/98304 s^4 - ..., where s = 1/x. diff --git a/lib/libm/src/e_j0f.c b/lib/libm/src/e_j0f.c index e485e55f75b..6e00b91a689 100644 --- a/lib/libm/src/e_j0f.c +++ b/lib/libm/src/e_j0f.c @@ -82,6 +82,7 @@ j0f(float x) return((one+u)*(one-u)+z*(r/s)); } } +DEF_NONSTD(j0f); static const float u00 = -7.3804296553e-02, /* 0xbd9726b5 */ @@ -148,6 +149,7 @@ y0f(float x) v = one+z*(v01+z*(v02+z*(v03+z*v04))); return(u/v + tpi*(j0f(x)*logf(x))); } +DEF_NONSTD(y0f); /* The asymptotic expansions of pzero is * 1 - 9/128 s^2 + 11025/98304 s^4 - ..., where s = 1/x. diff --git a/lib/libm/src/e_j1.c b/lib/libm/src/e_j1.c index 2c475a5f1a4..1e9cf10397b 100644 --- a/lib/libm/src/e_j1.c +++ b/lib/libm/src/e_j1.c @@ -119,6 +119,7 @@ j1(double x) r *= x; return(x*0.5+r/s); } +DEF_NONSTD(j1); static const double U0[5] = { -1.96057090646238940668e-01, /* 0xBFC91866, 0x143CBC8A */ @@ -183,6 +184,7 @@ y1(double x) v = one+z*(V0[0]+z*(V0[1]+z*(V0[2]+z*(V0[3]+z*V0[4])))); return(x*(u/v) + tpi*(j1(x)*log(x)-one/x)); } +DEF_NONSTD(y1); /* For x >= 8, the asymptotic expansions of pone is * 1 + 15/128 s^2 - 4725/2^15 s^4 - ..., where s = 1/x. diff --git a/lib/libm/src/e_j1f.c b/lib/libm/src/e_j1f.c index b65abc0e443..290cf1e369b 100644 --- a/lib/libm/src/e_j1f.c +++ b/lib/libm/src/e_j1f.c @@ -77,6 +77,7 @@ j1f(float x) r *= x; return(x*(float)0.5+r/s); } +DEF_NONSTD(j1f); static const float U0[5] = { -1.9605709612e-01, /* 0xbe48c331 */ @@ -141,6 +142,7 @@ y1f(float x) v = one+z*(V0[0]+z*(V0[1]+z*(V0[2]+z*(V0[3]+z*V0[4])))); return(x*(u/v) + tpi*(j1f(x)*logf(x)-one/x)); } +DEF_NONSTD(y1f); /* For x >= 8, the asymptotic expansions of pone is * 1 + 15/128 s^2 - 4725/2^15 s^4 - ..., where s = 1/x. diff --git a/lib/libm/src/e_lgamma_r.c b/lib/libm/src/e_lgamma_r.c index fb22a4dde39..92d1fac7ab1 100644 --- a/lib/libm/src/e_lgamma_r.c +++ b/lib/libm/src/e_lgamma_r.c @@ -294,3 +294,4 @@ lgamma_r(double x, int *signgamp) if(hx<0) r = nadj - r; return r; } +DEF_NONSTD(lgamma_r); diff --git a/lib/libm/src/e_lgammaf_r.c b/lib/libm/src/e_lgammaf_r.c index 2e5b413cfb1..573b7325756 100644 --- a/lib/libm/src/e_lgammaf_r.c +++ b/lib/libm/src/e_lgammaf_r.c @@ -230,3 +230,4 @@ lgammaf_r(float x, int *signgamp) if(hx<0) r = nadj - r; return r; } +DEF_NONSTD(lgammaf_r); diff --git a/lib/libm/src/e_log.c b/lib/libm/src/e_log.c index 7eca6847e4d..172cd121136 100644 --- a/lib/libm/src/e_log.c +++ b/lib/libm/src/e_log.c @@ -130,7 +130,5 @@ log(double x) return dk*ln2_hi-((s*(f-R)-dk*ln2_lo)-f); } } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(logl, log); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(log); +LDBL_MAYBE_CLONE(log); diff --git a/lib/libm/src/e_log10.c b/lib/libm/src/e_log10.c index c73547f97ba..61300a6415a 100644 --- a/lib/libm/src/e_log10.c +++ b/lib/libm/src/e_log10.c @@ -82,7 +82,5 @@ log10(double x) z = y*log10_2lo + ivln10*log(x); return z+y*log10_2hi; } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(log10l, log10); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(log10); +LDBL_MAYBE_UNUSED_CLONE(log10); diff --git a/lib/libm/src/e_log2.c b/lib/libm/src/e_log2.c index 306c11dba3d..68586466f91 100644 --- a/lib/libm/src/e_log2.c +++ b/lib/libm/src/e_log2.c @@ -74,7 +74,5 @@ log2(double x) } else return (dk-((s*(f-R))-f)/ln2); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(log2l, log2); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(log2); +LDBL_MAYBE_UNUSED_CLONE(log2); diff --git a/lib/libm/src/e_logf.c b/lib/libm/src/e_logf.c index 543f33a0d1f..02b45c03218 100644 --- a/lib/libm/src/e_logf.c +++ b/lib/libm/src/e_logf.c @@ -79,3 +79,4 @@ logf(float x) return dk*ln2_hi-((s*(f-R)-dk*ln2_lo)-f); } } +DEF_STD(logf); diff --git a/lib/libm/src/e_pow.c b/lib/libm/src/e_pow.c index 2af0e921b3e..3f2509765f7 100644 --- a/lib/libm/src/e_pow.c +++ b/lib/libm/src/e_pow.c @@ -300,7 +300,5 @@ pow(double x, double y) else SET_HIGH_WORD(z,j); return s*z; } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(powl, pow); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(pow); +LDBL_MAYBE_CLONE(pow); diff --git a/lib/libm/src/e_powf.c b/lib/libm/src/e_powf.c index 3c4269d7146..970dcdd6ad8 100644 --- a/lib/libm/src/e_powf.c +++ b/lib/libm/src/e_powf.c @@ -242,3 +242,4 @@ powf(float x, float y) else SET_FLOAT_WORD(z,j); return s*z; } +DEF_STD(powf); diff --git a/lib/libm/src/e_remainder.c b/lib/libm/src/e_remainder.c index 5c36f2ff2f1..fa9310c3f01 100644 --- a/lib/libm/src/e_remainder.c +++ b/lib/libm/src/e_remainder.c @@ -68,7 +68,5 @@ remainder(double x, double p) SET_HIGH_WORD(x,hx^sx); return x; } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(remainderl, remainder); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(remainder); +LDBL_MAYBE_UNUSED_CLONE(remainder); diff --git a/lib/libm/src/e_remainderf.c b/lib/libm/src/e_remainderf.c index d94f09638dc..27dbc2debad 100644 --- a/lib/libm/src/e_remainderf.c +++ b/lib/libm/src/e_remainderf.c @@ -58,3 +58,4 @@ remainderf(float x, float p) SET_FLOAT_WORD(x,hx^sx); return x; } +DEF_STD(remainderf); diff --git a/lib/libm/src/e_scalb.c b/lib/libm/src/e_scalb.c index 5762ea98098..52a4fbcf5cd 100644 --- a/lib/libm/src/e_scalb.c +++ b/lib/libm/src/e_scalb.c @@ -25,6 +25,7 @@ scalb(double x, int fn) { return scalbn(x, fn); } +DEF_NONSTD(scalb); #else @@ -41,4 +42,5 @@ scalb(double x, double fn) if (-fn > 65000.0) return scalbn(x,-65000); return scalbn(x,(int)fn); } +DEF_NONSTD(scalb); #endif diff --git a/lib/libm/src/e_scalbf.c b/lib/libm/src/e_scalbf.c index f66271f968f..545330eeaa0 100644 --- a/lib/libm/src/e_scalbf.c +++ b/lib/libm/src/e_scalbf.c @@ -22,6 +22,7 @@ scalbf(float x, int fn) { return scalbnf(x,fn); } +DEF_NONSTD(scalbf); #else @@ -38,4 +39,5 @@ scalbf(float x, float fn) if (-fn > (float)65000.0) return scalbnf(x,-65000); return scalbnf(x,(int)fn); } +DEF_NONSTD(scalbf); #endif diff --git a/lib/libm/src/e_sinh.c b/lib/libm/src/e_sinh.c index 944228f6613..1df129dcb58 100644 --- a/lib/libm/src/e_sinh.c +++ b/lib/libm/src/e_sinh.c @@ -74,7 +74,5 @@ sinh(double x) /* |x| > overflowthresold, sinh(x) overflow */ return x*shuge; } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(sinhl, sinh); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(sinh); +LDBL_MAYBE_CLONE(sinh); diff --git a/lib/libm/src/e_sinhf.c b/lib/libm/src/e_sinhf.c index d898b474a15..77211bdd374 100644 --- a/lib/libm/src/e_sinhf.c +++ b/lib/libm/src/e_sinhf.c @@ -54,3 +54,4 @@ sinhf(float x) /* |x| > overflowthresold, sinh(x) overflow */ return x*shuge; } +DEF_STD(sinhf); diff --git a/lib/libm/src/e_sqrt.c b/lib/libm/src/e_sqrt.c index dac3f1b2f2f..e7b3ef44b5a 100644 --- a/lib/libm/src/e_sqrt.c +++ b/lib/libm/src/e_sqrt.c @@ -183,6 +183,8 @@ sqrt(double x) INSERT_WORDS(z,ix0,ix1); return z; } +DEF_STD(sqrt); +LDBL_MAYBE_CLONE(sqrt); /* Other methods (use floating-point arithmetic) @@ -440,7 +442,3 @@ B. sqrt(x) by Reciproot Iteration (4) Special cases (see (4) of Section A). */ - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(sqrtl, sqrt); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ diff --git a/lib/libm/src/e_sqrtf.c b/lib/libm/src/e_sqrtf.c index 80d35278cad..b46a30036f6 100644 --- a/lib/libm/src/e_sqrtf.c +++ b/lib/libm/src/e_sqrtf.c @@ -83,3 +83,4 @@ sqrtf(float x) SET_FLOAT_WORD(z,ix); return z; } +DEF_STD(sqrtf); diff --git a/lib/libm/src/e_sqrtl.c b/lib/libm/src/e_sqrtl.c index 9bbeec88db0..2e4db8f748a 100644 --- a/lib/libm/src/e_sqrtl.c +++ b/lib/libm/src/e_sqrtl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_sqrtl.c,v 1.2 2016/09/12 04:28:41 guenther Exp $ */ +/* $OpenBSD: e_sqrtl.c,v 1.3 2016/09/12 19:47:02 guenther Exp $ */ /*- * Copyright (c) 2007 Steven G. Kargl * All rights reserved. @@ -229,3 +229,4 @@ sqrtl(long double x) u.bits.ext_exp--; return (u.e); } +DEF_STD(sqrtl); diff --git a/lib/libm/src/ld128/e_coshl.c b/lib/libm/src/ld128/e_coshl.c index 3098c7b625d..e44eda92c3f 100644 --- a/lib/libm/src/ld128/e_coshl.c +++ b/lib/libm/src/ld128/e_coshl.c @@ -103,3 +103,4 @@ coshl(long double x) /* |x| > overflowthresold, cosh(x) overflow */ return huge * huge; } +DEF_STD(coshl); diff --git a/lib/libm/src/ld128/e_expl.c b/lib/libm/src/ld128/e_expl.c index 0118d4fca04..4e10575d845 100644 --- a/lib/libm/src/ld128/e_expl.c +++ b/lib/libm/src/ld128/e_expl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_expl.c,v 1.3 2013/11/12 20:35:18 martynas Exp $ */ +/* $OpenBSD: e_expl.c,v 1.4 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> @@ -143,3 +143,4 @@ x = 1.0L + x + x; x = ldexpl( x, n ); return(x); } +DEF_STD(expl); diff --git a/lib/libm/src/ld128/e_hypotl.c b/lib/libm/src/ld128/e_hypotl.c index ff642d9ce91..63beb0e486f 100644 --- a/lib/libm/src/ld128/e_hypotl.c +++ b/lib/libm/src/ld128/e_hypotl.c @@ -120,3 +120,4 @@ hypotl(long double x, long double y) return t1*w; } else return w; } +DEF_STD(hypotl); diff --git a/lib/libm/src/ld128/e_lgammal.c b/lib/libm/src/ld128/e_lgammal.c index 04b1546f7d2..b0e03cf520a 100644 --- a/lib/libm/src/ld128/e_lgammal.c +++ b/lib/libm/src/ld128/e_lgammal.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_lgammal.c,v 1.4 2016/09/12 04:39:47 guenther Exp $ */ +/* $OpenBSD: e_lgammal.c,v 1.5 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> @@ -1036,3 +1036,4 @@ lgammal(long double x) q += neval (p, RASY, NRASY) / x; return (q); } +DEF_STD(lgammal); diff --git a/lib/libm/src/ld128/e_logl.c b/lib/libm/src/ld128/e_logl.c index 8f2b7e6e709..5900c5071bd 100644 --- a/lib/libm/src/ld128/e_logl.c +++ b/lib/libm/src/ld128/e_logl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_logl.c,v 1.1 2011/07/06 00:02:42 martynas Exp $ */ +/* $OpenBSD: e_logl.c,v 1.2 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> @@ -281,3 +281,4 @@ logl(long double x) y += e * ln2a; return y; } +DEF_STD(logl); diff --git a/lib/libm/src/ld128/e_powl.c b/lib/libm/src/ld128/e_powl.c index 1c73633e4f5..34646810163 100644 --- a/lib/libm/src/ld128/e_powl.c +++ b/lib/libm/src/ld128/e_powl.c @@ -437,3 +437,4 @@ powl(long double x, long double y) } return s * z; } +DEF_STD(powl); diff --git a/lib/libm/src/ld128/e_sinhl.c b/lib/libm/src/ld128/e_sinhl.c index a158d5a7b10..7bd19c6ad93 100644 --- a/lib/libm/src/ld128/e_sinhl.c +++ b/lib/libm/src/ld128/e_sinhl.c @@ -102,3 +102,4 @@ sinhl(long double x) /* |x| > overflowthreshold, sinhl(x) overflow */ return x * shuge; } +DEF_STD(sinhl); diff --git a/lib/libm/src/ld128/invtrig.h b/lib/libm/src/ld128/invtrig.h index 89b49766b86..fd8c0b42532 100644 --- a/lib/libm/src/ld128/invtrig.h +++ b/lib/libm/src/ld128/invtrig.h @@ -1,4 +1,4 @@ -/* $OpenBSD: invtrig.h,v 1.1 2008/12/09 20:00:35 martynas Exp $ */ +/* $OpenBSD: invtrig.h,v 1.2 2016/09/12 19:47:02 guenther Exp $ */ /*- * Copyright (c) 2008 David Schultz <das@FreeBSD.ORG> * All rights reserved. @@ -76,11 +76,13 @@ #define pio2_lo atanlo[3] #define pio4_hi atanhi[1] +__BEGIN_HIDDEN_DECLS /* Constants shared by the long double inverse trig functions. */ extern const long double pS0, pS1, pS2, pS3, pS4, pS5, pS6, pS7, pS8, pS9; extern const long double qS1, qS2, qS3, qS4, qS5, qS6, qS7, qS8, qS9; extern const long double atanhi[], atanlo[], aT[]; extern const long double pi_lo; +__END_HIDDEN_DECLS static inline long double P(long double x) diff --git a/lib/libm/src/ld128/s_erfl.c b/lib/libm/src/ld128/s_erfl.c index c6b3d4d0b3b..fdfe9573e4c 100644 --- a/lib/libm/src/ld128/s_erfl.c +++ b/lib/libm/src/ld128/s_erfl.c @@ -791,6 +791,7 @@ erfl(long double x) y = -y; return( y ); } +DEF_STD(erfl); long double erfcl(long double x) @@ -924,3 +925,4 @@ erfcl(long double x) return two - tiny; } } +DEF_STD(erfcl); diff --git a/lib/libm/src/ld128/s_expm1l.c b/lib/libm/src/ld128/s_expm1l.c index eb58b3ee209..ca95dfaa79b 100644 --- a/lib/libm/src/ld128/s_expm1l.c +++ b/lib/libm/src/ld128/s_expm1l.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_expm1l.c,v 1.1 2011/07/06 00:02:42 martynas Exp $ */ +/* $OpenBSD: s_expm1l.c,v 1.2 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> @@ -160,3 +160,4 @@ expm1l(long double x) x = px * qx + (px - 1.0); return x; } +DEF_STD(expm1l); diff --git a/lib/libm/src/ld128/s_floorl.c b/lib/libm/src/ld128/s_floorl.c index a7d8140cc64..6e2f1291c04 100644 --- a/lib/libm/src/ld128/s_floorl.c +++ b/lib/libm/src/ld128/s_floorl.c @@ -69,3 +69,4 @@ floorl(long double x) SET_LDOUBLE_WORDS64(x,i0,i1); return x; } +DEF_STD(floorl); diff --git a/lib/libm/src/ld128/s_log1pl.c b/lib/libm/src/ld128/s_log1pl.c index 673bf6a1617..24a51d4e4ad 100644 --- a/lib/libm/src/ld128/s_log1pl.c +++ b/lib/libm/src/ld128/s_log1pl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_log1pl.c,v 1.1 2011/07/06 00:02:42 martynas Exp $ */ +/* $OpenBSD: s_log1pl.c,v 1.2 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> @@ -245,3 +245,4 @@ log1pl(long double xm1) z = z + e * C1; return (z); } +DEF_STD(log1pl); diff --git a/lib/libm/src/ld128/s_nextafterl.c b/lib/libm/src/ld128/s_nextafterl.c index 7a3bbf7751d..35507658282 100644 --- a/lib/libm/src/ld128/s_nextafterl.c +++ b/lib/libm/src/ld128/s_nextafterl.c @@ -68,5 +68,5 @@ nextafterl(long double x, long double y) SET_LDOUBLE_WORDS64(x,hx,lx); return x; } - -__strong_alias(nexttowardl, nextafterl); +DEF_STD(nextafterl); +MAKE_UNUSED_CLONE(nexttowardl, nextafterl); diff --git a/lib/libm/src/ld128/s_remquol.c b/lib/libm/src/ld128/s_remquol.c index ee7a7131137..b779489e0f9 100644 --- a/lib/libm/src/ld128/s_remquol.c +++ b/lib/libm/src/ld128/s_remquol.c @@ -166,3 +166,4 @@ fixup: *quo = (sxy ? -q : q); return x; } +DEF_STD(remquol); diff --git a/lib/libm/src/ld80/e_coshl.c b/lib/libm/src/ld80/e_coshl.c index 25349dbb39a..cdb4dffeab3 100644 --- a/lib/libm/src/ld80/e_coshl.c +++ b/lib/libm/src/ld80/e_coshl.c @@ -80,3 +80,4 @@ coshl(long double x) /* |x| >= log(2*maxdouble), cosh(x) overflow */ return huge*huge; } +DEF_STD(coshl); diff --git a/lib/libm/src/ld80/e_expl.c b/lib/libm/src/ld80/e_expl.c index 2e1008a7e36..698c19f85bb 100644 --- a/lib/libm/src/ld80/e_expl.c +++ b/lib/libm/src/ld80/e_expl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_expl.c,v 1.3 2013/11/12 20:35:19 martynas Exp $ */ +/* $OpenBSD: e_expl.c,v 1.4 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> @@ -129,3 +129,4 @@ x = 1.0L + ldexpl( x, 1 ); x = ldexpl( x, n ); return(x); } +DEF_STD(expl); diff --git a/lib/libm/src/ld80/e_hypotl.c b/lib/libm/src/ld80/e_hypotl.c index e70d2b1d104..0030db33d47 100644 --- a/lib/libm/src/ld80/e_hypotl.c +++ b/lib/libm/src/ld80/e_hypotl.c @@ -120,3 +120,4 @@ hypotl(long double x, long double y) return t1*w; } else return w; } +DEF_STD(hypotl); diff --git a/lib/libm/src/ld80/e_lgammal.c b/lib/libm/src/ld80/e_lgammal.c index 04c0aef84c5..18c445f71ae 100644 --- a/lib/libm/src/ld80/e_lgammal.c +++ b/lib/libm/src/ld80/e_lgammal.c @@ -423,3 +423,4 @@ lgammal(long double x) r = nadj - r; return r; } +DEF_STD(lgammal); diff --git a/lib/libm/src/ld80/e_logl.c b/lib/libm/src/ld80/e_logl.c index 7c1b854dfcf..a85ae0bfc5a 100644 --- a/lib/libm/src/ld80/e_logl.c +++ b/lib/libm/src/ld80/e_logl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_logl.c,v 1.3 2013/11/12 20:35:19 martynas Exp $ */ +/* $OpenBSD: e_logl.c,v 1.4 2016/09/12 19:47:03 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> @@ -188,3 +188,4 @@ z = z + x; z = z + e * C1; /* This sum has an error of 1/2 lsb. */ return( z ); } +DEF_STD(logl); diff --git a/lib/libm/src/ld80/e_powl.c b/lib/libm/src/ld80/e_powl.c index 95811510904..51a7ab50ee3 100644 --- a/lib/libm/src/ld80/e_powl.c +++ b/lib/libm/src/ld80/e_powl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_powl.c,v 1.5 2013/11/12 20:35:19 martynas Exp $ */ +/* $OpenBSD: e_powl.c,v 1.6 2016/09/12 19:47:03 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> @@ -463,6 +463,7 @@ if( nflg ) return( z ); } +DEF_STD(powl); /* Find a multiple of 1/NXT that is within 1/NXT of x. */ diff --git a/lib/libm/src/ld80/e_sinhl.c b/lib/libm/src/ld80/e_sinhl.c index b5b0be79006..481313fb9ae 100644 --- a/lib/libm/src/ld80/e_sinhl.c +++ b/lib/libm/src/ld80/e_sinhl.c @@ -74,3 +74,4 @@ sinhl(long double x) /* |x| > overflowthreshold, sinhl(x) overflow */ return x*shuge; } +DEF_STD(sinhl); diff --git a/lib/libm/src/ld80/invtrig.h b/lib/libm/src/ld80/invtrig.h index 0dc77e01e34..ee9e000992e 100644 --- a/lib/libm/src/ld80/invtrig.h +++ b/lib/libm/src/ld80/invtrig.h @@ -1,4 +1,4 @@ -/* $OpenBSD: invtrig.h,v 1.1 2008/12/09 20:00:35 martynas Exp $ */ +/* $OpenBSD: invtrig.h,v 1.2 2016/09/12 19:47:03 guenther Exp $ */ /*- * Copyright (c) 2008 David Schultz <das@FreeBSD.ORG> * All rights reserved. @@ -78,10 +78,12 @@ typedef struct longdouble { typedef long double LONGDOUBLE; #endif +__BEGIN_HIDDEN_DECLS extern const LONGDOUBLE pS0, pS1, pS2, pS3, pS4, pS5, pS6; extern const LONGDOUBLE qS1, qS2, qS3, qS4, qS5; extern const LONGDOUBLE atanhi[], atanlo[], aT[]; extern const LONGDOUBLE pi_lo; +__END_HIDDEN_DECLS #ifndef STRUCT_DECLS diff --git a/lib/libm/src/ld80/s_erfl.c b/lib/libm/src/ld80/s_erfl.c index 0bb8931aa32..89101b5baa7 100644 --- a/lib/libm/src/ld80/s_erfl.c +++ b/lib/libm/src/ld80/s_erfl.c @@ -324,6 +324,7 @@ erfl(long double x) else return r / x - one; } +DEF_STD(erfl); long double erfcl(long double x) @@ -428,3 +429,4 @@ erfcl(long double x) return two - tiny; } } +DEF_STD(erfcl); diff --git a/lib/libm/src/ld80/s_expm1l.c b/lib/libm/src/ld80/s_expm1l.c index 06b053964f4..8c03cf585da 100644 --- a/lib/libm/src/ld80/s_expm1l.c +++ b/lib/libm/src/ld80/s_expm1l.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_expm1l.c,v 1.2 2011/07/20 21:02:51 martynas Exp $ */ +/* $OpenBSD: s_expm1l.c,v 1.3 2016/09/12 19:47:03 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> @@ -136,3 +136,4 @@ px = ldexpl(1.0L, k); x = px * qx + (px - 1.0); return x; } +DEF_STD(expm1l); diff --git a/lib/libm/src/ld80/s_floorl.c b/lib/libm/src/ld80/s_floorl.c index a5b787796bc..41f344b1437 100644 --- a/lib/libm/src/ld80/s_floorl.c +++ b/lib/libm/src/ld80/s_floorl.c @@ -78,3 +78,4 @@ floorl(long double x) SET_LDOUBLE_WORDS(x,se,i0,i1); return x; } +DEF_STD(floorl); diff --git a/lib/libm/src/ld80/s_log1pl.c b/lib/libm/src/ld80/s_log1pl.c index 2fbac5a815f..db40b8bd7d5 100644 --- a/lib/libm/src/ld80/s_log1pl.c +++ b/lib/libm/src/ld80/s_log1pl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_log1pl.c,v 1.3 2013/11/12 20:35:19 martynas Exp $ */ +/* $OpenBSD: s_log1pl.c,v 1.4 2016/09/12 19:47:03 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> @@ -189,3 +189,4 @@ z = z + x; z = z + e * C1; return( z ); } +DEF_STD(log1pl); diff --git a/lib/libm/src/ld80/s_nextafterl.c b/lib/libm/src/ld80/s_nextafterl.c index 39de3fa9607..8d4f1009a86 100644 --- a/lib/libm/src/ld80/s_nextafterl.c +++ b/lib/libm/src/ld80/s_nextafterl.c @@ -87,5 +87,5 @@ nextafterl(long double x, long double y) SET_LDOUBLE_WORDS(x,esx,hx,lx); return x; } - -__strong_alias(nexttowardl, nextafterl); +DEF_STD(nextafterl); +MAKE_UNUSED_CLONE(nexttowardl, nextafterl); diff --git a/lib/libm/src/ld80/s_remquol.c b/lib/libm/src/ld80/s_remquol.c index 244c1053f17..0c65639038c 100644 --- a/lib/libm/src/ld80/s_remquol.c +++ b/lib/libm/src/ld80/s_remquol.c @@ -164,3 +164,4 @@ fixup: *quo = (sxy ? -q : q); return x; } +DEF_STD(remquol); diff --git a/lib/libm/src/math_private.h b/lib/libm/src/math_private.h index 5bece0cbe6f..dbd4df26990 100644 --- a/lib/libm/src/math_private.h +++ b/lib/libm/src/math_private.h @@ -1,4 +1,4 @@ -/* $OpenBSD: math_private.h,v 1.17 2014/06/02 19:31:17 kettenis Exp $ */ +/* $OpenBSD: math_private.h,v 1.18 2016/09/12 19:47:02 guenther Exp $ */ /* * ==================================================== * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. @@ -359,6 +359,7 @@ do { \ #endif /* FLT_EVAL_METHOD == 0 || __GNUC__ == 0 */ #endif /* FLT_EVAL_METHOD */ +__BEGIN_HIDDEN_DECLS /* fdlibm kernel function */ extern int __ieee754_rem_pio2(double,double*); extern double __kernel_sin(double,double,int); @@ -382,6 +383,7 @@ long double __kernel_tanl(long double, long double, int); * Common routine to process the arguments to nan(), nanf(), and nanl(). */ void _scan_nan(uint32_t *__words, int __num_words, const char *__s); +__END_HIDDEN_DECLS /* * TRUNC() is a macro that sets the trailing 27 bits in the mantissa @@ -409,9 +411,11 @@ struct Double { /* * Functions internal to the math package, yet not static. */ +__BEGIN_HIDDEN_DECLS double __exp__D(double, double); struct Double __log__D(double); long double __p1evll(long double, void *, int); long double __polevll(long double, void *, int); +__END_HIDDEN_DECLS #endif /* _MATH_PRIVATE_H_ */ diff --git a/lib/libm/src/s_asinh.c b/lib/libm/src/s_asinh.c index 7358d7371dd..769f9d0bd84 100644 --- a/lib/libm/src/s_asinh.c +++ b/lib/libm/src/s_asinh.c @@ -53,7 +53,5 @@ asinh(double x) } if(hx>0) return w; else return -w; } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(asinhl, asinh); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(asinh); +LDBL_MAYBE_CLONE(asinh); diff --git a/lib/libm/src/s_atan.c b/lib/libm/src/s_atan.c index c70c9128d8c..65cfd9d13e3 100644 --- a/lib/libm/src/s_atan.c +++ b/lib/libm/src/s_atan.c @@ -115,7 +115,5 @@ atan(double x) return (hx<0)? -z:z; } } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(atanl, atan); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(atan); +LDBL_MAYBE_CLONE(atan); diff --git a/lib/libm/src/s_atanf.c b/lib/libm/src/s_atanf.c index 66a0c3e459f..423d8791124 100644 --- a/lib/libm/src/s_atanf.c +++ b/lib/libm/src/s_atanf.c @@ -93,3 +93,4 @@ atanf(float x) return (hx<0)? -z:z; } } +DEF_STD(atanf); diff --git a/lib/libm/src/s_atanl.c b/lib/libm/src/s_atanl.c index 6ce61533a18..75646985383 100644 --- a/lib/libm/src/s_atanl.c +++ b/lib/libm/src/s_atanl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_atanl.c,v 1.1 2008/12/09 20:00:35 martynas Exp $ */ +/* $OpenBSD: s_atanl.c,v 1.2 2016/09/12 19:47:02 guenther Exp $ */ /* @(#)s_atan.c 5.1 93/09/24 */ /* FreeBSD: head/lib/msun/src/s_atan.c 176451 2008-02-22 02:30:36Z das */ /* @@ -99,3 +99,4 @@ atanl(long double x) return (expsign<0)? -z:z; } } +DEF_STD(atanl); diff --git a/lib/libm/src/s_cabs.c b/lib/libm/src/s_cabs.c index 01b7619a7eb..fbb4dcdc8d4 100644 --- a/lib/libm/src/s_cabs.c +++ b/lib/libm/src/s_cabs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_cabs.c,v 1.6 2013/07/03 04:46:36 espie Exp $ */ +/* $OpenBSD: s_cabs.c,v 1.7 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -24,7 +24,5 @@ cabs(double complex z) { return hypot(__real__ z, __imag__ z); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(cabsl, cabs); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(cabs); +LDBL_MAYBE_CLONE(cabs); diff --git a/lib/libm/src/s_cabsf.c b/lib/libm/src/s_cabsf.c index d4d22f2dbb5..6c3e1417e09 100644 --- a/lib/libm/src/s_cabsf.c +++ b/lib/libm/src/s_cabsf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_cabsf.c,v 1.1 2008/09/07 20:36:09 martynas Exp $ */ +/* $OpenBSD: s_cabsf.c,v 1.2 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -23,3 +23,4 @@ cabsf(float complex z) { return hypotf(__real__ z, __imag__ z); } +DEF_STD(cabsf); diff --git a/lib/libm/src/s_cabsl.c b/lib/libm/src/s_cabsl.c index 2e68ec0e693..11a5cea466a 100644 --- a/lib/libm/src/s_cabsl.c +++ b/lib/libm/src/s_cabsl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_cabsl.c,v 1.1 2011/07/08 19:25:31 martynas Exp $ */ +/* $OpenBSD: s_cabsl.c,v 1.2 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2011 Martynas Venckus <martynas@openbsd.org> @@ -24,3 +24,4 @@ cabsl(long double complex z) { return hypotl(__real__ z, __imag__ z); } +DEF_STD(cabsl); diff --git a/lib/libm/src/s_cacos.c b/lib/libm/src/s_cacos.c index 35026eaffa1..b858c020408 100644 --- a/lib/libm/src/s_cacos.c +++ b/lib/libm/src/s_cacos.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_cacos.c,v 1.6 2013/07/03 04:46:36 espie Exp $ */ +/* $OpenBSD: s_cacos.c,v 1.7 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> * @@ -59,7 +59,5 @@ cacos(double complex z) w = (M_PI_2 - creal (w)) - cimag (w) * I; return (w); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(cacosl, cacos); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(cacos); +LDBL_MAYBE_UNUSED_CLONE(cacos); diff --git a/lib/libm/src/s_cacosh.c b/lib/libm/src/s_cacosh.c index 6ed364fdcdb..5ef3db6fbe0 100644 --- a/lib/libm/src/s_cacosh.c +++ b/lib/libm/src/s_cacosh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_cacosh.c,v 1.7 2015/07/16 13:29:11 martynas Exp $ */ +/* $OpenBSD: s_cacosh.c,v 1.8 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> * @@ -54,7 +54,5 @@ cacosh(double complex z) w = clog(z + csqrt(z + 1) * csqrt(z - 1)); return (w); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(cacoshl, cacosh); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(cacosh); +LDBL_MAYBE_UNUSED_CLONE(cacosh); diff --git a/lib/libm/src/s_carg.c b/lib/libm/src/s_carg.c index ba8653b39a0..97e5ff7258f 100644 --- a/lib/libm/src/s_carg.c +++ b/lib/libm/src/s_carg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_carg.c,v 1.6 2013/07/03 04:46:36 espie Exp $ */ +/* $OpenBSD: s_carg.c,v 1.7 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -24,7 +24,5 @@ carg(double complex z) { return atan2 (__imag__ z, __real__ z); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(cargl, carg); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(carg); +LDBL_MAYBE_CLONE(carg); diff --git a/lib/libm/src/s_cargf.c b/lib/libm/src/s_cargf.c index 12dbcde753d..a9e1b241f6b 100644 --- a/lib/libm/src/s_cargf.c +++ b/lib/libm/src/s_cargf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_cargf.c,v 1.1 2008/09/07 20:36:09 martynas Exp $ */ +/* $OpenBSD: s_cargf.c,v 1.2 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -23,3 +23,4 @@ cargf(float complex z) { return atan2f (__imag__ z, __real__ z); } +DEF_STD(cargf); diff --git a/lib/libm/src/s_cargl.c b/lib/libm/src/s_cargl.c index ba2fb5cdabe..cc2adf89697 100644 --- a/lib/libm/src/s_cargl.c +++ b/lib/libm/src/s_cargl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_cargl.c,v 1.1 2011/07/08 19:25:31 martynas Exp $ */ +/* $OpenBSD: s_cargl.c,v 1.2 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2011 Martynas Venckus <martynas@openbsd.org> @@ -24,3 +24,4 @@ cargl(long double complex z) { return atan2l(__imag__ z, __real__ z); } +DEF_STD(cargl); diff --git a/lib/libm/src/s_casin.c b/lib/libm/src/s_casin.c index 83e97ae9e22..94a4de007d1 100644 --- a/lib/libm/src/s_casin.c +++ b/lib/libm/src/s_casin.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_casin.c,v 1.7 2015/12/18 12:17:44 shadchin Exp $ */ +/* $OpenBSD: s_casin.c,v 1.8 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> * @@ -130,7 +130,5 @@ casin(double complex z) w = zz * (-1.0 * I); return (w); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(casinl, casin); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(casin); +LDBL_MAYBE_CLONE(casin); diff --git a/lib/libm/src/s_casinf.c b/lib/libm/src/s_casinf.c index 6edbfbf16d5..e99695bb8d9 100644 --- a/lib/libm/src/s_casinf.c +++ b/lib/libm/src/s_casinf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_casinf.c,v 1.4 2015/12/18 12:17:44 shadchin Exp $ */ +/* $OpenBSD: s_casinf.c,v 1.5 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> * @@ -132,3 +132,4 @@ casinf(float complex z) w = zz * (-1.0f * I); return (w); } +DEF_STD(casinf); diff --git a/lib/libm/src/s_casinh.c b/lib/libm/src/s_casinh.c index e78f709615e..3e0026a3956 100644 --- a/lib/libm/src/s_casinh.c +++ b/lib/libm/src/s_casinh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_casinh.c,v 1.6 2013/07/03 04:46:36 espie Exp $ */ +/* $OpenBSD: s_casinh.c,v 1.7 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> * @@ -54,7 +54,5 @@ casinh(double complex z) w = -1.0 * I * casin (z * I); return (w); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(casinhl, casinh); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(casinh); +LDBL_MAYBE_UNUSED_CLONE(casinh); diff --git a/lib/libm/src/s_casinl.c b/lib/libm/src/s_casinl.c index 0411be142c0..e6658eb24c3 100644 --- a/lib/libm/src/s_casinl.c +++ b/lib/libm/src/s_casinl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_casinl.c,v 1.4 2015/12/18 12:17:44 shadchin Exp $ */ +/* $OpenBSD: s_casinl.c,v 1.5 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> @@ -130,3 +130,4 @@ casinl(long double complex z) w = zz * (-1.0L * I); return (w); } +DEF_STD(casinl); diff --git a/lib/libm/src/s_catan.c b/lib/libm/src/s_catan.c index 87c624afb1d..5e41b5445c3 100644 --- a/lib/libm/src/s_catan.c +++ b/lib/libm/src/s_catan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_catan.c,v 1.6 2013/07/03 04:46:36 espie Exp $ */ +/* $OpenBSD: s_catan.c,v 1.7 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> * @@ -125,7 +125,5 @@ ovrf: w = MAXNUM + MAXNUM * I; return (w); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(catanl, catan); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(catan); +LDBL_MAYBE_CLONE(catan); diff --git a/lib/libm/src/s_catanf.c b/lib/libm/src/s_catanf.c index efd9096af64..d49fdd6d855 100644 --- a/lib/libm/src/s_catanf.c +++ b/lib/libm/src/s_catanf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_catanf.c,v 1.2 2010/07/18 18:42:26 guenther Exp $ */ +/* $OpenBSD: s_catanf.c,v 1.3 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> * @@ -122,3 +122,4 @@ ovrf: w = MAXNUMF + MAXNUMF * I; return (w); } +DEF_STD(catanf); diff --git a/lib/libm/src/s_catanh.c b/lib/libm/src/s_catanh.c index 16666fdd0f7..e38c883f480 100644 --- a/lib/libm/src/s_catanh.c +++ b/lib/libm/src/s_catanh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_catanh.c,v 1.6 2013/07/03 04:46:36 espie Exp $ */ +/* $OpenBSD: s_catanh.c,v 1.7 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> * @@ -54,7 +54,5 @@ catanh(double complex z) w = -1.0 * I * catan (z * I); return (w); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(catanhl, catanh); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(catanh); +LDBL_MAYBE_UNUSED_CLONE(catanh); diff --git a/lib/libm/src/s_catanl.c b/lib/libm/src/s_catanl.c index 1edc444ef62..2ecd22f3145 100644 --- a/lib/libm/src/s_catanl.c +++ b/lib/libm/src/s_catanl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_catanl.c,v 1.3 2011/07/20 21:02:51 martynas Exp $ */ +/* $OpenBSD: s_catanl.c,v 1.4 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> @@ -125,3 +125,4 @@ ovrf: w = LDBL_MAX + LDBL_MAX * I; return (w); } +DEF_STD(catanl); diff --git a/lib/libm/src/s_cbrt.c b/lib/libm/src/s_cbrt.c index 84399fa65d4..af6b75d8d2b 100644 --- a/lib/libm/src/s_cbrt.c +++ b/lib/libm/src/s_cbrt.c @@ -77,7 +77,5 @@ cbrt(double x) SET_HIGH_WORD(t,high|sign); return(t); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(cbrtl, cbrt); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(cbrt); +LDBL_MAYBE_UNUSED_CLONE(cbrt); diff --git a/lib/libm/src/s_ccos.c b/lib/libm/src/s_ccos.c index 06c6fc71d00..5905d80b107 100644 --- a/lib/libm/src/s_ccos.c +++ b/lib/libm/src/s_ccos.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_ccos.c,v 1.6 2013/07/03 04:46:36 espie Exp $ */ +/* $OpenBSD: s_ccos.c,v 1.7 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> * @@ -83,7 +83,5 @@ ccos(double complex z) w = cos(creal (z)) * ch - (sin (creal (z)) * sh) * I; return (w); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(ccosl, ccos); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(ccos); +LDBL_MAYBE_UNUSED_CLONE(ccos); diff --git a/lib/libm/src/s_ccosh.c b/lib/libm/src/s_ccosh.c index 31b7d421c1c..1fb56546ca6 100644 --- a/lib/libm/src/s_ccosh.c +++ b/lib/libm/src/s_ccosh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_ccosh.c,v 1.6 2013/07/03 04:46:36 espie Exp $ */ +/* $OpenBSD: s_ccosh.c,v 1.7 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> * @@ -57,7 +57,5 @@ ccosh(double complex z) w = cosh (x) * cos (y) + (sinh (x) * sin (y)) * I; return (w); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(ccoshl, ccosh); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(ccosh); +LDBL_MAYBE_UNUSED_CLONE(ccosh); diff --git a/lib/libm/src/s_ceil.c b/lib/libm/src/s_ceil.c index d1ea4a7f7ae..df22b506895 100644 --- a/lib/libm/src/s_ceil.c +++ b/lib/libm/src/s_ceil.c @@ -68,7 +68,5 @@ ceil(double x) INSERT_WORDS(x,i0,i1); return x; } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(ceill, ceil); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(ceil); +LDBL_MAYBE_UNUSED_CLONE(ceil); diff --git a/lib/libm/src/s_ceilf.c b/lib/libm/src/s_ceilf.c index 1f1335f73f4..6e4a4d1be32 100644 --- a/lib/libm/src/s_ceilf.c +++ b/lib/libm/src/s_ceilf.c @@ -47,3 +47,4 @@ ceilf(float x) SET_FLOAT_WORD(x,i0); return x; } +DEF_STD(ceilf); diff --git a/lib/libm/src/s_cexp.c b/lib/libm/src/s_cexp.c index 33b1e1b8f81..182a4ed42db 100644 --- a/lib/libm/src/s_cexp.c +++ b/lib/libm/src/s_cexp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_cexp.c,v 1.6 2013/07/03 04:46:36 espie Exp $ */ +/* $OpenBSD: s_cexp.c,v 1.7 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> * @@ -69,7 +69,5 @@ cexp(double complex z) w = r * cos (y) + r * sin (y) * I; return (w); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(cexpl, cexp); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(cexp); +LDBL_MAYBE_UNUSED_CLONE(cexp); diff --git a/lib/libm/src/s_cimag.c b/lib/libm/src/s_cimag.c index cc5d90e2494..a4cd8557ebe 100644 --- a/lib/libm/src/s_cimag.c +++ b/lib/libm/src/s_cimag.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_cimag.c,v 1.6 2013/07/03 04:46:36 espie Exp $ */ +/* $OpenBSD: s_cimag.c,v 1.7 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -24,7 +24,5 @@ cimag(double complex z) { return __imag__ z; } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(cimagl, cimag); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(cimag); +LDBL_MAYBE_CLONE(cimag); diff --git a/lib/libm/src/s_cimagf.c b/lib/libm/src/s_cimagf.c index 609851fbbda..f3293f07738 100644 --- a/lib/libm/src/s_cimagf.c +++ b/lib/libm/src/s_cimagf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_cimagf.c,v 1.1 2008/09/07 20:36:09 martynas Exp $ */ +/* $OpenBSD: s_cimagf.c,v 1.2 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -23,3 +23,4 @@ cimagf(float complex z) { return __imag__ z; } +DEF_STD(cimagf); diff --git a/lib/libm/src/s_cimagl.c b/lib/libm/src/s_cimagl.c index b25c3402027..53139a4d69c 100644 --- a/lib/libm/src/s_cimagl.c +++ b/lib/libm/src/s_cimagl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_cimagl.c,v 1.1 2011/07/08 19:25:31 martynas Exp $ */ +/* $OpenBSD: s_cimagl.c,v 1.2 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2011 Martynas Venckus <martynas@openbsd.org> @@ -24,3 +24,4 @@ cimagl(long double complex z) { return __imag__ z; } +DEF_STD(cimagl); diff --git a/lib/libm/src/s_clog.c b/lib/libm/src/s_clog.c index 7b17efa17aa..e3e9d04c76a 100644 --- a/lib/libm/src/s_clog.c +++ b/lib/libm/src/s_clog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_clog.c,v 1.6 2013/07/03 04:46:36 espie Exp $ */ +/* $OpenBSD: s_clog.c,v 1.7 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> * @@ -71,7 +71,5 @@ clog(double complex z) w = p + rr * I; return (w); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(clogl, clog); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(clog); +LDBL_MAYBE_CLONE(clog); diff --git a/lib/libm/src/s_clogf.c b/lib/libm/src/s_clogf.c index 75969272155..31d1cbbba6d 100644 --- a/lib/libm/src/s_clogf.c +++ b/lib/libm/src/s_clogf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_clogf.c,v 1.2 2010/07/18 18:42:26 guenther Exp $ */ +/* $OpenBSD: s_clogf.c,v 1.3 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> * @@ -70,3 +70,4 @@ clogf(float complex z) w = p + rr * I; return (w); } +DEF_STD(clogf); diff --git a/lib/libm/src/s_clogl.c b/lib/libm/src/s_clogl.c index 9b115ca4986..afd74ee10e0 100644 --- a/lib/libm/src/s_clogl.c +++ b/lib/libm/src/s_clogl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_clogl.c,v 1.2 2011/07/20 19:28:33 martynas Exp $ */ +/* $OpenBSD: s_clogl.c,v 1.3 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> @@ -71,3 +71,4 @@ clogl(long double complex z) w = p + rr * I; return (w); } +DEF_STD(clogl); diff --git a/lib/libm/src/s_conj.c b/lib/libm/src/s_conj.c index 97f1ebea704..6403ef3fd48 100644 --- a/lib/libm/src/s_conj.c +++ b/lib/libm/src/s_conj.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_conj.c,v 1.6 2013/07/03 04:46:36 espie Exp $ */ +/* $OpenBSD: s_conj.c,v 1.7 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -24,7 +24,5 @@ conj(double complex z) { return ~z; } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(conjl, conj); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(conj); +LDBL_MAYBE_UNUSED_CLONE(conj); diff --git a/lib/libm/src/s_copysign.c b/lib/libm/src/s_copysign.c index a6c1b09032f..c499d55ce8b 100644 --- a/lib/libm/src/s_copysign.c +++ b/lib/libm/src/s_copysign.c @@ -30,7 +30,5 @@ copysign(double x, double y) SET_HIGH_WORD(x,(hx&0x7fffffff)|(hy&0x80000000)); return x; } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(copysignl, copysign); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(copysign); +LDBL_MAYBE_CLONE(copysign); diff --git a/lib/libm/src/s_copysignf.c b/lib/libm/src/s_copysignf.c index 267ed2da96a..553e7daf9c8 100644 --- a/lib/libm/src/s_copysignf.c +++ b/lib/libm/src/s_copysignf.c @@ -31,3 +31,4 @@ copysignf(float x, float y) SET_FLOAT_WORD(x,(ix&0x7fffffff)|(iy&0x80000000)); return x; } +DEF_STD(copysignf); diff --git a/lib/libm/src/s_copysignl.c b/lib/libm/src/s_copysignl.c index 3d50a4118c0..2db1258bd40 100644 --- a/lib/libm/src/s_copysignl.c +++ b/lib/libm/src/s_copysignl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_copysignl.c,v 1.1 2008/12/09 20:00:35 martynas Exp $ */ +/* $OpenBSD: s_copysignl.c,v 1.2 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -29,3 +29,4 @@ copysignl(long double x, long double y) return x; } +DEF_STD(copysignl); diff --git a/lib/libm/src/s_cos.c b/lib/libm/src/s_cos.c index d29c290094f..8b923d5fe61 100644 --- a/lib/libm/src/s_cos.c +++ b/lib/libm/src/s_cos.c @@ -74,7 +74,5 @@ cos(double x) } } } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(cosl, cos); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(cos); +LDBL_MAYBE_CLONE(cos); diff --git a/lib/libm/src/s_cosf.c b/lib/libm/src/s_cosf.c index aaa3d00bf53..16cdd648cf5 100644 --- a/lib/libm/src/s_cosf.c +++ b/lib/libm/src/s_cosf.c @@ -43,3 +43,4 @@ cosf(float x) } } } +DEF_STD(cosf); diff --git a/lib/libm/src/s_cosl.c b/lib/libm/src/s_cosl.c index 6104751b6d5..867cc6ee9c2 100644 --- a/lib/libm/src/s_cosl.c +++ b/lib/libm/src/s_cosl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_cosl.c,v 1.1 2008/12/09 20:00:35 martynas Exp $ */ +/* $OpenBSD: s_cosl.c,v 1.2 2016/09/12 19:47:02 guenther Exp $ */ /*- * Copyright (c) 2007 Steven G. Kargl * All rights reserved. @@ -114,3 +114,4 @@ cosl(long double x) return (hi); } +DEF_STD(cosl); diff --git a/lib/libm/src/s_cpow.c b/lib/libm/src/s_cpow.c index c1a4e59fbc2..e44763f5548 100644 --- a/lib/libm/src/s_cpow.c +++ b/lib/libm/src/s_cpow.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_cpow.c,v 1.6 2013/07/03 04:46:36 espie Exp $ */ +/* $OpenBSD: s_cpow.c,v 1.7 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> * @@ -70,7 +70,5 @@ cpow(double complex a, double complex z) w = r * cos (theta) + (r * sin (theta)) * I; return (w); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(cpowl, cpow); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(cpow); +LDBL_MAYBE_UNUSED_CLONE(cpow); diff --git a/lib/libm/src/s_cproj.c b/lib/libm/src/s_cproj.c index f937b45cecc..edada2c3f1b 100644 --- a/lib/libm/src/s_cproj.c +++ b/lib/libm/src/s_cproj.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_cproj.c,v 1.7 2013/07/03 04:46:36 espie Exp $ */ +/* $OpenBSD: s_cproj.c,v 1.8 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -33,7 +33,5 @@ cproj(double complex z) return res; } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(cprojl, cproj); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(cproj); +LDBL_MAYBE_UNUSED_CLONE(cproj); diff --git a/lib/libm/src/s_creal.c b/lib/libm/src/s_creal.c index c0fa669cb70..979c1740efd 100644 --- a/lib/libm/src/s_creal.c +++ b/lib/libm/src/s_creal.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_creal.c,v 1.6 2013/07/03 04:46:36 espie Exp $ */ +/* $OpenBSD: s_creal.c,v 1.7 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -24,7 +24,5 @@ creal(double complex z) { return __real__ z; } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(creall, creal); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(creal); +LDBL_MAYBE_CLONE(creal); diff --git a/lib/libm/src/s_crealf.c b/lib/libm/src/s_crealf.c index 12c54ea615b..0049adfdcac 100644 --- a/lib/libm/src/s_crealf.c +++ b/lib/libm/src/s_crealf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_crealf.c,v 1.1 2008/09/07 20:36:09 martynas Exp $ */ +/* $OpenBSD: s_crealf.c,v 1.2 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -23,3 +23,4 @@ crealf(float complex z) { return __real__ z; } +DEF_STD(crealf); diff --git a/lib/libm/src/s_creall.c b/lib/libm/src/s_creall.c index 4f3f4a4194e..6050c20436d 100644 --- a/lib/libm/src/s_creall.c +++ b/lib/libm/src/s_creall.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_creall.c,v 1.1 2011/07/08 19:25:31 martynas Exp $ */ +/* $OpenBSD: s_creall.c,v 1.2 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2011 Martynas Venckus <martynas@openbsd.org> @@ -24,3 +24,4 @@ creall(long double complex z) { return __real__ z; } +DEF_STD(creall); diff --git a/lib/libm/src/s_csin.c b/lib/libm/src/s_csin.c index 3d2f2c87bf2..b14c1d4bdab 100644 --- a/lib/libm/src/s_csin.c +++ b/lib/libm/src/s_csin.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_csin.c,v 1.6 2013/07/03 04:46:36 espie Exp $ */ +/* $OpenBSD: s_csin.c,v 1.7 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> * @@ -85,7 +85,5 @@ csin(double complex z) w = sin (creal(z)) * ch + (cos (creal(z)) * sh) * I; return (w); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(csinl, csin); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(csin); +LDBL_MAYBE_UNUSED_CLONE(csin); diff --git a/lib/libm/src/s_csinh.c b/lib/libm/src/s_csinh.c index 0baa962c84e..e8839a36432 100644 --- a/lib/libm/src/s_csinh.c +++ b/lib/libm/src/s_csinh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_csinh.c,v 1.6 2013/07/03 04:46:36 espie Exp $ */ +/* $OpenBSD: s_csinh.c,v 1.7 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> * @@ -56,7 +56,5 @@ csinh(double complex z) w = sinh (x) * cos (y) + (cosh (x) * sin (y)) * I; return (w); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(csinhl, csinh); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(csinh); +LDBL_MAYBE_UNUSED_CLONE(csinh); diff --git a/lib/libm/src/s_csqrt.c b/lib/libm/src/s_csqrt.c index 3450ce0caac..b0ffa88e885 100644 --- a/lib/libm/src/s_csqrt.c +++ b/lib/libm/src/s_csqrt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_csqrt.c,v 1.7 2015/12/18 12:10:30 shadchin Exp $ */ +/* $OpenBSD: s_csqrt.c,v 1.8 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> * @@ -130,7 +130,5 @@ csqrt(double complex z) w = t + r * I; return (w); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(csqrtl, csqrt); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(csqrt); +LDBL_MAYBE_CLONE(csqrt); diff --git a/lib/libm/src/s_csqrtf.c b/lib/libm/src/s_csqrtf.c index 91a3d1bf727..6f7770c0298 100644 --- a/lib/libm/src/s_csqrtf.c +++ b/lib/libm/src/s_csqrtf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_csqrtf.c,v 1.3 2015/12/18 12:10:30 shadchin Exp $ */ +/* $OpenBSD: s_csqrtf.c,v 1.4 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> * @@ -129,3 +129,4 @@ csqrtf(float complex z) w = t + r * I; return (w); } +DEF_STD(csqrtf); diff --git a/lib/libm/src/s_csqrtl.c b/lib/libm/src/s_csqrtl.c index a21e8052c17..a82bddc866d 100644 --- a/lib/libm/src/s_csqrtl.c +++ b/lib/libm/src/s_csqrtl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_csqrtl.c,v 1.3 2015/12/18 12:10:30 shadchin Exp $ */ +/* $OpenBSD: s_csqrtl.c,v 1.4 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> @@ -126,3 +126,4 @@ csqrtl(long double complex z) w = t + r * I; return (w); } +DEF_STD(csqrtl); diff --git a/lib/libm/src/s_ctan.c b/lib/libm/src/s_ctan.c index 0612d203709..87123f32869 100644 --- a/lib/libm/src/s_ctan.c +++ b/lib/libm/src/s_ctan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_ctan.c,v 1.6 2013/07/03 04:46:36 espie Exp $ */ +/* $OpenBSD: s_ctan.c,v 1.7 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> * @@ -151,7 +151,5 @@ ctan(double complex z) w = sin (2.0 * creal(z)) / d + (sinh (2.0 * cimag(z)) / d) * I; return (w); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(ctanl, ctan); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(ctan); +LDBL_MAYBE_UNUSED_CLONE(ctan); diff --git a/lib/libm/src/s_ctanh.c b/lib/libm/src/s_ctanh.c index 16931eca1fa..c8fbadb8f11 100644 --- a/lib/libm/src/s_ctanh.c +++ b/lib/libm/src/s_ctanh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_ctanh.c,v 1.6 2013/07/03 04:46:36 espie Exp $ */ +/* $OpenBSD: s_ctanh.c,v 1.7 2016/09/12 19:47:02 guenther Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> * @@ -58,7 +58,5 @@ ctanh(double complex z) w = sinh (2.0 * x) / d + (sin (2.0 * y) / d) * I; return (w); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(ctanhl, ctanh); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(ctanh); +LDBL_MAYBE_UNUSED_CLONE(ctanh); diff --git a/lib/libm/src/s_erf.c b/lib/libm/src/s_erf.c index a7f5aa24466..30e183f8f23 100644 --- a/lib/libm/src/s_erf.c +++ b/lib/libm/src/s_erf.c @@ -235,6 +235,8 @@ erf(double x) r = exp(-z*z-0.5625)*exp((z-x)*(z+x)+R/S); if(hx>=0) return one-r/x; else return r/x-one; } +DEF_STD(erf); +LDBL_MAYBE_CLONE(erf); double erfc(double x) @@ -296,8 +298,5 @@ erfc(double x) if(hx>0) return tiny*tiny; else return two-tiny; } } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(erfl, erf); -__strong_alias(erfcl, erf); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(erfc); +LDBL_MAYBE_CLONE(erfc); diff --git a/lib/libm/src/s_exp2.c b/lib/libm/src/s_exp2.c index c28b7c44285..0f8d66ffbf6 100644 --- a/lib/libm/src/s_exp2.c +++ b/lib/libm/src/s_exp2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_exp2.c,v 1.8 2015/08/20 19:24:58 naddy Exp $ */ +/* $OpenBSD: s_exp2.c,v 1.9 2016/09/12 19:47:02 guenther Exp $ */ /*- * Copyright (c) 2005 David Schultz <das@FreeBSD.ORG> * All rights reserved. @@ -388,7 +388,5 @@ exp2(double x) return (r * twopkp1000 * twom1000); } } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(exp2l, exp2); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(exp2); +LDBL_MAYBE_UNUSED_CLONE(exp2); diff --git a/lib/libm/src/s_expm1.c b/lib/libm/src/s_expm1.c index 9c82a2b74ef..ec6b416f7dc 100644 --- a/lib/libm/src/s_expm1.c +++ b/lib/libm/src/s_expm1.c @@ -217,7 +217,5 @@ expm1(double x) } return y; } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(expm1l, expm1); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(expm1); +LDBL_MAYBE_CLONE(expm1); diff --git a/lib/libm/src/s_expm1f.c b/lib/libm/src/s_expm1f.c index 69b25394aa2..7b7e7c72cc3 100644 --- a/lib/libm/src/s_expm1f.c +++ b/lib/libm/src/s_expm1f.c @@ -120,3 +120,4 @@ expm1f(float x) } return y; } +DEF_STD(expm1f); diff --git a/lib/libm/src/s_fabsf.c b/lib/libm/src/s_fabsf.c index 71b9f755e6d..e3b96a71200 100644 --- a/lib/libm/src/s_fabsf.c +++ b/lib/libm/src/s_fabsf.c @@ -28,3 +28,4 @@ fabsf(float x) SET_FLOAT_WORD(x,ix&0x7fffffff); return x; } +DEF_STD(fabsf); diff --git a/lib/libm/src/s_floor.c b/lib/libm/src/s_floor.c index 56ab76fcb45..1d7d0f77aa0 100644 --- a/lib/libm/src/s_floor.c +++ b/lib/libm/src/s_floor.c @@ -69,7 +69,5 @@ floor(double x) INSERT_WORDS(x,i0,i1); return x; } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(floorl, floor); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(floor); +LDBL_MAYBE_CLONE(floor); diff --git a/lib/libm/src/s_floorf.c b/lib/libm/src/s_floorf.c index 8cc5e3058f3..27789f1b496 100644 --- a/lib/libm/src/s_floorf.c +++ b/lib/libm/src/s_floorf.c @@ -56,3 +56,4 @@ floorf(float x) SET_FLOAT_WORD(x,i0); return x; } +DEF_STD(floorf); diff --git a/lib/libm/src/s_fma.c b/lib/libm/src/s_fma.c index 9486e1aaec2..9257a948b72 100644 --- a/lib/libm/src/s_fma.c +++ b/lib/libm/src/s_fma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_fma.c,v 1.6 2013/11/12 19:00:38 martynas Exp $ */ +/* $OpenBSD: s_fma.c,v 1.7 2016/09/12 19:47:02 guenther Exp $ */ /*- * Copyright (c) 2005 David Schultz <das@FreeBSD.ORG> @@ -200,7 +200,5 @@ fma(double x, double y, double z) return ((long double)x * y + z); } #endif /* LDBL_MANT_DIG != 113 */ - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(fmal, fma); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(fma); +LDBL_MAYBE_UNUSED_CLONE(fma); diff --git a/lib/libm/src/s_fmax.c b/lib/libm/src/s_fmax.c index 0f4a8cb8715..30da9fa2c83 100644 --- a/lib/libm/src/s_fmax.c +++ b/lib/libm/src/s_fmax.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_fmax.c,v 1.10 2013/11/12 18:28:02 martynas Exp $ */ +/* $OpenBSD: s_fmax.c,v 1.11 2016/09/12 19:47:02 guenther Exp $ */ /*- * Copyright (c) 2004 David Schultz <das@FreeBSD.ORG> * All rights reserved. @@ -47,7 +47,5 @@ fmax(double x, double y) return (x > y ? x : y); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(fmaxl, fmax); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(fmax); +LDBL_MAYBE_UNUSED_CLONE(fmax); diff --git a/lib/libm/src/s_fmin.c b/lib/libm/src/s_fmin.c index 7b99b914a85..3083c1174f3 100644 --- a/lib/libm/src/s_fmin.c +++ b/lib/libm/src/s_fmin.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_fmin.c,v 1.10 2013/11/12 18:28:02 martynas Exp $ */ +/* $OpenBSD: s_fmin.c,v 1.11 2016/09/12 19:47:02 guenther Exp $ */ /*- * Copyright (c) 2004 David Schultz <das@FreeBSD.ORG> * All rights reserved. @@ -47,7 +47,5 @@ fmin(double x, double y) return (x < y ? x : y); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(fminl, fmin); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(fmin); +LDBL_MAYBE_UNUSED_CLONE(fmin); diff --git a/lib/libm/src/s_frexpl.c b/lib/libm/src/s_frexpl.c index 9093af12bd8..015c6ad42e3 100644 --- a/lib/libm/src/s_frexpl.c +++ b/lib/libm/src/s_frexpl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_frexpl.c,v 1.1 2008/12/09 20:00:35 martynas Exp $ */ +/* $OpenBSD: s_frexpl.c,v 1.2 2016/09/12 19:47:02 guenther Exp $ */ /*- * Copyright (c) 2004-2005 David Schultz <das@FreeBSD.ORG> * All rights reserved. @@ -68,3 +68,4 @@ frexpl(long double x, int *ex) return x; } +DEF_STD(frexpl); diff --git a/lib/libm/src/s_ilogb.c b/lib/libm/src/s_ilogb.c index 29e435c2eb2..14dec8dacb5 100644 --- a/lib/libm/src/s_ilogb.c +++ b/lib/libm/src/s_ilogb.c @@ -43,7 +43,5 @@ ilogb(double x) else if (hx<0x7ff00000) return (hx>>20)-1023; else return 0x7fffffff; } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(ilogbl, ilogb); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(ilogb); +LDBL_MAYBE_CLONE(ilogb); diff --git a/lib/libm/src/s_ilogbf.c b/lib/libm/src/s_ilogbf.c index bac38c6b9a3..04c3e316d54 100644 --- a/lib/libm/src/s_ilogbf.c +++ b/lib/libm/src/s_ilogbf.c @@ -33,3 +33,4 @@ ilogbf(float x) else if (hx<0x7f800000) return (hx>>23)-127; else return 0x7fffffff; } +DEF_STD(ilogbf); diff --git a/lib/libm/src/s_ilogbl.c b/lib/libm/src/s_ilogbl.c index da06cc9e6d8..9c1f83fff4f 100644 --- a/lib/libm/src/s_ilogbl.c +++ b/lib/libm/src/s_ilogbl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_ilogbl.c,v 1.1 2008/12/09 20:00:35 martynas Exp $ */ +/* $OpenBSD: s_ilogbl.c,v 1.2 2016/09/12 19:47:02 guenther Exp $ */ /* * From: @(#)s_ilogb.c 5.1 93/09/24 * ==================================================== @@ -76,3 +76,4 @@ ilogbl(long double x) else return (INT_MAX); } +DEF_STD(ilogbl); diff --git a/lib/libm/src/s_llrint.c b/lib/libm/src/s_llrint.c index bab027e7e16..a8d74065b71 100644 --- a/lib/libm/src/s_llrint.c +++ b/lib/libm/src/s_llrint.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_llrint.c,v 1.5 2013/07/03 04:46:36 espie Exp $ */ +/* $OpenBSD: s_llrint.c,v 1.6 2016/09/12 19:47:02 guenther Exp $ */ /* $NetBSD: llrint.c,v 1.2 2004/10/13 15:18:32 drochner Exp $ */ /* @@ -12,7 +12,3 @@ #define RESTYPE_MAX LLONG_MAX #include "s_lrint.c" - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(llrintl, llrint); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ diff --git a/lib/libm/src/s_llround.c b/lib/libm/src/s_llround.c index 079ff6125c3..e0de123a1c4 100644 --- a/lib/libm/src/s_llround.c +++ b/lib/libm/src/s_llround.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_llround.c,v 1.5 2013/07/03 04:46:36 espie Exp $ */ +/* $OpenBSD: s_llround.c,v 1.6 2016/09/12 19:47:02 guenther Exp $ */ /* $NetBSD: llround.c,v 1.2 2004/10/13 15:18:32 drochner Exp $ */ /* @@ -12,7 +12,3 @@ #define RESTYPE_MAX LLONG_MAX #include "s_lround.c" - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(llroundl, llround); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ diff --git a/lib/libm/src/s_log1p.c b/lib/libm/src/s_log1p.c index 64671f6d1d2..20fcfeefd64 100644 --- a/lib/libm/src/s_log1p.c +++ b/lib/libm/src/s_log1p.c @@ -157,7 +157,5 @@ log1p(double x) if(k==0) return f-(hfsq-s*(hfsq+R)); else return k*ln2_hi-((hfsq-(s*(hfsq+R)+(k*ln2_lo+c)))-f); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(log1pl, log1p); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(log1p); +LDBL_MAYBE_CLONE(log1p); diff --git a/lib/libm/src/s_log1pf.c b/lib/libm/src/s_log1pf.c index c5e10e1c0fa..897a0109b7c 100644 --- a/lib/libm/src/s_log1pf.c +++ b/lib/libm/src/s_log1pf.c @@ -94,3 +94,4 @@ log1pf(float x) if(k==0) return f-(hfsq-s*(hfsq+R)); else return k*ln2_hi-((hfsq-(s*(hfsq+R)+(k*ln2_lo+c)))-f); } +DEF_STD(log1pf); diff --git a/lib/libm/src/s_logb.c b/lib/libm/src/s_logb.c index 96c1208bf93..09fe82c3d1e 100644 --- a/lib/libm/src/s_logb.c +++ b/lib/libm/src/s_logb.c @@ -32,3 +32,4 @@ logb(double x) else return (double) (ix-1023); } +DEF_STD(logb); diff --git a/lib/libm/src/s_logbf.c b/lib/libm/src/s_logbf.c index bed408efab6..30737b97683 100644 --- a/lib/libm/src/s_logbf.c +++ b/lib/libm/src/s_logbf.c @@ -29,3 +29,4 @@ logbf(float x) else return (float) (ix-127); } +DEF_STD(logbf); diff --git a/lib/libm/src/s_lrint.c b/lib/libm/src/s_lrint.c index e5d8ca10e28..865cb0e1b40 100644 --- a/lib/libm/src/s_lrint.c +++ b/lib/libm/src/s_lrint.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_lrint.c,v 1.10 2013/07/03 04:46:36 espie Exp $ */ +/* $OpenBSD: s_lrint.c,v 1.11 2016/09/12 19:47:02 guenther Exp $ */ /* $NetBSD: lrint.c,v 1.3 2004/10/13 15:18:32 drochner Exp $ */ /*- @@ -97,7 +97,5 @@ LRINTNAME(double x) return (s ? -res : res); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(lrintl, lrint); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(LRINTNAME); +LDBL_MAYBE_CLONE(LRINTNAME); diff --git a/lib/libm/src/s_lrintf.c b/lib/libm/src/s_lrintf.c index ca6c5a87468..fae445483e6 100644 --- a/lib/libm/src/s_lrintf.c +++ b/lib/libm/src/s_lrintf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_lrintf.c,v 1.5 2011/04/20 21:32:59 martynas Exp $ */ +/* $OpenBSD: s_lrintf.c,v 1.6 2016/09/12 19:47:02 guenther Exp $ */ /* $NetBSD: lrintf.c,v 1.3 2004/10/13 15:18:32 drochner Exp $ */ /*- @@ -90,3 +90,4 @@ LRINTNAME(float x) return (s ? -res : res); } +DEF_STD(LRINTNAME); diff --git a/lib/libm/src/s_lround.c b/lib/libm/src/s_lround.c index 15ac8e9c91d..4b671a93114 100644 --- a/lib/libm/src/s_lround.c +++ b/lib/libm/src/s_lround.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_lround.c,v 1.7 2013/07/03 04:46:36 espie Exp $ */ +/* $OpenBSD: s_lround.c,v 1.8 2016/09/12 19:47:02 guenther Exp $ */ /* $NetBSD: lround.c,v 1.2 2004/10/13 15:18:32 drochner Exp $ */ /*- @@ -87,7 +87,5 @@ LROUNDNAME(double x) return (s ? -res : res); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(lroundl, lround); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(LROUNDNAME); +LDBL_MAYBE_UNUSED_CLONE(LROUNDNAME); diff --git a/lib/libm/src/s_nan.c b/lib/libm/src/s_nan.c index 33628c82390..7d9dbc9b979 100644 --- a/lib/libm/src/s_nan.c +++ b/lib/libm/src/s_nan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_nan.c,v 1.13 2014/07/21 01:51:11 guenther Exp $ */ +/* $OpenBSD: s_nan.c,v 1.14 2016/09/12 19:47:02 guenther Exp $ */ /*- * Copyright (c) 2007 David Schultz * All rights reserved. @@ -108,6 +108,8 @@ nan(const char *s) #endif return (u.d); } +DEF_STD(nan); +LDBL_MAYBE_UNUSED_CLONE(nan); float nanf(const char *s) @@ -121,7 +123,3 @@ nanf(const char *s) u.bits[0] |= 0x7fc00000; return (u.f); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(nanl, nan); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ diff --git a/lib/libm/src/s_nextafter.c b/lib/libm/src/s_nextafter.c index bbaf4158819..ba7d0ea1e28 100644 --- a/lib/libm/src/s_nextafter.c +++ b/lib/libm/src/s_nextafter.c @@ -71,9 +71,10 @@ nextafter(double x, double y) INSERT_WORDS(x,hx,lx); return x; } +DEF_STD(nextafter); +LDBL_MAYBE_CLONE(nextafter); #if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(nextafterl, nextafter); -__strong_alias(nexttoward, nextafter); -__strong_alias(nexttowardl, nextafter); +MAKE_UNUSED_CLONE(nexttoward, nextafter); +MAKE_UNUSED_CLONE(nexttowardl, nextafter); #endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ diff --git a/lib/libm/src/s_remquo.c b/lib/libm/src/s_remquo.c index 2175dbb43a9..5eeb47a8fde 100644 --- a/lib/libm/src/s_remquo.c +++ b/lib/libm/src/s_remquo.c @@ -149,7 +149,5 @@ fixup: *quo = (sxy ? -q : q); return x; } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(remquol, remquo); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(remquo); +LDBL_MAYBE_CLONE(remquo); diff --git a/lib/libm/src/s_rint.c b/lib/libm/src/s_rint.c index 89b4999d810..0661fecefeb 100644 --- a/lib/libm/src/s_rint.c +++ b/lib/libm/src/s_rint.c @@ -75,7 +75,5 @@ rint(double x) w = TWO52[sx]+x; return w-TWO52[sx]; } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(rintl, rint); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(rint); +LDBL_MAYBE_CLONE(rint); diff --git a/lib/libm/src/s_rintf.c b/lib/libm/src/s_rintf.c index 15ea33f699d..eda6ea1c553 100644 --- a/lib/libm/src/s_rintf.c +++ b/lib/libm/src/s_rintf.c @@ -58,3 +58,4 @@ rintf(float x) w = TWO23[sx]+x; return w-TWO23[sx]; } +DEF_STD(rintf); diff --git a/lib/libm/src/s_rintl.c b/lib/libm/src/s_rintl.c index 55ebca5ba0e..7d540316e19 100644 --- a/lib/libm/src/s_rintl.c +++ b/lib/libm/src/s_rintl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_rintl.c,v 1.1 2008/12/09 20:00:35 martynas Exp $ */ +/* $OpenBSD: s_rintl.c,v 1.2 2016/09/12 19:47:02 guenther Exp $ */ /*- * Copyright (c) 2008 David Schultz <das@FreeBSD.ORG> * All rights reserved. @@ -89,3 +89,4 @@ rintl(long double x) return (x); } +DEF_NONSTD(rintl); diff --git a/lib/libm/src/s_round.c b/lib/libm/src/s_round.c index ce7eb925bd2..7ba16441bf3 100644 --- a/lib/libm/src/s_round.c +++ b/lib/libm/src/s_round.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_round.c,v 1.6 2013/07/03 04:46:36 espie Exp $ */ +/* $OpenBSD: s_round.c,v 1.7 2016/09/12 19:47:02 guenther Exp $ */ /*- * Copyright (c) 2003, Steven G. Kargl @@ -51,7 +51,5 @@ round(double x) return (-t); } } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(roundl, round); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(round); +LDBL_MAYBE_CLONE(round); diff --git a/lib/libm/src/s_roundl.c b/lib/libm/src/s_roundl.c index b893f3193cc..319abfb4ede 100644 --- a/lib/libm/src/s_roundl.c +++ b/lib/libm/src/s_roundl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_roundl.c,v 1.2 2012/12/05 23:20:04 deraadt Exp $ */ +/* $OpenBSD: s_roundl.c,v 1.3 2016/09/12 19:47:02 guenther Exp $ */ /*- * Copyright (c) 2003, Steven G. Kargl @@ -48,3 +48,4 @@ roundl(long double x) return (-t); } } +DEF_STD(roundl); diff --git a/lib/libm/src/s_scalbn.c b/lib/libm/src/s_scalbn.c index ce4bd1a4c8c..7ca54bfc0fb 100644 --- a/lib/libm/src/s_scalbn.c +++ b/lib/libm/src/s_scalbn.c @@ -25,7 +25,5 @@ scalbn (double x, int n) { return ldexp(x, n); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(scalbnl, scalbn); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(scalbn); +LDBL_MAYBE_CLONE(scalbn); diff --git a/lib/libm/src/s_scalbnf.c b/lib/libm/src/s_scalbnf.c index 5ab9208b5d9..a3363033d60 100644 --- a/lib/libm/src/s_scalbnf.c +++ b/lib/libm/src/s_scalbnf.c @@ -48,6 +48,7 @@ scalbnf(float x, int n) SET_FLOAT_WORD(x,(ix&0x807fffff)|(k<<23)); return x*twom25; } +DEF_STD(scalbnf); float ldexpf(float x, int n) diff --git a/lib/libm/src/s_scalbnl.c b/lib/libm/src/s_scalbnl.c index 7ff444815b8..293b21a0414 100644 --- a/lib/libm/src/s_scalbnl.c +++ b/lib/libm/src/s_scalbnl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_scalbnl.c,v 1.3 2013/11/12 18:28:02 martynas Exp $ */ +/* $OpenBSD: s_scalbnl.c,v 1.4 2016/09/12 19:47:02 guenther Exp $ */ /* @(#)s_scalbn.c 5.1 93/09/24 */ /* * ==================================================== @@ -74,9 +74,11 @@ scalbnl (long double x, int n) u.bits.ext_exp = k; return u.e*0x1p-128; } +DEF_STD(scalbnl); long double ldexpl(long double x, int n) { return scalbnl(x, n); } +DEF_STD(ldexpl); diff --git a/lib/libm/src/s_signgam.c b/lib/libm/src/s_signgam.c index cec0a5a75aa..c6a6dbeae3a 100644 --- a/lib/libm/src/s_signgam.c +++ b/lib/libm/src/s_signgam.c @@ -1,4 +1,7 @@ -/* $OpenBSD: s_signgam.c,v 1.2 2015/01/20 04:41:01 krw Exp $ */ +/* $OpenBSD: s_signgam.c,v 1.3 2016/09/12 19:47:02 guenther Exp $ */ #include "math.h" #include "math_private.h" int signgam = 0; +#if 0 +DEF_NONSTD(signgam); +#endif diff --git a/lib/libm/src/s_sin.c b/lib/libm/src/s_sin.c index 65d9647af46..058486a696b 100644 --- a/lib/libm/src/s_sin.c +++ b/lib/libm/src/s_sin.c @@ -74,7 +74,5 @@ sin(double x) } } } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(sinl, sin); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(sin); +LDBL_MAYBE_CLONE(sin); diff --git a/lib/libm/src/s_sinf.c b/lib/libm/src/s_sinf.c index 7bb90e67fcd..1214212ddb3 100644 --- a/lib/libm/src/s_sinf.c +++ b/lib/libm/src/s_sinf.c @@ -43,3 +43,4 @@ sinf(float x) } } } +DEF_STD(sinf); diff --git a/lib/libm/src/s_sinl.c b/lib/libm/src/s_sinl.c index dc940dd7837..a4303d170f3 100644 --- a/lib/libm/src/s_sinl.c +++ b/lib/libm/src/s_sinl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_sinl.c,v 1.1 2008/12/09 20:00:35 martynas Exp $ */ +/* $OpenBSD: s_sinl.c,v 1.2 2016/09/12 19:47:02 guenther Exp $ */ /*- * Copyright (c) 2007 Steven G. Kargl * All rights reserved. @@ -115,3 +115,4 @@ sinl(long double x) return (s ? -hi : hi); } +DEF_STD(sinl); diff --git a/lib/libm/src/s_tan.c b/lib/libm/src/s_tan.c index 558751c413a..afa0520aefa 100644 --- a/lib/libm/src/s_tan.c +++ b/lib/libm/src/s_tan.c @@ -68,7 +68,5 @@ tan(double x) -1 -- n odd */ } } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(tanl, tan); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(tan); +LDBL_MAYBE_UNUSED_CLONE(tan); diff --git a/lib/libm/src/s_tanh.c b/lib/libm/src/s_tanh.c index cb96ce5314a..f01bd0d6851 100644 --- a/lib/libm/src/s_tanh.c +++ b/lib/libm/src/s_tanh.c @@ -76,7 +76,5 @@ tanh(double x) } return (jx>=0)? z: -z; } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(tanhl, tanh); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(tanh); +LDBL_MAYBE_UNUSED_CLONE(tanh); diff --git a/lib/libm/src/s_trunc.c b/lib/libm/src/s_trunc.c index 46a748fd8f4..2bace31af8c 100644 --- a/lib/libm/src/s_trunc.c +++ b/lib/libm/src/s_trunc.c @@ -58,7 +58,5 @@ trunc(double x) INSERT_WORDS(x,i0,i1); return x; } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(truncl, trunc); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(trunc); +LDBL_MAYBE_UNUSED_CLONE(trunc); diff --git a/lib/libm/src/w_lgamma.c b/lib/libm/src/w_lgamma.c index a0470d19a11..bc8b3f6d1e3 100644 --- a/lib/libm/src/w_lgamma.c +++ b/lib/libm/src/w_lgamma.c @@ -28,7 +28,5 @@ lgamma(double x) { return lgamma_r(x,&signgam); } - -#if LDBL_MANT_DIG == DBL_MANT_DIG -__strong_alias(lgammal, lgamma); -#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */ +DEF_STD(lgamma); +LDBL_MAYBE_CLONE(lgamma); |