From a16e8bc08edca84d507715c66d6cddbbc7ed3b62 Mon Sep 17 00:00:00 2001 From: "Gabriel F. T. Gomes" Date: Mon, 14 Aug 2017 13:46:15 -0300 Subject: Provide a C++ version of issignaling that does not use __MATH_TG The macro __MATH_TG contains the logic to select between long double and _Float128, when these types are ABI-distinct. This logic relies on __builtin_types_compatible_p, which is not available in C++ mode. On the other hand, C++ function overloading provides the means to distinguish between the floating-point types. The overloading resolution will match the correct parameter regardless of type qualifiers, i.e.: const and volatile. Tested for powerpc64le, s390x, and x86_64. * math/math.h [defined __cplusplus] (issignaling): Provide a C++ definition for issignaling that does not rely on __MATH_TG, since __MATH_TG uses __builtin_types_compatible_p, which is only available in C mode. (CFLAGS-test-math-issignaling.cc): New variable. * math/Makefile [CXX] (tests): Add test-math-issignaling. * math/test-math-issignaling.cc: New test for C++ implementation of type-generic issignaling. * sysdeps/powerpc/powerpc64le/Makefile [subdir == math] (CXXFLAGS-test-math-issignaling.cc): Add -mfloat128 to the build options of test-math-issignaling on powerpc64le. --- math/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'math/Makefile') diff --git a/math/Makefile b/math/Makefile index fb79b801cf..9e88cfc637 100644 --- a/math/Makefile +++ b/math/Makefile @@ -208,7 +208,7 @@ tests-internal = test-matherr test-matherr-2 tests-static += atest-exp atest-sincos atest-exp2 ifneq (,$(CXX)) -tests += test-math-isinff test-math-iszero +tests += test-math-isinff test-math-iszero test-math-issignaling endif ifneq (no,$(PERL)) @@ -355,6 +355,7 @@ CFLAGS-test-signgam-ullong-init-static.c = -std=c99 CFLAGS-test-math-isinff.cc = -std=gnu++11 CFLAGS-test-math-iszero.cc = -std=gnu++11 +CFLAGS-test-math-issignaling.cc = -std=gnu++11 CFLAGS-test-iszero-excess-precision.c = -fexcess-precision=standard CFLAGS-test-iseqsig-excess-precision.c = -fexcess-precision=standard -- cgit v1.2.3