Skip to content
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

Add flags checks to BMI1 intrinsic lowering #66736

Merged
merged 3 commits into from
Mar 20, 2022
Merged
Changes from 1 commit
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
19 changes: 19 additions & 0 deletions src/coreclr/jit/lowerxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3789,6 +3789,13 @@ GenTree* Lowering::TryLowerAndOpToResetLowestSetBit(GenTreeOp* andNode)
return nullptr;
}

// prevent decomposed 64 integer node parts in x86 from being recognised
Wraith2 marked this conversation as resolved.
Show resolved Hide resolved
if (((addOp1->gtFlags & GTF_SET_FLAGS) == GTF_SET_FLAGS) || ((addOp2->gtFlags & GTF_SET_FLAGS) == GTF_SET_FLAGS) ||
((op2->gtFlags & GTF_SET_FLAGS) == GTF_SET_FLAGS) || ((andNode->gtFlags & GTF_SET_FLAGS) == GTF_SET_FLAGS))
Wraith2 marked this conversation as resolved.
Show resolved Hide resolved
{
return nullptr;
}

NamedIntrinsic intrinsic;
if (op1->TypeIs(TYP_LONG) && comp->compOpportunisticallyDependsOn(InstructionSet_BMI1_X64))
{
Expand Down Expand Up @@ -3868,6 +3875,12 @@ GenTree* Lowering::TryLowerAndOpToExtractLowestSetBit(GenTreeOp* andNode)
return nullptr;
}

// prevent decomposed 64 integer node parts in x86 from being recognised
Wraith2 marked this conversation as resolved.
Show resolved Hide resolved
if (((opNode->gtFlags & GTF_SET_FLAGS) == GTF_SET_FLAGS) || ((negNode->gtFlags & GTF_SET_FLAGS) == GTF_SET_FLAGS))
{
return nullptr;
}

NamedIntrinsic intrinsic;
if (andNode->TypeIs(TYP_LONG) && comp->compOpportunisticallyDependsOn(InstructionSet_BMI1_X64))
{
Expand Down Expand Up @@ -3947,6 +3960,12 @@ GenTree* Lowering::TryLowerAndOpToAndNot(GenTreeOp* andNode)
return nullptr;
}

// prevent decomposed 64 integer node parts in x86 from being recognised
Wraith2 marked this conversation as resolved.
Show resolved Hide resolved
if (((andNode->gtFlags & GTF_SET_FLAGS) == GTF_SET_FLAGS) || ((notNode->gtFlags & GTF_SET_FLAGS) == GTF_SET_FLAGS))
{
return nullptr;
}

NamedIntrinsic intrinsic;
if (andNode->TypeIs(TYP_LONG) && comp->compOpportunisticallyDependsOn(InstructionSet_BMI1_X64))
{
Expand Down