ldbl-128ibm-compat: Add regular character printing functions
commit421a1d34bffab52263706b6332333e45fc10ab2f
authorGabriel F. T. Gomes <gabrielftg@linux.ibm.com>
Thu, 8 Aug 2019 13:42:35 +0000 (8 10:42 -0300)
committerGabriel F. T. Gomes <gabrielftg@linux.ibm.com>
Fri, 22 Nov 2019 21:10:52 +0000 (22 18:10 -0300)
treee3a363eeb44b3c8c2f6b534979e819c6a8332bc0
parent93486ba583ecef1ba17357cfeb658ce3bea583bd
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>
17 files changed:
sysdeps/ieee754/ldbl-128ibm-compat/Makefile
sysdeps/ieee754/ldbl-128ibm-compat/Versions
sysdeps/ieee754/ldbl-128ibm-compat/ieee128-asprintf.c [new file with mode: 0644]
sysdeps/ieee754/ldbl-128ibm-compat/ieee128-dprintf.c [new file with mode: 0644]
sysdeps/ieee754/ldbl-128ibm-compat/ieee128-fprintf.c [new file with mode: 0644]
sysdeps/ieee754/ldbl-128ibm-compat/ieee128-printf.c [new file with mode: 0644]
sysdeps/ieee754/ldbl-128ibm-compat/ieee128-snprintf.c [new file with mode: 0644]
sysdeps/ieee754/ldbl-128ibm-compat/ieee128-sprintf.c [new file with mode: 0644]
sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vasprintf.c [new file with mode: 0644]
sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vdprintf.c [new file with mode: 0644]
sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vfprintf.c [new file with mode: 0644]
sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vprintf.c [new file with mode: 0644]
sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vsnprintf.c [new file with mode: 0644]
sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vsprintf.c [new file with mode: 0644]
sysdeps/ieee754/ldbl-128ibm-compat/test-printf-ibm128.c [new file with mode: 0644]
sysdeps/ieee754/ldbl-128ibm-compat/test-printf-ieee128.c [new file with mode: 0644]
sysdeps/ieee754/ldbl-128ibm-compat/test-printf-ldbl-compat.c [new file with mode: 0644]