On 02/09/2015 06:26 PM, Richard Henderson wrote:
On 02/09/2015 11:10 AM, Kenneth Zadeck wrote:
+@table @code
+@findex ltgt
+@cindex less than or greater than
+@item (ltgt:@var{m} @var{x} @var{y})
+@code{STORE_FLAG_VALUE} if the values represented by @var{x} and
+@var{y} are less, or greater, otherwise 0. This is a quiet operation
+that applies only to floating point operands and does not have a
+corresponding IEC 60559 operation.
This is intended to match c99 7.12.14.5 islessgreater, which I believe is the
compareQuietNotEqual operation.
I think that the description that I have is correct. According to IEEE
754-2008, table 5.1, page 29, compareQuietNotEqual is defined to have
the true relations of LT GT UN. What appears to be described in c99
7.12.14.5 is a quiet version with relations LT GT and so returns false
if either operand is a nan. This does not have a defined name in IEEE
754-2008, but if it did would have the name compareQuietLessGreater
according to their naming conventions.
+@table @code
+@findex uneq
+@cindex unordered or equal
+@item (uneq:@var{m} @var{x} @var{y})
+@code{STORE_FLAG_VALUE} if the values represented by @var{x} and
+@var{y} are unordered or equal, otherwise 0. This is a quiet
+operation that applies only to floating point operands and does not
+have a corresponding IEC 60559 operation.
This is the strict inverse to LTGT, i.e. !compareQuietNotEqual, and you of
course note this is not the same as compareQuietEqual.
I believe that when the c99 math.h comparison builtins were added, treating
EQ+NE as quiet comparisons was common but not universal. It's possible this
could be simplified now.
I agree that this is the strict inverse of LTGT, but as the name of this
implies, if either operand is a nan, this returns true. As such, the
relations are UN and EQ which matches the name.
r~