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