Skip to content

Commit aaafed2

Browse files
Ensure that MultiplyAddEstimate exits for cases where GT_MUL is unsupported (#109842)
1 parent 360615c commit aaafed2

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

src/coreclr/jit/hwintrinsicxarch.cpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3233,6 +3233,38 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
32333233
break;
32343234
}
32353235

3236+
if ((simdSize == 32) && !varTypeIsFloating(simdBaseType) &&
3237+
!compOpportunisticallyDependsOn(InstructionSet_AVX2))
3238+
{
3239+
// We can't deal with TYP_SIMD32 for integral types if the compiler doesn't support AVX2
3240+
break;
3241+
}
3242+
3243+
assert(simdSize != 64 || IsBaselineVector512IsaSupportedDebugOnly());
3244+
3245+
if (varTypeIsLong(simdBaseType))
3246+
{
3247+
if (TARGET_POINTER_SIZE == 4)
3248+
{
3249+
// TODO-XARCH-CQ: 32bit support
3250+
break;
3251+
}
3252+
3253+
if ((simdSize == 32) && compOpportunisticallyDependsOn(InstructionSet_AVX2))
3254+
{
3255+
// Emulate NI_AVX512DQ_VL_MultiplyLow with AVX2 for SIMD32
3256+
}
3257+
else if ((simdSize == 16) && compOpportunisticallyDependsOn(InstructionSet_SSE41))
3258+
{
3259+
// Emulate NI_AVX512DQ_VL_MultiplyLow with SSE41 for SIMD16
3260+
}
3261+
else
3262+
{
3263+
// Software fallback
3264+
break;
3265+
}
3266+
}
3267+
32363268
op3 = impSIMDPopStack();
32373269
op2 = impSIMDPopStack();
32383270
op1 = impSIMDPopStack();

0 commit comments

Comments
 (0)