On 5/7/24 8:06 AM, 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.
We kicked it around a bit in our meeting today and the thinking is that while RISC-V implementation is IEEE 754 compliant, it does differ from other implementations.

So do we want to be stuck explaining this corner of IEEE 754 compliance to end users? If not, then we probably want to go with your fix.

Similarly if there's a reasonable chance a standard higher in the software stacks mandates the behavior that everyone else has, then we'd want to go with your fix as well.

So after further review, I'd lean towards fixing this in libstdc++ by whatever means you think is cleanest.

jeff

Reply via email to