use of org.graalvm.compiler.asm.amd64.AMD64Assembler.OperandSize in project graal by oracle.
the class AMD64NodeMatchRules method addMemory.
@MatchRule("(Add value Read=access)")
@MatchRule("(Add value FloatingRead=access)")
public ComplexMatchResult addMemory(ValueNode value, LIRLowerableAccess access) {
OperandSize size = getMemorySize(access);
if (size.isXmmType()) {
TargetDescription target = getLIRGeneratorTool().target();
boolean isAvx = ((AMD64) target.arch).getFeatures().contains(CPUFeature.AVX);
if (isAvx) {
return binaryRead(AVXOp.ADD, size, value, access);
} else {
return binaryRead(SSEOp.ADD, size, value, access);
}
} else {
return binaryRead(ADD.getRMOpcode(size), size, value, access);
}
}
use of org.graalvm.compiler.asm.amd64.AMD64Assembler.OperandSize 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));
}
}
use of org.graalvm.compiler.asm.amd64.AMD64Assembler.OperandSize in project graal by oracle.
the class AMD64ArithmeticLIRGenerator method emitBinaryConst.
private Variable emitBinaryConst(LIRKind resultKind, AMD64BinaryArithmetic op, OperandSize size, boolean commutative, AllocatableValue a, ConstantValue b, boolean setFlags) {
long value = b.getJavaConstant().asLong();
if (NumUtil.isInt(value)) {
Variable result = getLIRGen().newVariable(resultKind);
int constant = (int) value;
if (!setFlags) {
AMD64MOp mop = getMOp(op, constant);
if (mop != null) {
getLIRGen().append(new AMD64Unary.MOp(mop, size, result, a));
return result;
}
}
getLIRGen().append(new AMD64Binary.ConstOp(op, size, result, a, constant));
return result;
} else {
return emitBinaryVar(resultKind, op.getRMOpcode(size), size, commutative, a, getLIRGen().asAllocatable(b));
}
}
use of org.graalvm.compiler.asm.amd64.AMD64Assembler.OperandSize in project graal by oracle.
the class AMD64LIRGenerator method emitCompareRegMemoryOp.
private boolean emitCompareRegMemoryOp(OperandSize size, AllocatableValue a, AMD64AddressValue b, LIRFrameState state) {
AMD64RMOp op = CMP.getRMOpcode(size);
append(new AMD64BinaryConsumer.MemoryRMOp(op, size, a, b, state));
return false;
}
use of org.graalvm.compiler.asm.amd64.AMD64Assembler.OperandSize in project graal by oracle.
the class AMD64NodeMatchRules method mulMemory.
@MatchRule("(Mul value Read=access)")
@MatchRule("(Mul value FloatingRead=access)")
public ComplexMatchResult mulMemory(ValueNode value, LIRLowerableAccess access) {
OperandSize size = getMemorySize(access);
if (size.isXmmType()) {
TargetDescription target = getLIRGeneratorTool().target();
boolean isAvx = ((AMD64) target.arch).getFeatures().contains(CPUFeature.AVX);
if (isAvx) {
return binaryRead(AVXOp.MUL, size, value, access);
} else {
return binaryRead(SSEOp.MUL, size, value, access);
}
} else {
return binaryRead(AMD64RMOp.IMUL, size, value, access);
}
}
Aggregations