1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-07 06:43:00 +03:00

float128: Add strfromf128

Add strfromf128 to stdlib when _Float128 support is enabled.

	* stdio-common/printf-parsemb.c (__parse_one_specmb): Initialize
	spec->info.is_binary128 to zero.
	* stdio-common/printf.h (printf_info): Add new member is_binary128
	to indicate that the number being converted to string is compatible
	with the IEC 60559 binary128 format.
	* stdio-common/printf_fp.c (__printf_fp_l): Add code to deal with
	_Float128 numbers.
	* stdio-common/printf_fphex.c: Include ieee754_float128.h and
	ldbl-128/printf_fphex_macros.h
	(__printf_fphex): Add code to deal with _Float128 numbers.
	* stdio-common/printf_size.c (__printf_size): Likewise.
	* stdio-common/vfprintf.c (process_arg): Initialize member
	info.is_binary128 to zero.
	* stdlib/fpioconst.h (FLT128_MAX_10_EXP_LOG): New macro.
	* stdlib/stdlib.h: Include bits/floatn.h for _Float128 support.
	(strfromf128): New declaration.
	* stdlib/strfrom-skeleton.c (STRFROM): Set member info.is_binary128
	to one.
	* sysdeps/ieee754/float128/Makefile: Add strfromf128.
	* sysdeps/ieee754/float128/Versions: Likewise.
	* sysdeps/ieee754/float128/strfromf128.c: New file.
This commit is contained in:
Gabriel F. T. Gomes
2016-11-03 12:37:08 -02:00
parent 2bc646c9e9
commit cf2046ec7d
13 changed files with 173 additions and 8 deletions

View File

@@ -770,7 +770,8 @@ static const uint8_t jump_table[] =
.pad = pad, \
.extra = 0, \
.i18n = use_outdigits, \
.wide = sizeof (CHAR_T) != 1 }; \
.wide = sizeof (CHAR_T) != 1, \
.is_binary128 = 0}; \
\
if (is_long_double) \
the_arg.pa_long_double = va_arg (ap, long double); \
@@ -788,6 +789,8 @@ static const uint8_t jump_table[] =
fspec->data_arg_type = PA_DOUBLE; \
fspec->info.is_long_double = 0; \
} \
/* Not supported by *printf functions. */ \
fspec->info.is_binary128 = 0; \
\
function_done = __printf_fp (s, &fspec->info, &ptr); \
} \
@@ -827,7 +830,8 @@ static const uint8_t jump_table[] =
.group = group, \
.pad = pad, \
.extra = 0, \
.wide = sizeof (CHAR_T) != 1 }; \
.wide = sizeof (CHAR_T) != 1, \
.is_binary128 = 0}; \
\
if (is_long_double) \
the_arg.pa_long_double = va_arg (ap, long double); \
@@ -842,6 +846,8 @@ static const uint8_t jump_table[] =
ptr = (const void *) &args_value[fspec->data_arg]; \
if (__ldbl_is_dbl) \
fspec->info.is_long_double = 0; \
/* Not supported by *printf functions. */ \
fspec->info.is_binary128 = 0; \
\
function_done = __printf_fphex (s, &fspec->info, &ptr); \
} \