This commit is contained in:
Egor Bogatov 2025-07-30 13:54:03 +00:00 committed by GitHub
commit b35d28d1ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 68 deletions

View File

@ -384,7 +384,7 @@ bool Lowering::IsContainableUnaryOrBinaryOp(GenTree* parentNode, GenTree* childN
if (childNode->OperIs(GT_NEG))
{
// If we have a contained LSH, RSH or RSZ, we can still contain NEG if the parent is a EQ or NE.
if (childNode->gtGetOp1()->isContained() && !childNode->gtGetOp1()->OperIs(GT_LSH, GT_RSH, GT_RSZ, GT_CAST))
if (childNode->gtGetOp1()->isContained() && !childNode->gtGetOp1()->OperIs(GT_LSH, GT_RSH, GT_RSZ))
{
// Cannot contain if the childs op1 is already contained
return false;
@ -403,31 +403,6 @@ bool Lowering::IsContainableUnaryOrBinaryOp(GenTree* parentNode, GenTree* childN
{
return false;
}
if (childNode->gtGetOp1()->OperIs(GT_CAST))
{
// Grab the cast as well, we can contain this with cmn (extended-register).
GenTreeCast* cast = childNode->gtGetOp1()->AsCast();
GenTree* castOp = cast->CastOp();
// Cannot contain the cast from floating point.
if (!varTypeIsIntegral(castOp))
{
return false;
}
// Cannot contain the cast if it already contains it's CastOp.
if (castOp->isContained())
{
return false;
}
assert(!cast->gtOverflow());
assert(varTypeIsIntegral(cast) && varTypeIsIntegral(cast->CastToType()));
MakeSrcContained(childNode, cast);
}
return true;
}

View File

@ -159,47 +159,5 @@ namespace TestCompareNegative
}
return false;
}
[MethodImpl(MethodImplOptions.NoInlining)]
static bool CmnExtendedB(int a, int b)
{
//ARM64-FULL-LINE: cmn {{w[0-9]+}}, {{w[0-9]+}}, SXTB
return (a == -(sbyte)b);
}
[MethodImpl(MethodImplOptions.NoInlining)]
static bool CmnExtendedH(int a, int b)
{
//ARM64-FULL-LINE: cmn {{w[0-9]+}}, {{w[0-9]+}}, SXTH
return (a == -(short)b);
}
[MethodImpl(MethodImplOptions.NoInlining)]
static bool CmnExtendedS(long a, long b)
{
//ARM64-FULL-LINE: cmn {{x[0-9]+}}, {{w[0-9]+}}, SXTW
return (a == -(long)(int)b);
}
[MethodImpl(MethodImplOptions.NoInlining)]
static bool CmnExtendedUB(int a, int b)
{
//ARM64-FULL-LINE: cmn {{w[0-9]+}}, {{w[0-9]+}}, UXTB
return (a == -(byte)b);
}
[MethodImpl(MethodImplOptions.NoInlining)]
static bool CmnExtendedUH(int a, int b)
{
//ARM64-FULL-LINE: cmn {{w[0-9]+}}, {{w[0-9]+}}, UXTH
return (a == -(ushort)b);
}
[MethodImpl(MethodImplOptions.NoInlining)]
static bool CmnExtendedUS(long a, long b)
{
//ARM64-FULL-LINE: cmn {{x[0-9]+}}, {{w[0-9]+}}, UXTW
return (a == -(uint)b);
}
}
}