Search in sources :

Example 1 with AArch64AddressValue

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));
}
Also used : AArch64AddressValue(org.graalvm.compiler.lir.aarch64.AArch64AddressValue) LIRKind(org.graalvm.compiler.core.common.LIRKind) LIRGeneratorTool(org.graalvm.compiler.lir.gen.LIRGeneratorTool) AllocatableValue(jdk.vm.ci.meta.AllocatableValue)

Example 2 with AArch64AddressValue

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));
}
Also used : AArch64AddressValue(org.graalvm.compiler.lir.aarch64.AArch64AddressValue) AArch64Kind(jdk.vm.ci.aarch64.AArch64Kind) LIRValueUtil.asJavaConstant(org.graalvm.compiler.lir.LIRValueUtil.asJavaConstant) LIRValueUtil.isJavaConstant(org.graalvm.compiler.lir.LIRValueUtil.isJavaConstant) JavaConstant(jdk.vm.ci.meta.JavaConstant) StoreOp(org.graalvm.compiler.lir.aarch64.AArch64Move.StoreOp) AllocatableValue(jdk.vm.ci.meta.AllocatableValue) StoreConstantOp(org.graalvm.compiler.lir.aarch64.AArch64Move.StoreConstantOp)

Example 3 with AArch64AddressValue

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);
        }
    }
}
Also used : AArch64Move(org.graalvm.compiler.lir.aarch64.AArch64Move) LoadAddressOp(org.graalvm.compiler.lir.aarch64.AArch64Move.LoadAddressOp) AArch64AddressValue(org.graalvm.compiler.lir.aarch64.AArch64AddressValue) AllocatableValue(jdk.vm.ci.meta.AllocatableValue)

Example 4 with AArch64AddressValue

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));
}
Also used : RegisterValue(jdk.vm.ci.code.RegisterValue) AArch64AddressValue(org.graalvm.compiler.lir.aarch64.AArch64AddressValue) StoreOp(org.graalvm.compiler.lir.aarch64.AArch64Move.StoreOp) AArch64Kind(jdk.vm.ci.aarch64.AArch64Kind) LIRKind(org.graalvm.compiler.core.common.LIRKind)

Example 5 with AArch64AddressValue

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;
}
Also used : Variable(org.graalvm.compiler.lir.Variable) AArch64AddressValue(org.graalvm.compiler.lir.aarch64.AArch64AddressValue) AArch64Kind(jdk.vm.ci.aarch64.AArch64Kind) LoadOp(org.graalvm.compiler.lir.aarch64.AArch64Move.LoadOp)

Aggregations

AArch64AddressValue (org.graalvm.compiler.lir.aarch64.AArch64AddressValue)6 AArch64Kind (jdk.vm.ci.aarch64.AArch64Kind)4 AllocatableValue (jdk.vm.ci.meta.AllocatableValue)3 LIRKind (org.graalvm.compiler.core.common.LIRKind)2 Variable (org.graalvm.compiler.lir.Variable)2 StoreOp (org.graalvm.compiler.lir.aarch64.AArch64Move.StoreOp)2 RegisterValue (jdk.vm.ci.code.RegisterValue)1 JavaConstant (jdk.vm.ci.meta.JavaConstant)1 AArch64ArithmeticLIRGenerator (org.graalvm.compiler.core.aarch64.AArch64ArithmeticLIRGenerator)1 AArch64LIRGenerator (org.graalvm.compiler.core.aarch64.AArch64LIRGenerator)1 IntegerStamp (org.graalvm.compiler.core.common.type.IntegerStamp)1 LIRValueUtil.asJavaConstant (org.graalvm.compiler.lir.LIRValueUtil.asJavaConstant)1 LIRValueUtil.isJavaConstant (org.graalvm.compiler.lir.LIRValueUtil.isJavaConstant)1 AArch64Move (org.graalvm.compiler.lir.aarch64.AArch64Move)1 LoadAddressOp (org.graalvm.compiler.lir.aarch64.AArch64Move.LoadAddressOp)1 LoadOp (org.graalvm.compiler.lir.aarch64.AArch64Move.LoadOp)1 StoreConstantOp (org.graalvm.compiler.lir.aarch64.AArch64Move.StoreConstantOp)1 AArch64Unary (org.graalvm.compiler.lir.aarch64.AArch64Unary)1 LIRGeneratorTool (org.graalvm.compiler.lir.gen.LIRGeneratorTool)1