Skip to content

Commit d1fc57e

Browse files
authored
Remove InstructionSet_VectorT256 if AVX2 is disabled via env var
1 parent d347315 commit d1fc57e

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/coreclr/vm/codeman.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,6 @@ void EEJitManager::SetCpuInfo()
12991299
if (((cpuFeatures & XArchIntrinsicConstants_VectorT256) != 0) && ((maxVectorTBitWidth == 0) || (maxVectorTBitWidth >= 256)))
13001300
{
13011301
// We allow 256-bit Vector<T> by default
1302-
CPUCompileFlags.Clear(InstructionSet_VectorT128);
13031302
CPUCompileFlags.Set(InstructionSet_VectorT256);
13041303
}
13051304

@@ -1541,6 +1540,20 @@ void EEJitManager::SetCpuInfo()
15411540
CPUCompileFlags.EnsureValidInstructionSetSupport();
15421541

15431542
#if defined(TARGET_X86) || defined(TARGET_AMD64)
1543+
1544+
// Clean up mutually exclusive ISAs
1545+
if (CPUCompileFlags.IsSet(InstructionSet_VectorT512))
1546+
{
1547+
// We don't currently support InstructionSet_VectorT512, but just to
1548+
// make it future proof.
1549+
CPUCompileFlags.Clear(InstructionSet_VectorT256);
1550+
CPUCompileFlags.Clear(InstructionSet_VectorT128);
1551+
}
1552+
else if (CPUCompileFlags.IsSet(InstructionSet_VectorT256))
1553+
{
1554+
CPUCompileFlags.Clear(InstructionSet_VectorT128);
1555+
}
1556+
15441557
int cpuidInfo[4];
15451558

15461559
const int CPUID_EAX = 0;

0 commit comments

Comments
 (0)