public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Jason Merrill <jason@redhat.com>,
	Jonathan Wakely <jwakely@redhat.com>, Bruce Korb <bkorb@gnu.org>,
	<gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] c++: Implement P1467R9 - Extended floating-point types and standard names compiler part except for bfloat16 [PR106652]
Date: Mon, 12 Sep 2022 19:36:05 +0000	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2209121927040.3025938@digraph.polyomino.org.uk> (raw)
In-Reply-To: <Yx7oXsjWwmgsaj/A@tucnak>

On Mon, 12 Sep 2022, Jakub Jelinek via Gcc-patches wrote:

> Now, I guess for the fixincludes it could also use
> #  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
> where earlier GCC 13 snapshots would not be doing the fixincludes,
> but the question is what to use for upstream glibc, because
> there will be 13.0 snapshots where C++ doesn't support _Float{16,32,64,128}
> and where it is essential to use what glibc has been doing previously
> and using the #else would fail miserably, and then 13.0 snapshots where it
> does support it and where using the if would fail miserably.

We don't claim in glibc to support old snapshots from master, so checking 
for __GNUC_PREREQ (13, 0) and failing for such older GCC 13 versions is 
fine.

> Conversion from BFmode to SFmode is easy, left shift by 16 and ought to be
> implemented inline, SFmode -> BFmode conversion is harder,

Properly the right way for converting from BFmode to SFmode in the 
presence of -fsignaling-nans should depend on how the result is used.  If 
it's used for arithmetic, it's OK to have converted a BFmode signaling NaN 
to an SFmode signaling NaN, but if e.g. the result is examined with 
issignaling or otherwise stored so it may be significant later whether the 
result is a quiet or signaling NaN, IEEE semantics would mean a signaling 
NaN should be a converted to a quiet NaN with "invalid" raised.  Though I 
don't know how far hardware instructions for BFmode attempt to follow IEEE 
semantics.

(Cf. powerpc single-precision load instructions whose effect is defined as 
a purely bitwise conversion from single to double precision, so that 
single-precision load and store of a signaling NaN never end up converting 
it to a quiet NaN even though the in-register format is double precision.)

> (untested) and the question is if it should be implemented in libgcc
> (and using soft-fp or not), or inline, or both depending on -Os.

Also if you try to do a direct conversion between BFmode and HFmode, 
soft-fp's current support for conversions may not handle that case (where 
one type has wider exponent range and other type has higher precision).

-- 
Joseph S. Myers
joseph@codesourcery.com

  reply	other threads:[~2022-09-12 19:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-12  8:05 Jakub Jelinek
2022-09-12 19:36 ` Joseph Myers [this message]
2022-09-12 20:52   ` Jakub Jelinek
2022-09-12 21:00     ` Jakub Jelinek
2022-09-13 17:50     ` Joseph Myers
2022-09-16 11:48 ` Jason Merrill
2022-09-16 17:34   ` Jakub Jelinek
2022-09-17  8:58     ` Jason Merrill
2022-09-19 16:39       ` Jakub Jelinek
2022-09-26 21:15         ` Jason Merrill
2022-09-26 22:11           ` Jakub Jelinek
2022-09-20  3:35 ` Hongtao Liu
2022-09-20  7:14   ` Hongtao Liu
2022-09-20  8:51   ` Jakub Jelinek
2022-09-22 15:56     ` [RFC PATCH] __trunc{tf,xf,df,sf,hf}bf2, __truncbfhf2 and __extendbfsf2 Jakub Jelinek
2022-09-23  0:44       ` Hongtao Liu

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=alpine.DEB.2.22.394.2209121927040.3025938@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=bkorb@gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=jason@redhat.com \
    --cc=jwakely@redhat.com \
    /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).