From f67d78192c1be9d56d3a6f3fda4e0a70ae48c44d Mon Sep 17 00:00:00 2001 From: "Gabriel F. T. Gomes" Date: Tue, 13 Dec 2016 22:42:51 -0200 Subject: Move wrappers to libm-compat-calls-auto This commit moves one step towards the deprecation of wrappers that use _LIB_VERSION / matherr / __kernel_standard functionality, by adding the suffix '_compat' to their filenames and adjusting Makefiles and #includes accordingly. New template wrappers that do not use such functionality will be added by future patches and will be first used by the float128 wrappers. --- math/Makefile | 18 ++++++--- math/w_acos.c | 42 --------------------- math/w_acos_compat.c | 42 +++++++++++++++++++++ math/w_acosf.c | 38 ------------------- math/w_acosf_compat.c | 38 +++++++++++++++++++ math/w_acosh.c | 37 ------------------- math/w_acosh_compat.c | 37 +++++++++++++++++++ math/w_acoshf.c | 33 ----------------- math/w_acoshf_compat.c | 33 +++++++++++++++++ math/w_acoshl.c | 33 ----------------- math/w_acoshl_compat.c | 33 +++++++++++++++++ math/w_acosl.c | 38 ------------------- math/w_acosl_compat.c | 38 +++++++++++++++++++ math/w_asin.c | 42 --------------------- math/w_asin_compat.c | 42 +++++++++++++++++++++ math/w_asinf.c | 38 ------------------- math/w_asinf_compat.c | 38 +++++++++++++++++++ math/w_asinl.c | 38 ------------------- math/w_asinl_compat.c | 38 +++++++++++++++++++ math/w_atan2.c | 45 ----------------------- math/w_atan2_compat.c | 45 +++++++++++++++++++++++ math/w_atan2f.c | 41 --------------------- math/w_atan2f_compat.c | 41 +++++++++++++++++++++ math/w_atan2l.c | 41 --------------------- math/w_atan2l_compat.c | 41 +++++++++++++++++++++ math/w_atanh.c | 40 -------------------- math/w_atanh_compat.c | 40 ++++++++++++++++++++ math/w_atanhf.c | 36 ------------------ math/w_atanhf_compat.c | 36 ++++++++++++++++++ math/w_atanhl.c | 36 ------------------ math/w_atanhl_compat.c | 36 ++++++++++++++++++ math/w_cosh.c | 34 ----------------- math/w_cosh_compat.c | 34 +++++++++++++++++ math/w_coshf.c | 34 ----------------- math/w_coshf_compat.c | 34 +++++++++++++++++ math/w_coshl.c | 35 ------------------ math/w_coshl_compat.c | 35 ++++++++++++++++++ math/w_exp10.c | 46 ----------------------- math/w_exp10_compat.c | 46 +++++++++++++++++++++++ math/w_exp10f.c | 40 -------------------- math/w_exp10f_compat.c | 40 ++++++++++++++++++++ math/w_exp10l.c | 40 -------------------- math/w_exp10l_compat.c | 40 ++++++++++++++++++++ math/w_exp2.c | 23 ------------ math/w_exp2_compat.c | 23 ++++++++++++ math/w_exp2f.c | 19 ---------- math/w_exp2f_compat.c | 19 ++++++++++ math/w_exp2l.c | 19 ---------- math/w_exp2l_compat.c | 19 ++++++++++ math/w_fmod.c | 37 ------------------- math/w_fmod_compat.c | 37 +++++++++++++++++++ math/w_fmodf.c | 33 ----------------- math/w_fmodf_compat.c | 33 +++++++++++++++++ math/w_fmodl.c | 33 ----------------- math/w_fmodl_compat.c | 33 +++++++++++++++++ math/w_hypot.c | 35 ------------------ math/w_hypot_compat.c | 35 ++++++++++++++++++ math/w_hypotf.c | 35 ------------------ math/w_hypotf_compat.c | 35 ++++++++++++++++++ math/w_hypotl.c | 36 ------------------ math/w_hypotl_compat.c | 36 ++++++++++++++++++ math/w_j0.c | 68 ---------------------------------- math/w_j0_compat.c | 68 ++++++++++++++++++++++++++++++++++ math/w_j0f.c | 63 -------------------------------- math/w_j0f_compat.c | 63 ++++++++++++++++++++++++++++++++ math/w_j0l.c | 64 -------------------------------- math/w_j0l_compat.c | 64 ++++++++++++++++++++++++++++++++ math/w_j1.c | 68 ---------------------------------- math/w_j1_compat.c | 68 ++++++++++++++++++++++++++++++++++ math/w_j1f.c | 63 -------------------------------- math/w_j1f_compat.c | 63 ++++++++++++++++++++++++++++++++ math/w_j1l.c | 64 -------------------------------- math/w_j1l_compat.c | 64 ++++++++++++++++++++++++++++++++ math/w_jn.c | 68 ---------------------------------- math/w_jn_compat.c | 68 ++++++++++++++++++++++++++++++++++ math/w_jnf.c | 63 -------------------------------- math/w_jnf_compat.c | 63 ++++++++++++++++++++++++++++++++ math/w_jnl.c | 91 ---------------------------------------------- math/w_jnl_compat.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++ math/w_log.c | 48 ------------------------ math/w_log10.c | 48 ------------------------ math/w_log10_compat.c | 48 ++++++++++++++++++++++++ math/w_log10f.c | 44 ---------------------- math/w_log10f_compat.c | 44 ++++++++++++++++++++++ math/w_log10l.c | 44 ---------------------- math/w_log10l_compat.c | 44 ++++++++++++++++++++++ math/w_log2.c | 48 ------------------------ math/w_log2_compat.c | 48 ++++++++++++++++++++++++ math/w_log2f.c | 44 ---------------------- math/w_log2f_compat.c | 44 ++++++++++++++++++++++ math/w_log2l.c | 44 ---------------------- math/w_log2l_compat.c | 44 ++++++++++++++++++++++ math/w_log_compat.c | 48 ++++++++++++++++++++++++ math/w_logf.c | 44 ---------------------- math/w_logf_compat.c | 44 ++++++++++++++++++++++ math/w_logl.c | 44 ---------------------- math/w_logl_compat.c | 44 ++++++++++++++++++++++ math/w_pow.c | 64 -------------------------------- math/w_pow_compat.c | 64 ++++++++++++++++++++++++++++++++ math/w_powf.c | 60 ------------------------------ math/w_powf_compat.c | 60 ++++++++++++++++++++++++++++++ math/w_powl.c | 60 ------------------------------ math/w_powl_compat.c | 60 ++++++++++++++++++++++++++++++ math/w_remainder.c | 40 -------------------- math/w_remainder_compat.c | 40 ++++++++++++++++++++ math/w_remainderf.c | 35 ------------------ math/w_remainderf_compat.c | 35 ++++++++++++++++++ math/w_remainderl.c | 35 ------------------ math/w_remainderl_compat.c | 35 ++++++++++++++++++ math/w_scalb.c | 80 ---------------------------------------- math/w_scalb_compat.c | 80 ++++++++++++++++++++++++++++++++++++++++ math/w_scalbf.c | 76 -------------------------------------- math/w_scalbf_compat.c | 76 ++++++++++++++++++++++++++++++++++++++ math/w_scalbl.c | 76 -------------------------------------- math/w_scalbl_compat.c | 76 ++++++++++++++++++++++++++++++++++++++ math/w_sinh.c | 34 ----------------- math/w_sinh_compat.c | 34 +++++++++++++++++ math/w_sinhf.c | 33 ----------------- math/w_sinhf_compat.c | 33 +++++++++++++++++ math/w_sinhl.c | 34 ----------------- math/w_sinhl_compat.c | 34 +++++++++++++++++ math/w_sqrt.c | 36 ------------------ math/w_sqrt_compat.c | 36 ++++++++++++++++++ math/w_sqrtf.c | 32 ---------------- math/w_sqrtf_compat.c | 32 ++++++++++++++++ math/w_sqrtl.c | 32 ---------------- math/w_sqrtl_compat.c | 32 ++++++++++++++++ math/w_tgamma.c | 46 ----------------------- math/w_tgamma_compat.c | 46 +++++++++++++++++++++++ math/w_tgammaf.c | 44 ---------------------- math/w_tgammaf_compat.c | 44 ++++++++++++++++++++++ math/w_tgammal.c | 45 ----------------------- math/w_tgammal_compat.c | 45 +++++++++++++++++++++++ 133 files changed, 2972 insertions(+), 2964 deletions(-) delete mode 100644 math/w_acos.c create mode 100644 math/w_acos_compat.c delete mode 100644 math/w_acosf.c create mode 100644 math/w_acosf_compat.c delete mode 100644 math/w_acosh.c create mode 100644 math/w_acosh_compat.c delete mode 100644 math/w_acoshf.c create mode 100644 math/w_acoshf_compat.c delete mode 100644 math/w_acoshl.c create mode 100644 math/w_acoshl_compat.c delete mode 100644 math/w_acosl.c create mode 100644 math/w_acosl_compat.c delete mode 100644 math/w_asin.c create mode 100644 math/w_asin_compat.c delete mode 100644 math/w_asinf.c create mode 100644 math/w_asinf_compat.c delete mode 100644 math/w_asinl.c create mode 100644 math/w_asinl_compat.c delete mode 100644 math/w_atan2.c create mode 100644 math/w_atan2_compat.c delete mode 100644 math/w_atan2f.c create mode 100644 math/w_atan2f_compat.c delete mode 100644 math/w_atan2l.c create mode 100644 math/w_atan2l_compat.c delete mode 100644 math/w_atanh.c create mode 100644 math/w_atanh_compat.c delete mode 100644 math/w_atanhf.c create mode 100644 math/w_atanhf_compat.c delete mode 100644 math/w_atanhl.c create mode 100644 math/w_atanhl_compat.c delete mode 100644 math/w_cosh.c create mode 100644 math/w_cosh_compat.c delete mode 100644 math/w_coshf.c create mode 100644 math/w_coshf_compat.c delete mode 100644 math/w_coshl.c create mode 100644 math/w_coshl_compat.c delete mode 100644 math/w_exp10.c create mode 100644 math/w_exp10_compat.c delete mode 100644 math/w_exp10f.c create mode 100644 math/w_exp10f_compat.c delete mode 100644 math/w_exp10l.c create mode 100644 math/w_exp10l_compat.c delete mode 100644 math/w_exp2.c create mode 100644 math/w_exp2_compat.c delete mode 100644 math/w_exp2f.c create mode 100644 math/w_exp2f_compat.c delete mode 100644 math/w_exp2l.c create mode 100644 math/w_exp2l_compat.c delete mode 100644 math/w_fmod.c create mode 100644 math/w_fmod_compat.c delete mode 100644 math/w_fmodf.c create mode 100644 math/w_fmodf_compat.c delete mode 100644 math/w_fmodl.c create mode 100644 math/w_fmodl_compat.c delete mode 100644 math/w_hypot.c create mode 100644 math/w_hypot_compat.c delete mode 100644 math/w_hypotf.c create mode 100644 math/w_hypotf_compat.c delete mode 100644 math/w_hypotl.c create mode 100644 math/w_hypotl_compat.c delete mode 100644 math/w_j0.c create mode 100644 math/w_j0_compat.c delete mode 100644 math/w_j0f.c create mode 100644 math/w_j0f_compat.c delete mode 100644 math/w_j0l.c create mode 100644 math/w_j0l_compat.c delete mode 100644 math/w_j1.c create mode 100644 math/w_j1_compat.c delete mode 100644 math/w_j1f.c create mode 100644 math/w_j1f_compat.c delete mode 100644 math/w_j1l.c create mode 100644 math/w_j1l_compat.c delete mode 100644 math/w_jn.c create mode 100644 math/w_jn_compat.c delete mode 100644 math/w_jnf.c create mode 100644 math/w_jnf_compat.c delete mode 100644 math/w_jnl.c create mode 100644 math/w_jnl_compat.c delete mode 100644 math/w_log.c delete mode 100644 math/w_log10.c create mode 100644 math/w_log10_compat.c delete mode 100644 math/w_log10f.c create mode 100644 math/w_log10f_compat.c delete mode 100644 math/w_log10l.c create mode 100644 math/w_log10l_compat.c delete mode 100644 math/w_log2.c create mode 100644 math/w_log2_compat.c delete mode 100644 math/w_log2f.c create mode 100644 math/w_log2f_compat.c delete mode 100644 math/w_log2l.c create mode 100644 math/w_log2l_compat.c create mode 100644 math/w_log_compat.c delete mode 100644 math/w_logf.c create mode 100644 math/w_logf_compat.c delete mode 100644 math/w_logl.c create mode 100644 math/w_logl_compat.c delete mode 100644 math/w_pow.c create mode 100644 math/w_pow_compat.c delete mode 100644 math/w_powf.c create mode 100644 math/w_powf_compat.c delete mode 100644 math/w_powl.c create mode 100644 math/w_powl_compat.c delete mode 100644 math/w_remainder.c create mode 100644 math/w_remainder_compat.c delete mode 100644 math/w_remainderf.c create mode 100644 math/w_remainderf_compat.c delete mode 100644 math/w_remainderl.c create mode 100644 math/w_remainderl_compat.c delete mode 100644 math/w_scalb.c create mode 100644 math/w_scalb_compat.c delete mode 100644 math/w_scalbf.c create mode 100644 math/w_scalbf_compat.c delete mode 100644 math/w_scalbl.c create mode 100644 math/w_scalbl_compat.c delete mode 100644 math/w_sinh.c create mode 100644 math/w_sinh_compat.c delete mode 100644 math/w_sinhf.c create mode 100644 math/w_sinhf_compat.c delete mode 100644 math/w_sinhl.c create mode 100644 math/w_sinhl_compat.c delete mode 100644 math/w_sqrt.c create mode 100644 math/w_sqrt_compat.c delete mode 100644 math/w_sqrtf.c create mode 100644 math/w_sqrtf_compat.c delete mode 100644 math/w_sqrtl.c create mode 100644 math/w_sqrtl_compat.c delete mode 100644 math/w_tgamma.c create mode 100644 math/w_tgamma_compat.c delete mode 100644 math/w_tgammaf.c create mode 100644 math/w_tgammaf_compat.c delete mode 100644 math/w_tgammal.c create mode 100644 math/w_tgammal_compat.c (limited to 'math') diff --git a/math/Makefile b/math/Makefile index d15b58e1cf..0ee46480e2 100644 --- a/math/Makefile +++ b/math/Makefile @@ -65,19 +65,26 @@ libm-calls = \ s_ceilF s_cosF s_erfF s_expm1F s_fabsF \ s_floorF s_log1pF s_logbF \ s_nextafterF s_nexttowardF s_rintF s_scalblnF \ - s_significandF s_sinF s_tanF s_tanhF w_acosF w_acoshF w_asinF \ - w_atan2F w_atanhF w_coshF w_expF w_exp2F w_exp10F w_fmodF \ - w_tgammaF w_hypotF w_j0F w_j1F w_jnF w_lgammaF w_lgammaF_r \ - w_logF w_log10F w_powF w_remainderF w_scalbF w_sinhF w_sqrtF \ + s_significandF s_sinF s_tanF s_tanhF \ + w_expF \ + w_lgammaF w_lgammaF_r \ s_fpclassifyF s_truncF \ s_remquoF e_log2F e_exp2F s_roundF s_nearbyintF s_sincosF \ - s_fmaF s_lrintF s_llrintF s_lroundF s_llroundF e_exp10F w_log2F \ + s_fmaF s_lrintF s_llrintF s_lroundF s_llroundF e_exp10F \ s_issignalingF $(calls:s_%=m_%) x2y2m1F \ gamma_productF lgamma_negF lgamma_productF \ s_nextupF s_totalorderF s_totalordermagF s_getpayloadF \ s_setpayloadF s_setpayloadsigF s_roundevenF s_fromfpF s_ufromfpF \ s_fromfpxF s_ufromfpxF $(gen-libm-calls) +libm-compat-calls-auto = \ + w_acosF_compat w_acoshF_compat w_asinF_compat w_atan2F_compat \ + w_atanhF_compat w_coshF_compat w_exp2F_compat w_exp10F_compat \ + w_fmodF_compat w_hypotF_compat w_j0F_compat w_j1F_compat \ + w_jnF_compat w_log2F_compat w_log10F_compat w_logF_compat \ + w_powF_compat w_remainderF_compat w_scalbF_compat \ + w_sinhF_compat w_sqrtF_compat w_tgammaF_compat + libm-compat-calls-ldouble-yes = w_lgamma_compatl k_standardl libm-compat-calls = w_lgamma_compatf w_lgamma_compat k_standard k_standardf \ $(libm-compat-calls-ldouble-$(long-double-fcts)) @@ -116,6 +123,7 @@ type-float-routines := k_rem_pio2f type-foreach = $(foreach t,$(types),$(subst F,$(type-$(t)-suffix),$(1))) libm-routines = $(strip $(libm-support) $(libm-compat-calls) \ + $(call type-foreach, $(libm-compat-calls-auto)) \ $(call type-foreach, $(libm-calls)) \ $(foreach t, $(types), $(type-$(t)-routines))) \ diff --git a/math/w_acos.c b/math/w_acos.c deleted file mode 100644 index e6fbdf139c..0000000000 --- a/math/w_acos.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - - -/* wrapper acos */ -double -__acos (double x) -{ - if (__builtin_expect (isgreater (fabs (x), 1.0), 0) - && _LIB_VERSION != _IEEE_) - { - /* acos(|x|>1) */ - __feraiseexcept (FE_INVALID); - return __kernel_standard (x, x, 1); - } - - return __ieee754_acos (x); -} -weak_alias (__acos, acos) -#ifdef NO_LONG_DOUBLE -strong_alias (__acos, __acosl) -weak_alias (__acos, acosl) -#endif diff --git a/math/w_acos_compat.c b/math/w_acos_compat.c new file mode 100644 index 0000000000..e6fbdf139c --- /dev/null +++ b/math/w_acos_compat.c @@ -0,0 +1,42 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + + +/* wrapper acos */ +double +__acos (double x) +{ + if (__builtin_expect (isgreater (fabs (x), 1.0), 0) + && _LIB_VERSION != _IEEE_) + { + /* acos(|x|>1) */ + __feraiseexcept (FE_INVALID); + return __kernel_standard (x, x, 1); + } + + return __ieee754_acos (x); +} +weak_alias (__acos, acos) +#ifdef NO_LONG_DOUBLE +strong_alias (__acos, __acosl) +weak_alias (__acos, acosl) +#endif diff --git a/math/w_acosf.c b/math/w_acosf.c deleted file mode 100644 index f389da19ba..0000000000 --- a/math/w_acosf.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - - -/* wrapper acosf */ -float -__acosf (float x) -{ - if (__builtin_expect (isgreater (fabsf (x), 1.0f), 0) - && _LIB_VERSION != _IEEE_) - { - /* acos(|x|>1) */ - feraiseexcept (FE_INVALID); - return __kernel_standard_f (x, x, 101); - } - - return __ieee754_acosf (x); -} -weak_alias (__acosf, acosf) diff --git a/math/w_acosf_compat.c b/math/w_acosf_compat.c new file mode 100644 index 0000000000..f389da19ba --- /dev/null +++ b/math/w_acosf_compat.c @@ -0,0 +1,38 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + + +/* wrapper acosf */ +float +__acosf (float x) +{ + if (__builtin_expect (isgreater (fabsf (x), 1.0f), 0) + && _LIB_VERSION != _IEEE_) + { + /* acos(|x|>1) */ + feraiseexcept (FE_INVALID); + return __kernel_standard_f (x, x, 101); + } + + return __ieee754_acosf (x); +} +weak_alias (__acosf, acosf) diff --git a/math/w_acosh.c b/math/w_acosh.c deleted file mode 100644 index 286ea86b89..0000000000 --- a/math/w_acosh.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include - - -/* wrapper acosh */ -double -__acosh (double x) -{ - if (__builtin_expect (isless (x, 1.0), 0) && _LIB_VERSION != _IEEE_) - /* acosh(x<1) */ - return __kernel_standard (x, x, 29); - - return __ieee754_acosh (x); -} -weak_alias (__acosh, acosh) -#ifdef NO_LONG_DOUBLE -strong_alias (__acosh, __acoshl) -weak_alias (__acosh, acoshl) -#endif diff --git a/math/w_acosh_compat.c b/math/w_acosh_compat.c new file mode 100644 index 0000000000..286ea86b89 --- /dev/null +++ b/math/w_acosh_compat.c @@ -0,0 +1,37 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + + +/* wrapper acosh */ +double +__acosh (double x) +{ + if (__builtin_expect (isless (x, 1.0), 0) && _LIB_VERSION != _IEEE_) + /* acosh(x<1) */ + return __kernel_standard (x, x, 29); + + return __ieee754_acosh (x); +} +weak_alias (__acosh, acosh) +#ifdef NO_LONG_DOUBLE +strong_alias (__acosh, __acoshl) +weak_alias (__acosh, acoshl) +#endif diff --git a/math/w_acoshf.c b/math/w_acoshf.c deleted file mode 100644 index 801a52edf0..0000000000 --- a/math/w_acoshf.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include - - -/* wrapper acoshf */ -float -__acoshf (float x) -{ - if (__builtin_expect (isless (x, 1.0f), 0) && _LIB_VERSION != _IEEE_) - /* acosh(x<1) */ - return __kernel_standard_f (x, x, 129); - - return __ieee754_acoshf (x); -} -weak_alias (__acoshf, acoshf) diff --git a/math/w_acoshf_compat.c b/math/w_acoshf_compat.c new file mode 100644 index 0000000000..801a52edf0 --- /dev/null +++ b/math/w_acoshf_compat.c @@ -0,0 +1,33 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + + +/* wrapper acoshf */ +float +__acoshf (float x) +{ + if (__builtin_expect (isless (x, 1.0f), 0) && _LIB_VERSION != _IEEE_) + /* acosh(x<1) */ + return __kernel_standard_f (x, x, 129); + + return __ieee754_acoshf (x); +} +weak_alias (__acoshf, acoshf) diff --git a/math/w_acoshl.c b/math/w_acoshl.c deleted file mode 100644 index 310f3c9954..0000000000 --- a/math/w_acoshl.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include - - -/* wrapper acosl */ -long double -__acoshl (long double x) -{ - if (__builtin_expect (isless (x, 1.0L), 0) && _LIB_VERSION != _IEEE_) - /* acosh(x<1) */ - return __kernel_standard_l (x, x, 229); - - return __ieee754_acoshl (x); -} -weak_alias (__acoshl, acoshl) diff --git a/math/w_acoshl_compat.c b/math/w_acoshl_compat.c new file mode 100644 index 0000000000..310f3c9954 --- /dev/null +++ b/math/w_acoshl_compat.c @@ -0,0 +1,33 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + + +/* wrapper acosl */ +long double +__acoshl (long double x) +{ + if (__builtin_expect (isless (x, 1.0L), 0) && _LIB_VERSION != _IEEE_) + /* acosh(x<1) */ + return __kernel_standard_l (x, x, 229); + + return __ieee754_acoshl (x); +} +weak_alias (__acoshl, acoshl) diff --git a/math/w_acosl.c b/math/w_acosl.c deleted file mode 100644 index eaccc6646d..0000000000 --- a/math/w_acosl.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - - -/* wrapper acosl */ -long double -__acosl (long double x) -{ - if (__builtin_expect (isgreater (fabsl (x), 1.0L), 0) - && _LIB_VERSION != _IEEE_) - { - /* acos(|x|>1) */ - feraiseexcept (FE_INVALID); - return __kernel_standard_l (x, x, 201); - } - - return __ieee754_acosl (x); -} -weak_alias (__acosl, acosl) diff --git a/math/w_acosl_compat.c b/math/w_acosl_compat.c new file mode 100644 index 0000000000..eaccc6646d --- /dev/null +++ b/math/w_acosl_compat.c @@ -0,0 +1,38 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + + +/* wrapper acosl */ +long double +__acosl (long double x) +{ + if (__builtin_expect (isgreater (fabsl (x), 1.0L), 0) + && _LIB_VERSION != _IEEE_) + { + /* acos(|x|>1) */ + feraiseexcept (FE_INVALID); + return __kernel_standard_l (x, x, 201); + } + + return __ieee754_acosl (x); +} +weak_alias (__acosl, acosl) diff --git a/math/w_asin.c b/math/w_asin.c deleted file mode 100644 index b2ad6323ed..0000000000 --- a/math/w_asin.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - - -/* wrapper asin */ -double -__asin (double x) -{ - if (__builtin_expect (isgreater (fabs (x), 1.0), 0) - && _LIB_VERSION != _IEEE_) - { - /* asin(|x|>1) */ - __feraiseexcept (FE_INVALID); - return __kernel_standard (x, x, 2); - } - - return __ieee754_asin (x); -} -weak_alias (__asin, asin) -#ifdef NO_LONG_DOUBLE -strong_alias (__asin, __asinl) -weak_alias (__asin, asinl) -#endif diff --git a/math/w_asin_compat.c b/math/w_asin_compat.c new file mode 100644 index 0000000000..b2ad6323ed --- /dev/null +++ b/math/w_asin_compat.c @@ -0,0 +1,42 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + + +/* wrapper asin */ +double +__asin (double x) +{ + if (__builtin_expect (isgreater (fabs (x), 1.0), 0) + && _LIB_VERSION != _IEEE_) + { + /* asin(|x|>1) */ + __feraiseexcept (FE_INVALID); + return __kernel_standard (x, x, 2); + } + + return __ieee754_asin (x); +} +weak_alias (__asin, asin) +#ifdef NO_LONG_DOUBLE +strong_alias (__asin, __asinl) +weak_alias (__asin, asinl) +#endif diff --git a/math/w_asinf.c b/math/w_asinf.c deleted file mode 100644 index 0d0ee98f98..0000000000 --- a/math/w_asinf.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - - -/* wrapper asinf */ -float -__asinf (float x) -{ - if (__builtin_expect (isgreater (fabsf (x), 1.0f), 0) - && _LIB_VERSION != _IEEE_) - { - /* asin(|x|>1) */ - feraiseexcept (FE_INVALID); - return __kernel_standard_f (x, x, 102); - } - - return __ieee754_asinf (x); -} -weak_alias (__asinf, asinf) diff --git a/math/w_asinf_compat.c b/math/w_asinf_compat.c new file mode 100644 index 0000000000..0d0ee98f98 --- /dev/null +++ b/math/w_asinf_compat.c @@ -0,0 +1,38 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + + +/* wrapper asinf */ +float +__asinf (float x) +{ + if (__builtin_expect (isgreater (fabsf (x), 1.0f), 0) + && _LIB_VERSION != _IEEE_) + { + /* asin(|x|>1) */ + feraiseexcept (FE_INVALID); + return __kernel_standard_f (x, x, 102); + } + + return __ieee754_asinf (x); +} +weak_alias (__asinf, asinf) diff --git a/math/w_asinl.c b/math/w_asinl.c deleted file mode 100644 index a02fa1e04c..0000000000 --- a/math/w_asinl.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - - -/* wrapper asinl */ -long double -__asinl (long double x) -{ - if (__builtin_expect (isgreater (fabsl (x), 1.0L), 0) - && _LIB_VERSION != _IEEE_) - { - /* asin(|x|>1) */ - feraiseexcept (FE_INVALID); - return __kernel_standard_l (x, x, 202); - } - - return __ieee754_asinl (x); -} -weak_alias (__asinl, asinl) diff --git a/math/w_asinl_compat.c b/math/w_asinl_compat.c new file mode 100644 index 0000000000..a02fa1e04c --- /dev/null +++ b/math/w_asinl_compat.c @@ -0,0 +1,38 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + + +/* wrapper asinl */ +long double +__asinl (long double x) +{ + if (__builtin_expect (isgreater (fabsl (x), 1.0L), 0) + && _LIB_VERSION != _IEEE_) + { + /* asin(|x|>1) */ + feraiseexcept (FE_INVALID); + return __kernel_standard_l (x, x, 202); + } + + return __ieee754_asinl (x); +} +weak_alias (__asinl, asinl) diff --git a/math/w_atan2.c b/math/w_atan2.c deleted file mode 100644 index cceb602258..0000000000 --- a/math/w_atan2.c +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -/* - * wrapper atan2(y,x) - */ - -#include -#include -#include - - -double -__atan2 (double y, double x) -{ - double z; - - if (__builtin_expect (x == 0.0 && y == 0.0, 0) && _LIB_VERSION == _SVID_) - return __kernel_standard (y, x, 3); /* atan2(+-0,+-0) */ - - z = __ieee754_atan2 (y, x); - if (__glibc_unlikely (z == 0.0 && y != 0.0 && isfinite (x))) - __set_errno (ERANGE); - return z; -} -weak_alias (__atan2, atan2) -#ifdef NO_LONG_DOUBLE -strong_alias (__atan2, __atan2l) -weak_alias (__atan2, atan2l) -#endif diff --git a/math/w_atan2_compat.c b/math/w_atan2_compat.c new file mode 100644 index 0000000000..cceb602258 --- /dev/null +++ b/math/w_atan2_compat.c @@ -0,0 +1,45 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* + * wrapper atan2(y,x) + */ + +#include +#include +#include + + +double +__atan2 (double y, double x) +{ + double z; + + if (__builtin_expect (x == 0.0 && y == 0.0, 0) && _LIB_VERSION == _SVID_) + return __kernel_standard (y, x, 3); /* atan2(+-0,+-0) */ + + z = __ieee754_atan2 (y, x); + if (__glibc_unlikely (z == 0.0 && y != 0.0 && isfinite (x))) + __set_errno (ERANGE); + return z; +} +weak_alias (__atan2, atan2) +#ifdef NO_LONG_DOUBLE +strong_alias (__atan2, __atan2l) +weak_alias (__atan2, atan2l) +#endif diff --git a/math/w_atan2f.c b/math/w_atan2f.c deleted file mode 100644 index 8343893e74..0000000000 --- a/math/w_atan2f.c +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -/* - * wrapper atan2f(y,x) - */ - -#include -#include -#include - - -float -__atan2f (float y, float x) -{ - float z; - - if (__builtin_expect (x == 0.0f && y == 0.0f, 0) && _LIB_VERSION == _SVID_) - return __kernel_standard_f (y, x, 103); /* atan2(+-0,+-0) */ - - z = __ieee754_atan2f (y, x); - if (__glibc_unlikely (z == 0.0f && y != 0.0f && isfinite (x))) - __set_errno (ERANGE); - return z; -} -weak_alias (__atan2f, atan2f) diff --git a/math/w_atan2f_compat.c b/math/w_atan2f_compat.c new file mode 100644 index 0000000000..8343893e74 --- /dev/null +++ b/math/w_atan2f_compat.c @@ -0,0 +1,41 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* + * wrapper atan2f(y,x) + */ + +#include +#include +#include + + +float +__atan2f (float y, float x) +{ + float z; + + if (__builtin_expect (x == 0.0f && y == 0.0f, 0) && _LIB_VERSION == _SVID_) + return __kernel_standard_f (y, x, 103); /* atan2(+-0,+-0) */ + + z = __ieee754_atan2f (y, x); + if (__glibc_unlikely (z == 0.0f && y != 0.0f && isfinite (x))) + __set_errno (ERANGE); + return z; +} +weak_alias (__atan2f, atan2f) diff --git a/math/w_atan2l.c b/math/w_atan2l.c deleted file mode 100644 index b7b29ff6c3..0000000000 --- a/math/w_atan2l.c +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -/* - * wrapper atan2l(y,x) - */ - -#include -#include -#include - - -long double -__atan2l (long double y, long double x) -{ - long double z; - - if (__builtin_expect (x == 0.0L && y == 0.0L, 0) && _LIB_VERSION == _SVID_) - return __kernel_standard_l (y, x, 203); /* atan2(+-0,+-0) */ - - z = __ieee754_atan2l (y, x); - if (__glibc_unlikely (z == 0.0L && y != 0.0L && isfinite (x))) - __set_errno (ERANGE); - return z; -} -weak_alias (__atan2l, atan2l) diff --git a/math/w_atan2l_compat.c b/math/w_atan2l_compat.c new file mode 100644 index 0000000000..b7b29ff6c3 --- /dev/null +++ b/math/w_atan2l_compat.c @@ -0,0 +1,41 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* + * wrapper atan2l(y,x) + */ + +#include +#include +#include + + +long double +__atan2l (long double y, long double x) +{ + long double z; + + if (__builtin_expect (x == 0.0L && y == 0.0L, 0) && _LIB_VERSION == _SVID_) + return __kernel_standard_l (y, x, 203); /* atan2(+-0,+-0) */ + + z = __ieee754_atan2l (y, x); + if (__glibc_unlikely (z == 0.0L && y != 0.0L && isfinite (x))) + __set_errno (ERANGE); + return z; +} +weak_alias (__atan2l, atan2l) diff --git a/math/w_atanh.c b/math/w_atanh.c deleted file mode 100644 index 456dcb34e7..0000000000 --- a/math/w_atanh.c +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include - - -/* wrapper atanh */ -double -__atanh (double x) -{ - if (__builtin_expect (isgreaterequal (fabs (x), 1.0), 0) - && _LIB_VERSION != _IEEE_) - return __kernel_standard (x, x, - fabs (x) > 1.0 - ? 30 /* atanh(|x|>1) */ - : 31); /* atanh(|x|==1) */ - - return __ieee754_atanh (x); -} -weak_alias (__atanh, atanh) -#ifdef NO_LONG_DOUBLE -strong_alias (__atanh, __atanhl) -weak_alias (__atanh, atanhl) -#endif diff --git a/math/w_atanh_compat.c b/math/w_atanh_compat.c new file mode 100644 index 0000000000..456dcb34e7 --- /dev/null +++ b/math/w_atanh_compat.c @@ -0,0 +1,40 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + + +/* wrapper atanh */ +double +__atanh (double x) +{ + if (__builtin_expect (isgreaterequal (fabs (x), 1.0), 0) + && _LIB_VERSION != _IEEE_) + return __kernel_standard (x, x, + fabs (x) > 1.0 + ? 30 /* atanh(|x|>1) */ + : 31); /* atanh(|x|==1) */ + + return __ieee754_atanh (x); +} +weak_alias (__atanh, atanh) +#ifdef NO_LONG_DOUBLE +strong_alias (__atanh, __atanhl) +weak_alias (__atanh, atanhl) +#endif diff --git a/math/w_atanhf.c b/math/w_atanhf.c deleted file mode 100644 index dd14145c1c..0000000000 --- a/math/w_atanhf.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include - - -/* wrapper atanhf */ -float -__atanhf (float x) -{ - if (__builtin_expect (isgreaterequal (fabsf (x), 1.0f), 0) - && _LIB_VERSION != _IEEE_) - return __kernel_standard_f (x, x, - fabsf (x) > 1.0f - ? 130 /* atanh(|x|>1) */ - : 131); /* atanh(|x|==1) */ - - return __ieee754_atanhf (x); -} -weak_alias (__atanhf, atanhf) diff --git a/math/w_atanhf_compat.c b/math/w_atanhf_compat.c new file mode 100644 index 0000000000..dd14145c1c --- /dev/null +++ b/math/w_atanhf_compat.c @@ -0,0 +1,36 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + + +/* wrapper atanhf */ +float +__atanhf (float x) +{ + if (__builtin_expect (isgreaterequal (fabsf (x), 1.0f), 0) + && _LIB_VERSION != _IEEE_) + return __kernel_standard_f (x, x, + fabsf (x) > 1.0f + ? 130 /* atanh(|x|>1) */ + : 131); /* atanh(|x|==1) */ + + return __ieee754_atanhf (x); +} +weak_alias (__atanhf, atanhf) diff --git a/math/w_atanhl.c b/math/w_atanhl.c deleted file mode 100644 index 37e8da598a..0000000000 --- a/math/w_atanhl.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include - - -/* wrapper atanhl */ -long double -__atanhl (long double x) -{ - if (__builtin_expect (isgreaterequal (fabsl (x), 1.0L), 0) - && _LIB_VERSION != _IEEE_) - return __kernel_standard_l (x, x, - fabsl (x) > 1.0L - ? 230 /* atanh(|x|>1) */ - : 231); /* atanh(|x|==1) */ - - return __ieee754_atanhl (x); -} -weak_alias (__atanhl, atanhl) diff --git a/math/w_atanhl_compat.c b/math/w_atanhl_compat.c new file mode 100644 index 0000000000..37e8da598a --- /dev/null +++ b/math/w_atanhl_compat.c @@ -0,0 +1,36 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + + +/* wrapper atanhl */ +long double +__atanhl (long double x) +{ + if (__builtin_expect (isgreaterequal (fabsl (x), 1.0L), 0) + && _LIB_VERSION != _IEEE_) + return __kernel_standard_l (x, x, + fabsl (x) > 1.0L + ? 230 /* atanh(|x|>1) */ + : 231); /* atanh(|x|==1) */ + + return __ieee754_atanhl (x); +} +weak_alias (__atanhl, atanhl) diff --git a/math/w_cosh.c b/math/w_cosh.c deleted file mode 100644 index 0771434ec1..0000000000 --- a/math/w_cosh.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Optimizations bu Ulrich Drepper , 2011 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -/* - * wrapper cosh(x) - */ - -#include -#include - -double -__cosh (double x) -{ - double z = __ieee754_cosh (x); - if (__builtin_expect (!isfinite (z), 0) && isfinite (x) - && _LIB_VERSION != _IEEE_) - return __kernel_standard (x, x, 5); /* cosh overflow */ - - return z; -} -weak_alias (__cosh, cosh) -#ifdef NO_LONG_DOUBLE -strong_alias (__cosh, __coshl) -weak_alias (__cosh, coshl) -#endif diff --git a/math/w_cosh_compat.c b/math/w_cosh_compat.c new file mode 100644 index 0000000000..0771434ec1 --- /dev/null +++ b/math/w_cosh_compat.c @@ -0,0 +1,34 @@ +/* Optimizations bu Ulrich Drepper , 2011 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * wrapper cosh(x) + */ + +#include +#include + +double +__cosh (double x) +{ + double z = __ieee754_cosh (x); + if (__builtin_expect (!isfinite (z), 0) && isfinite (x) + && _LIB_VERSION != _IEEE_) + return __kernel_standard (x, x, 5); /* cosh overflow */ + + return z; +} +weak_alias (__cosh, cosh) +#ifdef NO_LONG_DOUBLE +strong_alias (__cosh, __coshl) +weak_alias (__cosh, coshl) +#endif diff --git a/math/w_coshf.c b/math/w_coshf.c deleted file mode 100644 index dc7fb53ba3..0000000000 --- a/math/w_coshf.c +++ /dev/null @@ -1,34 +0,0 @@ -/* w_coshf.c -- float version of w_cosh.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - * Optimizations by Ulrich Drepper , 2011. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -/* - * wrapper coshf(x) - */ - -#include -#include - -float -__coshf (float x) -{ - float z = __ieee754_coshf (x); - if (__builtin_expect (!isfinite (z), 0) && isfinite (x) - && _LIB_VERSION != _IEEE_) - return __kernel_standard_f (x, x, 105); /* cosh overflow */ - - return z; -} -weak_alias (__coshf, coshf) diff --git a/math/w_coshf_compat.c b/math/w_coshf_compat.c new file mode 100644 index 0000000000..dc7fb53ba3 --- /dev/null +++ b/math/w_coshf_compat.c @@ -0,0 +1,34 @@ +/* w_coshf.c -- float version of w_cosh.c. + * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. + * Optimizations by Ulrich Drepper , 2011. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * wrapper coshf(x) + */ + +#include +#include + +float +__coshf (float x) +{ + float z = __ieee754_coshf (x); + if (__builtin_expect (!isfinite (z), 0) && isfinite (x) + && _LIB_VERSION != _IEEE_) + return __kernel_standard_f (x, x, 105); /* cosh overflow */ + + return z; +} +weak_alias (__coshf, coshf) diff --git a/math/w_coshl.c b/math/w_coshl.c deleted file mode 100644 index 27f0a4f4c3..0000000000 --- a/math/w_coshl.c +++ /dev/null @@ -1,35 +0,0 @@ -/* w_acoshl.c -- long double version of w_acosh.c. - * Conversion to long double by Ulrich Drepper, - * Cygnus Support, drepper@cygnus.com. - * Optimizations bu Ulrich Drepper , 2011. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -/* - * wrapper coshl(x) - */ - -#include -#include - -long double -__coshl (long double x) -{ - long double z = __ieee754_coshl (x); - if (__builtin_expect (!isfinite (z), 0) && isfinite (x) - && _LIB_VERSION != _IEEE_) - return __kernel_standard_l (x, x, 205); /* cosh overflow */ - - return z; -} -weak_alias (__coshl, coshl) diff --git a/math/w_coshl_compat.c b/math/w_coshl_compat.c new file mode 100644 index 0000000000..27f0a4f4c3 --- /dev/null +++ b/math/w_coshl_compat.c @@ -0,0 +1,35 @@ +/* w_acoshl.c -- long double version of w_acosh.c. + * Conversion to long double by Ulrich Drepper, + * Cygnus Support, drepper@cygnus.com. + * Optimizations bu Ulrich Drepper , 2011. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * wrapper coshl(x) + */ + +#include +#include + +long double +__coshl (long double x) +{ + long double z = __ieee754_coshl (x); + if (__builtin_expect (!isfinite (z), 0) && isfinite (x) + && _LIB_VERSION != _IEEE_) + return __kernel_standard_l (x, x, 205); /* cosh overflow */ + + return z; +} +weak_alias (__coshl, coshl) diff --git a/math/w_exp10.c b/math/w_exp10.c deleted file mode 100644 index 1ba9279e8b..0000000000 --- a/math/w_exp10.c +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - - -/* - * wrapper exp10(x) - */ - -#include -#include - -double -__exp10 (double x) -{ - double z = __ieee754_exp10 (x); - if (__builtin_expect (!isfinite (z) || z == 0, 0) - && isfinite (x) && _LIB_VERSION != _IEEE_) - /* exp10 overflow (46) if x > 0, underflow (47) if x < 0. */ - return __kernel_standard (x, x, 46 + !!signbit (x)); - - return z; -} -weak_alias (__exp10, exp10) -strong_alias (__exp10, __pow10) -weak_alias (__pow10, pow10) -#ifdef NO_LONG_DOUBLE -strong_alias (__exp10, __exp10l) -weak_alias (__exp10, exp10l) -strong_alias (__exp10l, __pow10l) -weak_alias (__pow10l, pow10l) -#endif diff --git a/math/w_exp10_compat.c b/math/w_exp10_compat.c new file mode 100644 index 0000000000..1ba9279e8b --- /dev/null +++ b/math/w_exp10_compat.c @@ -0,0 +1,46 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + + +/* + * wrapper exp10(x) + */ + +#include +#include + +double +__exp10 (double x) +{ + double z = __ieee754_exp10 (x); + if (__builtin_expect (!isfinite (z) || z == 0, 0) + && isfinite (x) && _LIB_VERSION != _IEEE_) + /* exp10 overflow (46) if x > 0, underflow (47) if x < 0. */ + return __kernel_standard (x, x, 46 + !!signbit (x)); + + return z; +} +weak_alias (__exp10, exp10) +strong_alias (__exp10, __pow10) +weak_alias (__pow10, pow10) +#ifdef NO_LONG_DOUBLE +strong_alias (__exp10, __exp10l) +weak_alias (__exp10, exp10l) +strong_alias (__exp10l, __pow10l) +weak_alias (__pow10l, pow10l) +#endif diff --git a/math/w_exp10f.c b/math/w_exp10f.c deleted file mode 100644 index 7993945900..0000000000 --- a/math/w_exp10f.c +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - - -/* - * wrapper exp10f(x) - */ - -#include -#include - -float -__exp10f (float x) -{ - float z = __ieee754_exp10f (x); - if (__builtin_expect (!isfinite (z) || z == 0, 0) - && isfinite (x) && _LIB_VERSION != _IEEE_) - /* exp10f overflow (146) if x > 0, underflow (147) if x < 0. */ - return __kernel_standard_f (x, x, 146 + !!signbit (x)); - - return z; -} -weak_alias (__exp10f, exp10f) -strong_alias (__exp10f, __pow10f) -weak_alias (__pow10f, pow10f) diff --git a/math/w_exp10f_compat.c b/math/w_exp10f_compat.c new file mode 100644 index 0000000000..7993945900 --- /dev/null +++ b/math/w_exp10f_compat.c @@ -0,0 +1,40 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + + +/* + * wrapper exp10f(x) + */ + +#include +#include + +float +__exp10f (float x) +{ + float z = __ieee754_exp10f (x); + if (__builtin_expect (!isfinite (z) || z == 0, 0) + && isfinite (x) && _LIB_VERSION != _IEEE_) + /* exp10f overflow (146) if x > 0, underflow (147) if x < 0. */ + return __kernel_standard_f (x, x, 146 + !!signbit (x)); + + return z; +} +weak_alias (__exp10f, exp10f) +strong_alias (__exp10f, __pow10f) +weak_alias (__pow10f, pow10f) diff --git a/math/w_exp10l.c b/math/w_exp10l.c deleted file mode 100644 index 27344686c3..0000000000 --- a/math/w_exp10l.c +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - - -/* - * wrapper exp10l(x) - */ - -#include -#include - -long double -__exp10l (long double x) -{ - long double z = __ieee754_exp10l (x); - if (__builtin_expect (!isfinite (z) || z == 0, 0) - && isfinite (x) && _LIB_VERSION != _IEEE_) - /* exp10l overflow (246) if x > 0, underflow (247) if x < 0. */ - return __kernel_standard_l (x, x, 246 + !!signbit (x)); - - return z; -} -weak_alias (__exp10l, exp10l) -strong_alias (__exp10l, __pow10l) -weak_alias (__pow10l, pow10l) diff --git a/math/w_exp10l_compat.c b/math/w_exp10l_compat.c new file mode 100644 index 0000000000..27344686c3 --- /dev/null +++ b/math/w_exp10l_compat.c @@ -0,0 +1,40 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + + +/* + * wrapper exp10l(x) + */ + +#include +#include + +long double +__exp10l (long double x) +{ + long double z = __ieee754_exp10l (x); + if (__builtin_expect (!isfinite (z) || z == 0, 0) + && isfinite (x) && _LIB_VERSION != _IEEE_) + /* exp10l overflow (246) if x > 0, underflow (247) if x < 0. */ + return __kernel_standard_l (x, x, 246 + !!signbit (x)); + + return z; +} +weak_alias (__exp10l, exp10l) +strong_alias (__exp10l, __pow10l) +weak_alias (__pow10l, pow10l) diff --git a/math/w_exp2.c b/math/w_exp2.c deleted file mode 100644 index ca17f9ea63..0000000000 --- a/math/w_exp2.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * wrapper exp2(x) - */ - -#include -#include - -double -__exp2 (double x) -{ - double z = __ieee754_exp2 (x); - if (__builtin_expect (!isfinite (z) || z == 0, 0) - && isfinite (x) && _LIB_VERSION != _IEEE_) - /* exp2 overflow: 44, exp2 underflow: 45 */ - return __kernel_standard (x, x, 44 + !!signbit (x)); - - return z; -} -weak_alias (__exp2, exp2) -#ifdef NO_LONG_DOUBLE -strong_alias (__exp2, __exp2l) -weak_alias (__exp2, exp2l) -#endif diff --git a/math/w_exp2_compat.c b/math/w_exp2_compat.c new file mode 100644 index 0000000000..ca17f9ea63 --- /dev/null +++ b/math/w_exp2_compat.c @@ -0,0 +1,23 @@ +/* + * wrapper exp2(x) + */ + +#include +#include + +double +__exp2 (double x) +{ + double z = __ieee754_exp2 (x); + if (__builtin_expect (!isfinite (z) || z == 0, 0) + && isfinite (x) && _LIB_VERSION != _IEEE_) + /* exp2 overflow: 44, exp2 underflow: 45 */ + return __kernel_standard (x, x, 44 + !!signbit (x)); + + return z; +} +weak_alias (__exp2, exp2) +#ifdef NO_LONG_DOUBLE +strong_alias (__exp2, __exp2l) +weak_alias (__exp2, exp2l) +#endif diff --git a/math/w_exp2f.c b/math/w_exp2f.c deleted file mode 100644 index 61cbd6cda1..0000000000 --- a/math/w_exp2f.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * wrapper exp2f(x) - */ - -#include -#include - -float -__exp2f (float x) -{ - float z = __ieee754_exp2f (x); - if (__builtin_expect (!isfinite (z) || z == 0, 0) - && isfinite (x) && _LIB_VERSION != _IEEE_) - /* exp2 overflow: 144, exp2 underflow: 145 */ - return __kernel_standard_f (x, x, 144 + !!signbit (x)); - - return z; -} -weak_alias (__exp2f, exp2f) diff --git a/math/w_exp2f_compat.c b/math/w_exp2f_compat.c new file mode 100644 index 0000000000..61cbd6cda1 --- /dev/null +++ b/math/w_exp2f_compat.c @@ -0,0 +1,19 @@ +/* + * wrapper exp2f(x) + */ + +#include +#include + +float +__exp2f (float x) +{ + float z = __ieee754_exp2f (x); + if (__builtin_expect (!isfinite (z) || z == 0, 0) + && isfinite (x) && _LIB_VERSION != _IEEE_) + /* exp2 overflow: 144, exp2 underflow: 145 */ + return __kernel_standard_f (x, x, 144 + !!signbit (x)); + + return z; +} +weak_alias (__exp2f, exp2f) diff --git a/math/w_exp2l.c b/math/w_exp2l.c deleted file mode 100644 index 47aed3cb83..0000000000 --- a/math/w_exp2l.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * wrapper exp2l(x) - */ - -#include -#include - -long double -__exp2l (long double x) -{ - long double z = __ieee754_exp2l (x); - if (__builtin_expect (!isfinite (z) || z == 0, 0) - && isfinite (x) && _LIB_VERSION != _IEEE_) - /* exp2 overflow: 244, exp2 underflow: 245 */ - return __kernel_standard_l (x, x, 244 + !!signbit (x)); - - return z; -} -weak_alias (__exp2l, exp2l) diff --git a/math/w_exp2l_compat.c b/math/w_exp2l_compat.c new file mode 100644 index 0000000000..47aed3cb83 --- /dev/null +++ b/math/w_exp2l_compat.c @@ -0,0 +1,19 @@ +/* + * wrapper exp2l(x) + */ + +#include +#include + +long double +__exp2l (long double x) +{ + long double z = __ieee754_exp2l (x); + if (__builtin_expect (!isfinite (z) || z == 0, 0) + && isfinite (x) && _LIB_VERSION != _IEEE_) + /* exp2 overflow: 244, exp2 underflow: 245 */ + return __kernel_standard_l (x, x, 244 + !!signbit (x)); + + return z; +} +weak_alias (__exp2l, exp2l) diff --git a/math/w_fmod.c b/math/w_fmod.c deleted file mode 100644 index 746550a33c..0000000000 --- a/math/w_fmod.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include - -/* wrapper fmod */ -double -__fmod (double x, double y) -{ - if (__builtin_expect (isinf (x) || y == 0.0, 0) - && _LIB_VERSION != _IEEE_ && !isnan (y) && !isnan (x)) - /* fmod(+-Inf,y) or fmod(x,0) */ - return __kernel_standard (x, y, 27); - - return __ieee754_fmod (x, y); -} -weak_alias (__fmod, fmod) -#ifdef NO_LONG_DOUBLE -strong_alias (__fmod, __fmodl) -weak_alias (__fmod, fmodl) -#endif diff --git a/math/w_fmod_compat.c b/math/w_fmod_compat.c new file mode 100644 index 0000000000..746550a33c --- /dev/null +++ b/math/w_fmod_compat.c @@ -0,0 +1,37 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + +/* wrapper fmod */ +double +__fmod (double x, double y) +{ + if (__builtin_expect (isinf (x) || y == 0.0, 0) + && _LIB_VERSION != _IEEE_ && !isnan (y) && !isnan (x)) + /* fmod(+-Inf,y) or fmod(x,0) */ + return __kernel_standard (x, y, 27); + + return __ieee754_fmod (x, y); +} +weak_alias (__fmod, fmod) +#ifdef NO_LONG_DOUBLE +strong_alias (__fmod, __fmodl) +weak_alias (__fmod, fmodl) +#endif diff --git a/math/w_fmodf.c b/math/w_fmodf.c deleted file mode 100644 index 45ece587c8..0000000000 --- a/math/w_fmodf.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include - -/* wrapper fmodf */ -float -__fmodf (float x, float y) -{ - if (__builtin_expect (isinf (x) || y == 0.0f, 0) - && _LIB_VERSION != _IEEE_ && !isnan (y) && !isnan (x)) - /* fmod(+-Inf,y) or fmod(x,0) */ - return __kernel_standard_f (x, y, 127); - - return __ieee754_fmodf (x, y); -} -weak_alias (__fmodf, fmodf) diff --git a/math/w_fmodf_compat.c b/math/w_fmodf_compat.c new file mode 100644 index 0000000000..45ece587c8 --- /dev/null +++ b/math/w_fmodf_compat.c @@ -0,0 +1,33 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + +/* wrapper fmodf */ +float +__fmodf (float x, float y) +{ + if (__builtin_expect (isinf (x) || y == 0.0f, 0) + && _LIB_VERSION != _IEEE_ && !isnan (y) && !isnan (x)) + /* fmod(+-Inf,y) or fmod(x,0) */ + return __kernel_standard_f (x, y, 127); + + return __ieee754_fmodf (x, y); +} +weak_alias (__fmodf, fmodf) diff --git a/math/w_fmodl.c b/math/w_fmodl.c deleted file mode 100644 index 1f385bdbae..0000000000 --- a/math/w_fmodl.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include - -/* wrapper fmodl */ -long double -__fmodl (long double x, long double y) -{ - if (__builtin_expect (isinf (x) || y == 0.0L, 0) - && _LIB_VERSION != _IEEE_ && !isnan (y) && !isnan (x)) - /* fmod(+-Inf,y) or fmod(x,0) */ - return __kernel_standard_l (x, y, 227); - - return __ieee754_fmodl (x, y); -} -weak_alias (__fmodl, fmodl) diff --git a/math/w_fmodl_compat.c b/math/w_fmodl_compat.c new file mode 100644 index 0000000000..1f385bdbae --- /dev/null +++ b/math/w_fmodl_compat.c @@ -0,0 +1,33 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + +/* wrapper fmodl */ +long double +__fmodl (long double x, long double y) +{ + if (__builtin_expect (isinf (x) || y == 0.0L, 0) + && _LIB_VERSION != _IEEE_ && !isnan (y) && !isnan (x)) + /* fmod(+-Inf,y) or fmod(x,0) */ + return __kernel_standard_l (x, y, 227); + + return __ieee754_fmodl (x, y); +} +weak_alias (__fmodl, fmodl) diff --git a/math/w_hypot.c b/math/w_hypot.c deleted file mode 100644 index 7c662c8e40..0000000000 --- a/math/w_hypot.c +++ /dev/null @@ -1,35 +0,0 @@ -/* @(#)w_hypot.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -/* - * wrapper hypot(x,y) - */ - -#include -#include - - -double -__hypot (double x, double y) -{ - double z = __ieee754_hypot(x,y); - if(__builtin_expect(!isfinite(z), 0) - && isfinite(x) && isfinite(y) && _LIB_VERSION != _IEEE_) - return __kernel_standard(x, y, 4); /* hypot overflow */ - - return z; -} -weak_alias (__hypot, hypot) -#ifdef NO_LONG_DOUBLE -strong_alias (__hypot, __hypotl) -weak_alias (__hypot, hypotl) -#endif diff --git a/math/w_hypot_compat.c b/math/w_hypot_compat.c new file mode 100644 index 0000000000..7c662c8e40 --- /dev/null +++ b/math/w_hypot_compat.c @@ -0,0 +1,35 @@ +/* @(#)w_hypot.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * wrapper hypot(x,y) + */ + +#include +#include + + +double +__hypot (double x, double y) +{ + double z = __ieee754_hypot(x,y); + if(__builtin_expect(!isfinite(z), 0) + && isfinite(x) && isfinite(y) && _LIB_VERSION != _IEEE_) + return __kernel_standard(x, y, 4); /* hypot overflow */ + + return z; +} +weak_alias (__hypot, hypot) +#ifdef NO_LONG_DOUBLE +strong_alias (__hypot, __hypotl) +weak_alias (__hypot, hypotl) +#endif diff --git a/math/w_hypotf.c b/math/w_hypotf.c deleted file mode 100644 index 0ecacae715..0000000000 --- a/math/w_hypotf.c +++ /dev/null @@ -1,35 +0,0 @@ -/* w_hypotf.c -- float version of w_hypot.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -/* - * wrapper hypotf(x,y) - */ - -#include -#include - - -float -__hypotf(float x, float y) -{ - float z = __ieee754_hypotf(x,y); - if(__builtin_expect(!isfinite(z), 0) - && isfinite(x) && isfinite(y) && _LIB_VERSION != _IEEE_) - /* hypot overflow */ - return __kernel_standard_f(x, y, 104); - - return z; -} -weak_alias (__hypotf, hypotf) diff --git a/math/w_hypotf_compat.c b/math/w_hypotf_compat.c new file mode 100644 index 0000000000..0ecacae715 --- /dev/null +++ b/math/w_hypotf_compat.c @@ -0,0 +1,35 @@ +/* w_hypotf.c -- float version of w_hypot.c. + * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * wrapper hypotf(x,y) + */ + +#include +#include + + +float +__hypotf(float x, float y) +{ + float z = __ieee754_hypotf(x,y); + if(__builtin_expect(!isfinite(z), 0) + && isfinite(x) && isfinite(y) && _LIB_VERSION != _IEEE_) + /* hypot overflow */ + return __kernel_standard_f(x, y, 104); + + return z; +} +weak_alias (__hypotf, hypotf) diff --git a/math/w_hypotl.c b/math/w_hypotl.c deleted file mode 100644 index c784fa2c64..0000000000 --- a/math/w_hypotl.c +++ /dev/null @@ -1,36 +0,0 @@ -/* w_hypotl.c -- long double version of w_hypot.c. - * Conversion to long double by Ulrich Drepper, - * Cygnus Support, drepper@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -/* - * wrapper hypotl(x,y) - */ - -#include -#include - - -long double -__hypotl(long double x, long double y) -{ - long double z; - z = __ieee754_hypotl(x,y); - if(__builtin_expect(!isfinite(z), 0) - && isfinite(x) && isfinite(y) && _LIB_VERSION != _IEEE_) - return __kernel_standard_l(x, y, 204); /* hypot overflow */ - - return z; -} -weak_alias (__hypotl, hypotl) diff --git a/math/w_hypotl_compat.c b/math/w_hypotl_compat.c new file mode 100644 index 0000000000..c784fa2c64 --- /dev/null +++ b/math/w_hypotl_compat.c @@ -0,0 +1,36 @@ +/* w_hypotl.c -- long double version of w_hypot.c. + * Conversion to long double by Ulrich Drepper, + * Cygnus Support, drepper@cygnus.com. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * wrapper hypotl(x,y) + */ + +#include +#include + + +long double +__hypotl(long double x, long double y) +{ + long double z; + z = __ieee754_hypotl(x,y); + if(__builtin_expect(!isfinite(z), 0) + && isfinite(x) && isfinite(y) && _LIB_VERSION != _IEEE_) + return __kernel_standard_l(x, y, 204); /* hypot overflow */ + + return z; +} +weak_alias (__hypotl, hypotl) diff --git a/math/w_j0.c b/math/w_j0.c deleted file mode 100644 index e7b56f2412..0000000000 --- a/math/w_j0.c +++ /dev/null @@ -1,68 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - - -/* wrapper j0 */ -double -j0 (double x) -{ - if (__builtin_expect (isgreater (fabs (x), X_TLOSS), 0) - && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_) - /* j0(|x|>X_TLOSS) */ - return __kernel_standard (x, x, 34); - - return __ieee754_j0 (x); -} -#ifdef NO_LONG_DOUBLE -weak_alias (j0, j0l) -#endif - - -/* wrapper y0 */ -double -y0 (double x) -{ - if (__builtin_expect (islessequal (x, 0.0) || isgreater (x, X_TLOSS), 0) - && _LIB_VERSION != _IEEE_) - { - if (x < 0.0) - { - /* d = zero/(x-x) */ - __feraiseexcept (FE_INVALID); - return __kernel_standard (x, x, 9); - } - else if (x == 0.0) - { - /* d = -one/(x-x) */ - __feraiseexcept (FE_DIVBYZERO); - return __kernel_standard (x, x, 8); - } - else if (_LIB_VERSION != _POSIX_) - /* y0(x>X_TLOSS) */ - return __kernel_standard (x, x, 35); - } - - return __ieee754_y0 (x); -} -#ifdef NO_LONG_DOUBLE -weak_alias (y0, y0l) -#endif diff --git a/math/w_j0_compat.c b/math/w_j0_compat.c new file mode 100644 index 0000000000..e7b56f2412 --- /dev/null +++ b/math/w_j0_compat.c @@ -0,0 +1,68 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + + +/* wrapper j0 */ +double +j0 (double x) +{ + if (__builtin_expect (isgreater (fabs (x), X_TLOSS), 0) + && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_) + /* j0(|x|>X_TLOSS) */ + return __kernel_standard (x, x, 34); + + return __ieee754_j0 (x); +} +#ifdef NO_LONG_DOUBLE +weak_alias (j0, j0l) +#endif + + +/* wrapper y0 */ +double +y0 (double x) +{ + if (__builtin_expect (islessequal (x, 0.0) || isgreater (x, X_TLOSS), 0) + && _LIB_VERSION != _IEEE_) + { + if (x < 0.0) + { + /* d = zero/(x-x) */ + __feraiseexcept (FE_INVALID); + return __kernel_standard (x, x, 9); + } + else if (x == 0.0) + { + /* d = -one/(x-x) */ + __feraiseexcept (FE_DIVBYZERO); + return __kernel_standard (x, x, 8); + } + else if (_LIB_VERSION != _POSIX_) + /* y0(x>X_TLOSS) */ + return __kernel_standard (x, x, 35); + } + + return __ieee754_y0 (x); +} +#ifdef NO_LONG_DOUBLE +weak_alias (y0, y0l) +#endif diff --git a/math/w_j0f.c b/math/w_j0f.c deleted file mode 100644 index 34220b90b8..0000000000 --- a/math/w_j0f.c +++ /dev/null @@ -1,63 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - - -/* wrapper j0f */ -float -j0f (float x) -{ - if (__builtin_expect (isgreater (fabsf (x), (float) X_TLOSS), 0) - && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_) - /* j0(|x|>X_TLOSS) */ - return __kernel_standard_f (x, x, 134); - - return __ieee754_j0f (x); -} - - -/* wrapper y0f */ -float -y0f (float x) -{ - if (__builtin_expect (islessequal (x, 0.0f) - || isgreater (x, (float) X_TLOSS), 0) - && _LIB_VERSION != _IEEE_) - { - if (x < 0.0f) - { - /* d = zero/(x-x) */ - feraiseexcept (FE_INVALID); - return __kernel_standard_f (x, x, 109); - } - else if (x == 0.0f) - { - /* d = -one/(x-x) */ - feraiseexcept (FE_DIVBYZERO); - return __kernel_standard_f (x, x, 108); - } - else if (_LIB_VERSION != _POSIX_) - /* y0(x>X_TLOSS) */ - return __kernel_standard_f (x, x, 135); - } - - return __ieee754_y0f (x); -} diff --git a/math/w_j0f_compat.c b/math/w_j0f_compat.c new file mode 100644 index 0000000000..34220b90b8 --- /dev/null +++ b/math/w_j0f_compat.c @@ -0,0 +1,63 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + + +/* wrapper j0f */ +float +j0f (float x) +{ + if (__builtin_expect (isgreater (fabsf (x), (float) X_TLOSS), 0) + && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_) + /* j0(|x|>X_TLOSS) */ + return __kernel_standard_f (x, x, 134); + + return __ieee754_j0f (x); +} + + +/* wrapper y0f */ +float +y0f (float x) +{ + if (__builtin_expect (islessequal (x, 0.0f) + || isgreater (x, (float) X_TLOSS), 0) + && _LIB_VERSION != _IEEE_) + { + if (x < 0.0f) + { + /* d = zero/(x-x) */ + feraiseexcept (FE_INVALID); + return __kernel_standard_f (x, x, 109); + } + else if (x == 0.0f) + { + /* d = -one/(x-x) */ + feraiseexcept (FE_DIVBYZERO); + return __kernel_standard_f (x, x, 108); + } + else if (_LIB_VERSION != _POSIX_) + /* y0(x>X_TLOSS) */ + return __kernel_standard_f (x, x, 135); + } + + return __ieee754_y0f (x); +} diff --git a/math/w_j0l.c b/math/w_j0l.c deleted file mode 100644 index e03fa1d223..0000000000 --- a/math/w_j0l.c +++ /dev/null @@ -1,64 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - - -/* wrapper j0l */ -long double -__j0l (long double x) -{ - if (__builtin_expect (isgreater (fabsl (x), X_TLOSS), 0) - && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_) - /* j0(|x|>X_TLOSS) */ - return __kernel_standard_l (x, x, 234); - - return __ieee754_j0l (x); -} -weak_alias (__j0l, j0l) - - -/* wrapper y0l */ -long double -__y0l (long double x) -{ - if (__builtin_expect (islessequal (x, 0.0L) || isgreater (x, X_TLOSS), 0) - && _LIB_VERSION != _IEEE_) - { - if (x < 0.0L) - { - /* d = zero/(x-x) */ - feraiseexcept (FE_INVALID); - return __kernel_standard_l (x, x, 209); - } - else if (x == 0.0L) - { - /* d = -one/(x-x) */ - feraiseexcept (FE_DIVBYZERO); - return __kernel_standard_l (x, x, 208); - } - else if (_LIB_VERSION != _POSIX_) - /* y0(x>X_TLOSS) */ - return __kernel_standard_l (x, x, 235); - } - - return __ieee754_y0l (x); -} -weak_alias (__y0l, y0l) diff --git a/math/w_j0l_compat.c b/math/w_j0l_compat.c new file mode 100644 index 0000000000..e03fa1d223 --- /dev/null +++ b/math/w_j0l_compat.c @@ -0,0 +1,64 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + + +/* wrapper j0l */ +long double +__j0l (long double x) +{ + if (__builtin_expect (isgreater (fabsl (x), X_TLOSS), 0) + && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_) + /* j0(|x|>X_TLOSS) */ + return __kernel_standard_l (x, x, 234); + + return __ieee754_j0l (x); +} +weak_alias (__j0l, j0l) + + +/* wrapper y0l */ +long double +__y0l (long double x) +{ + if (__builtin_expect (islessequal (x, 0.0L) || isgreater (x, X_TLOSS), 0) + && _LIB_VERSION != _IEEE_) + { + if (x < 0.0L) + { + /* d = zero/(x-x) */ + feraiseexcept (FE_INVALID); + return __kernel_standard_l (x, x, 209); + } + else if (x == 0.0L) + { + /* d = -one/(x-x) */ + feraiseexcept (FE_DIVBYZERO); + return __kernel_standard_l (x, x, 208); + } + else if (_LIB_VERSION != _POSIX_) + /* y0(x>X_TLOSS) */ + return __kernel_standard_l (x, x, 235); + } + + return __ieee754_y0l (x); +} +weak_alias (__y0l, y0l) diff --git a/math/w_j1.c b/math/w_j1.c deleted file mode 100644 index efbe8df5e0..0000000000 --- a/math/w_j1.c +++ /dev/null @@ -1,68 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - - -/* wrapper j1 */ -double -j1 (double x) -{ - if (__builtin_expect (isgreater (fabs (x), X_TLOSS), 0) - && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_) - /* j1(|x|>X_TLOSS) */ - return __kernel_standard (x, x, 36); - - return __ieee754_j1 (x); -} -#ifdef NO_LONG_DOUBLE -weak_alias (j1, j1l) -#endif - - -/* wrapper y1 */ -double -y1 (double x) -{ - if (__builtin_expect (islessequal (x, 0.0) || isgreater (x, X_TLOSS), 0) - && _LIB_VERSION != _IEEE_) - { - if (x < 0.0) - { - /* d = zero/(x-x) */ - __feraiseexcept (FE_INVALID); - return __kernel_standard (x, x, 11); - } - else if (x == 0.0) - { - /* d = -one/(x-x) */ - __feraiseexcept (FE_DIVBYZERO); - return __kernel_standard (x, x, 10); - } - else if (_LIB_VERSION != _POSIX_) - /* y1(x>X_TLOSS) */ - return __kernel_standard (x, x, 37); - } - - return __ieee754_y1 (x); -} -#ifdef NO_LONG_DOUBLE -weak_alias (y1, y1l) -#endif diff --git a/math/w_j1_compat.c b/math/w_j1_compat.c new file mode 100644 index 0000000000..efbe8df5e0 --- /dev/null +++ b/math/w_j1_compat.c @@ -0,0 +1,68 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + + +/* wrapper j1 */ +double +j1 (double x) +{ + if (__builtin_expect (isgreater (fabs (x), X_TLOSS), 0) + && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_) + /* j1(|x|>X_TLOSS) */ + return __kernel_standard (x, x, 36); + + return __ieee754_j1 (x); +} +#ifdef NO_LONG_DOUBLE +weak_alias (j1, j1l) +#endif + + +/* wrapper y1 */ +double +y1 (double x) +{ + if (__builtin_expect (islessequal (x, 0.0) || isgreater (x, X_TLOSS), 0) + && _LIB_VERSION != _IEEE_) + { + if (x < 0.0) + { + /* d = zero/(x-x) */ + __feraiseexcept (FE_INVALID); + return __kernel_standard (x, x, 11); + } + else if (x == 0.0) + { + /* d = -one/(x-x) */ + __feraiseexcept (FE_DIVBYZERO); + return __kernel_standard (x, x, 10); + } + else if (_LIB_VERSION != _POSIX_) + /* y1(x>X_TLOSS) */ + return __kernel_standard (x, x, 37); + } + + return __ieee754_y1 (x); +} +#ifdef NO_LONG_DOUBLE +weak_alias (y1, y1l) +#endif diff --git a/math/w_j1f.c b/math/w_j1f.c deleted file mode 100644 index 7558685946..0000000000 --- a/math/w_j1f.c +++ /dev/null @@ -1,63 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - - -/* wrapper j1f */ -float -j1f (float x) -{ - if (__builtin_expect (isgreater (fabsf (x), X_TLOSS), 0) - && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_) - /* j1(|x|>X_TLOSS) */ - return __kernel_standard_f (x, x, 136); - - return __ieee754_j1f (x); -} - - -/* wrapper y1f */ -float -y1f (float x) -{ - if (__builtin_expect (islessequal (x, 0.0f) - || isgreater (x, (float) X_TLOSS), 0) - && _LIB_VERSION != _IEEE_) - { - if (x < 0.0f) - { - /* d = zero/(x-x) */ - feraiseexcept (FE_INVALID); - return __kernel_standard_f (x, x, 111); - } - else if (x == 0.0f) - { - /* d = -one/(x-x) */ - feraiseexcept (FE_DIVBYZERO); - return __kernel_standard_f (x, x, 110); - } - else if (_LIB_VERSION != _POSIX_) - /* y1(x>X_TLOSS) */ - return __kernel_standard_f (x, x, 137); - } - - return __ieee754_y1f (x); -} diff --git a/math/w_j1f_compat.c b/math/w_j1f_compat.c new file mode 100644 index 0000000000..7558685946 --- /dev/null +++ b/math/w_j1f_compat.c @@ -0,0 +1,63 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + + +/* wrapper j1f */ +float +j1f (float x) +{ + if (__builtin_expect (isgreater (fabsf (x), X_TLOSS), 0) + && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_) + /* j1(|x|>X_TLOSS) */ + return __kernel_standard_f (x, x, 136); + + return __ieee754_j1f (x); +} + + +/* wrapper y1f */ +float +y1f (float x) +{ + if (__builtin_expect (islessequal (x, 0.0f) + || isgreater (x, (float) X_TLOSS), 0) + && _LIB_VERSION != _IEEE_) + { + if (x < 0.0f) + { + /* d = zero/(x-x) */ + feraiseexcept (FE_INVALID); + return __kernel_standard_f (x, x, 111); + } + else if (x == 0.0f) + { + /* d = -one/(x-x) */ + feraiseexcept (FE_DIVBYZERO); + return __kernel_standard_f (x, x, 110); + } + else if (_LIB_VERSION != _POSIX_) + /* y1(x>X_TLOSS) */ + return __kernel_standard_f (x, x, 137); + } + + return __ieee754_y1f (x); +} diff --git a/math/w_j1l.c b/math/w_j1l.c deleted file mode 100644 index f35261dd2a..0000000000 --- a/math/w_j1l.c +++ /dev/null @@ -1,64 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - - -/* wrapper j1l */ -long double -__j1l (long double x) -{ - if (__builtin_expect (isgreater (fabsl (x), X_TLOSS), 0) - && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_) - /* j1(|x|>X_TLOSS) */ - return __kernel_standard_l (x, x, 236); - - return __ieee754_j1l (x); -} -weak_alias (__j1l, j1l) - - -/* wrapper y1l */ -long double -__y1l (long double x) -{ - if (__builtin_expect (islessequal (x, 0.0L) || isgreater (x, X_TLOSS), 0) - && _LIB_VERSION != _IEEE_) - { - if (x < 0.0L) - { - /* d = zero/(x-x) */ - feraiseexcept (FE_INVALID); - return __kernel_standard_l (x, x, 211); - } - else if (x == 0.0L) - { - /* d = -one/(x-x) */ - feraiseexcept (FE_DIVBYZERO); - return __kernel_standard_l (x, x, 210); - } - else if (_LIB_VERSION != _POSIX_) - /* y1(x>X_TLOSS) */ - return __kernel_standard_l (x, x, 237); - } - - return __ieee754_y1l (x); -} -weak_alias (__y1l, y1l) diff --git a/math/w_j1l_compat.c b/math/w_j1l_compat.c new file mode 100644 index 0000000000..f35261dd2a --- /dev/null +++ b/math/w_j1l_compat.c @@ -0,0 +1,64 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + + +/* wrapper j1l */ +long double +__j1l (long double x) +{ + if (__builtin_expect (isgreater (fabsl (x), X_TLOSS), 0) + && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_) + /* j1(|x|>X_TLOSS) */ + return __kernel_standard_l (x, x, 236); + + return __ieee754_j1l (x); +} +weak_alias (__j1l, j1l) + + +/* wrapper y1l */ +long double +__y1l (long double x) +{ + if (__builtin_expect (islessequal (x, 0.0L) || isgreater (x, X_TLOSS), 0) + && _LIB_VERSION != _IEEE_) + { + if (x < 0.0L) + { + /* d = zero/(x-x) */ + feraiseexcept (FE_INVALID); + return __kernel_standard_l (x, x, 211); + } + else if (x == 0.0L) + { + /* d = -one/(x-x) */ + feraiseexcept (FE_DIVBYZERO); + return __kernel_standard_l (x, x, 210); + } + else if (_LIB_VERSION != _POSIX_) + /* y1(x>X_TLOSS) */ + return __kernel_standard_l (x, x, 237); + } + + return __ieee754_y1l (x); +} +weak_alias (__y1l, y1l) diff --git a/math/w_jn.c b/math/w_jn.c deleted file mode 100644 index 9321bf5e7d..0000000000 --- a/math/w_jn.c +++ /dev/null @@ -1,68 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - - -/* wrapper jn */ -double -jn (int n, double x) -{ - if (__builtin_expect (isgreater (fabs (x), X_TLOSS), 0) - && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_) - /* jn(n,|x|>X_TLOSS) */ - return __kernel_standard (n, x, 38); - - return __ieee754_jn (n, x); -} -#ifdef NO_LONG_DOUBLE -weak_alias (jn, jnl) -#endif - - -/* wrapper yn */ -double -yn (int n, double x) -{ - if (__builtin_expect (islessequal (x, 0.0) || isgreater (x, X_TLOSS), 0) - && _LIB_VERSION != _IEEE_) - { - if (x < 0.0) - { - /* d = zero/(x-x) */ - __feraiseexcept (FE_INVALID); - return __kernel_standard (n, x, 13); - } - else if (x == 0.0) - { - /* d = -one/(x-x) */ - __feraiseexcept (FE_DIVBYZERO); - return __kernel_standard (n, x, 12); - } - else if (_LIB_VERSION != _POSIX_) - /* yn(n,x>X_TLOSS) */ - return __kernel_standard (n, x, 39); - } - - return __ieee754_yn (n, x); -} -#ifdef NO_LONG_DOUBLE -weak_alias (yn, ynl) -#endif diff --git a/math/w_jn_compat.c b/math/w_jn_compat.c new file mode 100644 index 0000000000..9321bf5e7d --- /dev/null +++ b/math/w_jn_compat.c @@ -0,0 +1,68 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + + +/* wrapper jn */ +double +jn (int n, double x) +{ + if (__builtin_expect (isgreater (fabs (x), X_TLOSS), 0) + && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_) + /* jn(n,|x|>X_TLOSS) */ + return __kernel_standard (n, x, 38); + + return __ieee754_jn (n, x); +} +#ifdef NO_LONG_DOUBLE +weak_alias (jn, jnl) +#endif + + +/* wrapper yn */ +double +yn (int n, double x) +{ + if (__builtin_expect (islessequal (x, 0.0) || isgreater (x, X_TLOSS), 0) + && _LIB_VERSION != _IEEE_) + { + if (x < 0.0) + { + /* d = zero/(x-x) */ + __feraiseexcept (FE_INVALID); + return __kernel_standard (n, x, 13); + } + else if (x == 0.0) + { + /* d = -one/(x-x) */ + __feraiseexcept (FE_DIVBYZERO); + return __kernel_standard (n, x, 12); + } + else if (_LIB_VERSION != _POSIX_) + /* yn(n,x>X_TLOSS) */ + return __kernel_standard (n, x, 39); + } + + return __ieee754_yn (n, x); +} +#ifdef NO_LONG_DOUBLE +weak_alias (yn, ynl) +#endif diff --git a/math/w_jnf.c b/math/w_jnf.c deleted file mode 100644 index 9752b2a8c5..0000000000 --- a/math/w_jnf.c +++ /dev/null @@ -1,63 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - - -/* wrapper jnf */ -float -jnf (int n, float x) -{ - if (__builtin_expect (isgreater (fabsf (x), (float) X_TLOSS), 0) - && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_) - /* jn(n,|x|>X_TLOSS) */ - return __kernel_standard_f (n, x, 138); - - return __ieee754_jnf (n, x); -} - - -/* wrapper ynf */ -float -ynf (int n, float x) -{ - if (__builtin_expect (islessequal (x, 0.0f) - || isgreater (x, (float) X_TLOSS), 0) - && _LIB_VERSION != _IEEE_) - { - if (x < 0.0f) - { - /* d = zero/(x-x) */ - feraiseexcept (FE_INVALID); - return __kernel_standard_f (n, x, 113); - } - else if (x == 0.0) - { - /* d = -one/(x-x) */ - feraiseexcept (FE_DIVBYZERO); - return __kernel_standard_f (n, x, 112); - } - else if (_LIB_VERSION != _POSIX_) - /* yn(n,x>X_TLOSS) */ - return __kernel_standard_f (n, x, 139); - } - - return __ieee754_ynf (n, x); -} diff --git a/math/w_jnf_compat.c b/math/w_jnf_compat.c new file mode 100644 index 0000000000..9752b2a8c5 --- /dev/null +++ b/math/w_jnf_compat.c @@ -0,0 +1,63 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + + +/* wrapper jnf */ +float +jnf (int n, float x) +{ + if (__builtin_expect (isgreater (fabsf (x), (float) X_TLOSS), 0) + && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_) + /* jn(n,|x|>X_TLOSS) */ + return __kernel_standard_f (n, x, 138); + + return __ieee754_jnf (n, x); +} + + +/* wrapper ynf */ +float +ynf (int n, float x) +{ + if (__builtin_expect (islessequal (x, 0.0f) + || isgreater (x, (float) X_TLOSS), 0) + && _LIB_VERSION != _IEEE_) + { + if (x < 0.0f) + { + /* d = zero/(x-x) */ + feraiseexcept (FE_INVALID); + return __kernel_standard_f (n, x, 113); + } + else if (x == 0.0) + { + /* d = -one/(x-x) */ + feraiseexcept (FE_DIVBYZERO); + return __kernel_standard_f (n, x, 112); + } + else if (_LIB_VERSION != _POSIX_) + /* yn(n,x>X_TLOSS) */ + return __kernel_standard_f (n, x, 139); + } + + return __ieee754_ynf (n, x); +} diff --git a/math/w_jnl.c b/math/w_jnl.c deleted file mode 100644 index d17b047956..0000000000 --- a/math/w_jnl.c +++ /dev/null @@ -1,91 +0,0 @@ -/* w_jnl.c -- long double version of w_jn.c. - * Conversion to long double by Ulrich Drepper, - * Cygnus Support, drepper@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#if defined(LIBM_SCCS) && !defined(lint) -static char rcsid[] = "$NetBSD: $"; -#endif - -/* - * wrapper jn(int n, double x), yn(int n, double x) - * floating point Bessel's function of the 1st and 2nd kind - * of order n - * - * Special cases: - * y0(0)=y1(0)=yn(n,0) = -inf with division by zero signal; - * y0(-ve)=y1(-ve)=yn(n,-ve) are NaN with invalid signal. - * Note 2. About jn(n,x), yn(n,x) - * For n=0, j0(x) is called, - * for n=1, j1(x) is called, - * for nx, a continued fraction approximation to - * j(n,x)/j(n-1,x) is evaluated and then backward - * recursion is used starting from a supposed value - * for j(n,x). The resulting value of j(0,x) is - * compared with the actual value to correct the - * supposed value of j(n,x). - * - * yn(n,x) is similar in all respects, except - * that forward recursion is used for all - * values of n>1. - * - */ - -#include -#include - -long double __jnl(int n, long double x) /* wrapper jnl */ -{ -#ifdef _IEEE_LIBM - return __ieee754_jnl(n,x); -#else - long double z; - z = __ieee754_jnl(n,x); - if (_LIB_VERSION == _IEEE_ - || _LIB_VERSION == _POSIX_ - || isnan(x)) - return z; - if(fabsl(x)>X_TLOSS) { - return __kernel_standard_l((double)n,x,238); /* jn(|x|>X_TLOSS,n) */ - } else - return z; -#endif -} -weak_alias (__jnl, jnl) - -long double __ynl(int n, long double x) /* wrapper ynl */ -{ -#ifdef _IEEE_LIBM - return __ieee754_ynl(n,x); -#else - long double z; - z = __ieee754_ynl(n,x); - if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z; - if(x <= 0.0){ - if(x==0.0) - /* d= -one/(x-x); */ - return __kernel_standard_l((double)n,x,212); - else - /* d = zero/(x-x); */ - return __kernel_standard_l((double)n,x,213); - } - if(x>X_TLOSS && _LIB_VERSION != _POSIX_) { - return __kernel_standard_l((double)n,x,239); /* yn(x>X_TLOSS,n) */ - } else - return z; -#endif -} -weak_alias (__ynl, ynl) diff --git a/math/w_jnl_compat.c b/math/w_jnl_compat.c new file mode 100644 index 0000000000..d17b047956 --- /dev/null +++ b/math/w_jnl_compat.c @@ -0,0 +1,91 @@ +/* w_jnl.c -- long double version of w_jn.c. + * Conversion to long double by Ulrich Drepper, + * Cygnus Support, drepper@cygnus.com. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: $"; +#endif + +/* + * wrapper jn(int n, double x), yn(int n, double x) + * floating point Bessel's function of the 1st and 2nd kind + * of order n + * + * Special cases: + * y0(0)=y1(0)=yn(n,0) = -inf with division by zero signal; + * y0(-ve)=y1(-ve)=yn(n,-ve) are NaN with invalid signal. + * Note 2. About jn(n,x), yn(n,x) + * For n=0, j0(x) is called, + * for n=1, j1(x) is called, + * for nx, a continued fraction approximation to + * j(n,x)/j(n-1,x) is evaluated and then backward + * recursion is used starting from a supposed value + * for j(n,x). The resulting value of j(0,x) is + * compared with the actual value to correct the + * supposed value of j(n,x). + * + * yn(n,x) is similar in all respects, except + * that forward recursion is used for all + * values of n>1. + * + */ + +#include +#include + +long double __jnl(int n, long double x) /* wrapper jnl */ +{ +#ifdef _IEEE_LIBM + return __ieee754_jnl(n,x); +#else + long double z; + z = __ieee754_jnl(n,x); + if (_LIB_VERSION == _IEEE_ + || _LIB_VERSION == _POSIX_ + || isnan(x)) + return z; + if(fabsl(x)>X_TLOSS) { + return __kernel_standard_l((double)n,x,238); /* jn(|x|>X_TLOSS,n) */ + } else + return z; +#endif +} +weak_alias (__jnl, jnl) + +long double __ynl(int n, long double x) /* wrapper ynl */ +{ +#ifdef _IEEE_LIBM + return __ieee754_ynl(n,x); +#else + long double z; + z = __ieee754_ynl(n,x); + if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z; + if(x <= 0.0){ + if(x==0.0) + /* d= -one/(x-x); */ + return __kernel_standard_l((double)n,x,212); + else + /* d = zero/(x-x); */ + return __kernel_standard_l((double)n,x,213); + } + if(x>X_TLOSS && _LIB_VERSION != _POSIX_) { + return __kernel_standard_l((double)n,x,239); /* yn(x>X_TLOSS,n) */ + } else + return z; +#endif +} +weak_alias (__ynl, ynl) diff --git a/math/w_log.c b/math/w_log.c deleted file mode 100644 index 4b470695ae..0000000000 --- a/math/w_log.c +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - - -/* wrapper log(x) */ -double -__log (double x) -{ - if (__builtin_expect (islessequal (x, 0.0), 0) && _LIB_VERSION != _IEEE_) - { - if (x == 0.0) - { - __feraiseexcept (FE_DIVBYZERO); - return __kernel_standard (x, x, 16); /* log(0) */ - } - else - { - __feraiseexcept (FE_INVALID); - return __kernel_standard (x, x, 17); /* log(x<0) */ - } - } - - return __ieee754_log (x); -} -weak_alias (__log, log) -#ifdef NO_LONG_DOUBLE -strong_alias (__log, __logl) -weak_alias (__log, logl) -#endif diff --git a/math/w_log10.c b/math/w_log10.c deleted file mode 100644 index 9704ba9cdc..0000000000 --- a/math/w_log10.c +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - - -/* wrapper log10(x) */ -double -__log10 (double x) -{ - if (__builtin_expect (islessequal (x, 0.0), 0) && _LIB_VERSION != _IEEE_) - { - if (x == 0.0) - { - __feraiseexcept (FE_DIVBYZERO); - return __kernel_standard (x, x, 18); /* log10(0) */ - } - else - { - __feraiseexcept (FE_INVALID); - return __kernel_standard (x, x, 19); /* log10(x<0) */ - } - } - - return __ieee754_log10 (x); -} -weak_alias (__log10, log10) -#ifdef NO_LONG_DOUBLE -strong_alias (__log10, __log10l) -weak_alias (__log10, log10l) -#endif diff --git a/math/w_log10_compat.c b/math/w_log10_compat.c new file mode 100644 index 0000000000..9704ba9cdc --- /dev/null +++ b/math/w_log10_compat.c @@ -0,0 +1,48 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + + +/* wrapper log10(x) */ +double +__log10 (double x) +{ + if (__builtin_expect (islessequal (x, 0.0), 0) && _LIB_VERSION != _IEEE_) + { + if (x == 0.0) + { + __feraiseexcept (FE_DIVBYZERO); + return __kernel_standard (x, x, 18); /* log10(0) */ + } + else + { + __feraiseexcept (FE_INVALID); + return __kernel_standard (x, x, 19); /* log10(x<0) */ + } + } + + return __ieee754_log10 (x); +} +weak_alias (__log10, log10) +#ifdef NO_LONG_DOUBLE +strong_alias (__log10, __log10l) +weak_alias (__log10, log10l) +#endif diff --git a/math/w_log10f.c b/math/w_log10f.c deleted file mode 100644 index f8921fe285..0000000000 --- a/math/w_log10f.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - - -/* wrapper log10f(x) */ -float -__log10f (float x) -{ - if (__builtin_expect (islessequal (x, 0.0f), 0) && _LIB_VERSION != _IEEE_) - { - if (x == 0.0f) - { - feraiseexcept (FE_DIVBYZERO); - return __kernel_standard_f (x, x, 118); /* log10(0) */ - } - else - { - feraiseexcept (FE_INVALID); - return __kernel_standard_f (x, x, 119); /* log10(x<0) */ - } - } - - return __ieee754_log10f (x); -} -weak_alias (__log10f, log10f) diff --git a/math/w_log10f_compat.c b/math/w_log10f_compat.c new file mode 100644 index 0000000000..f8921fe285 --- /dev/null +++ b/math/w_log10f_compat.c @@ -0,0 +1,44 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + + +/* wrapper log10f(x) */ +float +__log10f (float x) +{ + if (__builtin_expect (islessequal (x, 0.0f), 0) && _LIB_VERSION != _IEEE_) + { + if (x == 0.0f) + { + feraiseexcept (FE_DIVBYZERO); + return __kernel_standard_f (x, x, 118); /* log10(0) */ + } + else + { + feraiseexcept (FE_INVALID); + return __kernel_standard_f (x, x, 119); /* log10(x<0) */ + } + } + + return __ieee754_log10f (x); +} +weak_alias (__log10f, log10f) diff --git a/math/w_log10l.c b/math/w_log10l.c deleted file mode 100644 index cfb514a8ab..0000000000 --- a/math/w_log10l.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - - -/* wrapper log10l(x) */ -long double -__log10l (long double x) -{ - if (__builtin_expect (islessequal (x, 0.0L), 0) && _LIB_VERSION != _IEEE_) - { - if (x == 0.0L) - { - feraiseexcept (FE_DIVBYZERO); - return __kernel_standard_l (x, x, 218); /* log10(0) */ - } - else - { - feraiseexcept (FE_INVALID); - return __kernel_standard_l (x, x, 219); /* log10(x<0) */ - } - } - - return __ieee754_log10l (x); -} -weak_alias (__log10l, log10l) diff --git a/math/w_log10l_compat.c b/math/w_log10l_compat.c new file mode 100644 index 0000000000..cfb514a8ab --- /dev/null +++ b/math/w_log10l_compat.c @@ -0,0 +1,44 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + + +/* wrapper log10l(x) */ +long double +__log10l (long double x) +{ + if (__builtin_expect (islessequal (x, 0.0L), 0) && _LIB_VERSION != _IEEE_) + { + if (x == 0.0L) + { + feraiseexcept (FE_DIVBYZERO); + return __kernel_standard_l (x, x, 218); /* log10(0) */ + } + else + { + feraiseexcept (FE_INVALID); + return __kernel_standard_l (x, x, 219); /* log10(x<0) */ + } + } + + return __ieee754_log10l (x); +} +weak_alias (__log10l, log10l) diff --git a/math/w_log2.c b/math/w_log2.c deleted file mode 100644 index b8e842d5be..0000000000 --- a/math/w_log2.c +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - - -/* wrapper log2(x) */ -double -__log2 (double x) -{ - if (__builtin_expect (islessequal (x, 0.0), 0) && _LIB_VERSION != _IEEE_) - { - if (x == 0.0) - { - feraiseexcept (FE_DIVBYZERO); - return __kernel_standard (x, x, 48); /* log2(0) */ - } - else - { - feraiseexcept (FE_INVALID); - return __kernel_standard (x, x, 49); /* log2(x<0) */ - } - } - - return __ieee754_log2 (x); -} -weak_alias (__log2, log2) -#ifdef NO_LONG_DOUBLE -strong_alias (__log2, __log2l) -weak_alias (__log2, log2l) -#endif diff --git a/math/w_log2_compat.c b/math/w_log2_compat.c new file mode 100644 index 0000000000..b8e842d5be --- /dev/null +++ b/math/w_log2_compat.c @@ -0,0 +1,48 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + + +/* wrapper log2(x) */ +double +__log2 (double x) +{ + if (__builtin_expect (islessequal (x, 0.0), 0) && _LIB_VERSION != _IEEE_) + { + if (x == 0.0) + { + feraiseexcept (FE_DIVBYZERO); + return __kernel_standard (x, x, 48); /* log2(0) */ + } + else + { + feraiseexcept (FE_INVALID); + return __kernel_standard (x, x, 49); /* log2(x<0) */ + } + } + + return __ieee754_log2 (x); +} +weak_alias (__log2, log2) +#ifdef NO_LONG_DOUBLE +strong_alias (__log2, __log2l) +weak_alias (__log2, log2l) +#endif diff --git a/math/w_log2f.c b/math/w_log2f.c deleted file mode 100644 index 357cc0afe9..0000000000 --- a/math/w_log2f.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - - -/* wrapper log2f(x) */ -float -__log2f (float x) -{ - if (__builtin_expect (islessequal (x, 0.0f), 0) && _LIB_VERSION != _IEEE_) - { - if (x == 0.0) - { - feraiseexcept (FE_DIVBYZERO); - return __kernel_standard_f (x, x, 148); /* log2(0) */ - } - else - { - feraiseexcept (FE_INVALID); - return __kernel_standard_f (x, x, 149); /* log2(x<0) */ - } - } - - return __ieee754_log2f (x); -} -weak_alias (__log2f, log2f) diff --git a/math/w_log2f_compat.c b/math/w_log2f_compat.c new file mode 100644 index 0000000000..357cc0afe9 --- /dev/null +++ b/math/w_log2f_compat.c @@ -0,0 +1,44 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + + +/* wrapper log2f(x) */ +float +__log2f (float x) +{ + if (__builtin_expect (islessequal (x, 0.0f), 0) && _LIB_VERSION != _IEEE_) + { + if (x == 0.0) + { + feraiseexcept (FE_DIVBYZERO); + return __kernel_standard_f (x, x, 148); /* log2(0) */ + } + else + { + feraiseexcept (FE_INVALID); + return __kernel_standard_f (x, x, 149); /* log2(x<0) */ + } + } + + return __ieee754_log2f (x); +} +weak_alias (__log2f, log2f) diff --git a/math/w_log2l.c b/math/w_log2l.c deleted file mode 100644 index 3d9994e055..0000000000 --- a/math/w_log2l.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - - -/* wrapper log2l(x) */ -long double -__log2l (long double x) -{ - if (__builtin_expect (islessequal (x, 0.0L), 0) && _LIB_VERSION != _IEEE_) - { - if (x == 0.0L) - { - feraiseexcept (FE_DIVBYZERO); - return __kernel_standard_l (x, x, 248); /* log2(0) */ - } - else - { - feraiseexcept (FE_INVALID); - return __kernel_standard_l (x, x, 249); /* log2(x<0) */ - } - } - - return __ieee754_log2l (x); -} -weak_alias (__log2l, log2l) diff --git a/math/w_log2l_compat.c b/math/w_log2l_compat.c new file mode 100644 index 0000000000..3d9994e055 --- /dev/null +++ b/math/w_log2l_compat.c @@ -0,0 +1,44 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + + +/* wrapper log2l(x) */ +long double +__log2l (long double x) +{ + if (__builtin_expect (islessequal (x, 0.0L), 0) && _LIB_VERSION != _IEEE_) + { + if (x == 0.0L) + { + feraiseexcept (FE_DIVBYZERO); + return __kernel_standard_l (x, x, 248); /* log2(0) */ + } + else + { + feraiseexcept (FE_INVALID); + return __kernel_standard_l (x, x, 249); /* log2(x<0) */ + } + } + + return __ieee754_log2l (x); +} +weak_alias (__log2l, log2l) diff --git a/math/w_log_compat.c b/math/w_log_compat.c new file mode 100644 index 0000000000..4b470695ae --- /dev/null +++ b/math/w_log_compat.c @@ -0,0 +1,48 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + + +/* wrapper log(x) */ +double +__log (double x) +{ + if (__builtin_expect (islessequal (x, 0.0), 0) && _LIB_VERSION != _IEEE_) + { + if (x == 0.0) + { + __feraiseexcept (FE_DIVBYZERO); + return __kernel_standard (x, x, 16); /* log(0) */ + } + else + { + __feraiseexcept (FE_INVALID); + return __kernel_standard (x, x, 17); /* log(x<0) */ + } + } + + return __ieee754_log (x); +} +weak_alias (__log, log) +#ifdef NO_LONG_DOUBLE +strong_alias (__log, __logl) +weak_alias (__log, logl) +#endif diff --git a/math/w_logf.c b/math/w_logf.c deleted file mode 100644 index 8b0f4fc9d1..0000000000 --- a/math/w_logf.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - - -/* wrapper logf(x) */ -float -__logf (float x) -{ - if (__builtin_expect (islessequal (x, 0.0f), 0) && _LIB_VERSION != _IEEE_) - { - if (x == 0.0f) - { - feraiseexcept (FE_DIVBYZERO); - return __kernel_standard_f (x, x, 116); /* log(0) */ - } - else - { - feraiseexcept (FE_INVALID); - return __kernel_standard_f (x, x, 117); /* log(x<0) */ - } - } - - return __ieee754_logf (x); -} -weak_alias (__logf, logf) diff --git a/math/w_logf_compat.c b/math/w_logf_compat.c new file mode 100644 index 0000000000..8b0f4fc9d1 --- /dev/null +++ b/math/w_logf_compat.c @@ -0,0 +1,44 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + + +/* wrapper logf(x) */ +float +__logf (float x) +{ + if (__builtin_expect (islessequal (x, 0.0f), 0) && _LIB_VERSION != _IEEE_) + { + if (x == 0.0f) + { + feraiseexcept (FE_DIVBYZERO); + return __kernel_standard_f (x, x, 116); /* log(0) */ + } + else + { + feraiseexcept (FE_INVALID); + return __kernel_standard_f (x, x, 117); /* log(x<0) */ + } + } + + return __ieee754_logf (x); +} +weak_alias (__logf, logf) diff --git a/math/w_logl.c b/math/w_logl.c deleted file mode 100644 index 12afbe575a..0000000000 --- a/math/w_logl.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - - -/* wrapper logl(x) */ -long double -__logl (long double x) -{ - if (__builtin_expect (islessequal (x, 0.0L), 0) && _LIB_VERSION != _IEEE_) - { - if (x == 0.0L) - { - feraiseexcept (FE_DIVBYZERO); - return __kernel_standard_l (x, x, 216); /* log(0) */ - } - else - { - feraiseexcept (FE_INVALID); - return __kernel_standard_l (x, x, 217); /* log(x<0) */ - } - } - - return __ieee754_logl (x); -} -weak_alias (__logl, logl) diff --git a/math/w_logl_compat.c b/math/w_logl_compat.c new file mode 100644 index 0000000000..12afbe575a --- /dev/null +++ b/math/w_logl_compat.c @@ -0,0 +1,44 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + + +/* wrapper logl(x) */ +long double +__logl (long double x) +{ + if (__builtin_expect (islessequal (x, 0.0L), 0) && _LIB_VERSION != _IEEE_) + { + if (x == 0.0L) + { + feraiseexcept (FE_DIVBYZERO); + return __kernel_standard_l (x, x, 216); /* log(0) */ + } + else + { + feraiseexcept (FE_INVALID); + return __kernel_standard_l (x, x, 217); /* log(x<0) */ + } + } + + return __ieee754_logl (x); +} +weak_alias (__logl, logl) diff --git a/math/w_pow.c b/math/w_pow.c deleted file mode 100644 index 0e24b755b2..0000000000 --- a/math/w_pow.c +++ /dev/null @@ -1,64 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include - - -/* wrapper pow */ -double -__pow (double x, double y) -{ - double z = __ieee754_pow (x, y); - if (__glibc_unlikely (!isfinite (z))) - { - if (_LIB_VERSION != _IEEE_) - { - if (isfinite (x) && isfinite (y)) - { - if (isnan (z)) - /* pow neg**non-int */ - return __kernel_standard (x, y, 24); - else if (x == 0.0 && y < 0.0) - { - if (signbit (x) && signbit (z)) - /* pow(-0.0,negative) */ - return __kernel_standard (x, y, 23); - else - /* pow(+0.0,negative) */ - return __kernel_standard (x, y, 43); - } - else - /* pow overflow */ - return __kernel_standard (x, y, 21); - } - } - } - else if (__builtin_expect (z == 0.0, 0) - && isfinite (x) && x != 0 && isfinite (y) - && _LIB_VERSION != _IEEE_) - /* pow underflow */ - return __kernel_standard (x, y, 22); - - return z; -} -weak_alias (__pow, pow) -#ifdef NO_LONG_DOUBLE -strong_alias (__pow, __powl) -weak_alias (__pow, powl) -#endif diff --git a/math/w_pow_compat.c b/math/w_pow_compat.c new file mode 100644 index 0000000000..0e24b755b2 --- /dev/null +++ b/math/w_pow_compat.c @@ -0,0 +1,64 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + + +/* wrapper pow */ +double +__pow (double x, double y) +{ + double z = __ieee754_pow (x, y); + if (__glibc_unlikely (!isfinite (z))) + { + if (_LIB_VERSION != _IEEE_) + { + if (isfinite (x) && isfinite (y)) + { + if (isnan (z)) + /* pow neg**non-int */ + return __kernel_standard (x, y, 24); + else if (x == 0.0 && y < 0.0) + { + if (signbit (x) && signbit (z)) + /* pow(-0.0,negative) */ + return __kernel_standard (x, y, 23); + else + /* pow(+0.0,negative) */ + return __kernel_standard (x, y, 43); + } + else + /* pow overflow */ + return __kernel_standard (x, y, 21); + } + } + } + else if (__builtin_expect (z == 0.0, 0) + && isfinite (x) && x != 0 && isfinite (y) + && _LIB_VERSION != _IEEE_) + /* pow underflow */ + return __kernel_standard (x, y, 22); + + return z; +} +weak_alias (__pow, pow) +#ifdef NO_LONG_DOUBLE +strong_alias (__pow, __powl) +weak_alias (__pow, powl) +#endif diff --git a/math/w_powf.c b/math/w_powf.c deleted file mode 100644 index 7e3b015001..0000000000 --- a/math/w_powf.c +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include - - -/* wrapper powf */ -float -__powf (float x, float y) -{ - float z = __ieee754_powf (x, y); - if (__glibc_unlikely (!isfinite (z))) - { - if (_LIB_VERSION != _IEEE_) - { - if (isfinite (x) && isfinite (y)) - { - if (isnan (z)) - /* pow neg**non-int */ - return __kernel_standard_f (x, y, 124); - else if (x == 0.0f && y < 0.0f) - { - if (signbit (x) && signbit (z)) - /* pow(-0.0,negative) */ - return __kernel_standard_f (x, y, 123); - else - /* pow(+0.0,negative) */ - return __kernel_standard_f (x, y, 143); - } - else - /* pow overflow */ - return __kernel_standard_f (x, y, 121); - } - } - } - else if (__builtin_expect (z == 0.0f, 0) - && isfinite (x) && x != 0 && isfinite (y) - && _LIB_VERSION != _IEEE_) - /* pow underflow */ - return __kernel_standard_f (x, y, 122); - - return z; -} -weak_alias (__powf, powf) diff --git a/math/w_powf_compat.c b/math/w_powf_compat.c new file mode 100644 index 0000000000..7e3b015001 --- /dev/null +++ b/math/w_powf_compat.c @@ -0,0 +1,60 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + + +/* wrapper powf */ +float +__powf (float x, float y) +{ + float z = __ieee754_powf (x, y); + if (__glibc_unlikely (!isfinite (z))) + { + if (_LIB_VERSION != _IEEE_) + { + if (isfinite (x) && isfinite (y)) + { + if (isnan (z)) + /* pow neg**non-int */ + return __kernel_standard_f (x, y, 124); + else if (x == 0.0f && y < 0.0f) + { + if (signbit (x) && signbit (z)) + /* pow(-0.0,negative) */ + return __kernel_standard_f (x, y, 123); + else + /* pow(+0.0,negative) */ + return __kernel_standard_f (x, y, 143); + } + else + /* pow overflow */ + return __kernel_standard_f (x, y, 121); + } + } + } + else if (__builtin_expect (z == 0.0f, 0) + && isfinite (x) && x != 0 && isfinite (y) + && _LIB_VERSION != _IEEE_) + /* pow underflow */ + return __kernel_standard_f (x, y, 122); + + return z; +} +weak_alias (__powf, powf) diff --git a/math/w_powl.c b/math/w_powl.c deleted file mode 100644 index 60a89c2b42..0000000000 --- a/math/w_powl.c +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include - - -/* wrapper powl */ -long double -__powl (long double x, long double y) -{ - long double z = __ieee754_powl (x, y); - if (__glibc_unlikely (!isfinite (z))) - { - if (_LIB_VERSION != _IEEE_) - { - if (isfinite (x) && isfinite (y)) - { - if (isnan (z)) - /* pow neg**non-int */ - return __kernel_standard_l (x, y, 224); - else if (x == 0.0L && y < 0.0L) - { - if (signbit (x) && signbit (z)) - /* pow(-0.0,negative) */ - return __kernel_standard_l (x, y, 223); - else - /* pow(+0.0,negative) */ - return __kernel_standard_l (x, y, 243); - } - else - /* pow overflow */ - return __kernel_standard_l (x, y, 221); - } - } - } - else if (__builtin_expect (z == 0.0L, 0) - && isfinite (x) && x != 0 && isfinite (y) - && _LIB_VERSION != _IEEE_) - /* pow underflow */ - return __kernel_standard_l (x, y, 222); - - return z; -} -weak_alias (__powl, powl) diff --git a/math/w_powl_compat.c b/math/w_powl_compat.c new file mode 100644 index 0000000000..60a89c2b42 --- /dev/null +++ b/math/w_powl_compat.c @@ -0,0 +1,60 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + + +/* wrapper powl */ +long double +__powl (long double x, long double y) +{ + long double z = __ieee754_powl (x, y); + if (__glibc_unlikely (!isfinite (z))) + { + if (_LIB_VERSION != _IEEE_) + { + if (isfinite (x) && isfinite (y)) + { + if (isnan (z)) + /* pow neg**non-int */ + return __kernel_standard_l (x, y, 224); + else if (x == 0.0L && y < 0.0L) + { + if (signbit (x) && signbit (z)) + /* pow(-0.0,negative) */ + return __kernel_standard_l (x, y, 223); + else + /* pow(+0.0,negative) */ + return __kernel_standard_l (x, y, 243); + } + else + /* pow overflow */ + return __kernel_standard_l (x, y, 221); + } + } + } + else if (__builtin_expect (z == 0.0L, 0) + && isfinite (x) && x != 0 && isfinite (y) + && _LIB_VERSION != _IEEE_) + /* pow underflow */ + return __kernel_standard_l (x, y, 222); + + return z; +} +weak_alias (__powl, powl) diff --git a/math/w_remainder.c b/math/w_remainder.c deleted file mode 100644 index 66445901f6..0000000000 --- a/math/w_remainder.c +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include - - -/* wrapper remainder */ -double -__remainder (double x, double y) -{ - if (((__builtin_expect (y == 0.0, 0) && ! isnan (x)) - || (__builtin_expect (isinf (x), 0) && ! isnan (y))) - && _LIB_VERSION != _IEEE_) - return __kernel_standard (x, y, 28); /* remainder domain */ - - return __ieee754_remainder (x, y); -} -weak_alias (__remainder, remainder) -weak_alias (__remainder, drem) -#ifdef NO_LONG_DOUBLE -strong_alias (__remainder, __remainderl) -weak_alias (__remainder, remainderl) -weak_alias (__remainder, dreml) -#endif diff --git a/math/w_remainder_compat.c b/math/w_remainder_compat.c new file mode 100644 index 0000000000..66445901f6 --- /dev/null +++ b/math/w_remainder_compat.c @@ -0,0 +1,40 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + + +/* wrapper remainder */ +double +__remainder (double x, double y) +{ + if (((__builtin_expect (y == 0.0, 0) && ! isnan (x)) + || (__builtin_expect (isinf (x), 0) && ! isnan (y))) + && _LIB_VERSION != _IEEE_) + return __kernel_standard (x, y, 28); /* remainder domain */ + + return __ieee754_remainder (x, y); +} +weak_alias (__remainder, remainder) +weak_alias (__remainder, drem) +#ifdef NO_LONG_DOUBLE +strong_alias (__remainder, __remainderl) +weak_alias (__remainder, remainderl) +weak_alias (__remainder, dreml) +#endif diff --git a/math/w_remainderf.c b/math/w_remainderf.c deleted file mode 100644 index 1db246a1c3..0000000000 --- a/math/w_remainderf.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include - - -/* wrapper remainderf */ -float -__remainderf (float x, float y) -{ - if (((__builtin_expect (y == 0.0f, 0) && ! isnan (x)) - || (__builtin_expect (isinf (x), 0) && ! isnan (y))) - && _LIB_VERSION != _IEEE_) - return __kernel_standard_f (x, y, 128); /* remainder domain */ - - return __ieee754_remainderf (x, y); -} -weak_alias (__remainderf, remainderf) -weak_alias (__remainderf, dremf) diff --git a/math/w_remainderf_compat.c b/math/w_remainderf_compat.c new file mode 100644 index 0000000000..1db246a1c3 --- /dev/null +++ b/math/w_remainderf_compat.c @@ -0,0 +1,35 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + + +/* wrapper remainderf */ +float +__remainderf (float x, float y) +{ + if (((__builtin_expect (y == 0.0f, 0) && ! isnan (x)) + || (__builtin_expect (isinf (x), 0) && ! isnan (y))) + && _LIB_VERSION != _IEEE_) + return __kernel_standard_f (x, y, 128); /* remainder domain */ + + return __ieee754_remainderf (x, y); +} +weak_alias (__remainderf, remainderf) +weak_alias (__remainderf, dremf) diff --git a/math/w_remainderl.c b/math/w_remainderl.c deleted file mode 100644 index 2fc40f1992..0000000000 --- a/math/w_remainderl.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include - - -/* wrapper remainderl */ -long double -__remainderl (long double x, long double y) -{ - if (((__builtin_expect (y == 0.0L, 0) && ! isnan (x)) - || (__builtin_expect (isinf (x), 0) && ! isnan (y))) - && _LIB_VERSION != _IEEE_) - return __kernel_standard_l (x, y, 228); /* remainder domain */ - - return __ieee754_remainderl (x, y); -} -weak_alias (__remainderl, remainderl) -weak_alias (__remainderl, dreml) diff --git a/math/w_remainderl_compat.c b/math/w_remainderl_compat.c new file mode 100644 index 0000000000..2fc40f1992 --- /dev/null +++ b/math/w_remainderl_compat.c @@ -0,0 +1,35 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + + +/* wrapper remainderl */ +long double +__remainderl (long double x, long double y) +{ + if (((__builtin_expect (y == 0.0L, 0) && ! isnan (x)) + || (__builtin_expect (isinf (x), 0) && ! isnan (y))) + && _LIB_VERSION != _IEEE_) + return __kernel_standard_l (x, y, 228); /* remainder domain */ + + return __ieee754_remainderl (x, y); +} +weak_alias (__remainderl, remainderl) +weak_alias (__remainderl, dreml) diff --git a/math/w_scalb.c b/math/w_scalb.c deleted file mode 100644 index 8354115512..0000000000 --- a/math/w_scalb.c +++ /dev/null @@ -1,80 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - - -static double -__attribute__ ((noinline)) -sysv_scalb (double x, double fn) -{ - double z = __ieee754_scalb (x, fn); - - if (__glibc_unlikely (isinf (z))) - { - if (isfinite (x)) - return __kernel_standard (x, fn, 32); /* scalb overflow */ - else - __set_errno (ERANGE); - } - else if (__builtin_expect (z == 0.0, 0) && z != x) - return __kernel_standard (x, fn, 33); /* scalb underflow */ - - return z; -} - - -/* Wrapper scalb */ -double -__scalb (double x, double fn) -{ - if (__glibc_unlikely (_LIB_VERSION == _SVID_)) - return sysv_scalb (x, fn); - else - { - double z = __ieee754_scalb (x, fn); - - if (__glibc_unlikely (!isfinite (z) || z == 0.0)) - { - if (isnan (z)) - { - if (!isnan (x) && !isnan (fn)) - __set_errno (EDOM); - } - else if (isinf (z)) - { - if (!isinf (x) && !isinf (fn)) - __set_errno (ERANGE); - } - else - { - /* z == 0. */ - if (x != 0.0 && !isinf (fn)) - __set_errno (ERANGE); - } - } - return z; - } -} -weak_alias (__scalb, scalb) -#ifdef NO_LONG_DOUBLE -strong_alias (__scalb, __scalbl) -weak_alias (__scalb, scalbl) -#endif diff --git a/math/w_scalb_compat.c b/math/w_scalb_compat.c new file mode 100644 index 0000000000..8354115512 --- /dev/null +++ b/math/w_scalb_compat.c @@ -0,0 +1,80 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + + +static double +__attribute__ ((noinline)) +sysv_scalb (double x, double fn) +{ + double z = __ieee754_scalb (x, fn); + + if (__glibc_unlikely (isinf (z))) + { + if (isfinite (x)) + return __kernel_standard (x, fn, 32); /* scalb overflow */ + else + __set_errno (ERANGE); + } + else if (__builtin_expect (z == 0.0, 0) && z != x) + return __kernel_standard (x, fn, 33); /* scalb underflow */ + + return z; +} + + +/* Wrapper scalb */ +double +__scalb (double x, double fn) +{ + if (__glibc_unlikely (_LIB_VERSION == _SVID_)) + return sysv_scalb (x, fn); + else + { + double z = __ieee754_scalb (x, fn); + + if (__glibc_unlikely (!isfinite (z) || z == 0.0)) + { + if (isnan (z)) + { + if (!isnan (x) && !isnan (fn)) + __set_errno (EDOM); + } + else if (isinf (z)) + { + if (!isinf (x) && !isinf (fn)) + __set_errno (ERANGE); + } + else + { + /* z == 0. */ + if (x != 0.0 && !isinf (fn)) + __set_errno (ERANGE); + } + } + return z; + } +} +weak_alias (__scalb, scalb) +#ifdef NO_LONG_DOUBLE +strong_alias (__scalb, __scalbl) +weak_alias (__scalb, scalbl) +#endif diff --git a/math/w_scalbf.c b/math/w_scalbf.c deleted file mode 100644 index fe93f0ac64..0000000000 --- a/math/w_scalbf.c +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - - -static float -__attribute__ ((noinline)) -sysv_scalbf (float x, float fn) -{ - float z = __ieee754_scalbf (x, fn); - - if (__glibc_unlikely (isinf (z))) - { - if (isfinite (x)) - return __kernel_standard_f (x, fn, 132); /* scalb overflow */ - else - __set_errno (ERANGE); - } - else if (__builtin_expect (z == 0.0f, 0) && z != x) - return __kernel_standard_f (x, fn, 133); /* scalb underflow */ - - return z; -} - - -/* Wrapper scalbf */ -float -__scalbf (float x, float fn) -{ - if (__glibc_unlikely (_LIB_VERSION == _SVID_)) - return sysv_scalbf (x, fn); - else - { - float z = __ieee754_scalbf (x, fn); - - if (__glibc_unlikely (!isfinite (z) || z == 0.0f)) - { - if (isnan (z)) - { - if (!isnan (x) && !isnan (fn)) - __set_errno (EDOM); - } - else if (isinf (z)) - { - if (!isinf (x) && !isinf (fn)) - __set_errno (ERANGE); - } - else - { - /* z == 0. */ - if (x != 0.0f && !isinf (fn)) - __set_errno (ERANGE); - } - } - return z; - } -} -weak_alias (__scalbf, scalbf) diff --git a/math/w_scalbf_compat.c b/math/w_scalbf_compat.c new file mode 100644 index 0000000000..fe93f0ac64 --- /dev/null +++ b/math/w_scalbf_compat.c @@ -0,0 +1,76 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + + +static float +__attribute__ ((noinline)) +sysv_scalbf (float x, float fn) +{ + float z = __ieee754_scalbf (x, fn); + + if (__glibc_unlikely (isinf (z))) + { + if (isfinite (x)) + return __kernel_standard_f (x, fn, 132); /* scalb overflow */ + else + __set_errno (ERANGE); + } + else if (__builtin_expect (z == 0.0f, 0) && z != x) + return __kernel_standard_f (x, fn, 133); /* scalb underflow */ + + return z; +} + + +/* Wrapper scalbf */ +float +__scalbf (float x, float fn) +{ + if (__glibc_unlikely (_LIB_VERSION == _SVID_)) + return sysv_scalbf (x, fn); + else + { + float z = __ieee754_scalbf (x, fn); + + if (__glibc_unlikely (!isfinite (z) || z == 0.0f)) + { + if (isnan (z)) + { + if (!isnan (x) && !isnan (fn)) + __set_errno (EDOM); + } + else if (isinf (z)) + { + if (!isinf (x) && !isinf (fn)) + __set_errno (ERANGE); + } + else + { + /* z == 0. */ + if (x != 0.0f && !isinf (fn)) + __set_errno (ERANGE); + } + } + return z; + } +} +weak_alias (__scalbf, scalbf) diff --git a/math/w_scalbl.c b/math/w_scalbl.c deleted file mode 100644 index 62645d4848..0000000000 --- a/math/w_scalbl.c +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - - -static long double -__attribute__ ((noinline)) -sysv_scalbl (long double x, long double fn) -{ - long double z = __ieee754_scalbl (x, fn); - - if (__glibc_unlikely (isinf (z))) - { - if (isfinite (x)) - return __kernel_standard_l (x, fn, 232); /* scalb overflow */ - else - __set_errno (ERANGE); - } - else if (__builtin_expect (z == 0.0L, 0) && z != x) - return __kernel_standard_l (x, fn, 233); /* scalb underflow */ - - return z; -} - - -/* Wrapper scalbl */ -long double -__scalbl (long double x, long double fn) -{ - if (__glibc_unlikely (_LIB_VERSION == _SVID_)) - return sysv_scalbl (x, fn); - else - { - long double z = __ieee754_scalbl (x, fn); - - if (__glibc_unlikely (!isfinite (z) || z == 0.0L)) - { - if (isnan (z)) - { - if (!isnan (x) && !isnan (fn)) - __set_errno (EDOM); - } - else if (isinf (z)) - { - if (!isinf (x) && !isinf (fn)) - __set_errno (ERANGE); - } - else - { - /* z == 0. */ - if (x != 0.0L && !isinf (fn)) - __set_errno (ERANGE); - } - } - return z; - } -} -weak_alias (__scalbl, scalbl) diff --git a/math/w_scalbl_compat.c b/math/w_scalbl_compat.c new file mode 100644 index 0000000000..62645d4848 --- /dev/null +++ b/math/w_scalbl_compat.c @@ -0,0 +1,76 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + + +static long double +__attribute__ ((noinline)) +sysv_scalbl (long double x, long double fn) +{ + long double z = __ieee754_scalbl (x, fn); + + if (__glibc_unlikely (isinf (z))) + { + if (isfinite (x)) + return __kernel_standard_l (x, fn, 232); /* scalb overflow */ + else + __set_errno (ERANGE); + } + else if (__builtin_expect (z == 0.0L, 0) && z != x) + return __kernel_standard_l (x, fn, 233); /* scalb underflow */ + + return z; +} + + +/* Wrapper scalbl */ +long double +__scalbl (long double x, long double fn) +{ + if (__glibc_unlikely (_LIB_VERSION == _SVID_)) + return sysv_scalbl (x, fn); + else + { + long double z = __ieee754_scalbl (x, fn); + + if (__glibc_unlikely (!isfinite (z) || z == 0.0L)) + { + if (isnan (z)) + { + if (!isnan (x) && !isnan (fn)) + __set_errno (EDOM); + } + else if (isinf (z)) + { + if (!isinf (x) && !isinf (fn)) + __set_errno (ERANGE); + } + else + { + /* z == 0. */ + if (x != 0.0L && !isinf (fn)) + __set_errno (ERANGE); + } + } + return z; + } +} +weak_alias (__scalbl, scalbl) diff --git a/math/w_sinh.c b/math/w_sinh.c deleted file mode 100644 index 51daf2ff35..0000000000 --- a/math/w_sinh.c +++ /dev/null @@ -1,34 +0,0 @@ -/* @(#)w_sinh.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -/* - * wrapper sinh(x) - */ - -#include -#include - -double -__sinh (double x) -{ - double z = __ieee754_sinh (x); - if (__builtin_expect (!isfinite (z), 0) && isfinite (x) - && _LIB_VERSION != _IEEE_) - return __kernel_standard (x, x, 25); /* sinh overflow */ - - return z; -} -weak_alias (__sinh, sinh) -#ifdef NO_LONG_DOUBLE -strong_alias (__sinh, __sinhl) -weak_alias (__sinh, sinhl) -#endif diff --git a/math/w_sinh_compat.c b/math/w_sinh_compat.c new file mode 100644 index 0000000000..51daf2ff35 --- /dev/null +++ b/math/w_sinh_compat.c @@ -0,0 +1,34 @@ +/* @(#)w_sinh.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * wrapper sinh(x) + */ + +#include +#include + +double +__sinh (double x) +{ + double z = __ieee754_sinh (x); + if (__builtin_expect (!isfinite (z), 0) && isfinite (x) + && _LIB_VERSION != _IEEE_) + return __kernel_standard (x, x, 25); /* sinh overflow */ + + return z; +} +weak_alias (__sinh, sinh) +#ifdef NO_LONG_DOUBLE +strong_alias (__sinh, __sinhl) +weak_alias (__sinh, sinhl) +#endif diff --git a/math/w_sinhf.c b/math/w_sinhf.c deleted file mode 100644 index 0e530b1600..0000000000 --- a/math/w_sinhf.c +++ /dev/null @@ -1,33 +0,0 @@ -/* w_sinhf.c -- float version of w_sinh.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -/* - * wrapper sinhf(x) - */ - -#include -#include - -float -__sinhf (float x) -{ - float z = __ieee754_sinhf (x); - if (__builtin_expect (!isfinite (z), 0) && isfinite (x) - && _LIB_VERSION != _IEEE_) - return __kernel_standard_f (x, x, 125); /* sinhf overflow */ - - return z; -} -weak_alias (__sinhf, sinhf) diff --git a/math/w_sinhf_compat.c b/math/w_sinhf_compat.c new file mode 100644 index 0000000000..0e530b1600 --- /dev/null +++ b/math/w_sinhf_compat.c @@ -0,0 +1,33 @@ +/* w_sinhf.c -- float version of w_sinh.c. + * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * wrapper sinhf(x) + */ + +#include +#include + +float +__sinhf (float x) +{ + float z = __ieee754_sinhf (x); + if (__builtin_expect (!isfinite (z), 0) && isfinite (x) + && _LIB_VERSION != _IEEE_) + return __kernel_standard_f (x, x, 125); /* sinhf overflow */ + + return z; +} +weak_alias (__sinhf, sinhf) diff --git a/math/w_sinhl.c b/math/w_sinhl.c deleted file mode 100644 index 7df7c0614f..0000000000 --- a/math/w_sinhl.c +++ /dev/null @@ -1,34 +0,0 @@ -/* w_sinhl.c -- long double version of w_sinh.c. - * Conversion to long double by Ulrich Drepper, - * Cygnus Support, drepper@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -/* - * wrapper sinhl(x) - */ - -#include -#include - -long double -__sinhl (long double x) -{ - long double z = __ieee754_sinhl (x); - if (__builtin_expect (!isfinite (z), 0) && isfinite (x) - && _LIB_VERSION != _IEEE_) - return __kernel_standard_l (x, x, 225); /* sinh overflow */ - - return z; -} -weak_alias (__sinhl, sinhl) diff --git a/math/w_sinhl_compat.c b/math/w_sinhl_compat.c new file mode 100644 index 0000000000..7df7c0614f --- /dev/null +++ b/math/w_sinhl_compat.c @@ -0,0 +1,34 @@ +/* w_sinhl.c -- long double version of w_sinh.c. + * Conversion to long double by Ulrich Drepper, + * Cygnus Support, drepper@cygnus.com. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * wrapper sinhl(x) + */ + +#include +#include + +long double +__sinhl (long double x) +{ + long double z = __ieee754_sinhl (x); + if (__builtin_expect (!isfinite (z), 0) && isfinite (x) + && _LIB_VERSION != _IEEE_) + return __kernel_standard_l (x, x, 225); /* sinh overflow */ + + return z; +} +weak_alias (__sinhl, sinhl) diff --git a/math/w_sqrt.c b/math/w_sqrt.c deleted file mode 100644 index 018da82e7a..0000000000 --- a/math/w_sqrt.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include - - -/* wrapper sqrt */ -double -__sqrt (double x) -{ - if (__builtin_expect (isless (x, 0.0), 0) && _LIB_VERSION != _IEEE_) - return __kernel_standard (x, x, 26); /* sqrt(negative) */ - - return __ieee754_sqrt (x); -} -weak_alias (__sqrt, sqrt) -#ifdef NO_LONG_DOUBLE -strong_alias (__sqrt, __sqrtl) -weak_alias (__sqrt, sqrtl) -#endif diff --git a/math/w_sqrt_compat.c b/math/w_sqrt_compat.c new file mode 100644 index 0000000000..018da82e7a --- /dev/null +++ b/math/w_sqrt_compat.c @@ -0,0 +1,36 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + + +/* wrapper sqrt */ +double +__sqrt (double x) +{ + if (__builtin_expect (isless (x, 0.0), 0) && _LIB_VERSION != _IEEE_) + return __kernel_standard (x, x, 26); /* sqrt(negative) */ + + return __ieee754_sqrt (x); +} +weak_alias (__sqrt, sqrt) +#ifdef NO_LONG_DOUBLE +strong_alias (__sqrt, __sqrtl) +weak_alias (__sqrt, sqrtl) +#endif diff --git a/math/w_sqrtf.c b/math/w_sqrtf.c deleted file mode 100644 index de5b42d8f6..0000000000 --- a/math/w_sqrtf.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include - - -/* wrapper sqrtf */ -float -__sqrtf (float x) -{ - if (__builtin_expect (isless (x, 0.0f), 0) && _LIB_VERSION != _IEEE_) - return __kernel_standard_f (x, x, 126); /* sqrt(negative) */ - - return __ieee754_sqrtf (x); -} -weak_alias (__sqrtf, sqrtf) diff --git a/math/w_sqrtf_compat.c b/math/w_sqrtf_compat.c new file mode 100644 index 0000000000..de5b42d8f6 --- /dev/null +++ b/math/w_sqrtf_compat.c @@ -0,0 +1,32 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + + +/* wrapper sqrtf */ +float +__sqrtf (float x) +{ + if (__builtin_expect (isless (x, 0.0f), 0) && _LIB_VERSION != _IEEE_) + return __kernel_standard_f (x, x, 126); /* sqrt(negative) */ + + return __ieee754_sqrtf (x); +} +weak_alias (__sqrtf, sqrtf) diff --git a/math/w_sqrtl.c b/math/w_sqrtl.c deleted file mode 100644 index b4663b71e0..0000000000 --- a/math/w_sqrtl.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include - - -/* wrapper sqrtl */ -long double -__sqrtl (long double x) -{ - if (__builtin_expect (isless (x, 0.0L), 0) && _LIB_VERSION != _IEEE_) - return __kernel_standard_l (x, x, 226); /* sqrt(negative) */ - - return __ieee754_sqrtl (x); -} -weak_alias (__sqrtl, sqrtl) diff --git a/math/w_sqrtl_compat.c b/math/w_sqrtl_compat.c new file mode 100644 index 0000000000..b4663b71e0 --- /dev/null +++ b/math/w_sqrtl_compat.c @@ -0,0 +1,32 @@ +/* Copyright (C) 2011-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + + +/* wrapper sqrtl */ +long double +__sqrtl (long double x) +{ + if (__builtin_expect (isless (x, 0.0L), 0) && _LIB_VERSION != _IEEE_) + return __kernel_standard_l (x, x, 226); /* sqrt(negative) */ + + return __ieee754_sqrtl (x); +} +weak_alias (__sqrtl, sqrtl) diff --git a/math/w_tgamma.c b/math/w_tgamma.c deleted file mode 100644 index 99b60298ca..0000000000 --- a/math/w_tgamma.c +++ /dev/null @@ -1,46 +0,0 @@ -/* @(#)w_gamma.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -/* double gamma(double x) - * Return the logarithm of the Gamma function of x or the Gamma function of x, - * depending on the library mode. - */ - -#include -#include -#include - -double -__tgamma(double x) -{ - int local_signgam; - double y = __ieee754_gamma_r(x,&local_signgam); - - if(__glibc_unlikely (!isfinite (y) || y == 0) - && (isfinite (x) || (isinf (x) && x < 0.0)) - && _LIB_VERSION != _IEEE_) { - if (x == 0.0) - return __kernel_standard(x,x,50); /* tgamma pole */ - else if(__floor(x)==x&&x<0.0) - return __kernel_standard(x,x,41); /* tgamma domain */ - else if (y == 0) - __set_errno (ERANGE); /* tgamma underflow */ - else - return __kernel_standard(x,x,40); /* tgamma overflow */ - } - return local_signgam < 0 ? -y : y; -} -weak_alias (__tgamma, tgamma) -#ifdef NO_LONG_DOUBLE -strong_alias (__tgamma, __tgammal) -weak_alias (__tgamma, tgammal) -#endif diff --git a/math/w_tgamma_compat.c b/math/w_tgamma_compat.c new file mode 100644 index 0000000000..99b60298ca --- /dev/null +++ b/math/w_tgamma_compat.c @@ -0,0 +1,46 @@ +/* @(#)w_gamma.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* double gamma(double x) + * Return the logarithm of the Gamma function of x or the Gamma function of x, + * depending on the library mode. + */ + +#include +#include +#include + +double +__tgamma(double x) +{ + int local_signgam; + double y = __ieee754_gamma_r(x,&local_signgam); + + if(__glibc_unlikely (!isfinite (y) || y == 0) + && (isfinite (x) || (isinf (x) && x < 0.0)) + && _LIB_VERSION != _IEEE_) { + if (x == 0.0) + return __kernel_standard(x,x,50); /* tgamma pole */ + else if(__floor(x)==x&&x<0.0) + return __kernel_standard(x,x,41); /* tgamma domain */ + else if (y == 0) + __set_errno (ERANGE); /* tgamma underflow */ + else + return __kernel_standard(x,x,40); /* tgamma overflow */ + } + return local_signgam < 0 ? -y : y; +} +weak_alias (__tgamma, tgamma) +#ifdef NO_LONG_DOUBLE +strong_alias (__tgamma, __tgammal) +weak_alias (__tgamma, tgammal) +#endif diff --git a/math/w_tgammaf.c b/math/w_tgammaf.c deleted file mode 100644 index dfce894cc8..0000000000 --- a/math/w_tgammaf.c +++ /dev/null @@ -1,44 +0,0 @@ -/* w_gammaf.c -- float version of w_gamma.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#include -#include -#include - -float -__tgammaf(float x) -{ - int local_signgam; - float y = __ieee754_gammaf_r(x,&local_signgam); - - if(__glibc_unlikely (!isfinite (y) || y == 0) - && (isfinite (x) || (isinf (x) && x < 0.0)) - && _LIB_VERSION != _IEEE_) { - if (x == (float)0.0) - /* tgammaf pole */ - return __kernel_standard_f(x, x, 150); - else if(__floorf(x)==x&&x<0.0f) - /* tgammaf domain */ - return __kernel_standard_f(x, x, 141); - else if (y == 0) - /* tgammaf underflow */ - __set_errno (ERANGE); - else - /* tgammaf overflow */ - return __kernel_standard_f(x, x, 140); - } - return local_signgam < 0 ? - y : y; -} -weak_alias (__tgammaf, tgammaf) diff --git a/math/w_tgammaf_compat.c b/math/w_tgammaf_compat.c new file mode 100644 index 0000000000..dfce894cc8 --- /dev/null +++ b/math/w_tgammaf_compat.c @@ -0,0 +1,44 @@ +/* w_gammaf.c -- float version of w_gamma.c. + * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#include +#include +#include + +float +__tgammaf(float x) +{ + int local_signgam; + float y = __ieee754_gammaf_r(x,&local_signgam); + + if(__glibc_unlikely (!isfinite (y) || y == 0) + && (isfinite (x) || (isinf (x) && x < 0.0)) + && _LIB_VERSION != _IEEE_) { + if (x == (float)0.0) + /* tgammaf pole */ + return __kernel_standard_f(x, x, 150); + else if(__floorf(x)==x&&x<0.0f) + /* tgammaf domain */ + return __kernel_standard_f(x, x, 141); + else if (y == 0) + /* tgammaf underflow */ + __set_errno (ERANGE); + else + /* tgammaf overflow */ + return __kernel_standard_f(x, x, 140); + } + return local_signgam < 0 ? - y : y; +} +weak_alias (__tgammaf, tgammaf) diff --git a/math/w_tgammal.c b/math/w_tgammal.c deleted file mode 100644 index 50de8cf906..0000000000 --- a/math/w_tgammal.c +++ /dev/null @@ -1,45 +0,0 @@ -/* w_gammal.c -- long double version of w_gamma.c. - * Conversion to long double by Ulrich Drepper, - * Cygnus Support, drepper@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -/* long double gammal(double x) - * Return the Gamma function of x. - */ - -#include -#include -#include - -long double -__tgammal(long double x) -{ - int local_signgam; - long double y = __ieee754_gammal_r(x,&local_signgam); - - if(__glibc_unlikely (!isfinite (y) || y == 0) - && (isfinite (x) || (isinf (x) && x < 0.0)) - && _LIB_VERSION != _IEEE_) { - if(x==0.0) - return __kernel_standard_l(x,x,250); /* tgamma pole */ - else if(__floorl(x)==x&&x<0.0L) - return __kernel_standard_l(x,x,241); /* tgamma domain */ - else if (y == 0) - __set_errno (ERANGE); /* tgamma underflow */ - else - return __kernel_standard_l(x,x,240); /* tgamma overflow */ - } - return local_signgam < 0 ? - y : y; -} -weak_alias (__tgammal, tgammal) diff --git a/math/w_tgammal_compat.c b/math/w_tgammal_compat.c new file mode 100644 index 0000000000..50de8cf906 --- /dev/null +++ b/math/w_tgammal_compat.c @@ -0,0 +1,45 @@ +/* w_gammal.c -- long double version of w_gamma.c. + * Conversion to long double by Ulrich Drepper, + * Cygnus Support, drepper@cygnus.com. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* long double gammal(double x) + * Return the Gamma function of x. + */ + +#include +#include +#include + +long double +__tgammal(long double x) +{ + int local_signgam; + long double y = __ieee754_gammal_r(x,&local_signgam); + + if(__glibc_unlikely (!isfinite (y) || y == 0) + && (isfinite (x) || (isinf (x) && x < 0.0)) + && _LIB_VERSION != _IEEE_) { + if(x==0.0) + return __kernel_standard_l(x,x,250); /* tgamma pole */ + else if(__floorl(x)==x&&x<0.0L) + return __kernel_standard_l(x,x,241); /* tgamma domain */ + else if (y == 0) + __set_errno (ERANGE); /* tgamma underflow */ + else + return __kernel_standard_l(x,x,240); /* tgamma overflow */ + } + return local_signgam < 0 ? - y : y; +} +weak_alias (__tgammal, tgammal) -- cgit v1.2.3