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]

meaning of floating-point comparison operators


GCC defines the following comparison operators:

   /* Comparison operations.  The ordered comparisons exist in two
      flavors, signed and unsigned.  */
   NE, EQ, GE, GT, LE, LT, GEU, GTU, LEU, LTU

   /* Additional floating point unordered comparision flavors.  */
   UNORDERED, ORDERED

   /* These are equivalent to unordered or ...  */
   UNEQ, UNGE, UNGT, UNLE, UNLT

   /* This is an ordered NE, ie !UNEQ, ie false for NaN.  */
   LTGT

The UN* operators, ORDERED, and UNORDERED, have obvious meaning, but
are the other ("normal") operators supposed to be equivalent to
"ORDERED && ...", or are they supposed to signal an exception if the
operands aren't ordered?

The reason I ask is because the machine I'm porting to offers
"ORDERED && ..." tests, "UNORDERED || ..." tests, and "signal if not
ordered" tests.

If the meaning is indeed "ORDERED && ...", NE would be synonymous
with LTGT, which makes me suspect that's not the case, but the way
that `reverse_condition_maybe_unordered' works (it reverses the
operators as if that _were_ the meaning) makes me wonder.

Thanks,

-Miles
-- 
"I distrust a research person who is always obviously busy on a task."
   --Robert Frosch, VP, GM Research


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