Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 4 additions & 3 deletions src/coreclr/jit/codegenarm64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2702,7 +2702,7 @@ void CodeGen::genCodeForBinary(GenTreeOp* tree)
if (op2->OperIs(GT_MUL) && op2->isContained())
{
// In the future, we might consider enabling this for floating-point "unsafe" math.
assert(varTypeIsIntegral(tree));
assert(varTypeIsIntegral(tree) || tree->TypeIs(TYP_BYREF));

// These operations cannot set flags
assert((tree->gtFlags & GTF_SET_FLAGS) == 0);
Expand Down Expand Up @@ -2740,7 +2740,7 @@ void CodeGen::genCodeForBinary(GenTreeOp* tree)
}
else if (op2->OperIs(GT_LSH, GT_RSH, GT_RSZ) && op2->isContained())
{
assert(varTypeIsIntegral(tree));
assert(varTypeIsIntegral(tree) || tree->TypeIs(TYP_BYREF));

GenTree* a = op1;
GenTree* b = op2->gtGetOp1();
Expand Down Expand Up @@ -2799,6 +2799,7 @@ void CodeGen::genCodeForBinary(GenTreeOp* tree)
}
else if (op2->OperIs(GT_ROR) && op2->isContained())
{
// ROR is only contained under AND/OR/XOR parents, which are never TYP_BYREF.
assert(varTypeIsIntegral(tree));

GenTree* a = op1;
Expand Down Expand Up @@ -2841,7 +2842,7 @@ void CodeGen::genCodeForBinary(GenTreeOp* tree)
}
else if (op2->OperIs(GT_CAST) && op2->isContained())
{
assert(varTypeIsIntegral(tree));
assert(varTypeIsIntegral(tree) || tree->TypeIs(TYP_BYREF));

GenTree* a = op1;
GenTree* b = op2->AsCast()->CastOp();
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/lowerarmarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ bool Lowering::IsContainableUnaryOrBinaryOp(GenTree* parentNode, GenTree* childN
if (parentNode->isContained())
return false;

if (!varTypeIsIntegral(parentNode))
if (!varTypeIsIntegral(parentNode) && !parentNode->TypeIs(TYP_BYREF))
return false;
Comment on lines 196 to 200

if (parentNode->gtGetOp1()->isContained() || (parentNode->OperIsBinary() && parentNode->gtGetOp2()->isContained()))
Expand Down
Loading