Skip to content

Commit 05cb7f5

Browse files
authored
Remove test coverage of FeatureSIMD=0 (#66670)
* Remove coverge of FeatureSIMD=0 * Remove COMPlus_FeatureSIMD flag * Remove isSacalarIsa() condition * Remove the flag from other places of VM
1 parent a5ec8aa commit 05cb7f5

21 files changed

+67
-163
lines changed

src/coreclr/inc/clrconfigvalues.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,6 @@ RETAIL_CONFIG_DWORD_INFO(INTERNAL_JitVNMapSelBudget, W("JitVNMapSelBudget"), 100
348348
#else // !(defined(TARGET_AMD64) || defined(TARGET_X86) || defined(TARGET_ARM64))
349349
#define EXTERNAL_FeatureSIMD_Default 0
350350
#endif // !(defined(TARGET_AMD64) || defined(TARGET_X86) || defined(TARGET_ARM64))
351-
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_FeatureSIMD, W("FeatureSIMD"), EXTERNAL_FeatureSIMD_Default, "Enable SIMD intrinsics recognition in System.Numerics.dll and/or System.Numerics.Vectors.dll")
352351
RETAIL_CONFIG_DWORD_INFO(INTERNAL_SIMD16ByteOnly, W("SIMD16ByteOnly"), 0, "Limit maximum SIMD vector length to 16 bytes (used by x64_arm64_altjit)")
353352
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_TrackDynamicMethodDebugInfo, W("TrackDynamicMethodDebugInfo"), 0, "Specifies whether debug info should be generated and tracked for dynamic methods")
354353

src/coreclr/inc/corjitflags.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,7 @@ class CORJIT_FLAGS
5757
CORJIT_FLAG_ALT_JIT = 14, // JIT should consider itself an ALT_JIT
5858
CORJIT_FLAG_UNUSED8 = 15,
5959
CORJIT_FLAG_UNUSED9 = 16,
60-
61-
62-
#if defined(TARGET_X86) || defined(TARGET_AMD64) || defined(TARGET_ARM64)
63-
CORJIT_FLAG_FEATURE_SIMD = 17,
64-
#else
6560
CORJIT_FLAG_UNUSED10 = 17,
66-
#endif // !(defined(TARGET_X86) || defined(TARGET_AMD64) || defined(TARGET_ARM64))
6761

6862
CORJIT_FLAG_MAKEFINALCODE = 18, // Use the final code generator, i.e., not the interpreter.
6963
CORJIT_FLAG_READYTORUN = 19, // Use version-resilient code generation

src/coreclr/jit/compiler.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2666,12 +2666,6 @@ void Compiler::compInitOptions(JitFlags* jitFlags)
26662666
#endif // DEBUG
26672667

26682668
#ifdef FEATURE_SIMD
2669-
2670-
#ifndef TARGET_ARM64
2671-
// Minimum bar for availing SIMD benefits is SSE2 on AMD64/x86.
2672-
featureSIMD = jitFlags->IsSet(JitFlags::JIT_FLAG_FEATURE_SIMD);
2673-
#endif
2674-
26752669
setUsesSIMDTypes(false);
26762670
#endif // FEATURE_SIMD
26772671

src/coreclr/jit/compiler.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8878,23 +8878,6 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
88788878
}
88798879

88808880
#ifdef FEATURE_SIMD
8881-
8882-
#ifndef TARGET_ARM64
8883-
// Should we support SIMD intrinsics?
8884-
bool featureSIMD;
8885-
#endif
8886-
8887-
// Should we recognize SIMD types?
8888-
// We always do this on ARM64 to support HVA types.
8889-
bool supportSIMDTypes()
8890-
{
8891-
#ifdef TARGET_ARM64
8892-
return true;
8893-
#else
8894-
return featureSIMD;
8895-
#endif
8896-
}
8897-
88988881
// Have we identified any SIMD types?
88998882
// This is currently used by struct promotion to avoid getting type information for a struct
89008883
// field to see if it is a SIMD type, if we haven't seen any SIMD types or operations in

src/coreclr/jit/ee_il_dll.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ unsigned CILJit::getMaxIntrinsicSIMDVectorLength(CORJIT_FLAGS cpuCompileFlags)
332332

333333
#ifdef FEATURE_SIMD
334334
#if defined(TARGET_XARCH)
335-
if (!jitFlags.IsSet(JitFlags::JIT_FLAG_PREJIT) && jitFlags.IsSet(JitFlags::JIT_FLAG_FEATURE_SIMD) &&
335+
if (!jitFlags.IsSet(JitFlags::JIT_FLAG_PREJIT) &&
336336
jitFlags.GetInstructionSetFlags().HasInstructionSet(InstructionSet_AVX2))
337337
{
338338
if (GetJitTls() != nullptr && JitTls::GetCompiler() != nullptr)

src/coreclr/jit/hwintrinsic.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -574,12 +574,11 @@ GenTree* Compiler::addRangeCheckForHWIntrinsic(GenTree* immOp, int immLowerBound
574574
// true iff the given instruction set is enabled via configuration (environment variables, etc.).
575575
bool Compiler::compSupportsHWIntrinsic(CORINFO_InstructionSet isa)
576576
{
577-
return compHWIntrinsicDependsOn(isa) && (supportSIMDTypes() || HWIntrinsicInfo::isScalarIsa(isa)) &&
578-
(
577+
return compHWIntrinsicDependsOn(isa) && (
579578
#ifdef DEBUG
580-
JitConfig.EnableIncompleteISAClass() ||
579+
JitConfig.EnableIncompleteISAClass() ||
581580
#endif
582-
HWIntrinsicInfo::isFullyImplementedIsa(isa));
581+
HWIntrinsicInfo::isFullyImplementedIsa(isa));
583582
}
584583

585584
//------------------------------------------------------------------------
@@ -766,7 +765,7 @@ GenTree* Compiler::impHWIntrinsic(NamedIntrinsic intrinsic,
766765
var_types retType = JITtype2varType(sig->retType);
767766
CorInfoType simdBaseJitType = CORINFO_TYPE_UNDEF;
768767

769-
if ((retType == TYP_STRUCT) && supportSIMDTypes())
768+
if (retType == TYP_STRUCT)
770769
{
771770
unsigned int sizeBytes;
772771
simdBaseJitType = getBaseJitTypeAndSizeOfSIMDType(sig->retTypeSigClass, &sizeBytes);
@@ -805,7 +804,6 @@ GenTree* Compiler::impHWIntrinsic(NamedIntrinsic intrinsic,
805804
}
806805
else
807806
{
808-
assert(supportSIMDTypes());
809807
unsigned int sizeBytes;
810808

811809
simdBaseJitType = getBaseJitTypeAndSizeOfSIMDType(clsHnd, &sizeBytes);

src/coreclr/jit/hwintrinsicarm64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
325325
assert(category != HW_Category_Scalar);
326326
assert(!HWIntrinsicInfo::isScalarIsa(HWIntrinsicInfo::lookupIsa(intrinsic)));
327327

328-
if (!supportSIMDTypes() || !IsBaselineSimdIsaSupported())
328+
if (!IsBaselineSimdIsaSupported())
329329
{
330330
return nullptr;
331331
}

src/coreclr/jit/hwintrinsicxarch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ GenTree* Compiler::impBaseIntrinsic(NamedIntrinsic intrinsic,
537537
GenTree* op3 = nullptr;
538538
GenTree* op4 = nullptr;
539539

540-
if (!featureSIMD || !IsBaselineSimdIsaSupported())
540+
if (!IsBaselineSimdIsaSupported())
541541
{
542542
return nullptr;
543543
}

src/coreclr/jit/importer.cpp

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,30 +1709,27 @@ var_types Compiler::impNormStructType(CORINFO_CLASS_HANDLE structHnd, CorInfoTyp
17091709
var_types structType = TYP_STRUCT;
17101710

17111711
#ifdef FEATURE_SIMD
1712-
if (supportSIMDTypes())
1712+
const DWORD structFlags = info.compCompHnd->getClassAttribs(structHnd);
1713+
1714+
// Don't bother if the struct contains GC references of byrefs, it can't be a SIMD type.
1715+
if ((structFlags & (CORINFO_FLG_CONTAINS_GC_PTR | CORINFO_FLG_BYREF_LIKE)) == 0)
17131716
{
1714-
const DWORD structFlags = info.compCompHnd->getClassAttribs(structHnd);
1717+
unsigned originalSize = info.compCompHnd->getClassSize(structHnd);
17151718

1716-
// Don't bother if the struct contains GC references of byrefs, it can't be a SIMD type.
1717-
if ((structFlags & (CORINFO_FLG_CONTAINS_GC_PTR | CORINFO_FLG_BYREF_LIKE)) == 0)
1719+
if (structSizeMightRepresentSIMDType(originalSize))
17181720
{
1719-
unsigned originalSize = info.compCompHnd->getClassSize(structHnd);
1720-
1721-
if (structSizeMightRepresentSIMDType(originalSize))
1721+
unsigned int sizeBytes;
1722+
CorInfoType simdBaseJitType = getBaseJitTypeAndSizeOfSIMDType(structHnd, &sizeBytes);
1723+
if (simdBaseJitType != CORINFO_TYPE_UNDEF)
17221724
{
1723-
unsigned int sizeBytes;
1724-
CorInfoType simdBaseJitType = getBaseJitTypeAndSizeOfSIMDType(structHnd, &sizeBytes);
1725-
if (simdBaseJitType != CORINFO_TYPE_UNDEF)
1725+
assert(sizeBytes == originalSize);
1726+
structType = getSIMDTypeForSize(sizeBytes);
1727+
if (pSimdBaseJitType != nullptr)
17261728
{
1727-
assert(sizeBytes == originalSize);
1728-
structType = getSIMDTypeForSize(sizeBytes);
1729-
if (pSimdBaseJitType != nullptr)
1730-
{
1731-
*pSimdBaseJitType = simdBaseJitType;
1732-
}
1733-
// Also indicate that we use floating point registers.
1734-
compFloatingPointUsed = true;
1729+
*pSimdBaseJitType = simdBaseJitType;
17351730
}
1731+
// Also indicate that we use floating point registers.
1732+
compFloatingPointUsed = true;
17361733
}
17371734
}
17381735
}
@@ -4439,7 +4436,7 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis,
44394436
case NI_System_Math_FusedMultiplyAdd:
44404437
{
44414438
#ifdef TARGET_XARCH
4442-
if (compExactlyDependsOn(InstructionSet_FMA) && supportSIMDTypes())
4439+
if (compExactlyDependsOn(InstructionSet_FMA))
44434440
{
44444441
assert(varTypeIsFloating(callType));
44454442

@@ -8916,14 +8913,11 @@ var_types Compiler::impImportCall(OPCODE opcode,
89168913
}
89178914

89188915
#ifdef FEATURE_SIMD
8919-
if (supportSIMDTypes())
8916+
call = impSIMDIntrinsic(opcode, newobjThis, clsHnd, methHnd, sig, mflags, pResolvedToken->token);
8917+
if (call != nullptr)
89208918
{
8921-
call = impSIMDIntrinsic(opcode, newobjThis, clsHnd, methHnd, sig, mflags, pResolvedToken->token);
8922-
if (call != nullptr)
8923-
{
8924-
bIntrinsicImported = true;
8925-
goto DONE_CALL;
8926-
}
8919+
bIntrinsicImported = true;
8920+
goto DONE_CALL;
89278921
}
89288922
#endif // FEATURE_SIMD
89298923

@@ -19951,7 +19945,7 @@ void Compiler::impInlineInitVars(InlineInfo* pInlineInfo)
1995119945
if ((!foundSIMDType || (type == TYP_STRUCT)) && isSIMDorHWSIMDClass(&(lclVarInfo[i + argCnt].lclVerTypeInfo)))
1995219946
{
1995319947
foundSIMDType = true;
19954-
if (supportSIMDTypes() && type == TYP_STRUCT)
19948+
if (type == TYP_STRUCT)
1995519949
{
1995619950
var_types structType = impNormStructType(lclVarInfo[i + argCnt].lclVerTypeInfo.GetClassHandle());
1995719951
lclVarInfo[i + argCnt].lclTypeInfo = structType;

src/coreclr/jit/jitee.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,6 @@ class JitFlags
187187
#endif
188188

189189
FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_ALT_JIT, JIT_FLAG_ALT_JIT);
190-
191-
#if defined(TARGET_X86) || defined(TARGET_AMD64) || defined(TARGET_ARM64)
192-
193-
FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_FEATURE_SIMD, JIT_FLAG_FEATURE_SIMD);
194-
195-
#endif
196-
197190
FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_MAKEFINALCODE, JIT_FLAG_MAKEFINALCODE);
198191
FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_READYTORUN, JIT_FLAG_READYTORUN);
199192
FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_PROF_ENTERLEAVE, JIT_FLAG_PROF_ENTERLEAVE);

0 commit comments

Comments
 (0)