What about them? I followed the existing code for folding == and != of
floats, in the optimistic hope that it was already correct.

Again, if you are aware of specific issues, please file them with test cases.

- Daniel

On Thu, Jan 29, 2009 at 12:20 PM, Neil Booth <[email protected]> wrote:
> Daniel Dunbar wrote:-
>
>> +      APFloat::cmpResult CR_r =
>> +        LHS.getComplexFloatReal().compare(RHS.getComplexFloatReal());
>> +      APFloat::cmpResult CR_i =
>> +        LHS.getComplexFloatImag().compare(RHS.getComplexFloatImag());
>> +
>> +      Result.setIsUnsigned(E->getType()->isUnsignedIntegerType());
>> +      if (E->getOpcode() == BinaryOperator::EQ)
>> +        Result = (CR_r == APFloat::cmpEqual &&
>> +                  CR_i == APFloat::cmpEqual);
>> +      else if (E->getOpcode() == BinaryOperator::NE)
>> +        Result = ((CR_r == APFloat::cmpGreaterThan ||
>> +                   CR_r == APFloat::cmpLessThan) &&
>> +                  (CR_i == APFloat::cmpGreaterThan ||
>> +                   CR_i == APFloat::cmpLessThan));
>> +      else
>> +        assert(0 && "Invalid complex compartison.");
>> +      Result.setIsUnsigned(E->getType()->isUnsignedIntegerType());
>> +      return true;
>
> What about NaNs?
>
> Neil.
>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to