Skip to content

Remove InstructionSet_VectorT256 if AVX2 is disabled via env var #89413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 25, 2023
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
15 changes: 14 additions & 1 deletion src/coreclr/vm/codeman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,6 @@ void EEJitManager::SetCpuInfo()
if (((cpuFeatures & XArchIntrinsicConstants_VectorT256) != 0) && ((maxVectorTBitWidth == 0) || (maxVectorTBitWidth >= 256)))
{
// We allow 256-bit Vector<T> by default
CPUCompileFlags.Clear(InstructionSet_VectorT128);
CPUCompileFlags.Set(InstructionSet_VectorT256);
}

Expand Down Expand Up @@ -1541,6 +1540,20 @@ void EEJitManager::SetCpuInfo()
CPUCompileFlags.EnsureValidInstructionSetSupport();

#if defined(TARGET_X86) || defined(TARGET_AMD64)

// Clean up mutually exclusive ISAs
if (CPUCompileFlags.IsSet(InstructionSet_VectorT512))
{
// We don't currently support InstructionSet_VectorT512, but just to
// make it future proof.
CPUCompileFlags.Clear(InstructionSet_VectorT256);
CPUCompileFlags.Clear(InstructionSet_VectorT128);
}
else if (CPUCompileFlags.IsSet(InstructionSet_VectorT256))
{
CPUCompileFlags.Clear(InstructionSet_VectorT128);
}

int cpuidInfo[4];

const int CPUID_EAX = 0;
Expand Down