Search in sources :

Example 16 with PlatformKind

use of jdk.vm.ci.meta.PlatformKind in project graal by oracle.

the class SPARCArithmeticLIRGenerator method moveBetweenFpGp.

private void moveBetweenFpGp(AllocatableValue dst, AllocatableValue src) {
    AllocatableValue tempSlot;
    PlatformKind dstKind = dst.getPlatformKind();
    PlatformKind srcKind = src.getPlatformKind();
    if (getLIRGen().getArchitecture().getFeatures().contains(CPUFeature.VIS3) && !(srcKind == WORD && dstKind == SINGLE) && !(srcKind == SINGLE && dstKind == WORD)) {
        tempSlot = AllocatableValue.ILLEGAL;
    } else {
        tempSlot = getTempSlot(LIRKind.value(XWORD));
    }
    getLIRGen().append(new MoveFpGp(dst, src, tempSlot));
}
Also used : PlatformKind(jdk.vm.ci.meta.PlatformKind) AllocatableValue(jdk.vm.ci.meta.AllocatableValue) MoveFpGp(org.graalvm.compiler.lir.sparc.SPARCMove.MoveFpGp)

Example 17 with PlatformKind

use of jdk.vm.ci.meta.PlatformKind in project graal by oracle.

the class JVMCIInfopointErrorTest method testInvalidShortOop.

@Test(expected = Error.class)
public void testInvalidShortOop() {
    test((tool, state, safepoint) -> {
        PlatformKind kind = tool.target().arch.getPlatformKind(JavaKind.Short);
        LIRKind lirKind = LIRKind.reference(kind);
        Variable var = tool.newVariable(lirKind);
        tool.append(new ValueDef(var));
        safepoint.accept(state);
        tool.append(new ValueUse(var));
    });
}
Also used : Variable(org.graalvm.compiler.lir.Variable) PlatformKind(jdk.vm.ci.meta.PlatformKind) LIRKind(org.graalvm.compiler.core.common.LIRKind) GraalCompilerTest(org.graalvm.compiler.core.test.GraalCompilerTest) Test(org.junit.Test)

Example 18 with PlatformKind

use of jdk.vm.ci.meta.PlatformKind in project graal by oracle.

the class LIRGenerator method createZapRegisters.

@Override
public SaveRegistersOp createZapRegisters() {
    Register[] zappedRegisters = getResult().getFrameMap().getRegisterConfig().getAllocatableRegisters().toArray();
    JavaConstant[] zapValues = new JavaConstant[zappedRegisters.length];
    for (int i = 0; i < zappedRegisters.length; i++) {
        PlatformKind kind = target().arch.getLargestStorableKind(zappedRegisters[i].getRegisterCategory());
        zapValues[i] = zapValueForKind(kind);
    }
    return createZapRegisters(zappedRegisters, zapValues);
}
Also used : Register(jdk.vm.ci.code.Register) JavaConstant(jdk.vm.ci.meta.JavaConstant) PlatformKind(jdk.vm.ci.meta.PlatformKind)

Example 19 with PlatformKind

use of jdk.vm.ci.meta.PlatformKind in project graal by oracle.

the class LIRGenerator method zapArgumentSpace.

@Override
public LIRInstruction zapArgumentSpace() {
    List<StackSlot> slots = null;
    for (AllocatableValue arg : res.getCallingConvention().getArguments()) {
        if (isStackSlot(arg)) {
            if (slots == null) {
                slots = new ArrayList<>();
            }
            slots.add((StackSlot) arg);
        } else {
            assert !isVirtualStackSlot(arg);
        }
    }
    if (slots == null) {
        return null;
    }
    StackSlot[] zappedStack = slots.toArray(new StackSlot[slots.size()]);
    JavaConstant[] zapValues = new JavaConstant[zappedStack.length];
    for (int i = 0; i < zappedStack.length; i++) {
        PlatformKind kind = zappedStack[i].getPlatformKind();
        zapValues[i] = zapValueForKind(kind);
    }
    return createZapArgumentSpace(zappedStack, zapValues);
}
Also used : LIRValueUtil.isVirtualStackSlot(org.graalvm.compiler.lir.LIRValueUtil.isVirtualStackSlot) StackSlot(jdk.vm.ci.code.StackSlot) ValueUtil.isStackSlot(jdk.vm.ci.code.ValueUtil.isStackSlot) JavaConstant(jdk.vm.ci.meta.JavaConstant) PlatformKind(jdk.vm.ci.meta.PlatformKind) ValueUtil.asAllocatableValue(jdk.vm.ci.code.ValueUtil.asAllocatableValue) ValueUtil.isAllocatableValue(jdk.vm.ci.code.ValueUtil.isAllocatableValue) AllocatableValue(jdk.vm.ci.meta.AllocatableValue)

Example 20 with PlatformKind

use of jdk.vm.ci.meta.PlatformKind in project graal by oracle.

the class NodeLIRBuilder method emitConditional.

public Variable emitConditional(LogicNode node, Value trueValue, Value falseValue) {
    if (node instanceof IsNullNode) {
        IsNullNode isNullNode = (IsNullNode) node;
        LIRKind kind = gen.getLIRKind(isNullNode.getValue().stamp(NodeView.DEFAULT));
        Value nullValue = gen.emitConstant(kind, JavaConstant.NULL_POINTER);
        return gen.emitConditionalMove(kind.getPlatformKind(), operand(isNullNode.getValue()), nullValue, Condition.EQ, false, trueValue, falseValue);
    } else if (node instanceof CompareNode) {
        CompareNode compare = (CompareNode) node;
        PlatformKind kind = gen.getLIRKind(compare.getX().stamp(NodeView.DEFAULT)).getPlatformKind();
        return gen.emitConditionalMove(kind, operand(compare.getX()), operand(compare.getY()), compare.condition().asCondition(), compare.unorderedIsTrue(), trueValue, falseValue);
    } else if (node instanceof LogicConstantNode) {
        return gen.emitMove(((LogicConstantNode) node).getValue() ? trueValue : falseValue);
    } else if (node instanceof IntegerTestNode) {
        IntegerTestNode test = (IntegerTestNode) node;
        return gen.emitIntegerTestMove(operand(test.getX()), operand(test.getY()), trueValue, falseValue);
    } else {
        throw GraalError.unimplemented(node.toString());
    }
}
Also used : CompareNode(org.graalvm.compiler.nodes.calc.CompareNode) IsNullNode(org.graalvm.compiler.nodes.calc.IsNullNode) IntegerTestNode(org.graalvm.compiler.nodes.calc.IntegerTestNode) ComplexMatchValue(org.graalvm.compiler.core.match.ComplexMatchValue) Value(jdk.vm.ci.meta.Value) AllocatableValue(jdk.vm.ci.meta.AllocatableValue) LogicConstantNode(org.graalvm.compiler.nodes.LogicConstantNode) LIRKind(org.graalvm.compiler.core.common.LIRKind) PlatformKind(jdk.vm.ci.meta.PlatformKind)

Aggregations

PlatformKind (jdk.vm.ci.meta.PlatformKind)20 Register (jdk.vm.ci.code.Register)6 LIRKind (org.graalvm.compiler.core.common.LIRKind)6 RegisterValue (jdk.vm.ci.code.RegisterValue)5 Variable (org.graalvm.compiler.lir.Variable)5 AllocatableValue (jdk.vm.ci.meta.AllocatableValue)4 CallingConvention (jdk.vm.ci.code.CallingConvention)3 TargetDescription (jdk.vm.ci.code.TargetDescription)3 GraalHotSpotVMConfig (org.graalvm.compiler.hotspot.GraalHotSpotVMConfig)3 HotSpotForeignCallLinkageImpl (org.graalvm.compiler.hotspot.HotSpotForeignCallLinkageImpl)3 ValueUtil.asRegister (jdk.vm.ci.code.ValueUtil.asRegister)2 ValueUtil.isRegister (jdk.vm.ci.code.ValueUtil.isRegister)2 JavaConstant (jdk.vm.ci.meta.JavaConstant)2 Value (jdk.vm.ci.meta.Value)2 GraalCompilerTest (org.graalvm.compiler.core.test.GraalCompilerTest)2 NullCheckOp (org.graalvm.compiler.lir.sparc.SPARCMove.NullCheckOp)2 Test (org.junit.Test)2 StackSlot (jdk.vm.ci.code.StackSlot)1 ValueUtil.asAllocatableValue (jdk.vm.ci.code.ValueUtil.asAllocatableValue)1 ValueUtil.isAllocatableValue (jdk.vm.ci.code.ValueUtil.isAllocatableValue)1