Search in sources :

Example 1 with CompareOperator

use of com.oracle.truffle.llvm.runtime.CompareOperator in project graal by oracle.

the class DebugExprNodeFactory method createCompareNode.

public DebugExpressionPair createCompareNode(DebugExpressionPair left, CompareKind op, DebugExpressionPair right) {
    checkError(left, op.name());
    checkError(right, op.name());
    DebugExprType commonType = DebugExprType.commonType(left.getType(), right.getType());
    DebugExpressionPair leftPair = createCastIfNecessary(left, commonType);
    DebugExpressionPair rightPair = createCastIfNecessary(right, commonType);
    CompareOperator cop;
    if (commonType.isFloatingType()) {
        cop = getFloatingCompareOperator(op);
    } else if (commonType.isUnsigned()) {
        cop = getUnsignedCompareOperator(op);
    } else {
        cop = getSignedCompareOperator(op);
    }
    LLVMExpressionNode node = CommonNodeFactory.createComparison(cop, commonType.getLLVMRuntimeType(), leftPair.getNode(), rightPair.getNode());
    return DebugExpressionPair.create(node, DebugExprType.getBoolType());
}
Also used : CompareOperator(com.oracle.truffle.llvm.runtime.CompareOperator) DebugExprType(com.oracle.truffle.llvm.runtime.debug.debugexpr.parser.DebugExprType) LLVMExpressionNode(com.oracle.truffle.llvm.runtime.nodes.api.LLVMExpressionNode)

Aggregations

CompareOperator (com.oracle.truffle.llvm.runtime.CompareOperator)1 DebugExprType (com.oracle.truffle.llvm.runtime.debug.debugexpr.parser.DebugExprType)1 LLVMExpressionNode (com.oracle.truffle.llvm.runtime.nodes.api.LLVMExpressionNode)1