On Sat, Jun 24, 2017 at 12:47 PM, Marc Glisse <marc.gli...@inria.fr> wrote: > On Sat, 24 Jun 2017, Andrew Pinski wrote: > >>> * if X is NaN, we may get a qNaN with the wrong sign bit. We probably >>> don't >>> care much though... >> >> >> Ok, I changed it to when not honoring NANs. > > > Note that I have no idea what guarantees we give in gcc. It is quite > possible that your patch is fine without this change, I only wanted to raise > the question in case someone knows.
So looking through, we do guarantee the sign of the NaNs except when not honoring NaNs in the first place. So the conversion from a>0?1.0:-1.0 to copysign will be conditional on honoring NaNs. But the x*copysign(1.0,x) will only conditional on not honoring sNaNs. > > -- > Marc Glisse