This is the mail archive of the gcc@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: [lno] [RFC] if-conversion and auto vectorizer


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~


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