Skip to content

Ensure that MultiplyAddEstimate exits for cases where GT_MUL is unsupported #109842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading