@@ -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;
0 commit comments