Search in sources :

Example 1 with AMD64RMIOp

use of org.graalvm.compiler.asm.amd64.AMD64Assembler.AMD64RMIOp in project graal by oracle.

the class AMD64ArithmeticLIRGenerator method emitIMULConst.

private Variable emitIMULConst(OperandSize size, AllocatableValue a, ConstantValue b) {
    long value = b.getJavaConstant().asLong();
    if (NumUtil.isInt(value)) {
        int imm = (int) value;
        AMD64RMIOp op;
        if (NumUtil.isByte(imm)) {
            op = AMD64RMIOp.IMUL_SX;
        } else {
            op = AMD64RMIOp.IMUL;
        }
        Variable ret = getLIRGen().newVariable(LIRKind.combine(a, b));
        getLIRGen().append(new AMD64Binary.RMIOp(op, size, ret, a, imm));
        return ret;
    } else {
        return emitBinaryVar(LIRKind.combine(a, b), AMD64RMOp.IMUL, size, true, a, getLIRGen().asAllocatable(b));
    }
}
Also used : Variable(org.graalvm.compiler.lir.Variable) AMD64Binary(org.graalvm.compiler.lir.amd64.AMD64Binary) AMD64RMIOp(org.graalvm.compiler.asm.amd64.AMD64Assembler.AMD64RMIOp)

Aggregations

AMD64RMIOp (org.graalvm.compiler.asm.amd64.AMD64Assembler.AMD64RMIOp)1 Variable (org.graalvm.compiler.lir.Variable)1 AMD64Binary (org.graalvm.compiler.lir.amd64.AMD64Binary)1