about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorGabriel F. T. Gomes <gftg@linux.vnet.ibm.com>2017-08-14 13:46:15 -0300
committerGabriel F. T. Gomes <gftg@linux.vnet.ibm.com>2017-08-22 10:05:41 -0300
commita16e8bc08edca84d507715c66d6cddbbc7ed3b62 (patch)
treef997f9780b600a0da3f0456162cc2405a0b19b1e /sysdeps
parent8d2ec553295a16ca94fe0285d6307e3b00a402d6 (diff)
downloadglibc-a16e8bc08edca84d507715c66d6cddbbc7ed3b62.tar.gz
glibc-a16e8bc08edca84d507715c66d6cddbbc7ed3b62.tar.xz
glibc-a16e8bc08edca84d507715c66d6cddbbc7ed3b62.zip
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.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/powerpc/powerpc64le/Makefile1
1 files changed, 1 insertions, 0 deletions
diff --git a/sysdeps/powerpc/powerpc64le/Makefile b/sysdeps/powerpc/powerpc64le/Makefile
index 77617b670a..19adbfa1c1 100644
--- a/sysdeps/powerpc/powerpc64le/Makefile
+++ b/sysdeps/powerpc/powerpc64le/Makefile
@@ -16,6 +16,7 @@ $(foreach suf,$(all-object-suffixes),%f128_r$(suf)): CFLAGS += -mfloat128
 $(foreach suf,$(all-object-suffixes),$(objpfx)test-float128%$(suf)): CFLAGS += -mfloat128
 $(foreach suf,$(all-object-suffixes),$(objpfx)test-ifloat128%$(suf)): CFLAGS += -mfloat128
 CFLAGS-libm-test-support-float128.c += -mfloat128
+CFLAGS-test-math-issignaling.cc += -mfloat128
 $(objpfx)test-float128% $(objpfx)test-ifloat128%: \
   gnulib-tests += $(f128-loader-link)
 endif