Search in sources :

Example 11 with PlatformKind

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

the class SPARCLIRGenerator method emitNullCheck.

@Override
public void emitNullCheck(Value address, LIRFrameState state) {
    PlatformKind kind = address.getPlatformKind();
    assert kind == XWORD : address + " - " + kind + " not an object!";
    append(new NullCheckOp(asAddressValue(address), state));
}
Also used : NullCheckOp(org.graalvm.compiler.lir.sparc.SPARCMove.NullCheckOp) PlatformKind(jdk.vm.ci.meta.PlatformKind)

Example 12 with PlatformKind

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

the class AMD64HotSpotForeignCallsProvider 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()
    // in templateInterpreter_x86_64.cpp around line 1923
    RegisterValue exception = rax.asValue(LIRKind.reference(word));
    RegisterValue exceptionPc = rdx.asValue(LIRKind.value(word));
    CallingConvention exceptionCc = new CallingConvention(0, ILLEGAL, exception, exceptionPc);
    register(new HotSpotForeignCallLinkageImpl(EXCEPTION_HANDLER, 0L, PRESERVES_REGISTERS, LEAF_NOFP, exceptionCc, null, NOT_REEXECUTABLE, any()));
    register(new HotSpotForeignCallLinkageImpl(EXCEPTION_HANDLER_IN_CALLER, JUMP_ADDRESS, PRESERVES_REGISTERS, LEAF_NOFP, exceptionCc, null, NOT_REEXECUTABLE, any()));
    link(new AMD64MathStub(ARITHMETIC_LOG_STUB, options, providers, registerStubCall(ARITHMETIC_LOG_STUB, REEXECUTABLE, LEAF, NO_LOCATIONS)));
    link(new AMD64MathStub(ARITHMETIC_LOG10_STUB, options, providers, registerStubCall(ARITHMETIC_LOG10_STUB, REEXECUTABLE, LEAF, NO_LOCATIONS)));
    link(new AMD64MathStub(ARITHMETIC_SIN_STUB, options, providers, registerStubCall(ARITHMETIC_SIN_STUB, REEXECUTABLE, LEAF, NO_LOCATIONS)));
    link(new AMD64MathStub(ARITHMETIC_COS_STUB, options, providers, registerStubCall(ARITHMETIC_COS_STUB, REEXECUTABLE, LEAF, NO_LOCATIONS)));
    link(new AMD64MathStub(ARITHMETIC_TAN_STUB, options, providers, registerStubCall(ARITHMETIC_TAN_STUB, REEXECUTABLE, LEAF, NO_LOCATIONS)));
    link(new AMD64MathStub(ARITHMETIC_EXP_STUB, options, providers, registerStubCall(ARITHMETIC_EXP_STUB, REEXECUTABLE, LEAF, NO_LOCATIONS)));
    link(new AMD64MathStub(ARITHMETIC_POW_STUB, options, providers, registerStubCall(ARITHMETIC_POW_STUB, REEXECUTABLE, LEAF, NO_LOCATIONS)));
    if (config.useCRC32Intrinsics) {
        // This stub does callee saving
        registerForeignCall(UPDATE_BYTES_CRC32, config.updateBytesCRC32Stub, NativeCall, PRESERVES_REGISTERS, LEAF_NOFP, NOT_REEXECUTABLE, any());
    }
    if (config.useCRC32CIntrinsics) {
        registerForeignCall(UPDATE_BYTES_CRC32C, config.updateBytesCRC32C, NativeCall, PRESERVES_REGISTERS, LEAF_NOFP, 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 13 with PlatformKind

use of jdk.vm.ci.meta.PlatformKind 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 14 with PlatformKind

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

the class LIRKind method verifyMoveKinds.

public static boolean verifyMoveKinds(ValueKind<?> dst, ValueKind<?> src, RegisterAllocationConfig config) {
    if (src.equals(dst)) {
        return true;
    }
    if (isUnknownReference(dst) || isValue(dst) && isValue(src)) {
        PlatformKind srcPlatformKind = src.getPlatformKind();
        PlatformKind dstPlatformKind = dst.getPlatformKind();
        if (srcPlatformKind.equals(dstPlatformKind)) {
            return true;
        }
        // if the register category matches it should be fine, although the kind is different
        return config.getRegisterCategory(srcPlatformKind).equals(config.getRegisterCategory(dstPlatformKind));
    }
    // reference information mismatch
    return false;
}
Also used : PlatformKind(jdk.vm.ci.meta.PlatformKind)

Example 15 with PlatformKind

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

the class SPARCArithmeticLIRGenerator method emitMul.

@Override
public Variable emitMul(Value a, Value b, boolean setFlags) {
    LIRKind resultKind = LIRKind.combine(a, b);
    PlatformKind aKind = a.getPlatformKind();
    if (isNumericInteger(aKind)) {
        if (setFlags) {
            Variable result = getLIRGen().newVariable(LIRKind.combine(a, b));
            if (aKind == XWORD) {
                getLIRGen().append(new SPARCLMulccOp(result, getLIRGen().load(a), getLIRGen().load(b), getLIRGen()));
            } else if (aKind == WORD) {
                getLIRGen().append(new SPARCIMulccOp(result, getLIRGen().load(a), getLIRGen().load(b)));
            } else {
                throw GraalError.shouldNotReachHere();
            }
            return result;
        } else {
            return emitBinary(resultKind, Op3s.Mulx, a, b);
        }
    } else {
        boolean isDouble = a.getPlatformKind().equals(DOUBLE);
        return emitBinary(resultKind, isDouble ? Fmuld : Fmuls, a, b);
    }
}
Also used : Variable(org.graalvm.compiler.lir.Variable) LIRKind(org.graalvm.compiler.core.common.LIRKind) PlatformKind(jdk.vm.ci.meta.PlatformKind) SPARCIMulccOp(org.graalvm.compiler.lir.sparc.SPARCArithmetic.SPARCIMulccOp) SPARCLMulccOp(org.graalvm.compiler.lir.sparc.SPARCArithmetic.SPARCLMulccOp)

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