From 1626f499d159f17d5d99dc41497b52074f3850df Mon Sep 17 00:00:00 2001 From: "Gabriel F. T. Gomes" Date: Thu, 27 Jun 2019 17:43:44 -0300 Subject: Prepare vfprintf to use __printf_fp/__printf_fphex with float128 arg On powerpc64le, long double can currently take two formats: the same as double (-mlong-double-64) or IBM Extended Precision (default with -mlong-double-128 or explicitly with -mabi=ibmlongdouble). The internal implementation of printf-like functions is aware of these possibilities and properly parses floating-point values from the variable arguments, before making calls to __printf_fp and __printf_fphex. These functions are also aware of the format possibilities and know how to convert both formats to string. When library support for TS 18661-3 was added to glibc, __printf_fp and __printf_fphex were extended with support for an additional type (__float128/_Float128) with a different format (binary128). Now that powerpc64le is getting support for its third long double format, and taking into account that this format is the same as the format of __float128/_Float128, this patch extends __vfprintf_internal to properly call __printf_fp and __printf_fphex with this new format. Tested for powerpc64le (with additional patches to actually enable the use of these preparations) and for x86_64. Reviewed-by: Adhemerval Zanella --- stdio-common/printf-parse.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'stdio-common/printf-parse.h') diff --git a/stdio-common/printf-parse.h b/stdio-common/printf-parse.h index 3975086..00f3280 100644 --- a/stdio-common/printf-parse.h +++ b/stdio-common/printf-parse.h @@ -57,6 +57,9 @@ union printf_arg unsigned long long int pa_u_long_long_int; double pa_double; long double pa_long_double; +#if __HAVE_FLOAT128_UNLIKE_LDBL + _Float128 pa_float128; +#endif const char *pa_string; const wchar_t *pa_wstring; void *pa_pointer; -- cgit v1.1