Skip to content

Commit

Permalink
Avoid an assert in gtNewSimdCreateBroadcastNode for TYP_LONG on 32-bit
Browse files Browse the repository at this point in the history
  • Loading branch information
tannergooding committed May 9, 2023
1 parent bc081b6 commit 94b5e53
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/coreclr/jit/hwintrinsicxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,13 +609,23 @@ GenTree* Compiler::impNonConstFallback(NamedIntrinsic intrinsic, var_types simdT
static_assert_no_msg(NI_AVX512F_VL_RotateLeftVariable == (NI_AVX512F_VL_RotateLeft + 1));
static_assert_no_msg(NI_AVX512F_VL_RotateRightVariable == (NI_AVX512F_VL_RotateRight + 1));

var_types simdBaseType = JitType2PreciseVarType(simdBaseJitType);

#if defined(TARGET_X86)
if (varTypeIsLong(simdBaseType))
{
// TODO-XARCH-CQ: We need to add TYP_LONG support to gtNewSimdCreateBroadcastNode
return nullptr;
}
#endif // TARGET_X86

impSpillSideEffect(true,
verCurrentState.esStackDepth - 2 DEBUGARG("Spilling op1 side effects for HWIntrinsic"));

GenTree* op2 = impPopStack().val;
GenTree* op1 = impSIMDPopStack();

if (varTypeIsLong(simdType))
if (varTypeIsLong(simdBaseType))
{
op2 = gtNewCastNode(TYP_LONG, op2, /* fromUnsigned */ true, TYP_LONG);
}
Expand Down

0 comments on commit 94b5e53

Please sign in to comment.