diff mbox series

Remove math-finite.h

Message ID VI1PR0801MB21270832B06280703457796983320@VI1PR0801MB2127.eurprd08.prod.outlook.com
State New
Headers show
Series Remove math-finite.h | expand

Commit Message

Wilco Dijkstra May 8, 2019, 6:10 p.m. UTC
Remove math-finite.h redirections for math functions since the most
commonly used math functions no longer use multiple entry points.

Passes buildmanyglibc (so far, it's still running). OK for commit?

2019-05-08  Wilco Dijkstra  <wdijkstr@arm.com>

        * bits/math-finite.h: Delete file.
        * math/Makefile: Remove math-finite.h from installed headers.
        * math/math.h: Remove math-finite.h inclusions.
        * sysdeps/ia64/fpu/bits/math-finite.h: Delete file.

--

Comments

Joseph Myers May 9, 2019, 4:05 p.m. UTC | #1
On Wed, 8 May 2019, Wilco Dijkstra wrote:

> Remove math-finite.h redirections for math functions since the most
> commonly used math functions no longer use multiple entry points.

If the header is removed, the tests of it should be removed as well (both 
the general support for all the libm-test tests running to test those 
function variants, including the TEST_FINITE code, and some specific tests 
that also have finite-math-only variants built with either 
-ffinite-math-only or -D__FINITE_MATH_ONLY__=1).

This is not otherwise a review of the patch.  A revised patch version 
would still need review and consensus on the change to be achieved.
Wilco Dijkstra May 13, 2019, 5:09 p.m. UTC | #2
Hi Joseph,

>> Remove math-finite.h redirections for math functions since the most
>> commonly used math functions no longer use multiple entry points.
>
> If the header is removed, the tests of it should be removed as well (both 
> the general support for all the libm-test tests running to test those 
> function variants, including the TEST_FINITE code, and some specific tests 
> that also have finite-math-only variants built with either 
> -ffinite-math-only or -D__FINITE_MATH_ONLY__=1).

Like this? I've done it as a separate patch since both are fairly large:


[PATCH] Remove finite-math tests

Remove the finite-math tests from the testsuite - these are no longer
useful after removing math-finite.h header
(https://sourceware.org/ml/libc-alpha/2019-05/msg00177.html).

2019-05-13  Wilco Dijkstra  <wdijkstr@arm.com>

        * math/Makefile: Update to remove finite-math tests.
        * math/gen-libm-test.py: Remove setting of NON_FINITE.
        * math/libm-test-driver.c: Remove TEST_FINITE, flag_test_finite.
        * math/libm-test-support.h: Remove flag_test_finite declartion.
        * math/libm-test-support.c: Remove NON_FINITE support.
        * math/test-finite-macros.c: Remove file.
        * math/test-math-finite.h: Likewise.
        * math/test-math-inline.h: Remove TEST_FINITE.
        * math/test-math-no-finite.h : Remove file.
        * math/test-math-vector.h: Remove TEST_FINITE.
	* math/test-signgam-finite.c: Remove test.
        * math/test-signgam-finite-c11.c: Likewise.
        * math/test-signgam-finite-c99.c: Likewise.
--

diff --git a/math/Makefile b/math/Makefile
index 8d754ed02c4e60dc9becc63e2b604e8c0d6557f7..d6eb0c430afd1586a7bcf9ebdb6e3c841dc2839e 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -228,8 +228,7 @@ tests = test-matherr-3 test-fenv basic-test \
 	test-tgmath-ret bug-nextafter bug-nexttoward bug-tgmath1 \
 	test-tgmath-int test-tgmath2 test-powl tst-CMPLX tst-CMPLX2 test-snan \
 	test-fenv-tls test-fenv-preserve test-fenv-return test-fenvinline \
-	test-nearbyint-except test-fenv-clear test-signgam-finite \
-	test-signgam-finite-c99 test-signgam-finite-c11 \
+	test-nearbyint-except test-fenv-clear \
 	test-nearbyint-except-2 test-signgam-uchar test-signgam-uchar-init \
 	test-signgam-uint test-signgam-uint-init test-signgam-ullong \
 	test-signgam-ullong-init test-nan-overflow test-nan-payload \
@@ -238,7 +237,7 @@ tests = test-matherr-3 test-fenv basic-test \
 	test-femode-traps test-iszero-excess-precision \
 	test-iseqsig-excess-precision test-flt-eval-method \
 	test-fp-ilogb-constants test-fp-llogb-constants \
-	test-fe-snans-always-signal test-finite-macros test-narrow-macros \
+	test-fe-snans-always-signal test-narrow-macros \
 	test-nan-const $(tests-static)
 tests-static = test-fpucw-static test-fpucw-ieee-static \
 	       test-signgam-uchar-static test-signgam-uchar-init-static \
@@ -297,17 +296,13 @@ generated += libm-test-ulps.h $(libm-test-c-auto) $(libm-test-c-noauto) \
 	     $(libm-test-c-narrow)
 
 libm-tests-base-normal = $(foreach t,$(test-types),test-$(t))
-libm-tests-base-finite = $(foreach t,$(test-types),test-$(t)-finite)
 libm-tests-base-inline = $(foreach t,$(test-types),test-i$(t))
 libm-tests-base-narrow = $(foreach t,$(test-type-pairs),test-$(t))
-libm-tests-base = $(libm-tests-base-normal) $(libm-tests-base-finite) \
-		  $(libm-tests-base-inline) $(libm-vec-tests)
+libm-tests-base = $(libm-tests-base-normal) $(libm-tests-base-inline) \
+		  $(libm-vec-tests)
 libm-tests-normal = $(foreach t,$(libm-tests-base-normal),\
 				$(foreach f,$(libm-test-funcs-all),\
 					    $(t)-$(f)))
-libm-tests-finite = $(foreach t,$(libm-tests-base-finite),\
-				$(foreach f,$(libm-test-funcs-all),\
-					    $(t)-$(f)))
 libm-tests-inline = $(foreach t,$(libm-tests-base-inline),\
 				$(foreach f,$(libm-test-funcs-all),\
 					    $(t)-$(f)))
@@ -316,11 +311,10 @@ libm-tests-narrow = $(foreach t,$(libm-tests-base-narrow),\
 					    $(t)-$(f)))
 libm-tests-vector = $(foreach t,$(libmvec-tests),\
 				$(foreach f,$($(t)-funcs),test-$(t)-$(f)))
-libm-tests = $(libm-tests-normal) $(libm-tests-finite) $(libm-tests-inline) \
+libm-tests = $(libm-tests-normal) $(libm-tests-inline) \
 	     $(libm-tests-narrow) $(libm-tests-vector)
 libm-tests-for-type = $(foreach f,$(libm-test-funcs-all),\
-				  test-$(1)-$(f) test-$(1)-finite-$(f) \
-				  test-i$(1)-$(f)) \
+				  test-$(1)-$(f) test-i$(1)-$(f)) \
 		      $(filter test-$(1)-%,$(libm-tests-vector) \
 					   $(libm-tests-narrow))
 
@@ -398,8 +392,6 @@ CFLAGS-test-float-vlen16-wrappers.c += $(float-vlen16-arch-ext-cflags)
 # validated.
 libm-test-no-inline-cflags = -fno-inline -ffloat-store -fno-builtin \
 			     -fsignaling-nans
-libm-test-finite-cflags = $(libm-test-no-inline-cflags) \
-			  -U__FINITE_MATH_ONLY__ -D__FINITE_MATH_ONLY__=1
 libm-test-inline-cflags = $(libm-test-fast-math-cflags)
 CFLAGS-test-tgmath.c += -fno-builtin
 # The following testcase uses very long lines (>3 million), so it may take a
@@ -411,9 +403,6 @@ CFLAGS-test-powl.c += -fno-builtin
 
 CFLAGS-test-snan.c += -fsignaling-nans
 
-CFLAGS-test-signgam-finite.c += -ffinite-math-only
-CFLAGS-test-signgam-finite-c99.c += -ffinite-math-only -std=c99
-CFLAGS-test-signgam-finite-c11.c += -ffinite-math-only -std=c11
 CFLAGS-test-signgam-uchar.c += -std=c99
 CFLAGS-test-signgam-uchar-init.c += -std=c99
 CFLAGS-test-signgam-uchar-static.c += -std=c99
@@ -440,8 +429,6 @@ CFLAGS-test-flt-eval-method.c += -fexcess-precision=standard
 
 CFLAGS-test-fe-snans-always-signal.c += -fsignaling-nans
 
-CFLAGS-test-finite-macros.c += -ffinite-math-only
-
 CFLAGS-test-nan-const.c += -fno-builtin
 
 include ../Rules
@@ -480,25 +467,13 @@ $(foreach t,$(libm-tests-normal),$(objpfx)$(t).c): $(objpfx)test-%.c:
 	func=$${type_func#*-}; \
 	( \
 	  echo "#include <test-$$type.h>"; \
-	  echo "#include <test-math-no-finite.h>"; \
+	  echo "#define TEST_EXCEPTIONS 1"; \
 	  echo "#include <test-math-no-inline.h>"; \
 	  echo "#include <test-math-errno.h>"; \
 	  echo "#include <test-math-scalar.h>"; \
 	  echo "#include <libm-test-$$func.c>"; \
 	) > $@
 
-$(foreach t,$(libm-tests-finite),$(objpfx)$(t).c): $(objpfx)test-%.c:
-	type_func=$*; \
-	type=$${type_func%%-*}; \
-	func=$${type_func#*-finite-}; \
-	( \
-	  echo "#include <test-$$type.h>"; \
-	  echo "#include <test-math-finite.h>"; \
-	  echo "#include <test-math-no-inline.h>"; \
-	  echo "#include <test-math-scalar.h>"; \
-	  echo "#include <libm-test-$$func.c>"; \
-	) > $@
-
 $(foreach t,$(libm-tests-inline),$(objpfx)$(t).c): $(objpfx)test-i%.c:
 	type_func=$*; \
 	type=$${type_func%%-*}; \
@@ -519,7 +494,7 @@ $(foreach t,$(libm-tests-narrow),$(objpfx)$(t).c): $(objpfx)test-%.c:
 	( \
 	  echo "#include <test-$$ret_type.h>"; \
 	  echo "#include <test-arg-$$arg_type.h>"; \
-	  echo "#include <test-math-no-finite.h>"; \
+	  echo "#define TEST_EXCEPTIONS 1"; \
 	  echo "#include <test-math-no-inline.h>"; \
 	  echo "#include <test-math-errno.h>"; \
 	  echo "#include <test-math-narrow.h>"; \
@@ -571,13 +546,6 @@ include $(o-iterator)
 
 define o-iterator-doit
 $(foreach f,$(libm-test-funcs-all),\
-	    $(objpfx)$(o)-$(f).o): CFLAGS += $(libm-test-finite-cflags)
-endef
-object-suffixes-left := $(libm-tests-base-finite)
-include $(o-iterator)
-
-define o-iterator-doit
-$(foreach f,$(libm-test-funcs-all),\
 	    $(objpfx)$(o)-$(f).o): CFLAGS += $(libm-test-inline-cflags)
 endef
 object-suffixes-left := $(libm-tests-base-inline)
diff --git a/math/gen-libm-test.py b/math/gen-libm-test.py
index 4574215fec7b385b0513f85622f3cdd69c8171ab..b98a69622f5c6988dfa5ccd60e5bf9c2d271849f 100755
--- a/math/gen-libm-test.py
+++ b/math/gen-libm-test.py
@@ -341,9 +341,6 @@ def apply_lit(arg, macro):
 
 def gen_test_args_res(descr_args, descr_res, args, res_rm):
     """Generate a test given the arguments and per-rounding-mode results."""
-    # Determine whether any arguments or results, for any rounding
-    # mode, are non-finite.
-    non_finite = False
     test_snan = False
     all_args_res = list(args)
     for r in res_rm:
@@ -351,10 +348,6 @@ def gen_test_args_res(descr_args, descr_res, args, res_rm):
     for a in all_args_res:
         if 'snan_value' in a:
             test_snan = True
-            non_finite = True
-        elif ('qnan_value' in a or 'plus_infty' in a or 'minus_infty' in a
-              or 'plus_oflow' in a or 'minus_oflow' in a):
-            non_finite = True
     # Process the arguments.
     args_disp = []
     args_c = []
@@ -422,8 +415,6 @@ def gen_test_args_res(descr_args, descr_res, args, res_rm):
         flags = []
         if ignore_result_any:
             flags.append('IGNORE_RESULT')
-        if non_finite:
-            flags.append('NON_FINITE')
         if test_snan:
             flags.append('TEST_SNAN')
         flags.append(res[res_pos])
diff --git a/math/libm-test-driver.c b/math/libm-test-driver.c
index 4640f30d64ae800687c6fe737b43c0d305847eb2..7623df549f86775b85194bbf60ec685cd4a2745f 100644
--- a/math/libm-test-driver.c
+++ b/math/libm-test-driver.c
@@ -23,7 +23,6 @@
 /* Flags set by the including file.  */
 const int flag_test_errno = TEST_ERRNO;
 const int flag_test_exceptions = TEST_EXCEPTIONS;
-const int flag_test_finite = TEST_FINITE;
 const int flag_test_inline = TEST_INLINE;
 const int flag_test_mathvec = TEST_MATHVEC;
 
@@ -44,8 +43,6 @@ const int snan_tests_arg = SNAN_TESTS (FLOAT);
 # define TEST_MSG "testing " STR_FLOAT " (vector length " STR_VEC_LEN ")\n"
 #elif TEST_INLINE
 # define TEST_MSG "testing " STR_FLOAT " (inline functions)\n"
-#elif TEST_FINITE
-# define TEST_MSG "testing " STR_FLOAT " (finite-math-only)\n"
 #elif TEST_NARROW
 # define TEST_MSG "testing " STR_FLOAT " (argument " STR_ARG_FLOAT ")\n"
 #else
diff --git a/math/libm-test-support.h b/math/libm-test-support.h
index 2b8d5a3d889a76cc1e678d5db190944d84058cc4..028cf5647027ca5c9c8c7e70f33bd2ea51871afd 100644
--- a/math/libm-test-support.h
+++ b/math/libm-test-support.h
@@ -34,7 +34,6 @@
 
 extern const int flag_test_errno;
 extern const int flag_test_exceptions;
-extern const int flag_test_finite;
 extern const int flag_test_inline;
 extern const int flag_test_mathvec;
 extern const int snan_tests_arg;
@@ -69,7 +68,6 @@ extern const char doc[];
 #define ERRNO_ERANGE			0x20000
 /* Flags generated by gen-libm-test.py, not entered here manually.  */
 #define IGNORE_RESULT			0x40000
-#define NON_FINITE			0x80000
 #define TEST_SNAN			0x100000
 #define NO_TEST_MATHVEC			0x200000
 
diff --git a/math/libm-test-support.c b/math/libm-test-support.c
index 5f986da75229746e62368583d4d6d8602b86d25b..ca70722720f0b6a8fb7a2e4194e7d419e5ac047c 100644
--- a/math/libm-test-support.c
+++ b/math/libm-test-support.c
@@ -983,8 +983,6 @@ enable_test (int exceptions)
     return 0;
   if (flag_test_inline && (exceptions & NO_TEST_INLINE))
     return 0;
-  if (flag_test_finite && (exceptions & NON_FINITE) != 0)
-    return 0;
   if ((!SNAN_TESTS (FLOAT) || !snan_tests_arg)
       && (exceptions & TEST_SNAN) != 0)
     return 0;
diff --git a/math/test-finite-macros.c b/math/test-finite-macros.c
deleted file mode 100644
index 14524a357b837d020f48aec10d05ed9ca1855c4f..0000000000000000000000000000000000000000
--- a/math/test-finite-macros.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Test finite-math-only code does not conflict with user macros (bug 22028).
-   Copyright (C) 2017-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/>.  */
-
-/* The main test is that the inclusion of <math.h> compiles.  */
-#define f first test macro
-#define l second test macro
-#define f128 third test macro
-
-#include <math.h>
-
-volatile float a, b;
-
-static int
-do_test (void)
-{
-  b = acosf (a);
-  return 0;
-}
-
-#include <support/test-driver.c>
diff --git a/math/test-math-finite.h b/math/test-math-finite.h
deleted file mode 100644
index e3c8e0a2b9f9aa547c8af0d8a38b26c6830ab6ca..0000000000000000000000000000000000000000
--- a/math/test-math-finite.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Common definitions for libm tests for finite-math-only.
-   Copyright (C) 2015-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/>.  */
-
-#define TEST_FINITE 1
-#define TEST_ERRNO 0
-#define TEST_EXCEPTIONS 1
diff --git a/math/test-math-inline.h b/math/test-math-inline.h
index b51cf52901b693aba3088da3774964c3b852e912..14553dda6ca6e82bdcf42b6122d8a65a9dd06dba 100644
--- a/math/test-math-inline.h
+++ b/math/test-math-inline.h
@@ -17,7 +17,6 @@
    <http://www.gnu.org/licenses/>.  */
 
 #define TEST_INLINE 1
-#define TEST_FINITE 0
 #define TEST_ERRNO 0
 #define TEST_EXCEPTIONS 0
 
diff --git a/math/test-math-no-finite.h b/math/test-math-no-finite.h
deleted file mode 100644
index e3456aae756375f41ef7d4cf47bb68a24dfdddfc..0000000000000000000000000000000000000000
--- a/math/test-math-no-finite.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Common definitions for libm tests for no-finite-math-only.
-   Copyright (C) 2015-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/>.  */
-
-#define TEST_FINITE 0
-#define TEST_EXCEPTIONS 1
diff --git a/math/test-math-vector.h b/math/test-math-vector.h
index b211ddebec08daafb76a8673dbfc7bf11659c0ac..775198867e097f0f8b1e3266aba2eba5a75e94a7 100644
--- a/math/test-math-vector.h
+++ b/math/test-math-vector.h
@@ -18,7 +18,6 @@
 
 #define TEST_MATHVEC 1
 #define TEST_NARROW 0
-#define TEST_FINITE 0
 #define TEST_ERRNO 0
 #define TEST_EXCEPTIONS 0
 
diff --git a/math/test-signgam-finite-c11.c b/math/test-signgam-finite-c11.c
deleted file mode 100644
index dff132df934fdb2ceb593ed9326e821b4349bd8f..0000000000000000000000000000000000000000
--- a/math/test-signgam-finite-c11.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "test-signgam-finite-c99.c"
diff --git a/math/test-signgam-finite-c99.c b/math/test-signgam-finite-c99.c
deleted file mode 100644
index 9be03a9edc1222953b3f5c331fb729f3dfab3335..0000000000000000000000000000000000000000
--- a/math/test-signgam-finite-c99.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Test lgamma functions do not set signgam for -ffinite-math-only for ISO C.
-   Copyright (C) 2015-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/>.  */
-
-#undef _LIBC
-#undef __LIBC_INTERNAL_MATH_INLINES
-#undef _GNU_SOURCE
-
-#include <math.h>
-#include <stdio.h>
-
-int signgam;
-
-#define RUN_TESTS(FUNC, TYPE)					\
-  do								\
-    {								\
-      volatile TYPE a, b, c __attribute__ ((unused));		\
-      a = 0.5;							\
-      b = -0.5;							\
-      signgam = 123;						\
-      c = FUNC (a);						\
-      if (signgam == 123)					\
-	puts ("PASS: " #FUNC " (0.5) setting signgam");		\
-      else							\
-	{							\
-	  puts ("FAIL: " #FUNC " (0.5) setting signgam");	\
-	  result = 1;						\
-	}							\
-      signgam = 123;						\
-      c = FUNC (b);						\
-      if (signgam == 123)					\
-	puts ("PASS: " #FUNC " (-0.5) setting signgam");	\
-      else							\
-	{							\
-	  puts ("FAIL: " #FUNC " (-0.5) setting signgam");	\
-	  result = 1;						\
-	}							\
-    }								\
-  while (0)
-
-int
-main (void)
-{
-  int result = 0;
-  RUN_TESTS (lgammaf, float);
-  RUN_TESTS (lgamma, double);
-  RUN_TESTS (lgammal, long double);
-  return result;
-}
diff --git a/math/test-signgam-finite.c b/math/test-signgam-finite.c
deleted file mode 100644
index 5ec697c7738d81b87099d9585ac14b58b3d091c2..0000000000000000000000000000000000000000
--- a/math/test-signgam-finite.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Test lgamma functions set signgam for -ffinite-math-only (bug 19211).
-   Copyright (C) 2015-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/>.  */
-
-#include <math.h>
-#include <stdio.h>
-
-#define RUN_TESTS(FUNC, TYPE)					\
-  do								\
-    {								\
-      volatile TYPE a, b, c __attribute__ ((unused));		\
-      a = 0.5;							\
-      b = -0.5;							\
-      signgam = 123;						\
-      c = FUNC (a);						\
-      if (signgam == 1)						\
-	puts ("PASS: " #FUNC " (0.5) setting signgam");		\
-      else							\
-	{							\
-	  puts ("FAIL: " #FUNC " (0.5) setting signgam");	\
-	  result = 1;						\
-	}							\
-      signgam = 123;						\
-      c = FUNC (b);						\
-      if (signgam == -1)					\
-	puts ("PASS: " #FUNC " (-0.5) setting signgam");	\
-      else							\
-	{							\
-	  puts ("FAIL: " #FUNC " (-0.5) setting signgam");	\
-	  result = 1;						\
-	}							\
-    }								\
-  while (0)
-
-static int
-do_test (void)
-{
-  int result = 0;
-  RUN_TESTS (lgammaf, float);
-  RUN_TESTS (gammaf, float);
-  RUN_TESTS (lgamma, double);
-  RUN_TESTS (gamma, double);
-  RUN_TESTS (lgammal, long double);
-  RUN_TESTS (gammal, long double);
-  return result;
-}
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff mbox series

Patch

diff --git a/bits/math-finite.h b/bits/math-finite.h
deleted file mode 100644
index 6141c1253724d022193fdd430b3ff0dab4730346..0000000000000000000000000000000000000000
--- a/bits/math-finite.h
+++ /dev/null
@@ -1,197 +0,0 @@ 
-/* Entry points to finite-math-only compiler runs.
-   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.h> directly; include <math.h> instead."
-#endif
-
-#define __REDIRFROM(...) __REDIRFROM_X(__VA_ARGS__)
-
-#define __REDIRTO(...) __REDIRTO_X(__VA_ARGS__)
-
-#define __MATH_REDIRCALL_X(from, args, to) \
-  extern _Mdouble_ __REDIRECT_NTH (from, args, to)
-#define __MATH_REDIRCALL(function, reentrant, args) \
-  __MATH_REDIRCALL_X \
-   (__REDIRFROM (function, reentrant), args, \
-    __REDIRTO (function, reentrant))
-#define __MATH_REDIRCALL_2(from, reentrant, args, to) \
-  __MATH_REDIRCALL_X \
-   (__REDIRFROM (from, reentrant), args, \
-    __REDIRTO (to, reentrant))
-
-#define __MATH_REDIRCALL_INTERNAL(function, reentrant, args) \
-  __MATH_REDIRCALL_X \
-   (__REDIRFROM (__CONCAT (__, function), \
-		 __CONCAT (reentrant, _finite)), \
-    args, __REDIRTO (function, _r))
-
-
-/* acos.  */
-__MATH_REDIRCALL (acos, , (_Mdouble_));
-
-#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
-/* acosh.  */
-__MATH_REDIRCALL (acosh, , (_Mdouble_));
-#endif
-
-/* asin.  */
-__MATH_REDIRCALL (asin, , (_Mdouble_));
-
-/* atan2.  */
-__MATH_REDIRCALL (atan2, , (_Mdouble_, _Mdouble_));
-
-#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
-/* atanh.  */
-__MATH_REDIRCALL (atanh, , (_Mdouble_));
-#endif
-
-/* cosh.  */
-__MATH_REDIRCALL (cosh, , (_Mdouble_));
-
-/* exp.  */
-__MATH_REDIRCALL (exp, , (_Mdouble_));
-
-#if __GLIBC_USE (IEC_60559_FUNCS_EXT)
-/* exp10.  */
-__MATH_REDIRCALL (exp10, , (_Mdouble_));
-#endif
-
-#ifdef __USE_ISOC99
-/* exp2.  */
-__MATH_REDIRCALL (exp2, , (_Mdouble_));
-#endif
-
-/* fmod.  */
-__MATH_REDIRCALL (fmod, , (_Mdouble_, _Mdouble_));
-
-#if defined __USE_XOPEN || defined __USE_ISOC99
-/* hypot.  */
-__MATH_REDIRCALL (hypot, , (_Mdouble_, _Mdouble_));
-#endif
-
-#if (__MATH_DECLARING_DOUBLE && (defined __USE_MISC || defined __USE_XOPEN)) \
-    || (!__MATH_DECLARING_DOUBLE && defined __USE_MISC)
-/* j0.  */
-__MATH_REDIRCALL (j0, , (_Mdouble_));
-
-/* y0.  */
-__MATH_REDIRCALL (y0, , (_Mdouble_));
-
-/* j1.  */
-__MATH_REDIRCALL (j1, , (_Mdouble_));
-
-/* y1.  */
-__MATH_REDIRCALL (y1, , (_Mdouble_));
-
-/* jn.  */
-__MATH_REDIRCALL (jn, , (int, _Mdouble_));
-
-/* yn.  */
-__MATH_REDIRCALL (yn, , (int, _Mdouble_));
-#endif
-
-#ifdef __USE_MISC
-/* lgamma_r.  */
-__MATH_REDIRCALL (lgamma, _r, (_Mdouble_, int *));
-#endif
-
-/* Redirect __lgammal_r_finite to __lgamma_r_finite when __NO_LONG_DOUBLE_MATH
-   is set and to itself otherwise.  It also redirects __lgamma_r_finite and
-   __lgammaf_r_finite to themselves.  */
-__MATH_REDIRCALL_INTERNAL (lgamma, _r, (_Mdouble_, int *));
-
-#if ((defined __USE_XOPEN || defined __USE_ISOC99) \
-     && defined __extern_always_inline)
-/* lgamma.  */
-__extern_always_inline _Mdouble_
-__NTH (__REDIRFROM (lgamma, ) (_Mdouble_ __d))
-{
-# if defined __USE_MISC || defined __USE_XOPEN
-  return __REDIRTO (lgamma, _r) (__d, &signgam);
-# else
-  int __local_signgam = 0;
-  return __REDIRTO (lgamma, _r) (__d, &__local_signgam);
-# endif
-}
-#endif
-
-#if ((defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K)) \
-     && defined __extern_always_inline) && !__MATH_DECLARING_FLOATN
-/* gamma.  */
-__extern_always_inline _Mdouble_
-__NTH (__REDIRFROM (gamma, ) (_Mdouble_ __d))
-{
-  return __REDIRTO (lgamma, _r) (__d, &signgam);
-}
-#endif
-
-/* log.  */
-__MATH_REDIRCALL (log, , (_Mdouble_));
-
-/* log10.  */
-__MATH_REDIRCALL (log10, , (_Mdouble_));
-
-#ifdef __USE_ISOC99
-/* log2.  */
-__MATH_REDIRCALL (log2, , (_Mdouble_));
-#endif
-
-/* pow.  */
-__MATH_REDIRCALL (pow, , (_Mdouble_, _Mdouble_));
-
-#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
-/* remainder.  */
-__MATH_REDIRCALL (remainder, , (_Mdouble_, _Mdouble_));
-#endif
-
-#if ((__MATH_DECLARING_DOUBLE \
-      && (defined __USE_MISC \
-	  || (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8))) \
-     || (!defined __MATH_DECLARE_LDOUBLE && defined __USE_MISC)) \
-    && !__MATH_DECLARING_FLOATN
-/* scalb.  */
-__MATH_REDIRCALL (scalb, , (_Mdouble_, _Mdouble_));
-#endif
-
-/* sinh.  */
-__MATH_REDIRCALL (sinh, , (_Mdouble_));
-
-/* sqrt.  */
-__MATH_REDIRCALL (sqrt, , (_Mdouble_));
-
-#if defined __USE_ISOC99 && defined __extern_always_inline
-/* tgamma.  */
-extern _Mdouble_
-__REDIRFROM (__gamma, _r_finite) (_Mdouble_, int *);
-
-__extern_always_inline _Mdouble_
-__NTH (__REDIRFROM (tgamma, ) (_Mdouble_ __d))
-{
-  int __local_signgam = 0;
-  _Mdouble_ __res = __REDIRTO (gamma, _r) (__d, &__local_signgam);
-  return __local_signgam < 0 ? -__res : __res;
-}
-#endif
-
-#undef __REDIRFROM
-#undef __REDIRTO
-#undef __MATH_REDIRCALL
-#undef __MATH_REDIRCALL_2
-#undef __MATH_REDIRCALL_INTERNAL
-#undef __MATH_REDIRCALL_X
diff --git a/math/Makefile b/math/Makefile
index cb4eaec6a9d54d3cb08a3ff86ea9fd15c41cf127..8d754ed02c4e60dc9becc63e2b604e8c0d6557f7 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -25,8 +25,7 @@  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-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 \
diff --git a/math/math.h b/math/math.h
index d70ec3877cc125b0241b7f63edafe4f6000c5f5c..ab2bef2ff75cd6fee9abd09135e52f9504d09364 100644
--- a/math/math.h
+++ b/math/math.h
@@ -1245,226 +1245,6 @@  iszero (__T __val)
 # include <bits/mathinline.h>
 #endif
 
-/* 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
-
-/* Include bits/math-finite.h for double.  */
-# define _Mdouble_ double
-# define __MATH_DECLARING_DOUBLE 1
-# define __MATH_DECLARING_FLOATN 0
-# define __REDIRFROM_X(function, reentrant) \
-  function ## reentrant
-# define __REDIRTO_X(function, reentrant) \
-   __ ## function ## reentrant ## _finite
-# include <bits/math-finite.h>
-# undef _Mdouble_
-# undef __MATH_DECLARING_DOUBLE
-# undef __MATH_DECLARING_FLOATN
-# undef __REDIRFROM_X
-# undef __REDIRTO_X
-
-/* When __USE_ISOC99 is defined, include math-finite for float and
-   long double, as well.  */
-# ifdef __USE_ISOC99
-
-/* Include bits/math-finite.h for float.  */
-#  define _Mdouble_ float
-#  define __MATH_DECLARING_DOUBLE 0
-#  define __MATH_DECLARING_FLOATN 0
-#  define __REDIRFROM_X(function, reentrant) \
-  function ## f ## reentrant
-#  define __REDIRTO_X(function, reentrant) \
-   __ ## function ## f ## reentrant ## _finite
-#  include <bits/math-finite.h>
-#  undef _Mdouble_
-#  undef __MATH_DECLARING_DOUBLE
-#  undef __MATH_DECLARING_FLOATN
-#  undef __REDIRFROM_X
-#  undef __REDIRTO_X
-
-/* Include bits/math-finite.h for long double.  */
-#  ifdef __MATH_DECLARE_LDOUBLE
-#   define _Mdouble_ long double
-#   define __MATH_DECLARING_DOUBLE 0
-#   define __MATH_DECLARING_FLOATN 0
-#   define __REDIRFROM_X(function, reentrant) \
-  function ## l ## reentrant
-#   ifdef __NO_LONG_DOUBLE_MATH
-#    define __REDIRTO_X(function, reentrant) \
-   __ ## function ## reentrant ## _finite
-#   else
-#    define __REDIRTO_X(function, reentrant) \
-   __ ## function ## l ## reentrant ## _finite
-#   endif
-#   include <bits/math-finite.h>
-#   undef _Mdouble_
-#   undef __MATH_DECLARING_DOUBLE
-#   undef __MATH_DECLARING_FLOATN
-#   undef __REDIRFROM_X
-#   undef __REDIRTO_X
-#  endif
-
-# endif /* __USE_ISOC99.  */
-
-/* Include bits/math-finite.h for _FloatN and _FloatNx.  */
-
-# if (__HAVE_DISTINCT_FLOAT16 || (__HAVE_FLOAT16 && !defined _LIBC))	\
-      && __GLIBC_USE (IEC_60559_TYPES_EXT)
-#  define _Mdouble_ _Float16
-#  define __MATH_DECLARING_DOUBLE 0
-#  define __MATH_DECLARING_FLOATN 1
-#  define __REDIRFROM_X(function, reentrant) \
-  function ## f16 ## reentrant
-#  if __HAVE_DISTINCT_FLOAT16
-#   define __REDIRTO_X(function, reentrant) \
-   __ ## function ## f16 ## reentrant ## _finite
-#  else
-#   error "non-disinct _Float16"
-#  endif
-#  include <bits/math-finite.h>
-#  undef _Mdouble_
-#  undef __MATH_DECLARING_DOUBLE
-#  undef __MATH_DECLARING_FLOATN
-#  undef __REDIRFROM_X
-#  undef __REDIRTO_X
-# endif
-
-# if (__HAVE_DISTINCT_FLOAT32 || (__HAVE_FLOAT32 && !defined _LIBC))	\
-      && __GLIBC_USE (IEC_60559_TYPES_EXT)
-#  define _Mdouble_ _Float32
-#  define __MATH_DECLARING_DOUBLE 0
-#  define __MATH_DECLARING_FLOATN 1
-#  define __REDIRFROM_X(function, reentrant) \
-  function ## f32 ## reentrant
-#  if __HAVE_DISTINCT_FLOAT32
-#   define __REDIRTO_X(function, reentrant) \
-   __ ## function ## f32 ## reentrant ## _finite
-#  else
-#   define __REDIRTO_X(function, reentrant) \
-   __ ## function ## f ## reentrant ## _finite
-#  endif
-#  include <bits/math-finite.h>
-#  undef _Mdouble_
-#  undef __MATH_DECLARING_DOUBLE
-#  undef __MATH_DECLARING_FLOATN
-#  undef __REDIRFROM_X
-#  undef __REDIRTO_X
-# endif
-
-# if (__HAVE_DISTINCT_FLOAT64 || (__HAVE_FLOAT64 && !defined _LIBC))	\
-      && __GLIBC_USE (IEC_60559_TYPES_EXT)
-#  define _Mdouble_ _Float64
-#  define __MATH_DECLARING_DOUBLE 0
-#  define __MATH_DECLARING_FLOATN 1
-#  define __REDIRFROM_X(function, reentrant) \
-  function ## f64 ## reentrant
-#  if __HAVE_DISTINCT_FLOAT64
-#   define __REDIRTO_X(function, reentrant) \
-   __ ## function ## f64 ## reentrant ## _finite
-#  else
-#   define __REDIRTO_X(function, reentrant) \
-   __ ## function ## reentrant ## _finite
-#  endif
-#  include <bits/math-finite.h>
-#  undef _Mdouble_
-#  undef __MATH_DECLARING_DOUBLE
-#  undef __MATH_DECLARING_FLOATN
-#  undef __REDIRFROM_X
-#  undef __REDIRTO_X
-# endif
-
-# if (__HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !defined _LIBC))	\
-      && __GLIBC_USE (IEC_60559_TYPES_EXT)
-#  define _Mdouble_ _Float128
-#  define __MATH_DECLARING_DOUBLE 0
-#  define __MATH_DECLARING_FLOATN 1
-#  define __REDIRFROM_X(function, reentrant) \
-  function ## f128 ## reentrant
-#  if __HAVE_DISTINCT_FLOAT128
-#   define __REDIRTO_X(function, reentrant) \
-   __ ## function ## f128 ## reentrant ## _finite
-#  else
-#   define __REDIRTO_X(function, reentrant) \
-   __ ## function ## l ## reentrant ## _finite
-#  endif
-#  include <bits/math-finite.h>
-#  undef _Mdouble_
-#  undef __MATH_DECLARING_DOUBLE
-#  undef __MATH_DECLARING_FLOATN
-#  undef __REDIRFROM_X
-#  undef __REDIRTO_X
-# endif
-
-# if (__HAVE_DISTINCT_FLOAT32X || (__HAVE_FLOAT32X && !defined _LIBC))	\
-      && __GLIBC_USE (IEC_60559_TYPES_EXT)
-#  define _Mdouble_ _Float32x
-#  define __MATH_DECLARING_DOUBLE 0
-#  define __MATH_DECLARING_FLOATN 1
-#  define __REDIRFROM_X(function, reentrant) \
-  function ## f32x ## reentrant
-#  if __HAVE_DISTINCT_FLOAT32X
-#   define __REDIRTO_X(function, reentrant) \
-   __ ## function ## f32x ## reentrant ## _finite
-#  else
-#   define __REDIRTO_X(function, reentrant) \
-   __ ## function ## reentrant ## _finite
-#  endif
-#  include <bits/math-finite.h>
-#  undef _Mdouble_
-#  undef __MATH_DECLARING_DOUBLE
-#  undef __MATH_DECLARING_FLOATN
-#  undef __REDIRFROM_X
-#  undef __REDIRTO_X
-# endif
-
-# if (__HAVE_DISTINCT_FLOAT64X || (__HAVE_FLOAT64X && !defined _LIBC))	\
-      && __GLIBC_USE (IEC_60559_TYPES_EXT)
-#  define _Mdouble_ _Float64x
-#  define __MATH_DECLARING_DOUBLE 0
-#  define __MATH_DECLARING_FLOATN 1
-#  define __REDIRFROM_X(function, reentrant) \
-  function ## f64x ## reentrant
-#  if __HAVE_DISTINCT_FLOAT64X
-#   define __REDIRTO_X(function, reentrant) \
-   __ ## function ## f64x ## reentrant ## _finite
-#  elif __HAVE_FLOAT64X_LONG_DOUBLE
-#   define __REDIRTO_X(function, reentrant) \
-   __ ## function ## l ## reentrant ## _finite
-#  else
-#   define __REDIRTO_X(function, reentrant) \
-   __ ## function ## f128 ## reentrant ## _finite
-#  endif
-#  include <bits/math-finite.h>
-#  undef _Mdouble_
-#  undef __MATH_DECLARING_DOUBLE
-#  undef __MATH_DECLARING_FLOATN
-#  undef __REDIRFROM_X
-#  undef __REDIRTO_X
-# endif
-
-# if (__HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !defined _LIBC)) \
-      && __GLIBC_USE (IEC_60559_TYPES_EXT)
-#  define _Mdouble_ _Float128x
-#  define __MATH_DECLARING_DOUBLE 0
-#  define __MATH_DECLARING_FLOATN 1
-#  define __REDIRFROM_X(function, reentrant) \
-  function ## f128x ## reentrant
-#  if __HAVE_DISTINCT_FLOAT128X
-#   define __REDIRTO_X(function, reentrant) \
-   __ ## function ## f128x ## reentrant ## _finite
-#  else
-#   error "non-disinct _Float128x"
-#  endif
-#  include <bits/math-finite.h>
-#  undef _Mdouble_
-#  undef __MATH_DECLARING_DOUBLE
-#  undef __MATH_DECLARING_FLOATN
-#  undef __REDIRFROM_X
-#  undef __REDIRTO_X
-# endif
-
-#endif /* __FINITE_MATH_ONLY__ > 0.  */
 
 #if __GLIBC_USE (IEC_60559_BFP_EXT)
 /* An expression whose type has the widest of the evaluation formats
diff --git a/sysdeps/ia64/fpu/bits/math-finite.h b/sysdeps/ia64/fpu/bits/math-finite.h
deleted file mode 100644
index 83b126df3fe8a213aab5e3fffd9b3149117aa281..0000000000000000000000000000000000000000
--- a/sysdeps/ia64/fpu/bits/math-finite.h
+++ /dev/null
@@ -1,24 +0,0 @@ 
-/* Entry points to finite-math-only compiler runs.
-   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.h> directly; include <math.h> instead."
-#endif
-
-/* Nothing can be done for IA-64 since the math functions differ in their
-   structure.  */