Skip to content

Commit

Permalink
Ensure AllBitsSet for TYP_SIMD64 is correctly handled
Browse files Browse the repository at this point in the history
  • Loading branch information
tannergooding committed Mar 15, 2023
1 parent b1c5dfe commit 3f5f97b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/coreclr/jit/codegenxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,8 @@ void CodeGen::genSetRegToConst(regNumber targetReg, var_types targetType, GenTre
emitter* emit = GetEmitter();
emitAttr attr = emitTypeSize(targetType);

if (vecCon->IsAllBitsSet())
// TODO-XARCH-AVX512: Remove the TYP_SIMD64 check once AllBitsSet for TYP_SIMD64 gets codegen support
if (vecCon->IsAllBitsSet() && !vecCon->TypeIs(TYP_SIMD64))
{
if ((attr != EA_32BYTE) || compiler->compOpportunisticallyDependsOn(InstructionSet_AVX2))
{
Expand Down
5 changes: 5 additions & 0 deletions src/coreclr/jit/gentree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4864,7 +4864,12 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree)
{
level = 0;

#if defined(TARGET_XARCH)
// TODO-XARCH-AVX512: Remove the TYP_SIMD64 check once AllBitsSet for TYP_SIMD64 gets codegen support
if ((tree->AsVecCon()->IsAllBitsSet() && !tree->TypeIs(TYP_SIMD64)) || tree->AsVecCon()->IsZero())
#else
if (tree->AsVecCon()->IsAllBitsSet() || tree->AsVecCon()->IsZero())
#endif // TARGET_*
{
// We generate `cmpeq* tgtReg, tgtReg`, which is 4-5 bytes, for AllBitsSet
// and generate `xorp* tgtReg, tgtReg`, which is 3-5 bytes, for Zero
Expand Down
3 changes: 2 additions & 1 deletion src/coreclr/jit/lowerxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6817,8 +6817,9 @@ bool Lowering::IsContainableHWIntrinsicOp(GenTreeHWIntrinsic* parentNode, GenTre
}
else if (childNode->IsCnsVec())
{
// TODO-XARCH-AVX512: Remove the TYP_SIMD64 check once AllBitsSet for TYP_SIMD64 gets codegen support
GenTreeVecCon* vecCon = childNode->AsVecCon();
canBeContained = !vecCon->IsAllBitsSet() && !vecCon->IsZero();
canBeContained = (!vecCon->IsAllBitsSet() || vecCon->TypeIs(TYP_SIMD64)) && !vecCon->IsZero();
}
}

Expand Down

0 comments on commit 3f5f97b

Please sign in to comment.