On Tue, 7 May 2024 at 15:11, Jonathan Wakely <jwak...@redhat.com> wrote:
>
> On Tue, 7 May 2024 at 15:06, Jonathan Wakely wrote:
> >
> > On Tue, 7 May 2024 at 14:57, Jeff Law wrote:
> > >
> > >
> > >
> > > On 5/7/24 7:49 AM, Jonathan Wakely wrote:
> > > > Do we want this change for RISC-V, to fix PR113578?
> > > >
> > > > I haven't tested it on RISC-V, only on x86_64-linux (where it doesn't do
> > > > anything).
> > > >
> > > > -- >8 --
> > > >
> > > > libstdc++-v3/ChangeLog:
> > > >
> > > >       PR libstdc++/113578
> > > >       * include/std/ostream (operator<<(basic_ostream&, float)):
> > > >       Restore signbit after converting to double.
> > > No strong opinion.     One could argue that the existence of a
> > > conditional like that inherently implies the generic code is dependent
> > > on specific processor behavior which probably is unwise.  But again, no
> > > strong opinion.
> >
> > Yes, but I'm not aware of any other processors that lose the signbit
> > like this, so in practice it's always worked fine to cast the float to
> > double.
>
> The similar glibc fix for strfrom is specific to RISC-V:
> https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0cc0033ef19bd3378445c2b851e53d7255cb1b1e

Looks like I spoke too soon and the same behaviour exists on Apple M1 chips.


>
> My patch uses copysign unconditionally, to avoid branching on isnan. I
> don't know if that's the right choice.

Reply via email to