glibc/sysdeps/ieee754/float128
Gabriel F. T. Gomes 8466ee1cb7 float128: Add signbit alternative for old compilers
In math/math.h, __MATH_TG will expand signbit to __builtin_signbit*,
e.g.: __builtin_signbitf128, before GCC 6.  However, there has never
been a __builtin_signbitf128 in GCC and the type-generic builtin is
only available since GCC 6.  For older GCC, this patch defines
__builtin_signbitf128 to __signbitf128, so that the internal function
is used instead of the non-existent builtin.

This patch also changes the implementation of __signbitf128, because
it was reusing the implementation of __signbitl from ldbl-128, which
calls __builtin_signbitl.  Using the long double version of the
builtin is not correct on machines where _Float128 is ABI-distinct
from long double (i.e.: ia64, powerpc64le, x86, x86_84).  The new
implementation does not rely on builtins when being built with GCC
versions older than 6.0.

The new code does not currently affect powerpc64le builds, because
only GCC 6.2 fulfills the requirements from configure.  It might
affect powerpc64le builds if those requirements are backported to
older versions of the compiler.  The new code affects x86_64 builds,
since glibc is supposed to build correctly with older versions of GCC.

Tested for powerpc64le and x86_64.

	* include/math.h (__signbitf128): Define as hidden.
	* sysdeps/ieee754/float128/s_signbitf128.c (__signbitf128):
	Reimplement without builtins.
	* sysdeps/ia64/bits/floatn.h [!__GNUC_PREREQ (6, 0)]
	(__builtin_signbitf128): Define to __signbitf128.
	* sysdeps/powerpc/bits/floatn.h: Likewise.
	* sysdeps/x86/bits/floatn.h: Likewise.
2017-06-30 18:34:29 -03:00
..
e_acosf128.c
e_acoshf128.c
e_asinf128.c
e_atan2f128.c
e_atanhf128.c
e_coshf128.c
e_exp10f128.c
e_expf128.c
e_fmodf128.c
e_gammaf128_r.c
e_hypotf128.c
e_ilogbf128.c
e_j0f128.c
e_j1f128.c
e_jnf128.c
e_lgammaf128_r.c
e_log2f128.c
e_log10f128.c
e_logf128.c
e_powf128.c
e_rem_pio2f128.c
e_remainderf128.c
e_scalbf128.c
e_sinhf128.c
float128_private.h Fix float128_private.h redefinition of SET_RESTORE_ROUNDL. 2017-06-22 22:57:28 +00:00
float1282mpn.c float128: Add conversion from float128 to mpn 2017-06-07 17:03:43 -03:00
gamma_productf128.c
ieee754_float128.h
k_cosf128.c
k_sincosf128.c
k_sinf128.c
k_tanf128.c
lgamma_negf128.c
lgamma_productf128.c
Makeconfig
Makefile Add libio-mtsafe flags to the build of strfromf128 2017-06-23 10:31:49 -03:00
mpn2float128.c float128: Add strtof128, wcstof128, and related functions. 2017-06-12 14:48:53 -03:00
s_asinhf128.c
s_atanf128.c
s_cbrtf128.c
s_ceilf128.c
s_copysignf128.c
s_cosf128.c
s_erff128.c
s_expm1f128.c
s_fabsf128.c
s_finitef128.c
s_floorf128.c
s_fmaf128.c
s_fpclassifyf128.c
s_frexpf128.c
s_fromfpf128.c
s_fromfpxf128.c
s_getpayloadf128.c
s_isinff128.c
s_isnanf128.c
s_issignalingf128.c
s_llrintf128.c
s_llroundf128.c
s_log1pf128.c
s_logbf128.c
s_lrintf128.c
s_lroundf128.c
s_modff128.c
s_nearbyintf128.c
s_nextafterf128.c
s_nexttowardf128.c
s_nextupf128.c
s_remquof128.c
s_rintf128.c
s_roundevenf128.c
s_roundf128.c
s_scalblnf128.c
s_scalbnf128.c
s_setpayloadf128.c
s_setpayloadsigf128.c
s_signbitf128.c float128: Add signbit alternative for old compilers 2017-06-30 18:34:29 -03:00
s_significandf128.c
s_sincosf128.c
s_sinf128.c
s_tanf128.c
s_tanhf128.c
s_totalorderf128.c
s_totalordermagf128.c
s_truncf128.c
s_ufromfpf128.c
s_ufromfpxf128.c
strfromf128.c float128: Add strfromf128 2017-06-07 17:08:21 -03:00
strtod_nan_float128.h float128: Add strtof128, wcstof128, and related functions. 2017-06-12 14:48:53 -03:00
strtof128_l.c Fix float128 uses of xlocale.h. 2017-06-22 22:34:49 +00:00
strtof128_nan.c float128: Add strtof128, wcstof128, and related functions. 2017-06-12 14:48:53 -03:00
strtof128.c float128: Add strtof128, wcstof128, and related functions. 2017-06-12 14:48:53 -03:00
t_sincosf128.c
Versions float128: Add strtof128, wcstof128, and related functions. 2017-06-12 14:48:53 -03:00
wcstof128_l.c Fix float128 uses of xlocale.h. 2017-06-22 22:34:49 +00:00
wcstof128_nan.c float128: Add strtof128, wcstof128, and related functions. 2017-06-12 14:48:53 -03:00
wcstof128.c Fix float128 uses of xlocale.h. 2017-06-22 22:34:49 +00:00
x2y2m1f128.c