use of jdk.vm.ci.meta.AllocatableValue in project graal by oracle.
the class AArch64ArithmeticLIRGenerator method emitBinaryConst.
private void emitBinaryConst(Variable result, AArch64ArithmeticOp op, AllocatableValue a, JavaConstant b) {
AllocatableValue x = moveSp(a);
getLIRGen().append(new AArch64ArithmeticOp.BinaryConstOp(op, result, x, b));
}
use of jdk.vm.ci.meta.AllocatableValue in project graal by oracle.
the class AArch64ArithmeticLIRGenerator method emitStore.
@Override
public void emitStore(ValueKind<?> lirKind, Value address, Value inputVal, LIRFrameState state) {
AArch64AddressValue storeAddress = getLIRGen().asAddressValue(address);
AArch64Kind kind = (AArch64Kind) lirKind.getPlatformKind();
if (isJavaConstant(inputVal) && kind.isInteger()) {
JavaConstant c = asJavaConstant(inputVal);
if (c.isDefaultForKind()) {
// We can load 0 directly into integer registers
getLIRGen().append(new StoreConstantOp(kind, storeAddress, c, state));
return;
}
}
AllocatableValue input = getLIRGen().asAllocatable(inputVal);
getLIRGen().append(new StoreOp(kind, storeAddress, input, state));
}
use of jdk.vm.ci.meta.AllocatableValue in project graal by oracle.
the class AArch64MoveFactory method createMove.
@Override
public LIRInstruction createMove(AllocatableValue dst, Value src) {
boolean srcIsSlot = isStackSlotValue(src);
boolean dstIsSlot = isStackSlotValue(dst);
if (isConstantValue(src)) {
return createLoad(dst, asConstant(src));
} else if (src instanceof AArch64AddressValue) {
return new LoadAddressOp(dst, (AArch64AddressValue) src);
} else {
assert src instanceof AllocatableValue;
if (srcIsSlot && dstIsSlot) {
throw GraalError.shouldNotReachHere(src.getClass() + " " + dst.getClass());
} else {
return new AArch64Move.Move(dst, (AllocatableValue) src);
}
}
}
use of jdk.vm.ci.meta.AllocatableValue in project graal by oracle.
the class AMD64AddressNode method generate.
@Override
public void generate(NodeLIRBuilderTool gen) {
LIRGeneratorTool tool = gen.getLIRGeneratorTool();
AllocatableValue baseValue = base == null ? Value.ILLEGAL : tool.asAllocatable(gen.operand(base));
AllocatableValue indexValue = index == null ? Value.ILLEGAL : tool.asAllocatable(gen.operand(index));
AllocatableValue baseReference = LIRKind.derivedBaseFromValue(baseValue);
AllocatableValue indexReference;
if (index == null) {
indexReference = null;
} else if (scale.equals(Scale.Times1)) {
indexReference = LIRKind.derivedBaseFromValue(indexValue);
} else {
if (LIRKind.isValue(indexValue)) {
indexReference = null;
} else {
indexReference = Value.ILLEGAL;
}
}
LIRKind kind = LIRKind.combineDerived(tool.getLIRKind(stamp(NodeView.DEFAULT)), baseReference, indexReference);
gen.setResult(this, new AMD64AddressValue(kind, baseValue, indexValue, scale, displacement));
}
use of jdk.vm.ci.meta.AllocatableValue in project graal by oracle.
the class AMD64AddressValue method forEachComponent.
@Override
public CompositeValue forEachComponent(LIRInstruction inst, OperandMode mode, InstructionValueProcedure proc) {
AllocatableValue newBase = (AllocatableValue) proc.doValue(inst, base, mode, flags);
AllocatableValue newIndex = (AllocatableValue) proc.doValue(inst, index, mode, flags);
if (!base.identityEquals(newBase) || !index.identityEquals(newIndex)) {
return new AMD64AddressValue(getValueKind(), newBase, newIndex, scale, displacement);
}
return this;
}
Aggregations