Search in sources :

Example 1 with BinaryOperator

use of com.oracle.truffle.llvm.parser.model.enums.BinaryOperator in project sulong by graalvm.

the class BinaryOperationConstant method fromSymbols.

public static BinaryOperationConstant fromSymbols(SymbolTable symbols, Type type, int opcode, int lhs, int rhs) {
    final boolean isFloatingPoint = Type.isFloatingpointType(type) || (type instanceof VectorType && Type.isFloatingpointType(((VectorType) type).getElementType()));
    final BinaryOperator operator = BinaryOperator.decode(opcode, isFloatingPoint);
    final BinaryOperationConstant constant = new BinaryOperationConstant(type, operator);
    constant.lhs = symbols.getForwardReferenced(lhs, constant);
    constant.rhs = symbols.getForwardReferenced(rhs, constant);
    return constant;
}
Also used : VectorType(com.oracle.truffle.llvm.runtime.types.VectorType) BinaryOperator(com.oracle.truffle.llvm.parser.model.enums.BinaryOperator)

Example 2 with BinaryOperator

use of com.oracle.truffle.llvm.parser.model.enums.BinaryOperator in project sulong by graalvm.

the class BinaryOperationInstruction method fromSymbols.

public static BinaryOperationInstruction fromSymbols(SymbolTable symbols, Type type, int opcode, int flags, int lhs, int rhs) {
    final boolean isFloatingPoint = Type.isFloatingpointType(type) || (type instanceof VectorType && Type.isFloatingpointType(((VectorType) type).getElementType()));
    final BinaryOperator operator = BinaryOperator.decode(opcode, isFloatingPoint);
    final BinaryOperationInstruction inst = new BinaryOperationInstruction(type, operator, Flag.decode(operator, flags));
    inst.lhs = symbols.getForwardReferenced(lhs, inst);
    inst.rhs = symbols.getForwardReferenced(rhs, inst);
    return inst;
}
Also used : VectorType(com.oracle.truffle.llvm.runtime.types.VectorType) BinaryOperator(com.oracle.truffle.llvm.parser.model.enums.BinaryOperator)

Aggregations

BinaryOperator (com.oracle.truffle.llvm.parser.model.enums.BinaryOperator)2 VectorType (com.oracle.truffle.llvm.runtime.types.VectorType)2