Skip to content

Commit a3ba381

Browse files
committed
Ensure we create a valid node when DOTNET_EnableSSE2=0 is set
1 parent 89f6bfe commit a3ba381

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/coreclr/jit/hwintrinsicxarch.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,8 +1413,17 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
14131413
op2 = impSIMDPopStack();
14141414
op1 = impSIMDPopStack();
14151415

1416-
op1 = gtFoldExpr(gtNewSimdUnOpNode(GT_NOT, retType, op1, simdBaseJitType, simdSize));
1417-
retNode = gtNewSimdBinOpNode(GT_AND, retType, op1, op2, simdBaseJitType, simdSize);
1416+
if (IsBaselineSimdIsaSupported())
1417+
{
1418+
op1 = gtFoldExpr(gtNewSimdUnOpNode(GT_NOT, retType, op1, simdBaseJitType, simdSize));
1419+
retNode = gtNewSimdBinOpNode(GT_AND, retType, op1, op2, simdBaseJitType, simdSize);
1420+
}
1421+
else
1422+
{
1423+
// We need to ensure we import even if SSE2 is disabled
1424+
assert(intrinsic == NI_SSE_AndNot);
1425+
retNode = gtNewSimdHWIntrinsicNode(retType, op1, op2, intrinsic, simdBaseJitType, simdSize);
1426+
}
14181427
break;
14191428
}
14201429

0 commit comments

Comments
 (0)