GCC modified for the FreeChainXenon project
Find a file
Jakub Jelinek e5bcbcd04c libstdc++: Add _Float128 to_chars/from_chars support for x86, ia64 and ppc64le with glibc
The following patch adds std::{to,from}_chars support for std::float128_t
on glibc 2.26+ for {i?86,x86_64,ia64,powerpc64le}-linux.
When long double is already IEEE quad, previous changes already handle
it by using long double overloads in _Float128 overloads.
The powerpc64le case (with explicit or implicit -mabi=ibmlongdouble)
is handled by using the __float128/__ieee128 entrypoints which are
already in the library and used for -mabi=ieeelongdouble.
For i?86, x86_64 and ia64 this patch adds new library entrypoints,
mostly by enabling the code that was already there for powerpc64le-linux.
Those use __float128 or __ieee128, the patch uses _Float128 for the
exported overloads and internally as template parameter.  While
powerpc64le-linux uses __sprintfieee128 and __strtoieee128,
for _Float128 the patch uses the glibc 2.26 strfromf128 and strtof128
APIs.  So that one can build gcc against older glibc and then compile
user programs on newer glibc, the patch uses weak references unless
gcc is compiled against glibc 2.26+.  strfromf128 unfortunately can't
handle %.0Lf and %.*Le, %.*Lf, %.*Lg format strings sprintf/__sprintfieee128
use, we need to remove the L from those and replace * with actually
directly printing the precision into the format string (i.e. it can
handle %.0f and %.27f (floating point type is implied from the function
name)).
Unlike the std::{,b}float16_t support, this one actually exports APIs
with std::float128_t aka _Float128 in the mangled name, because no
standard format is superset of it.  On the other side, e.g. on i?86/x86_64
it doesn't have restrictions like for _Float16/__bf16 which ISAs need
to be enabled in order to use it.

The denorm_min case in the testcase is temporarily commented out because
of the ERANGE subnormal issue Patrick posted patch for.

2022-11-07  Jakub Jelinek  <jakub@redhat.com>

	* include/std/charconv (from_chars, to_chars): Add _Float128
	overfloads if _GLIBCXX_HAVE_FLOAT128_MATH is defined.
	* config/abi/pre/gnu.ver (GLIBCXX_3.4.31): Export
	_ZSt8to_charsPcS_DF128_, _ZSt8to_charsPcS_DF128_St12chars_format,
	_ZSt8to_charsPcS_DF128_St12chars_formati and
	_ZSt10from_charsPKcS0_RDF128_St12chars_format.
	* src/c++17/floating_from_chars.cc (USE_STRTOF128_FOR_FROM_CHARS):
	Define if needed.
	(__strtof128): Declare.
	(from_chars_impl): Handle _Float128.
	(from_chars): New _Float128 overload if USE_STRTOF128_FOR_FROM_CHARS
	is define.
	* src/c++17/floating_to_chars.cc (__strfromf128): Declare.
	(FLOAT128_TO_CHARS): Define even when _Float128 is supported and
	wider than long double.
	(F128_type): Use _Float128 for that case.
	(floating_type_traits): Specialize for F128_type rather than
	__float128.
	(sprintf_ld): Add length argument.  Handle _Float128.
	(__floating_to_chars_shortest, __floating_to_chars_precision):
	Pass length to sprintf_ld.
	(to_chars): Add _Float128 overloads for the F128_type being
	_Float128 cases.
	* testsuite/20_util/to_chars/float128_c++23.cc: New test.
2022-11-07 15:15:50 +01:00
c++tools Daily bump. 2022-03-19 00:16:22 +00:00
config Daily bump. 2022-10-20 00:17:52 +00:00
contrib Manually add ChangeLog entries from r13-3652-ge4cba49413ca429dc82f6aa2e88129ecb3fdd943 2022-11-06 12:12:47 +01:00
fixincludes Daily bump. 2022-10-08 00:17:29 +00:00
gcc tree-ssa-sink: do not touch calls that return twice 2022-11-07 16:01:14 +03:00
gnattools Daily bump. 2022-09-01 00:17:39 +00:00
gotools Daily bump. 2022-08-31 00:16:45 +00:00
include Manually add ChangeLog entries from r13-3652-ge4cba49413ca429dc82f6aa2e88129ecb3fdd943 2022-11-06 12:12:47 +01:00
INSTALL
intl Daily bump. 2021-11-30 00:16:44 +00:00
libada Daily bump. 2022-08-26 00:16:21 +00:00
libatomic Daily bump. 2022-10-20 00:17:52 +00:00
libbacktrace Daily bump. 2022-10-13 00:17:37 +00:00
libcc1 Daily bump. 2022-11-02 00:17:38 +00:00
libcody Daily bump. 2022-06-04 00:16:27 +00:00
libcpp Daily bump. 2022-11-06 11:05:22 +00:00
libdecnumber Daily bump. 2022-10-08 00:17:29 +00:00
libffi Daily bump. 2022-10-13 00:17:37 +00:00
libgcc Daily bump. 2022-11-06 11:05:22 +00:00
libgfortran Daily bump. 2022-10-13 00:17:37 +00:00
libgo runtime: use _libgo_off_t_type when calling C mmap 2022-10-27 17:12:57 -07:00
libgomp Manually add ChangeLog entries from r13-3652-ge4cba49413ca429dc82f6aa2e88129ecb3fdd943 2022-11-06 12:12:47 +01:00
libiberty Daily bump. 2022-10-19 00:19:08 +00:00
libitm Daily bump. 2022-11-01 00:19:02 +00:00
libobjc Daily bump. 2022-10-21 00:17:52 +00:00
libphobos Daily bump. 2022-11-06 11:05:22 +00:00
libquadmath Daily bump. 2022-10-13 00:17:37 +00:00
libsanitizer Daily bump. 2022-10-20 00:17:52 +00:00
libssp Daily bump. 2022-10-13 00:17:37 +00:00
libstdc++-v3 libstdc++: Add _Float128 to_chars/from_chars support for x86, ia64 and ppc64le with glibc 2022-11-07 15:15:50 +01:00
libvtv Daily bump. 2022-11-01 00:19:02 +00:00
lto-plugin Daily bump. 2022-10-13 00:17:37 +00:00
maintainer-scripts Daily bump. 2022-07-29 00:16:21 +00:00
zlib Daily bump. 2022-10-13 00:17:37 +00:00
.dir-locals.el
.gitattributes
.gitignore .gitignore: do not ignore config.h 2022-07-19 17:07:04 +03:00
ABOUT-NLS
ar-lib
ChangeLog Manually add ChangeLog entries from r13-3652-ge4cba49413ca429dc82f6aa2e88129ecb3fdd943 2022-11-06 12:12:47 +01:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess
config.rpath
config.sub config.sub: change mode to 755. 2021-12-21 09:10:57 +01:00
configure Remove support for Intel MIC offloading 2022-11-04 10:51:01 +01:00
configure.ac Remove support for Intel MIC offloading 2022-11-04 10:51:01 +01:00
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
depcomp
install-sh
libtool-ldflags
libtool.m4 Generic configury support for shared libs on VxWorks 2022-10-11 07:31:07 +00:00
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
MAINTAINERS Update email address 2022-10-31 11:15:45 +00:00
Makefile.def Remove support for Intel MIC offloading 2022-11-04 10:51:01 +01:00
Makefile.in Remove support for Intel MIC offloading 2022-11-04 10:51:01 +01:00
Makefile.tpl Makefile.def: drop remnants of unused libelf 2022-08-18 09:37:09 +01:00
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
symlink-tree
test-driver
ylwrap

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.