Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion src/coreclr/vm/codeman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1539,7 +1539,15 @@ void EEJitManager::SetCpuInfo()

// x86-64-v3

if (((cpuFeatures & XArchIntrinsicConstants_Avx) != 0) && CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_EnableAVX))
bool enableAVX = ((cpuFeatures & XArchIntrinsicConstants_Avx) != 0) && CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_EnableAVX);

#if defined(FEATURE_INTERPRETER)
// The interpreter only supports 128-bit vectors, so don't enable AVX. The ISA
// dependency normalization below then removes the dependent AVX2/AVX512.
enableAVX = enableAVX && !interpreterOnly;
#endif
Comment thread
kotlarmilos marked this conversation as resolved.

if (enableAVX)
{
CPUCompileFlags.Set(InstructionSet_AVX);
}
Expand Down Expand Up @@ -1883,6 +1891,15 @@ void EEJitManager::SetCpuInfo()
preferredVectorBitWidth = 256;
}

#if defined(FEATURE_INTERPRETER)
if (interpreterOnly && (preferredVectorBitWidth > 128))
{
// Limit the preferred vector width so the Vector256/Vector512 marker ISAs
// set below are not reported after AVX was left disabled above.
preferredVectorBitWidth = 128;
}
#endif

if (preferredVectorBitWidth >= 512)
{
CPUCompileFlags.Set(InstructionSet_Vector512);
Expand Down