Skip to content

Commit

Permalink
Merge pull request #7343 from knn-k/aarch64shift0
Browse files Browse the repository at this point in the history
AArch64: Handle shift amount 0
  • Loading branch information
0xdaryl committed May 23, 2024
2 parents 5faa3ec + 721d05f commit 625d6fb
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions compiler/aarch64/codegen/BinaryEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1576,9 +1576,17 @@ static TR::Register *shiftHelper(TR::Node *node, TR::ARM64ShiftCode shiftType, T
if (secondOp == TR::iconst)
{
int32_t value = secondChild->getInt();
if (value == 0 && firstChild->getReferenceCount() == 1)
if (value == 0)
{
trgReg = srcReg;
if (firstChild->getReferenceCount() == 1)
{
trgReg = srcReg;
}
else
{
trgReg = cg->allocateRegister();
generateMovInstruction(cg, node, trgReg, srcReg, is64bit);
}
}
else
{
Expand Down

0 comments on commit 625d6fb

Please sign in to comment.