Search in sources :

Example 21 with RegisterValue

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

the class AMD64HotSpotLIRGenerator method moveValueToThread.

private void moveValueToThread(Value v, int offset) {
    LIRKind wordKind = LIRKind.value(target().arch.getWordKind());
    RegisterValue thread = getProviders().getRegisters().getThreadRegister().asValue(wordKind);
    AMD64AddressValue address = new AMD64AddressValue(wordKind, thread, offset);
    arithmeticLIRGen.emitStore(v.getValueKind(), address, v, null);
}
Also used : AMD64AddressValue(org.graalvm.compiler.lir.amd64.AMD64AddressValue) RegisterValue(jdk.vm.ci.code.RegisterValue) LIRKind(org.graalvm.compiler.core.common.LIRKind)

Example 22 with RegisterValue

use of jdk.vm.ci.code.RegisterValue 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 23 with RegisterValue

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

the class AArch64HotSpotLIRGenerator method emitUnwind.

@Override
public void emitUnwind(Value exception) {
    ForeignCallLinkage linkage = getForeignCalls().lookupForeignCall(HotSpotBackend.UNWIND_EXCEPTION_TO_CALLER);
    CallingConvention outgoingCc = linkage.getOutgoingCallingConvention();
    assert outgoingCc.getArgumentCount() == 2;
    RegisterValue exceptionParameter = (RegisterValue) outgoingCc.getArgument(0);
    emitMove(exceptionParameter, exception);
    append(new AArch64HotSpotUnwindOp(config, exceptionParameter));
}
Also used : CallingConvention(jdk.vm.ci.code.CallingConvention) RegisterValue(jdk.vm.ci.code.RegisterValue) ForeignCallLinkage(org.graalvm.compiler.core.common.spi.ForeignCallLinkage) HotSpotForeignCallLinkage(org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage)

Example 24 with RegisterValue

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

the class AArch64HotSpotForeignCallsProvider method initialize.

@Override
public void initialize(HotSpotProviders providers, OptionValues options) {
    GraalHotSpotVMConfig config = runtime.getVMConfig();
    TargetDescription target = providers.getCodeCache().getTarget();
    PlatformKind word = target.arch.getWordKind();
    // The calling convention for the exception handler stub is (only?) defined in
    // TemplateInterpreterGenerator::generate_throw_exception()
    RegisterValue exception = r0.asValue(LIRKind.reference(word));
    RegisterValue exceptionPc = r3.asValue(LIRKind.value(word));
    CallingConvention exceptionCc = new CallingConvention(0, ILLEGAL, exception, exceptionPc);
    register(new HotSpotForeignCallLinkageImpl(HotSpotBackend.EXCEPTION_HANDLER, 0L, PRESERVES_REGISTERS, LEAF, exceptionCc, null, NOT_REEXECUTABLE, any()));
    register(new HotSpotForeignCallLinkageImpl(HotSpotBackend.EXCEPTION_HANDLER_IN_CALLER, JUMP_ADDRESS, PRESERVES_REGISTERS, LEAF, exceptionCc, null, NOT_REEXECUTABLE, any()));
    // These stubs do callee saving
    if (config.useCRC32Intrinsics) {
        registerForeignCall(UPDATE_BYTES_CRC32, config.updateBytesCRC32Stub, NativeCall, PRESERVES_REGISTERS, LEAF, NOT_REEXECUTABLE, any());
    }
    if (config.useCRC32CIntrinsics) {
        registerForeignCall(UPDATE_BYTES_CRC32C, config.updateBytesCRC32C, NativeCall, PRESERVES_REGISTERS, LEAF, NOT_REEXECUTABLE, any());
    }
    super.initialize(providers, options);
}
Also used : CallingConvention(jdk.vm.ci.code.CallingConvention) RegisterValue(jdk.vm.ci.code.RegisterValue) HotSpotForeignCallLinkageImpl(org.graalvm.compiler.hotspot.HotSpotForeignCallLinkageImpl) TargetDescription(jdk.vm.ci.code.TargetDescription) PlatformKind(jdk.vm.ci.meta.PlatformKind) GraalHotSpotVMConfig(org.graalvm.compiler.hotspot.GraalHotSpotVMConfig)

Example 25 with RegisterValue

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

the class AMD64ArithmeticLIRGenerator method emitDIV.

private AMD64MulDivOp emitDIV(OperandSize size, Value a, Value b, LIRFrameState state) {
    LIRKind kind = LIRKind.combine(a, b);
    RegisterValue rax = moveToReg(AMD64.rax, a);
    RegisterValue rdx = AMD64.rdx.asValue(kind);
    getLIRGen().append(new AMD64ClearRegisterOp(size, rdx));
    return getLIRGen().append(new AMD64MulDivOp(AMD64MOp.DIV, size, kind, rdx, rax, getLIRGen().asAllocatable(b), state));
}
Also used : RegisterValue(jdk.vm.ci.code.RegisterValue) AMD64MulDivOp(org.graalvm.compiler.lir.amd64.AMD64MulDivOp) LIRKind(org.graalvm.compiler.core.common.LIRKind) AMD64ClearRegisterOp(org.graalvm.compiler.lir.amd64.AMD64ClearRegisterOp)

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