On Fri, Oct 14, 2022 at 5:00 PM Jakub Jelinek <ja...@redhat.com> wrote:
>
> On Fri, Oct 14, 2022 at 04:53:13PM +0200, Aldy Hernandez wrote:
> > > This looks wrong to me.
> > > !HONOR_NANS is different from !HONOR_SIGNED_ZEROS.
> > > The former says that either NaNs aren't supported or if they appear,
> > > it will be UB.
> > > The latter says that either -0.0 doesn't exist, or user doesn't care
> > > if -0.0 or 0.0 is used.
> > >
> > > So, what you do is ok for !MODE_HAS_SIGNED_ZEROS (TYPE_MODE (m_type)),
> > > but otherwise we want to canonicalize [x, -0.0] to [x, 0.0] and
> > > [0.0, y] to [-0.0, y].
> >
> > If the user doesn't care, I would expect  they'd be ok with it being
> > +0.0, but I must say, this is way beyond my paygrade.
>
> Unlike the NaN case where they can (easily) arrange for NaNs not to appear
> (say, avoid numerically undefined operations), for +/-0 if the hardware
> supports it they don't have much choice, sometimes computation will yield
> one, sometimes the other.  The option is "I don't use anything that depends
> on the zero sign, which is e.g. copysign from zero, signbit or poking at the
> bit patterns".
>
> > How does this patch in testing look?
>
> LGTM (perhaps some comment would be nice though).

Ughh, can I trouble you for one, cause frankly I'm a bit lost on this one?

Aldy

Reply via email to