Search in sources :

Example 16 with AllocatableValue

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

Example 17 with AllocatableValue

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));
}
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 18 with AllocatableValue

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);
        }
    }
}
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 19 with AllocatableValue

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

Example 20 with AllocatableValue

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;
}
Also used : AllocatableValue(jdk.vm.ci.meta.AllocatableValue)

Aggregations

AllocatableValue (jdk.vm.ci.meta.AllocatableValue)87 Value (jdk.vm.ci.meta.Value)22 Variable (org.graalvm.compiler.lir.Variable)20 LIRKind (org.graalvm.compiler.core.common.LIRKind)13 LIRInstruction (org.graalvm.compiler.lir.LIRInstruction)11 Indent (org.graalvm.compiler.debug.Indent)10 RegisterValue (jdk.vm.ci.code.RegisterValue)9 ValueUtil.asAllocatableValue (jdk.vm.ci.code.ValueUtil.asAllocatableValue)8 DebugContext (org.graalvm.compiler.debug.DebugContext)8 Register (jdk.vm.ci.code.Register)6 JavaConstant (jdk.vm.ci.meta.JavaConstant)6 AMD64MathIntrinsicUnaryOp (org.graalvm.compiler.lir.amd64.AMD64MathIntrinsicUnaryOp)5 LIRValueUtil.asJavaConstant (org.graalvm.compiler.lir.LIRValueUtil.asJavaConstant)4 LIRValueUtil.isJavaConstant (org.graalvm.compiler.lir.LIRValueUtil.isJavaConstant)4 ValueMoveOp (org.graalvm.compiler.lir.StandardOp.ValueMoveOp)4 ArithmeticLIRGenerator (org.graalvm.compiler.lir.gen.ArithmeticLIRGenerator)4 LIRGenerator (org.graalvm.compiler.lir.gen.LIRGenerator)4 SPARCAddressValue (org.graalvm.compiler.lir.sparc.SPARCAddressValue)4 AMD64Kind (jdk.vm.ci.amd64.AMD64Kind)3 ValueUtil.isAllocatableValue (jdk.vm.ci.code.ValueUtil.isAllocatableValue)3