use of com.oracle.truffle.llvm.parser.instructions.LLVMArithmeticInstructionType in project sulong by graalvm.
the class LLVMBitcodeInstructionVisitor method visit.
@Override
public void visit(BinaryOperationInstruction operation) {
LLVMExpressionNode lhs = symbols.resolve(operation.getLHS());
LLVMExpressionNode rhs = symbols.resolve(operation.getRHS());
final Type type = operation.getType();
final LLVMArithmeticInstructionType opA = LLVMBitcodeTypeHelper.toArithmeticInstructionType(operation.getOperator());
if (opA != null) {
final LLVMExpressionNode result = nodeFactory.createArithmeticOperation(runtime, lhs, rhs, opA, type, operation.getFlags());
createFrameWrite(result, operation);
return;
}
final LLVMLogicalInstructionKind opL = LLVMBitcodeTypeHelper.toLogicalInstructionType(operation.getOperator());
if (opL != null) {
final LLVMExpressionNode result = nodeFactory.createLogicalOperation(runtime, lhs, rhs, opL, type, operation.getFlags());
createFrameWrite(result, operation);
return;
}
throw new RuntimeException("Missed a binary operator");
}
Aggregations