[lno] [RFC] if-conversion and auto vectorizer

Richard Henderson rth@redhat.com
Mon Mar 15 23:08:00 GMT 2004


On Mon, Mar 15, 2004 at 05:42:28PM -0500, Robert Dewar wrote:
> > (1) MIN/MAX have better floating-point properties than conditional move.
> >     Consider 
> > 
> >         a = 0; b = NaN;
> > 
> >         c = a < b ? b : a;              // 0
> >     vs
> >         c = a > b ? a : b;              // NaN
> >     vs
> >         c = max(a, b);                  // Undefined
> 
> Does the C standard really specify that the < and > here are unordered
> comparisons? 

No.  C99 added isgreater etc that are defined to dtrt with NaN.

However, if fp exceptions are disabled (as they ususally are),
then the above will work as shown for almost all targets.



r~



More information about the Gcc mailing list