Skip to content

Commit

Permalink
Ensure we create a valid node when DOTNET_EnableSSE2=0 is set
Browse files Browse the repository at this point in the history
  • Loading branch information
tannergooding committed Jul 16, 2024
1 parent 89f6bfe commit a3ba381
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/coreclr/jit/hwintrinsicxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1413,8 +1413,17 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
op2 = impSIMDPopStack();
op1 = impSIMDPopStack();

op1 = gtFoldExpr(gtNewSimdUnOpNode(GT_NOT, retType, op1, simdBaseJitType, simdSize));
retNode = gtNewSimdBinOpNode(GT_AND, retType, op1, op2, simdBaseJitType, simdSize);
if (IsBaselineSimdIsaSupported())
{
op1 = gtFoldExpr(gtNewSimdUnOpNode(GT_NOT, retType, op1, simdBaseJitType, simdSize));
retNode = gtNewSimdBinOpNode(GT_AND, retType, op1, op2, simdBaseJitType, simdSize);
}
else
{
// We need to ensure we import even if SSE2 is disabled
assert(intrinsic == NI_SSE_AndNot);
retNode = gtNewSimdHWIntrinsicNode(retType, op1, op2, intrinsic, simdBaseJitType, simdSize);
}
break;
}

Expand Down

0 comments on commit a3ba381

Please sign in to comment.