public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: Jonathan Wakely <jwakely@redhat.com>
Cc: Jakub Jelinek <jakub@redhat.com>, <libstdc++@gcc.gnu.org>,
	<gcc-patches@gcc.gnu.org>
Subject: Re: [RFC PATCH] libstdc++, v2: Partial library support for std::float{16, 32, 64, 128}_t
Date: Mon, 17 Oct 2022 21:33:02 +0000	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2210172124420.2318399@digraph.polyomino.org.uk> (raw)
In-Reply-To: <CACb0b4=JQOSQ48kw9+xdRhEROVsqScAPwbG4xzhsZBiB=CSNRA@mail.gmail.com>

On Mon, 17 Oct 2022, Jonathan Wakely via Gcc-patches wrote:

> > And I/O etc. support is missing, not sure I'm able to handle that and if it
> > is e.g. possible to keep that support out of libstdc++.so.6, because what
> > extended floating point types one has on a particular arch could change over
> > time (I mean e.g. bfloat16_t support or float16_t support can be added
> > etc.).
> 
> Yes, I think we can add the I/O functions as always_inline because all
> they're going to do is convert the argument to float, double, or long
> double and then call the existing overloads. There will be no new
> virtual functions.

As with fma, note that doing conversions from strings to floating-point is 
a case where doing the operation on float and then narrowing is 
technically incorrect because double rounding can occur (the rounded float 
result can be half way between two values of the narrower type, without 
that being the exact mathematical result) but the operation should be 
correctly rounding.  It's fine to use float or double operations in the 
other direction (floating-point to strings), of course.

-- 
Joseph S. Myers
joseph@codesourcery.com

  parent reply	other threads:[~2022-10-17 21:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-27  8:45 [RFC PATCH] libstdc++: Partial library support for std::float{16,32,64,128}_t Jakub Jelinek
2022-10-16 10:20 ` [RFC PATCH] libstdc++, v2: " Jakub Jelinek
2022-10-17 13:07   ` Jonathan Wakely
2022-10-17 16:25     ` [PATCH] libstdc++, v3: Partial library support for std::float{16,32,64,128}_t and std::bfloat16_t Jakub Jelinek
2022-10-18  9:18       ` Jonathan Wakely
2022-10-17 21:33     ` Joseph Myers [this message]
2022-10-17 21:45       ` [RFC PATCH] libstdc++, v2: Partial library support for std::float{16, 32, 64, 128}_t Jonathan Wakely
2022-10-17 21:50       ` Jakub Jelinek

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.2210172124420.2318399@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=jwakely@redhat.com \
    --cc=libstdc++@gcc.gnu.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).