This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] fold a * (a > 0 ? 1 : -1) to abs(a) and related optimizations


On Sat, 24 Jun 2017, Marc Glisse wrote:

> * if X is NaN, we may get a qNaN with the wrong sign bit. We probably don't
> care much though...

The sign bit from a multiplication involving a NaN is not specified.  
*But* making any of these transformations with a qNaN loses the "invalid" 
exception from an ordered comparison involving a qNaN, so isn't valid in 
the case of (qNaNs respected and trapping-math).

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]