Search in sources :

Example 26 with RegisterValue

use of jdk.vm.ci.code.RegisterValue in project graal by oracle.

the class AMD64LIRGenerator method emitArrayCompareTo.

@Override
public Variable emitArrayCompareTo(JavaKind kind1, JavaKind kind2, Value array1, Value array2, Value length1, Value length2) {
    LIRKind resultKind = LIRKind.value(AMD64Kind.DWORD);
    RegisterValue raxRes = AMD64.rax.asValue(resultKind);
    RegisterValue cnt1 = AMD64.rcx.asValue(length1.getValueKind());
    RegisterValue cnt2 = AMD64.rdx.asValue(length2.getValueKind());
    emitMove(cnt1, length1);
    emitMove(cnt2, length2);
    append(new AMD64ArrayCompareToOp(this, kind1, kind2, raxRes, array1, array2, cnt1, cnt2));
    Variable result = newVariable(resultKind);
    emitMove(result, raxRes);
    return result;
}
Also used : RegisterValue(jdk.vm.ci.code.RegisterValue) Variable(org.graalvm.compiler.lir.Variable) LIRKind(org.graalvm.compiler.core.common.LIRKind) AMD64ArrayCompareToOp(org.graalvm.compiler.lir.amd64.AMD64ArrayCompareToOp)

Example 27 with RegisterValue

use of jdk.vm.ci.code.RegisterValue in project graal by oracle.

the class AMD64LIRGenerator method emitStringIndexOf.

@Override
public Variable emitStringIndexOf(Value source, Value sourceCount, Value target, Value targetCount, int constantTargetCount) {
    Variable result = newVariable(LIRKind.value(AMD64Kind.DWORD));
    RegisterValue cnt1 = AMD64.rdx.asValue(sourceCount.getValueKind());
    emitMove(cnt1, sourceCount);
    RegisterValue cnt2 = AMD64.rax.asValue(targetCount.getValueKind());
    emitMove(cnt2, targetCount);
    append(new AMD64StringIndexOfOp(this, result, source, target, cnt1, cnt2, AMD64.rcx.asValue(), AMD64.xmm0.asValue(), constantTargetCount, getVMPageSize()));
    return result;
}
Also used : RegisterValue(jdk.vm.ci.code.RegisterValue) Variable(org.graalvm.compiler.lir.Variable) AMD64StringIndexOfOp(org.graalvm.compiler.lir.amd64.AMD64StringIndexOfOp)

Example 28 with RegisterValue

use of jdk.vm.ci.code.RegisterValue in project graal by oracle.

the class AMD64LIRGenerator method emitCompareAndSwapBranch.

public void emitCompareAndSwapBranch(ValueKind<?> kind, AMD64AddressValue address, Value expectedValue, Value newValue, Condition condition, LabelRef trueLabel, LabelRef falseLabel, double trueLabelProbability) {
    assert kind.equals(expectedValue.getValueKind());
    assert kind.equals(newValue.getValueKind());
    assert condition == Condition.EQ || condition == Condition.NE;
    AMD64Kind memKind = (AMD64Kind) kind.getPlatformKind();
    RegisterValue raxValue = AMD64.rax.asValue(kind);
    emitMove(raxValue, expectedValue);
    append(new CompareAndSwapOp(memKind, raxValue, address, raxValue, asAllocatable(newValue)));
    append(new BranchOp(condition, trueLabel, falseLabel, trueLabelProbability));
}
Also used : RegisterValue(jdk.vm.ci.code.RegisterValue) AMD64Kind(jdk.vm.ci.amd64.AMD64Kind) BranchOp(org.graalvm.compiler.lir.amd64.AMD64ControlFlow.BranchOp) FloatBranchOp(org.graalvm.compiler.lir.amd64.AMD64ControlFlow.FloatBranchOp) CompareAndSwapOp(org.graalvm.compiler.lir.amd64.AMD64Move.CompareAndSwapOp)

Example 29 with RegisterValue

use of jdk.vm.ci.code.RegisterValue in project graal by oracle.

the class AMD64LIRGenerator method emitValueCompareAndSwap.

@Override
public Value emitValueCompareAndSwap(Value address, Value expectedValue, Value newValue) {
    ValueKind<?> kind = newValue.getValueKind();
    assert kind.equals(expectedValue.getValueKind());
    AMD64Kind memKind = (AMD64Kind) kind.getPlatformKind();
    AMD64AddressValue addressValue = asAddressValue(address);
    RegisterValue raxRes = AMD64.rax.asValue(kind);
    emitMove(raxRes, expectedValue);
    append(new CompareAndSwapOp(memKind, raxRes, addressValue, raxRes, asAllocatable(newValue)));
    Variable result = newVariable(kind);
    emitMove(result, raxRes);
    return result;
}
Also used : AMD64AddressValue(org.graalvm.compiler.lir.amd64.AMD64AddressValue) RegisterValue(jdk.vm.ci.code.RegisterValue) AMD64Kind(jdk.vm.ci.amd64.AMD64Kind) Variable(org.graalvm.compiler.lir.Variable) CompareAndSwapOp(org.graalvm.compiler.lir.amd64.AMD64Move.CompareAndSwapOp)

Example 30 with RegisterValue

use of jdk.vm.ci.code.RegisterValue in project graal by oracle.

the class ReadRegisterFixedNode method generate.

@Override
public void generate(NodeLIRBuilderTool gen) {
    LIRGeneratorTool tool = gen.getLIRGeneratorTool();
    SubstrateRegisterConfig registerConfig = (SubstrateRegisterConfig) tool.getRegisterConfig();
    LIRKind lirKind = tool.getLIRKind(FrameAccess.getWordStamp());
    RegisterValue value = registerSupplier.apply(registerConfig).asValue(lirKind);
    gen.setResult(this, tool.emitMove(value));
}
Also used : RegisterValue(jdk.vm.ci.code.RegisterValue) LIRKind(org.graalvm.compiler.core.common.LIRKind) SubstrateRegisterConfig(com.oracle.svm.core.graal.meta.SubstrateRegisterConfig) LIRGeneratorTool(org.graalvm.compiler.lir.gen.LIRGeneratorTool)

Aggregations

RegisterValue (jdk.vm.ci.code.RegisterValue)30 CallingConvention (jdk.vm.ci.code.CallingConvention)9 Variable (org.graalvm.compiler.lir.Variable)9 LIRKind (org.graalvm.compiler.core.common.LIRKind)8 Register (jdk.vm.ci.code.Register)7 ForeignCallLinkage (org.graalvm.compiler.core.common.spi.ForeignCallLinkage)6 PlatformKind (jdk.vm.ci.meta.PlatformKind)4 LIRGeneratorTool (org.graalvm.compiler.lir.gen.LIRGeneratorTool)4 AMD64Kind (jdk.vm.ci.amd64.AMD64Kind)3 TargetDescription (jdk.vm.ci.code.TargetDescription)3 AllocatableValue (jdk.vm.ci.meta.AllocatableValue)3 GraalHotSpotVMConfig (org.graalvm.compiler.hotspot.GraalHotSpotVMConfig)3 HotSpotForeignCallLinkage (org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage)3 HotSpotForeignCallLinkageImpl (org.graalvm.compiler.hotspot.HotSpotForeignCallLinkageImpl)3 AMD64AddressValue (org.graalvm.compiler.lir.amd64.AMD64AddressValue)3 CompareAndSwapOp (org.graalvm.compiler.lir.amd64.AMD64Move.CompareAndSwapOp)3 SubstrateRegisterConfig (com.oracle.svm.core.graal.meta.SubstrateRegisterConfig)2 ValueUtil.asRegisterValue (jdk.vm.ci.code.ValueUtil.asRegisterValue)2 TraceUtil.asShadowedRegisterValue (org.graalvm.compiler.lir.alloc.trace.TraceUtil.asShadowedRegisterValue)2 TraceUtil.isShadowedRegisterValue (org.graalvm.compiler.lir.alloc.trace.TraceUtil.isShadowedRegisterValue)2