1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +03:00

float128: Extend __MATH_TG for float128 support

* math/math.h (__MATH_TG): Extend the conditions to add
	_Float128 support.
	* misc/sys/cdefs.h (__HAVE_GENERIC_SELECTION): New macro.
This commit is contained in:
Gabriel F. T. Gomes
2016-12-09 11:41:55 -02:00
parent b2980e3c54
commit 477bf19a59
3 changed files with 44 additions and 0 deletions

View File

@@ -340,6 +340,27 @@ extern int signgam;
#ifdef __NO_LONG_DOUBLE_MATH
# define __MATH_TG(TG_ARG, FUNC, ARGS) \
(sizeof (TG_ARG) == sizeof (float) ? FUNC ## f ARGS : FUNC ARGS)
#elif __HAVE_DISTINCT_FLOAT128
# if __HAVE_GENERIC_SELECTION
# define __MATH_TG(TG_ARG, FUNC, ARGS) \
_Generic ((TG_ARG), \
float: FUNC ## f ARGS, \
default: FUNC ARGS, \
long double: FUNC ## l ARGS, \
_Float128: FUNC ## f128 ARGS)
# else
# define __MATH_TG(TG_ARG, FUNC, ARGS) \
__builtin_choose_expr \
(__builtin_types_compatible_p (__typeof (TG_ARG), float), \
FUNC ## f ARGS, \
__builtin_choose_expr \
(__builtin_types_compatible_p (__typeof (TG_ARG), double), \
FUNC ARGS, \
__builtin_choose_expr \
(__builtin_types_compatible_p (__typeof (TG_ARG), long double), \
FUNC ## l ARGS, \
FUNC ## f128 ARGS)))
# endif
#else
# define __MATH_TG(TG_ARG, FUNC, ARGS) \
(sizeof (TG_ARG) == sizeof (float) \