use of org.graalvm.compiler.lir.aarch64.AArch64AddressValue in project graal by oracle.
the class AArch64AddressNode 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 (addressingMode.equals(AddressingMode.IMMEDIATE_UNSCALED)) {
indexReference = LIRKind.derivedBaseFromValue(indexValue);
} else {
if (LIRKind.isValue(indexValue.getValueKind())) {
indexReference = null;
} else {
indexReference = Value.ILLEGAL;
}
}
LIRKind kind = LIRKind.combineDerived(tool.getLIRKind(stamp(NodeView.DEFAULT)), baseReference, indexReference);
gen.setResult(this, new AArch64AddressValue(kind, baseValue, indexValue, (int) displacement, scaleFactor, addressingMode));
}
use of org.graalvm.compiler.lir.aarch64.AArch64AddressValue 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 org.graalvm.compiler.lir.aarch64.AArch64AddressValue 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 org.graalvm.compiler.lir.aarch64.AArch64AddressValue in project graal by oracle.
the class AArch64HotSpotLIRGenerator method moveValueToThread.
private void moveValueToThread(Value value, int offset) {
LIRKind wordKind = LIRKind.value(target().arch.getWordKind());
RegisterValue thread = getProviders().getRegisters().getThreadRegister().asValue(wordKind);
final int transferSize = value.getValueKind().getPlatformKind().getSizeInBytes();
AArch64AddressValue address = new AArch64AddressValue(value.getValueKind(), thread, Value.ILLEGAL, offset, transferSize, AddressingMode.IMMEDIATE_SCALED);
append(new StoreOp((AArch64Kind) value.getPlatformKind(), address, loadReg(value), null));
}
use of org.graalvm.compiler.lir.aarch64.AArch64AddressValue in project graal by oracle.
the class AArch64ArithmeticLIRGenerator method emitLoad.
@Override
public Variable emitLoad(LIRKind kind, Value address, LIRFrameState state) {
AArch64AddressValue loadAddress = getLIRGen().asAddressValue(address);
Variable result = getLIRGen().newVariable(getLIRGen().toRegisterKind(kind));
getLIRGen().append(new LoadOp((AArch64Kind) kind.getPlatformKind(), result, loadAddress, state));
return result;
}
Aggregations