@@ -0,0 +1,31 @@
+/* List of functions where the *_finite versions match the normal versions.
+ Copyright (C) 2011-2019 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ 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
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _MATH_H
+# error "Never use <bits/math-finite-funcs.h> directly; include <math.h> instead."
+#endif
+
+/* By default we set the names of all the functions in math-finite.h to have
+ the _finite suffix so that when __FINITE_MATH_ONLY__ is set we call the
+ _finite version of the routines. On platforms where the normal version and
+ the _finite version are the same we allow the name to not be changed so that
+ the call is to the original name. This is done by setting
+ '__GLIBC_SKIP_MATH_FINITE_<NAME>'.
+
+ This has the side-affect of changing the name of the vectorized version of
+ the function if such a function exists. */
@@ -65,7 +65,9 @@ __MATH_REDIRCALL (atanh, , (_Mdouble_));
__MATH_REDIRCALL (cosh, , (_Mdouble_));
/* exp. */
+#ifndef __GLIBC_SKIP_MATH_FINITE_EXP
__MATH_REDIRCALL (exp, , (_Mdouble_));
+#endif
#if __GLIBC_USE (IEC_60559_FUNCS_EXT)
/* exp10. */
@@ -25,8 +25,8 @@ include ../Makeconfig
headers := math.h bits/mathcalls.h bits/mathinline.h \
fpu_control.h complex.h bits/cmathcalls.h fenv.h \
bits/fenv.h bits/fenvinline.h bits/mathdef.h tgmath.h \
- bits/math-finite.h bits/math-vector.h \
- finclude/math-vector-fortran.h \
+ bits/math-finite.h bits/math-finite-funcs.h \
+ bits/math-vector.h finclude/math-vector-fortran.h \
bits/libm-simd-decl-stubs.h bits/iscanonical.h \
bits/flt-eval-method.h bits/fp-fast.h bits/fp-logb.h \
bits/long-double.h bits/mathcalls-helper-functions.h \
@@ -1240,6 +1240,10 @@ iszero (__T __val)
# include <bits/mathinline.h>
#endif
+/* Get machine-depenedent list of functions that do not need
+ finite versions. */
+#include <bits/math-finite-funcs.h>
+
/* Define special entry points to use when the compiler got told to
only expect finite results. */
#if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0
@@ -0,0 +1,23 @@
+/* Platform specific list of functions that do not need *_finite versions.
+ Copyright (C) 2019 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ 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
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _MATH_H
+# error "Never use <bits/math-finite-funcs.h> directly; include <math.h> instead."
+#endif
+
+#define __GLIBC_SKIP_MATH_FINITE_EXP 1