Search in sources :

Example 1 with LLVMMetaLiteralNode

use of com.oracle.truffle.llvm.runtime.nodes.literals.LLVMMetaLiteralNode in project graal by oracle.

the class BasicNodeFactory method getCompareOp.

private static CompareOperator getCompareOp(LLVMExpressionNode expr) {
    LLVMMetaLiteralNode meta = (LLVMMetaLiteralNode) expr;
    String op = (String) meta.getMetadata();
    switch(op) {
        case "oeq":
            return CompareOperator.FP_ORDERED_EQUAL;
        case "ogt":
            return CompareOperator.FP_ORDERED_GREATER_THAN;
        case "oge":
            return CompareOperator.FP_ORDERED_GREATER_OR_EQUAL;
        case "olt":
            return CompareOperator.FP_ORDERED_LESS_THAN;
        case "ole":
            return CompareOperator.FP_ORDERED_LESS_OR_EQUAL;
        case "one":
            return CompareOperator.FP_ORDERED_NOT_EQUAL;
        case "ord":
            return CompareOperator.FP_ORDERED;
        case "ueq":
            return CompareOperator.FP_UNORDERED_EQUAL;
        case "ugt":
            return CompareOperator.FP_UNORDERED_GREATER_THAN;
        case "uge":
            return CompareOperator.FP_UNORDERED_GREATER_OR_EQUAL;
        case "ult":
            return CompareOperator.FP_UNORDERED_LESS_THAN;
        case "ule":
            return CompareOperator.FP_UNORDERED_LESS_OR_EQUAL;
        case "une":
            return CompareOperator.FP_UNORDERED_NOT_EQUAL;
        case "uno":
            return CompareOperator.FP_UNORDERED;
        default:
            throw new LLVMParserException("unsupported fp compare op: " + op);
    }
}
Also used : LLVMMetaLiteralNode(com.oracle.truffle.llvm.runtime.nodes.literals.LLVMMetaLiteralNode) LLVMParserException(com.oracle.truffle.llvm.runtime.except.LLVMParserException)

Aggregations

LLVMParserException (com.oracle.truffle.llvm.runtime.except.LLVMParserException)1 LLVMMetaLiteralNode (com.oracle.truffle.llvm.runtime.nodes.literals.LLVMMetaLiteralNode)1