Skip to content
Open
5 changes: 4 additions & 1 deletion src/coreclr/tools/Common/InstructionSetHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ public static InstructionSetSupport ConfigureInstructionSetSupport(string instru

if ((targetArchitecture == TargetArchitecture.X86) || (targetArchitecture == TargetArchitecture.X64))
{
if (isReadyToRun && targetOS != TargetOS.OSX && targetOS != TargetOS.MacCatalyst)
bool isAppleOS = targetOS is TargetOS.OSX or TargetOS.MacCatalyst
Comment thread
BrzVlad marked this conversation as resolved.
or TargetOS.iOSSimulator or TargetOS.tvOSSimulator;

if (isReadyToRun && !isAppleOS)
{
// ReadyToRun can presume AVX2, BMI1, BMI2, F16C, FMA, LZCNT, and MOVBE
instructionSetSupportBuilder.AddSupportedInstructionSet("x86-64-v3");
Expand Down
8 changes: 8 additions & 0 deletions src/coreclr/vm/ceeload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3583,6 +3583,14 @@ void Module::RunEagerFixupsUnlocked()
{
_ASSERTE(IsReadyToRun());
GetReadyToRunInfo()->DisableAllR2RCode();

#ifndef FEATURE_DYNAMIC_CODE_COMPILED
if (GetReadyToRunInfo()->IsStrippedILBodies())
{
EEPOLICY_HANDLE_FATAL_ERROR_WITH_MESSAGE(COR_E_EXECUTIONENGINE,
W("ReadyToRun code was disabled by a failed eager fixup, but the image has stripped IL bodies and this runtime has no JIT fallback."));
}
#endif // !FEATURE_DYNAMIC_CODE_COMPILED
}
else
{
Expand Down
15 changes: 6 additions & 9 deletions src/coreclr/vm/codeman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,12 @@ void EEJitManager::SetCpuInfo()
uint32_t maxVectorTBitWidth = (CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_MaxVectorTBitWidth) / 128) * 128;

#if defined(FEATURE_INTERPRETER)
if (maxVectorTBitWidth != 128 && CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_InterpMode) == 3)
#if defined(FEATURE_DYNAMIC_CODE_COMPILED)
bool interpreterOnly = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_InterpMode) == 3;
#else
bool interpreterOnly = true;
#endif
if (maxVectorTBitWidth != 128 && interpreterOnly)
{
// Disable larger Vector<T> sizes when interpreter is enabled
maxVectorTBitWidth = 128;
Expand Down Expand Up @@ -1701,14 +1706,6 @@ void EEJitManager::SetCpuInfo()

uint32_t preferredVectorBitWidth = (CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_PreferredVectorBitWidth) / 128) * 128;

#ifdef FEATURE_INTERPRETER
if (CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_InterpMode) == 3)
{
// Disable larger Vector<T> sizes when interpreter is enabled, and not compiling S.P.Corelib
preferredVectorBitWidth = 128;
}
#endif

if ((preferredVectorBitWidth == 0) && throttleVector512)
{
preferredVectorBitWidth = 256;
Expand Down
6 changes: 6 additions & 0 deletions src/coreclr/vm/readytoruninfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,12 @@ class ReadyToRunInfo
return m_pHeader->CoreHeader.Flags & READYTORUN_FLAG_PARTIAL;
}

BOOL IsStrippedILBodies()
{
LIMITED_METHOD_CONTRACT;
return m_pHeader->CoreHeader.Flags & READYTORUN_FLAG_STRIPPED_IL_BODIES;
}
Comment thread
kotlarmilos marked this conversation as resolved.

void DisableAllR2RCode()
{
LIMITED_METHOD_CONTRACT;
Expand Down
Loading