public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: libc-alpha@sourceware.org
Subject: Re: Update _FloatN header support for C++ in GCC 13
Date: Wed, 28 Sep 2022 20:28:00 +0200	[thread overview]
Message-ID: <YzSSMOYyigDPWE6n@tucnak> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2209280022150.425621@digraph.polyomino.org.uk>

On Wed, Sep 28, 2022 at 12:23:31AM +0000, Joseph Myers wrote:
> GCC 13 adds support for _FloatN and _FloatNx types in C++, so breaking
> the installed glibc headers that assume such support is not present.
> GCC mostly works around this with fixincludes, but that doesn't help
> for building glibc and its tests (glibc doesn't itself contain C++
> code, but there's C++ code built for tests).  Update glibc's
> bits/floatn-common.h and bits/floatn.h headers to handle the GCC 13
> support directly.
> 
> In general the changes match those made by fixincludes, though I think
> the ones in sysdeps/powerpc/bits/floatn.h, where the header tests
> __LDBL_MANT_DIG__ == 113 or uses #elif, wouldn't match the existing
> fixincludes patterns.
> 
> Some places involving special C++ handling in relation to _FloatN
> support are not changed.  There's no need to change the
> __HAVE_FLOATN_NOT_TYPEDEF definition (also in a form that wouldn't be
> matched by the fixincludes fixes) because it's only used in relation
> to macro definitions using features not supported for C++
> (__builtin_types_compatible_p and _Generic).  And there's no need to
> change the inline function overloads for issignaling, iszero and
> iscanonical in C++ because cases where types have the same format but
> are no longer compatible types are handled automatically by the C++
> overload resolution rules.
> 
> This patch also does not change the overload handling for iseqsig, and
> there I think changes *are* needed, beyond those in this patch or made
> by fixincludes.  The way that overload is defined, via a template
> parameter to a structure type, requires overloads whenever the types
> are incompatible, even if they have the same format.  So I think we
> need to add overloads with GCC 13 for every supported _FloatN and
> _FloatNx type, rather than just having one for _Float128 when it has a
> different ABI to long double as at present (but for older GCC, such
> overloads must not be defined for types that end up defined as
> typedefs for another type).
> 
> Tested with build-many-glibcs.py: compilers build for
> aarch64-linux-gnu ia64-linux-gnu mips64-linux-gnu powerpc-linux-gnu
> powerpc64le-linux-gnu x86_64-linux-gnu; glibcs build for
> aarch64-linux-gnu ia64-linux-gnu i686-linux-gnu mips-linux-gnu
> mips64-linux-gnu-n32 powerpc-linux-gnu powerpc64le-linux-gnu
> x86_64-linux-gnu.
> 
> ---
> 
> I am seeking review of this patch, not applying it as a math
> maintainer.

Went through all these and compared them to my include-fixed
of whole libc tree and the only changes are the _Float128x errors
which is desirable.
So, LGTM.

Reviewed-by: Jakub Jelinek <jakub@redhat.com>

	Jakub


  reply	other threads:[~2022-09-28 18:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-28  0:23 Joseph Myers
2022-09-28 18:28 ` Jakub Jelinek [this message]
2022-09-29 11:49 ` Andreas Schwab
2022-09-29 15:12   ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YzSSMOYyigDPWE6n@tucnak \
    --to=jakub@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).