glibc/sysdeps/powerpc
Gabriel F. T. Gomes aa0235dfde Add C++ versions of iscanonical for ldbl-96 and ldbl-128ibm (bug 22235)
All representations of floating-point numbers in types with IEC 60559
binary exchange format are canonical.  On the other hand, types with IEC
60559 extended formats, such as those implemented under ldbl-96 and
ldbl-128ibm, contain representations that are not canonical.

TS 18661-1 introduced the type-generic macro iscanonical, which returns
whether a floating-point value is canonical or not.  In Glibc, this
type-generic macro is implemented using the macro __MATH_TG, which, when
support for float128 is enabled, relies on __builtin_types_compatible_p
to select between floating-point types.  However, this use of
iscanonical breaks C++ applications, because the builtin is only
available in C mode.

This patch provides a C++ implementation of iscanonical that relies on
function overloading, rather than builtins, to select between
floating-point types.

Unlike the C++ implementations for iszero and issignaling, this
implementation ignores __NO_LONG_DOUBLE_MATH.  The double type always
matches IEC 60559 double format, which is always canonical.  Thus, when
double and long double are the same (__NO_LONG_DOUBLE_MATH), iscanonical
always returns 1 and is not implemented with __MATH_TG.

Tested for powerpc64, powerpc64le and x86_64.

	[BZ #22235]
	* math/math.h: Trivial fix for unbalanced parentheses in comment.
	* math/Makefile [CXX] (tests): Add test-math-iscanonical.cc.
	(CFLAGS-test-math-iscanonical.cc): New variable.
	* math/test-math-iscanonical.cc: New file.
	* sysdeps/ieee754/ldbl-96/bits/iscanonical.h (iscanonical):
	Provide a C++ implementation based on function overloading,
	rather than using __MATH_TG, which uses C-only builtins.
	* sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h (iscanonical):
	Likewise.
	* sysdeps/powerpc/powerpc64le/Makefile
	(CFLAGS-test-math-iscanonical.cc): New variable.
2017-10-03 16:01:37 -03:00
..
bits Remove ancient __signbit inlines 2017-09-28 19:52:13 +01:00
fpu powerpc: Regenerate ULPs for expf() and exp2f() 2017-09-26 16:13:33 -03:00
nofpu Use fabs(f/l) rather than __fabs 2017-09-29 18:54:24 +01:00
nptl
power4
power5+/fpu
power6
power7/fpu
powerpc32 Remove powerpc32 sqrt wrappers. 2017-08-25 11:33:04 +00:00
powerpc64 Do not wrap expf and exp2f 2017-10-02 14:38:54 +01:00
powerpc64le Add C++ versions of iscanonical for ldbl-96 and ldbl-128ibm (bug 22235) 2017-10-03 16:01:37 -03:00
soft-fp
sys/platform
Implies
Makefile tst-tlsopt-powerpc as a shared lib 2017-08-03 15:39:21 +09:30
Versions
abort-instr.h
atomic-machine.h
dl-procinfo.c powerpc: Update AT_HWCAP[2] bits 2017-06-23 09:10:32 -03:00
dl-procinfo.h
dl-tls.c
dl-tls.h
ffs.c
fpu_control.h
gccframe.h
hwcapinfo.c
hwcapinfo.h
ifunc-sel.h
jmpbuf-offsets.h
jmpbuf-unwind.h
ldsodefs.h
libc-tls.c
locale-defines.sym
longjmp.c
machine-gmon.h
math-tests.h
memusage.h
mod-tlsopt-powerpc.c tst-tlsopt-powerpc as a shared lib 2017-08-03 15:39:21 +09:30
mp_clz_tab.c
novmx-longjmp.c
novmx-sigjmp.c
novmxsetjmp.h
preconfigure
rtld-global-offsets.sym
sched_cpucount.c
sigjmp.c
sotruss-lib.c
stackinfo.h
sysdep.h
test-arith.c
test-arithf.c
test-get_hwcap-static.c
test-get_hwcap.c
test-gettimebase.c
tls-macros.h
tst-set_ppr.c
tst-stack-align.h
tst-tlsifunc-static.c powerpc: Fix float128 IFUNC relocations [BZ #21707] 2017-07-17 17:49:26 -03:00
tst-tlsifunc.c powerpc: Fix float128 IFUNC relocations [BZ #21707] 2017-07-17 17:49:26 -03:00
tst-tlsopt-powerpc.c tst-tlsopt-powerpc as a shared lib 2017-08-03 15:39:21 +09:30