From 5ab621c3476fef993f94975c826fd0fe3339c3e2 Mon Sep 17 00:00:00 2001 From: "Gabriel F. T. Gomes" Date: Mon, 30 Jan 2017 17:01:05 -0200 Subject: Move w_exp to libm-compat-call-auto This patch adds the "_compat" suffix to the wrappers of the function exp, which use _LIB_VERSION / matherr / __kernel_standard functionality. Tested for powerpc64le, s390, and x86_64. * math/Makefile (libm-calls): Move w_exp... (libm-compat-calls-auto): Here. * math/w_expl.c: Add suffix "_compat" to filename. * sysdeps/ia64/fpu/w_expl.c: Likewise. * sysdeps/ia64/fpu/w_expf.c: Likewise. * sysdeps/ia64/fpu/w_exp.c: Likewise. * sysdeps/ieee754/dbl-64/w_exp.c: Likewise. * sysdeps/ieee754/flt-32/w_expf.c: Likewise. * sysdeps/ieee754/ldbl-128/w_expl.c: Likewise. * sysdeps/ieee754/ldbl-128ibm/w_expl.c: Likewise. * sysdeps/ieee754/ldbl-96/w_expl.c: Likewise. * math/w_expl_compat.c: New file, copied from above. * sysdeps/ia64/fpu/w_exp_compat.c: Likewise. * sysdeps/ia64/fpu/w_expf_compat.c: Likewise. * sysdeps/ia64/fpu/w_expl_compat.c: Likewise. * sysdeps/ieee754/dbl-64/w_exp_compat.c: Likewise. * sysdeps/ieee754/flt-32/w_expf_compat.c: Likewise. * sysdeps/ieee754/ldbl-128/w_expl_compat.c: Likewise. * sysdeps/ieee754/ldbl-128ibm/w_expl_compat.c: Likewise. * sysdeps/ieee754/ldbl-96/w_expl_compat.c: Likewise. * sysdeps/ieee754/ldbl-64-128/w_expl.c: Add suffix "_compat" to filename. * sysdeps/ieee754/ldbl-opt/w_exp.c: Likewise. * sysdeps/ieee754/ldbl-64-128/w_expl_compat.c: New file, copied from above and adjusted for the new filenames. * sysdeps/ieee754/ldbl-opt/w_exp_compat.c: Likewise. --- ChangeLog | 33 +++++++++++++++++++++++ math/Makefile | 3 +-- math/w_expl.c | 13 --------- math/w_expl_compat.c | 13 +++++++++ sysdeps/ia64/fpu/w_exp.c | 1 - sysdeps/ia64/fpu/w_exp_compat.c | 1 + sysdeps/ia64/fpu/w_expf.c | 1 - sysdeps/ia64/fpu/w_expf_compat.c | 1 + sysdeps/ia64/fpu/w_expl.c | 1 - sysdeps/ia64/fpu/w_expl_compat.c | 1 + sysdeps/ieee754/dbl-64/w_exp.c | 38 -------------------------- sysdeps/ieee754/dbl-64/w_exp_compat.c | 38 ++++++++++++++++++++++++++ sysdeps/ieee754/flt-32/w_expf.c | 34 ----------------------- sysdeps/ieee754/flt-32/w_expf_compat.c | 34 +++++++++++++++++++++++ sysdeps/ieee754/ldbl-128/w_expl.c | 42 ----------------------------- sysdeps/ieee754/ldbl-128/w_expl_compat.c | 42 +++++++++++++++++++++++++++++ sysdeps/ieee754/ldbl-128ibm/w_expl.c | 21 --------------- sysdeps/ieee754/ldbl-128ibm/w_expl_compat.c | 21 +++++++++++++++ sysdeps/ieee754/ldbl-64-128/w_expl.c | 5 ---- sysdeps/ieee754/ldbl-64-128/w_expl_compat.c | 5 ++++ sysdeps/ieee754/ldbl-96/w_expl.c | 34 ----------------------- sysdeps/ieee754/ldbl-96/w_expl_compat.c | 34 +++++++++++++++++++++++ sysdeps/ieee754/ldbl-opt/w_exp.c | 5 ---- sysdeps/ieee754/ldbl-opt/w_exp_compat.c | 5 ++++ 24 files changed, 229 insertions(+), 197 deletions(-) delete mode 100644 math/w_expl.c create mode 100644 math/w_expl_compat.c delete mode 100644 sysdeps/ia64/fpu/w_exp.c create mode 100644 sysdeps/ia64/fpu/w_exp_compat.c delete mode 100644 sysdeps/ia64/fpu/w_expf.c create mode 100644 sysdeps/ia64/fpu/w_expf_compat.c delete mode 100644 sysdeps/ia64/fpu/w_expl.c create mode 100644 sysdeps/ia64/fpu/w_expl_compat.c delete mode 100644 sysdeps/ieee754/dbl-64/w_exp.c create mode 100644 sysdeps/ieee754/dbl-64/w_exp_compat.c delete mode 100644 sysdeps/ieee754/flt-32/w_expf.c create mode 100644 sysdeps/ieee754/flt-32/w_expf_compat.c delete mode 100644 sysdeps/ieee754/ldbl-128/w_expl.c create mode 100644 sysdeps/ieee754/ldbl-128/w_expl_compat.c delete mode 100644 sysdeps/ieee754/ldbl-128ibm/w_expl.c create mode 100644 sysdeps/ieee754/ldbl-128ibm/w_expl_compat.c delete mode 100644 sysdeps/ieee754/ldbl-64-128/w_expl.c create mode 100644 sysdeps/ieee754/ldbl-64-128/w_expl_compat.c delete mode 100644 sysdeps/ieee754/ldbl-96/w_expl.c create mode 100644 sysdeps/ieee754/ldbl-96/w_expl_compat.c delete mode 100644 sysdeps/ieee754/ldbl-opt/w_exp.c create mode 100644 sysdeps/ieee754/ldbl-opt/w_exp_compat.c diff --git a/ChangeLog b/ChangeLog index f755cd3..ce4d411 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,38 @@ 2017-02-08 Gabriel F. T. Gomes + * math/Makefile (libm-calls): Move w_exp... + (libm-compat-calls-auto): Here. + + * math/w_expl.c: Add suffix "_compat" to filename. + * sysdeps/ia64/fpu/w_expl.c: Likewise. + * sysdeps/ia64/fpu/w_expf.c: Likewise. + * sysdeps/ia64/fpu/w_exp.c: Likewise. + * sysdeps/ieee754/dbl-64/w_exp.c: Likewise. + * sysdeps/ieee754/flt-32/w_expf.c: Likewise. + * sysdeps/ieee754/ldbl-128/w_expl.c: Likewise. + * sysdeps/ieee754/ldbl-128ibm/w_expl.c: Likewise. + * sysdeps/ieee754/ldbl-96/w_expl.c: Likewise. + + * math/w_expl_compat.c: New file, copied from above. + * sysdeps/ia64/fpu/w_exp_compat.c: Likewise. + * sysdeps/ia64/fpu/w_expf_compat.c: Likewise. + * sysdeps/ia64/fpu/w_expl_compat.c: Likewise. + * sysdeps/ieee754/dbl-64/w_exp_compat.c: Likewise. + * sysdeps/ieee754/flt-32/w_expf_compat.c: Likewise. + * sysdeps/ieee754/ldbl-128/w_expl_compat.c: Likewise. + * sysdeps/ieee754/ldbl-128ibm/w_expl_compat.c: Likewise. + * sysdeps/ieee754/ldbl-96/w_expl_compat.c: Likewise. + + * sysdeps/ieee754/ldbl-64-128/w_expl.c: Add suffix "_compat" + to filename. + * sysdeps/ieee754/ldbl-opt/w_exp.c: Likewise. + + * sysdeps/ieee754/ldbl-64-128/w_expl_compat.c: New file, + copied from above and adjusted for the new filenames. + * sysdeps/ieee754/ldbl-opt/w_exp_compat.c: Likewise. + +2017-02-08 Gabriel F. T. Gomes + * math/Makefile (libm-calls): Move w_lgammaF... (libm-compat-calls-auto): Here. diff --git a/math/Makefile b/math/Makefile index fbbef49..0f59123 100644 --- a/math/Makefile +++ b/math/Makefile @@ -66,7 +66,6 @@ libm-calls = \ s_floorF s_log1pF s_logbF \ s_nextafterF s_nexttowardF s_rintF s_scalblnF \ s_significandF s_sinF s_tanF s_tanhF \ - w_expF \ 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 \ @@ -83,7 +82,7 @@ libm-compat-calls-auto = \ 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 \ - w_lgammaF_r_compat w_lgammaF_compat2 + w_lgammaF_r_compat w_lgammaF_compat2 w_expF_compat libm-compat-calls-ldouble-yes = w_lgamma_compatl k_standardl libm-compat-calls = w_lgamma_compatf w_lgamma_compat k_standard k_standardf \ diff --git a/math/w_expl.c b/math/w_expl.c deleted file mode 100644 index 70096a8..0000000 --- a/math/w_expl.c +++ /dev/null @@ -1,13 +0,0 @@ -#include -#include -#include - -long double -__expl(long double x) -{ - fputs ("__expl not implemented\n", stderr); - __set_errno (ENOSYS); - return 0.0; -} - -weak_alias (__expl, expl) diff --git a/math/w_expl_compat.c b/math/w_expl_compat.c new file mode 100644 index 0000000..70096a8 --- /dev/null +++ b/math/w_expl_compat.c @@ -0,0 +1,13 @@ +#include +#include +#include + +long double +__expl(long double x) +{ + fputs ("__expl not implemented\n", stderr); + __set_errno (ENOSYS); + return 0.0; +} + +weak_alias (__expl, expl) diff --git a/sysdeps/ia64/fpu/w_exp.c b/sysdeps/ia64/fpu/w_exp.c deleted file mode 100644 index 41254ae..0000000 --- a/sysdeps/ia64/fpu/w_exp.c +++ /dev/null @@ -1 +0,0 @@ -/* Not needed. */ diff --git a/sysdeps/ia64/fpu/w_exp_compat.c b/sysdeps/ia64/fpu/w_exp_compat.c new file mode 100644 index 0000000..41254ae --- /dev/null +++ b/sysdeps/ia64/fpu/w_exp_compat.c @@ -0,0 +1 @@ +/* Not needed. */ diff --git a/sysdeps/ia64/fpu/w_expf.c b/sysdeps/ia64/fpu/w_expf.c deleted file mode 100644 index 41254ae..0000000 --- a/sysdeps/ia64/fpu/w_expf.c +++ /dev/null @@ -1 +0,0 @@ -/* Not needed. */ diff --git a/sysdeps/ia64/fpu/w_expf_compat.c b/sysdeps/ia64/fpu/w_expf_compat.c new file mode 100644 index 0000000..41254ae --- /dev/null +++ b/sysdeps/ia64/fpu/w_expf_compat.c @@ -0,0 +1 @@ +/* Not needed. */ diff --git a/sysdeps/ia64/fpu/w_expl.c b/sysdeps/ia64/fpu/w_expl.c deleted file mode 100644 index 41254ae..0000000 --- a/sysdeps/ia64/fpu/w_expl.c +++ /dev/null @@ -1 +0,0 @@ -/* Not needed. */ diff --git a/sysdeps/ia64/fpu/w_expl_compat.c b/sysdeps/ia64/fpu/w_expl_compat.c new file mode 100644 index 0000000..41254ae --- /dev/null +++ b/sysdeps/ia64/fpu/w_expl_compat.c @@ -0,0 +1 @@ +/* Not needed. */ diff --git a/sysdeps/ieee754/dbl-64/w_exp.c b/sysdeps/ieee754/dbl-64/w_exp.c deleted file mode 100644 index e61e03b..0000000 --- a/sysdeps/ieee754/dbl-64/w_exp.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 - -/* wrapper exp */ -double -__exp (double x) -{ - double z = __ieee754_exp (x); - if (__builtin_expect (!isfinite (z) || z == 0, 0) - && isfinite (x) && _LIB_VERSION != _IEEE_) - return __kernel_standard (x, x, 6 + !!signbit (x)); - - return z; -} -hidden_def (__exp) -weak_alias (__exp, exp) -#ifdef NO_LONG_DOUBLE -strong_alias (__exp, __expl) -weak_alias (__exp, expl) -#endif diff --git a/sysdeps/ieee754/dbl-64/w_exp_compat.c b/sysdeps/ieee754/dbl-64/w_exp_compat.c new file mode 100644 index 0000000..e61e03b --- /dev/null +++ b/sysdeps/ieee754/dbl-64/w_exp_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 + +/* wrapper exp */ +double +__exp (double x) +{ + double z = __ieee754_exp (x); + if (__builtin_expect (!isfinite (z) || z == 0, 0) + && isfinite (x) && _LIB_VERSION != _IEEE_) + return __kernel_standard (x, x, 6 + !!signbit (x)); + + return z; +} +hidden_def (__exp) +weak_alias (__exp, exp) +#ifdef NO_LONG_DOUBLE +strong_alias (__exp, __expl) +weak_alias (__exp, expl) +#endif diff --git a/sysdeps/ieee754/flt-32/w_expf.c b/sysdeps/ieee754/flt-32/w_expf.c deleted file mode 100644 index b2be6aa..0000000 --- a/sysdeps/ieee754/flt-32/w_expf.c +++ /dev/null @@ -1,34 +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 expf */ -float -__expf (float x) -{ - float z = __ieee754_expf (x); - if (__builtin_expect (!isfinite (z) || z == 0, 0) - && isfinite (x) && _LIB_VERSION != _IEEE_) - return __kernel_standard_f (x, x, 106 + !!signbit (x)); - - return z; -} -hidden_def (__expf) -weak_alias (__expf, expf) diff --git a/sysdeps/ieee754/flt-32/w_expf_compat.c b/sysdeps/ieee754/flt-32/w_expf_compat.c new file mode 100644 index 0000000..b2be6aa --- /dev/null +++ b/sysdeps/ieee754/flt-32/w_expf_compat.c @@ -0,0 +1,34 @@ +/* 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 expf */ +float +__expf (float x) +{ + float z = __ieee754_expf (x); + if (__builtin_expect (!isfinite (z) || z == 0, 0) + && isfinite (x) && _LIB_VERSION != _IEEE_) + return __kernel_standard_f (x, x, 106 + !!signbit (x)); + + return z; +} +hidden_def (__expf) +weak_alias (__expf, expf) diff --git a/sysdeps/ieee754/ldbl-128/w_expl.c b/sysdeps/ieee754/ldbl-128/w_expl.c deleted file mode 100644 index c32616e..0000000 --- a/sysdeps/ieee754/ldbl-128/w_expl.c +++ /dev/null @@ -1,42 +0,0 @@ -/* w_expl.c -- long double version of w_exp.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 expl(x) - */ - -#include -#include - -long double __expl(long double x) /* wrapper exp */ -{ -#ifdef _IEEE_LIBM - return __ieee754_expl(x); -#else - long double z = __ieee754_expl (x); - if (__glibc_unlikely (!isfinite (z) || z == 0) - && isfinite (x) && _LIB_VERSION != _IEEE_) - return __kernel_standard_l (x, x, 206 + !!signbit (x)); - - return z; -#endif -} -hidden_def (__expl) -weak_alias (__expl, expl) diff --git a/sysdeps/ieee754/ldbl-128/w_expl_compat.c b/sysdeps/ieee754/ldbl-128/w_expl_compat.c new file mode 100644 index 0000000..c32616e --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/w_expl_compat.c @@ -0,0 +1,42 @@ +/* w_expl.c -- long double version of w_exp.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 expl(x) + */ + +#include +#include + +long double __expl(long double x) /* wrapper exp */ +{ +#ifdef _IEEE_LIBM + return __ieee754_expl(x); +#else + long double z = __ieee754_expl (x); + if (__glibc_unlikely (!isfinite (z) || z == 0) + && isfinite (x) && _LIB_VERSION != _IEEE_) + return __kernel_standard_l (x, x, 206 + !!signbit (x)); + + return z; +#endif +} +hidden_def (__expl) +weak_alias (__expl, expl) diff --git a/sysdeps/ieee754/ldbl-128ibm/w_expl.c b/sysdeps/ieee754/ldbl-128ibm/w_expl.c deleted file mode 100644 index c9d44b6..0000000 --- a/sysdeps/ieee754/ldbl-128ibm/w_expl.c +++ /dev/null @@ -1,21 +0,0 @@ -#include -#include -#include - -long double __expl(long double x) /* wrapper exp */ -{ - long double z; - z = __ieee754_expl(x); - if (_LIB_VERSION == _IEEE_) - return z; - if (isfinite(x)) - { - if (!isfinite (z)) - return __kernel_standard_l(x,x,206); /* exp overflow */ - else if (z == 0.0L) - return __kernel_standard_l(x,x,207); /* exp underflow */ - } - return z; -} -hidden_def (__expl) -long_double_symbol (libm, __expl, expl); diff --git a/sysdeps/ieee754/ldbl-128ibm/w_expl_compat.c b/sysdeps/ieee754/ldbl-128ibm/w_expl_compat.c new file mode 100644 index 0000000..c9d44b6 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128ibm/w_expl_compat.c @@ -0,0 +1,21 @@ +#include +#include +#include + +long double __expl(long double x) /* wrapper exp */ +{ + long double z; + z = __ieee754_expl(x); + if (_LIB_VERSION == _IEEE_) + return z; + if (isfinite(x)) + { + if (!isfinite (z)) + return __kernel_standard_l(x,x,206); /* exp overflow */ + else if (z == 0.0L) + return __kernel_standard_l(x,x,207); /* exp underflow */ + } + return z; +} +hidden_def (__expl) +long_double_symbol (libm, __expl, expl); diff --git a/sysdeps/ieee754/ldbl-64-128/w_expl.c b/sysdeps/ieee754/ldbl-64-128/w_expl.c deleted file mode 100644 index 2a402b0..0000000 --- a/sysdeps/ieee754/ldbl-64-128/w_expl.c +++ /dev/null @@ -1,5 +0,0 @@ -#include -#undef weak_alias -#define weak_alias(n,a) -#include -long_double_symbol (libm, __expl, expl); diff --git a/sysdeps/ieee754/ldbl-64-128/w_expl_compat.c b/sysdeps/ieee754/ldbl-64-128/w_expl_compat.c new file mode 100644 index 0000000..37c153e --- /dev/null +++ b/sysdeps/ieee754/ldbl-64-128/w_expl_compat.c @@ -0,0 +1,5 @@ +#include +#undef weak_alias +#define weak_alias(n,a) +#include +long_double_symbol (libm, __expl, expl); diff --git a/sysdeps/ieee754/ldbl-96/w_expl.c b/sysdeps/ieee754/ldbl-96/w_expl.c deleted file mode 100644 index a0b852a..0000000 --- a/sysdeps/ieee754/ldbl-96/w_expl.c +++ /dev/null @@ -1,34 +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 expl */ -long double -__expl (long double x) -{ - long double z = __ieee754_expl (x); - if (__builtin_expect (!isfinite (z) || z == 0, 0) - && isfinite (x) && _LIB_VERSION != _IEEE_) - return __kernel_standard_l (x, x, 206 + !!signbit (x)); - - return z; -} -hidden_def (__expl) -weak_alias (__expl, expl) diff --git a/sysdeps/ieee754/ldbl-96/w_expl_compat.c b/sysdeps/ieee754/ldbl-96/w_expl_compat.c new file mode 100644 index 0000000..a0b852a --- /dev/null +++ b/sysdeps/ieee754/ldbl-96/w_expl_compat.c @@ -0,0 +1,34 @@ +/* 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 expl */ +long double +__expl (long double x) +{ + long double z = __ieee754_expl (x); + if (__builtin_expect (!isfinite (z) || z == 0, 0) + && isfinite (x) && _LIB_VERSION != _IEEE_) + return __kernel_standard_l (x, x, 206 + !!signbit (x)); + + return z; +} +hidden_def (__expl) +weak_alias (__expl, expl) diff --git a/sysdeps/ieee754/ldbl-opt/w_exp.c b/sysdeps/ieee754/ldbl-opt/w_exp.c deleted file mode 100644 index 61fcfcc..0000000 --- a/sysdeps/ieee754/ldbl-opt/w_exp.c +++ /dev/null @@ -1,5 +0,0 @@ -#include -#include -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0) -compat_symbol (libm, __exp, expl, GLIBC_2_0); -#endif diff --git a/sysdeps/ieee754/ldbl-opt/w_exp_compat.c b/sysdeps/ieee754/ldbl-opt/w_exp_compat.c new file mode 100644 index 0000000..686c9c2 --- /dev/null +++ b/sysdeps/ieee754/ldbl-opt/w_exp_compat.c @@ -0,0 +1,5 @@ +#include +#include +#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0) +compat_symbol (libm, __exp, expl, GLIBC_2_0); +#endif -- cgit v1.1