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));
}
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);
}
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);
}
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;
}
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);
}
}
Aggregations