@@ -747,10 +747,11 @@ GenTree* Compiler::impHWIntrinsic(NamedIntrinsic intrinsic,
747
747
CORINFO_SIG_INFO* sig,
748
748
bool mustExpand)
749
749
{
750
- HWIntrinsicCategory category = HWIntrinsicInfo::lookupCategory (intrinsic);
751
- int numArgs = sig->numArgs ;
752
- var_types retType = JITtype2varType (sig->retType );
753
- CorInfoType simdBaseJitType = CORINFO_TYPE_UNDEF;
750
+ HWIntrinsicCategory category = HWIntrinsicInfo::lookupCategory (intrinsic);
751
+ CORINFO_InstructionSet isa = HWIntrinsicInfo::lookupIsa (intrinsic);
752
+ int numArgs = sig->numArgs ;
753
+ var_types retType = JITtype2varType (sig->retType );
754
+ CorInfoType simdBaseJitType = CORINFO_TYPE_UNDEF;
754
755
755
756
if ((retType == TYP_STRUCT) && featureSIMD)
756
757
{
@@ -771,20 +772,27 @@ GenTree* Compiler::impHWIntrinsic(NamedIntrinsic intrinsic,
771
772
772
773
if (simdBaseJitType == CORINFO_TYPE_UNDEF)
773
774
{
774
- if (category != HW_Category_Scalar)
775
+ if (( category == HW_Category_Scalar) || HWIntrinsicInfo::isScalarIsa (isa) )
775
776
{
776
- unsigned int sizeBytes;
777
- simdBaseJitType = getBaseJitTypeAndSizeOfSIMDType (clsHnd, &sizeBytes);
778
- assert ((category == HW_Category_Special) || (category == HW_Category_Helper) || (sizeBytes != 0 ));
777
+ simdBaseJitType = sig->retType ;
778
+
779
+ if (simdBaseJitType == CORINFO_TYPE_VOID)
780
+ {
781
+ simdBaseJitType = CORINFO_TYPE_UNDEF;
782
+ }
779
783
}
780
784
else
781
785
{
782
- simdBaseJitType = sig->retType ;
786
+ assert (featureSIMD);
787
+ unsigned int sizeBytes;
788
+
789
+ simdBaseJitType = getBaseJitTypeAndSizeOfSIMDType (clsHnd, &sizeBytes);
790
+ assert ((category == HW_Category_Special) || (category == HW_Category_Helper) || (sizeBytes != 0 ));
783
791
}
784
792
}
785
793
786
794
// Immediately return if the category is other than scalar/special and this is not a supported base type.
787
- if ((category != HW_Category_Special) && (category != HW_Category_Scalar) &&
795
+ if ((category != HW_Category_Special) && (category != HW_Category_Scalar) && ! HWIntrinsicInfo::isScalarIsa (isa) &&
788
796
!isSupportedBaseType (intrinsic, simdBaseJitType))
789
797
{
790
798
return nullptr ;
0 commit comments