glibc/sysdeps/ia64
Florian Weimer e88b9f0e5c stdio-common: Convert vfprintf and related functions to buffers
vfprintf is entangled with vfwprintf (of course), __printf_fp,
__printf_fphex, __vstrfmon_l_internal, and the strfrom family of
functions.  The latter use the internal snprintf functionality,
so vsnprintf is converted as well.

The simples conversion is __printf_fphex, followed by
__vstrfmon_l_internal and __printf_fp, and finally
__vfprintf_internal and __vfwprintf_internal.  __vsnprintf_internal
and strfrom* are mostly consuming the new interfaces, so they
are comparatively simple.

__printf_fp is a public symbol, so the FILE *-based interface
had to preserved.

The __printf_fp rewrite does not change the actual binary-to-decimal
conversion algorithm, and digits are still not emitted directly to
the target buffer.  However, the staging buffer now uses bytes
instead of wide characters, and one buffer copy is eliminated.

The changes are at least performance-neutral in my testing.
Floating point printing and snprintf improved measurably, so that
this Lua script

  for i=1,5000000 do
      print(i, i * math.pi)
  end

runs about 5% faster for me.  To preserve fprintf performance for
a simple "%d" format, this commit has some logic changes under
LABEL (unsigned_number) to avoid additional function calls.  There
are certainly some very easy performance improvements here: binary,
octal and hexadecimal formatting can easily avoid the temporary work
buffer (the number of digits can be computed ahead-of-time using one
of the __builtin_clz* built-ins). Decimal formatting can use a
specialized version of _itoa_word for base 10.

The existing (inconsistent) width handling between strfmon and printf
is preserved here.  __print_fp_buffer_1 would have to use
__translated_number_width to achieve ISO conformance for printf.

Test expectations in libio/tst-vtables-common.c are adjusted because
the internal staging buffer merges all virtual function calls into
one.

In general, stack buffer usage is greatly reduced, particularly for
unbuffered input streams.  __printf_fp can still use a large buffer
in binary128 mode for %g, though.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2022-12-19 18:56:54 +01:00
..
bits Update _FloatN header support for C++ in GCC 13 2022-09-28 20:10:08 +00:00
fpu stdio-common: Convert vfprintf and related functions to buffers 2022-12-19 18:56:54 +01:00
nptl elf: Introduce <dl-call_tls_init_tp.h> and call_tls_init_tp (bug 29249) 2022-11-03 17:28:03 +01:00
_mcount.S Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
abort-instr.h ia64: relocate out of ports/ subdir 2014-02-16 01:12:38 -05:00
atomic-machine.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
bzero.c ia64: Remove bzero optimization 2022-02-23 14:18:17 -03:00
configure elf: Replace PI_STATIC_AND_HIDDEN with opposite HIDDEN_VAR_NEEDS_DYNAMIC_RELOC 2022-04-26 09:26:22 -07:00
configure.ac elf: Replace PI_STATIC_AND_HIDDEN with opposite HIDDEN_VAR_NEEDS_DYNAMIC_RELOC 2022-04-26 09:26:22 -07:00
crti.S Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
crtn.S Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
dl-dtprocnum.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
dl-fptr.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
dl-lookupcfg.h elf: Issue la_symbind for bind-now (BZ #23734) 2022-02-01 14:49:46 -03:00
dl-machine.h ia64: Remove _dl_skip_args usage 2022-05-30 16:33:08 -03:00
dl-tls.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
dl-trampoline.S Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
elf-initfini.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
entry.h Restore ENTRY_POINT definition on hppa, ia64 (bug 28749) 2022-01-07 14:47:31 +01:00
float128-abi.h Move __isnanf128 to libc.so 2021-03-30 14:58:19 +05:30
gccframe.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
hp-timing.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
ia64libgcc.S ia64: relocate out of ports/ subdir 2014-02-16 01:12:38 -05:00
ieee754.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
Implies Add float128 support for ia64. 2017-06-26 22:50:45 +00:00
jmpbuf-unwind.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
ldbl2mpn.c x86: Use one ldbl2mpn.c file for both i386 and x86_64 2020-09-22 17:58:39 +02:00
ldsodefs.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
libc-symver.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
libc-tls.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
linkmap.h Rename bits/linkmap.h to linkmap.h (bug 14912). 2015-09-04 19:44:27 +00:00
machine-gmon.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
Makeconfig Add _Float64x function aliases. 2017-11-27 14:16:47 +00:00
Makefile Add float128 support for ia64. 2017-06-26 22:50:45 +00:00
math-tests-snan.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
memccpy.S Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
memchr.S Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
memcmp.S Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
memcpy.S Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
memmove.S Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
memset.S Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
softpipe.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
sotruss-lib.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
stackguard-macros.h ia64: relocate out of ports/ subdir 2014-02-16 01:12:38 -05:00
stackinfo.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
start.S Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
strchr.S Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
strcmp.S Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
strcpy.S Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
strlen.S Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
strncmp.S Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
strncpy.S Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
sysdep.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tininess.h ia64: relocate out of ports/ subdir 2014-02-16 01:12:38 -05:00
tst-audit.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
unwind-arch.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
unwind-resume.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
Versions hppa/ia64: _dl_unmap: make it hidden 2015-07-16 09:03:46 -04:00