Skip to content

Commit

Permalink
Ensure that MultiplyAddEstimate exits for cases where GT_MUL is unsup…
Browse files Browse the repository at this point in the history
…ported (#109842)
  • Loading branch information
tannergooding authored Nov 18, 2024
1 parent 360615c commit aaafed2
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/coreclr/jit/hwintrinsicxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3233,6 +3233,38 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
break;
}

if ((simdSize == 32) && !varTypeIsFloating(simdBaseType) &&
!compOpportunisticallyDependsOn(InstructionSet_AVX2))
{
// We can't deal with TYP_SIMD32 for integral types if the compiler doesn't support AVX2
break;
}

assert(simdSize != 64 || IsBaselineVector512IsaSupportedDebugOnly());

if (varTypeIsLong(simdBaseType))
{
if (TARGET_POINTER_SIZE == 4)
{
// TODO-XARCH-CQ: 32bit support
break;
}

if ((simdSize == 32) && compOpportunisticallyDependsOn(InstructionSet_AVX2))
{
// Emulate NI_AVX512DQ_VL_MultiplyLow with AVX2 for SIMD32
}
else if ((simdSize == 16) && compOpportunisticallyDependsOn(InstructionSet_SSE41))
{
// Emulate NI_AVX512DQ_VL_MultiplyLow with SSE41 for SIMD16
}
else
{
// Software fallback
break;
}
}

op3 = impSIMDPopStack();
op2 = impSIMDPopStack();
op1 = impSIMDPopStack();
Expand Down

0 comments on commit aaafed2

Please sign in to comment.