aboutsummaryrefslogtreecommitdiff
path: root/stdio-common/printf_size.c
diff options
context:
space:
mode:
authorGabriel F. T. Gomes <gftg@linux.vnet.ibm.com>2016-11-03 12:37:08 -0200
committerGabriel F. T. Gomes <gftg@linux.vnet.ibm.com>2017-06-07 17:08:21 -0300
commitcf2046ec7dd4b233180377cc5b8debcf551d1fc9 (patch)
tree40f45dc6bb3c49eadff4653c2a9ab0775f2f9cf7 /stdio-common/printf_size.c
parent2bc646c9e95b7c0005b2bc09c06671ffbb509629 (diff)
downloadglibc-cf2046ec7dd4b233180377cc5b8debcf551d1fc9.tar
glibc-cf2046ec7dd4b233180377cc5b8debcf551d1fc9.tar.gz
glibc-cf2046ec7dd4b233180377cc5b8debcf551d1fc9.tar.bz2
glibc-cf2046ec7dd4b233180377cc5b8debcf551d1fc9.zip
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.
Diffstat (limited to 'stdio-common/printf_size.c')
-rw-r--r--stdio-common/printf_size.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/stdio-common/printf_size.c b/stdio-common/printf_size.c
index bc953dc53c..e20b76cf91 100644
--- a/stdio-common/printf_size.c
+++ b/stdio-common/printf_size.c
@@ -104,6 +104,9 @@ __printf_size (FILE *fp, const struct printf_info *info,
{
union ieee754_double dbl;
long double ldbl;
+#if __HAVE_DISTINCT_FLOAT128
+ _Float128 f128;
+#endif
}
fpnum;
const void *ptr = &fpnum;
@@ -144,6 +147,11 @@ __printf_size (FILE *fp, const struct printf_info *info,
}
/* Fetch the argument value. */
+#if __HAVE_DISTINCT_FLOAT128
+ if (info->is_binary128)
+ PRINTF_SIZE_FETCH (_Float128, fpnum.f128)
+ else
+#endif
#ifndef __NO_LONG_DOUBLE_MATH
if (info->is_long_double && sizeof (long double) > sizeof (double))
PRINTF_SIZE_FETCH (long double, fpnum.ldbl)