glibc/sysdeps
Gabriel F. T. Gomes c85e54ac6c Provide a C++ version of iseqsig (bug 22377)
In C++ mode, __MATH_TG cannot be used for defining iseqsig, because
__MATH_TG relies on __builtin_types_compatible_p, which is a C-only
builtin.  This is true when float128 is provided as an ABI-distinct type
from long double.

Moreover, the comparison macros from ISO C take two floating-point
arguments, which need not have the same type.  Choosing what underlying
function to call requires evaluating the formats of the arguments, then
selecting which is wider.  The macro __MATH_EVAL_FMT2 provides this
information, however, only the type of the macro expansion is relevant
(actually evaluating the expression would be incorrect).

This patch provides a C++ version of iseqsig, in which only the type of
__MATH_EVAL_FMT2 (__typeof or decltype) is used as a template parameter
for __iseqsig_type.  This function calls the appropriate underlying
function.

Tested for powerpc64le and x86_64.

	[BZ #22377]
	* math/Makefile [C++] (tests): Add test for iseqsig.
	* math/math.h [C++] (iseqsig): New implementation, which does
	not rely on __MATH_TG/__builtin_types_compatible_p.
	* math/test-math-iseqsig.cc: New file.
	* sysdeps/powerpc/powerpc64le/Makefile
	(CFLAGS-test-math-iseqsig.cc): New variable.
2017-12-19 23:26:59 -02:00
..
aarch64 aarch64: fix start code for static pie 2017-12-18 10:07:07 +00:00
alpha Update Alpha libm-test-ulps 2017-12-06 18:55:09 -02:00
arm Add sysdeps/ieee754/soft-fp. 2017-12-12 23:35:21 +00:00
generic Revert exp reimplementation (causes test failures). 2017-12-19 18:11:37 +00:00
gnu The -Wstringop-truncation option new in GCC 8 detects common misuses 2017-11-15 17:39:59 -07:00
hppa Handle __gmon_start__ as undefined weak on hppa. 2017-12-02 14:43:28 -05:00
i386 Revert exp reimplementation (causes test failures). 2017-12-19 18:11:37 +00:00
ia64 Revert exp reimplementation (causes test failures). 2017-12-19 18:11:37 +00:00
ieee754 Avoid signed shift overflow in pow (bug 21309). 2017-12-19 18:41:01 +00:00
init_array Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
m68k Revert exp reimplementation (causes test failures). 2017-12-19 18:11:37 +00:00
mach Don't set errno in Hurd rtld's __access_noerrno 2017-12-15 18:02:56 +01:00
microblaze Add sysdeps/ieee754/soft-fp. 2017-12-12 23:35:21 +00:00
mips mips32: fix clobbering s0 in setjmp() [BZ #22624] 2017-12-18 18:26:49 +00:00
nios2 Add sysdeps/ieee754/soft-fp. 2017-12-12 23:35:21 +00:00
nptl Linux/x86: Update cancel_jmp_buf to match __jmp_buf_tag [BZ #22563] 2017-12-19 02:44:04 -08:00
posix posix: Fix generic p{read,write}v buffer allocation (BZ#22457) 2017-11-24 12:16:15 -02:00
powerpc Provide a C++ version of iseqsig (bug 22377) 2017-12-19 23:26:59 -02:00
pthread aio: Remove internal_function function attribute 2017-08-31 15:59:06 +02:00
s390 s390: Update ulps 2017-12-16 14:11:56 +05:30
sh Add sysdeps/ieee754/soft-fp. 2017-12-12 23:35:21 +00:00
sparc Update SPARC divrem generation to match output. 2017-12-15 14:06:07 +00:00
tile Add sysdeps/ieee754/soft-fp. 2017-12-12 23:35:21 +00:00
unix sh: Fix clone exit return code (BZ #22605) 2017-12-19 12:02:01 -02:00
wordsize-32 Build divdi3 only for architecture that required it 2017-04-06 15:14:34 -03:00
wordsize-64 posix: Consolidate Linux glob implementation 2017-09-08 16:34:02 +02:00
x86 Add _Float64x function aliases. 2017-11-27 14:16:47 +00:00
x86_64 Revert exp reimplementation (causes test failures). 2017-12-19 18:11:37 +00:00