diff options
author | Gabriel F. T. Gomes <gabrielftg@linux.ibm.com> | 2019-08-08 10:42:35 -0300 |
---|---|---|
committer | Gabriel F. T. Gomes <gabrielftg@linux.ibm.com> | 2019-11-22 18:10:52 -0300 |
commit | 421a1d34bffab52263706b6332333e45fc10ab2f (patch) | |
tree | e3a363eeb44b3c8c2f6b534979e819c6a8332bc0 /sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vdprintf.c | |
parent | 93486ba583ecef1ba17357cfeb658ce3bea583bd (diff) | |
download | glibc-421a1d34bffab52263706b6332333e45fc10ab2f.tar.gz glibc-421a1d34bffab52263706b6332333e45fc10ab2f.tar.xz glibc-421a1d34bffab52263706b6332333e45fc10ab2f.zip |
ldbl-128ibm-compat: Add regular character printing functions
The 'mode' argument to __vfprintf_internal allows the selection of the long double format for all long double arguments requested by the format string. Currently, there are two possibilities: long double with the same format as double or long double as something else. The 'something else' format varies between architectures, and on powerpc64le, it means IBM Extended Precision format. In preparation for the third option of long double format on powerpc64le, this patch uses the new mode mask, PRINTF_LDBL_USES_FLOAT128, which tells __vfprintf_internal to save the floating-point values into variables of type __float128 and adjusts the parameters to __printf_fp and __printf_fphex as if it was a call from strfromf128. Many files from the stdio-common, wcsmbs, argp, misc, and libio directories will have IEEE binary128 counterparts. Setting the correct compiler options to these files (original and counterparts) would produce a large amount of repetitive Makefile rules. To avoid this repetition, this patch adds a Makefile routine that iterates over the files adding or removing the appropriate flags. Tested for powerpc64le. Reviewed-By: Florian Weimer <fweimer@redhat.com> Reviewed-By: Joseph Myers <joseph@codesourcery.com> Reviewed-By: Paul E. Murphy <murphyp@linux.ibm.com>
Diffstat (limited to 'sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vdprintf.c')
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vdprintf.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vdprintf.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vdprintf.c new file mode 100644 index 0000000000..88fbb3743d --- /dev/null +++ b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vdprintf.c @@ -0,0 +1,26 @@ +/* Wrapper for vdprintf. IEEE128 version. + Copyright (C) 2019 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <libio/libioP.h> + +extern int +___ieee128_vdprintf (int d, const char *format, va_list ap) +{ + return __vdprintf_internal (d, format, ap, PRINTF_LDBL_USES_FLOAT128); +} +strong_alias (___ieee128_vdprintf, __vdprintfieee128) |