[cfe-commits] r63280 - in /cfe/trunk: lib/AST/ExprConstant.cpp test/CodeGen/const-init.c

Neil Booth neil at daikokuya.co.uk
Thu Jan 29 12:20:35 PST 2009


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.



More information about the cfe-commits mailing list