Skip to content

Commit 3f071e3

Browse files
Milad FarazmandCommit Bot
authored andcommitted
PPC: Optimize clearing higher bits of mulhw/mulhwu
Change-Id: Ie3e14a6ef4531349e81a8ae741bc7470c7e547ca Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2349468 Reviewed-by: Junliang Yan <jyan@ca.ibm.com> Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com> Cr-Commit-Position: refs/heads/master@{#69343}
1 parent f6af044 commit 3f071e3

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

src/compiler/backend/ppc/code-generator-ppc.cc

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,18 +1515,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
15151515
}
15161516
break;
15171517
case kPPC_MulHigh32:
1518-
__ mulhw(ip, i.InputRegister(0), i.InputRegister(1), i.OutputRCBit());
1518+
__ mulhw(r0, i.InputRegister(0), i.InputRegister(1), i.OutputRCBit());
15191519
// High 32 bits are undefined and need to be cleared.
1520-
__ li(r0, Operand(-1));
1521-
__ clrldi(r0, r0, Operand(32));
1522-
__ and_(i.OutputRegister(), ip, r0);
1520+
__ clrldi(i.OutputRegister(), r0, Operand(32));
15231521
break;
15241522
case kPPC_MulHighU32:
1525-
__ mulhwu(ip, i.InputRegister(0), i.InputRegister(1), i.OutputRCBit());
1523+
__ mulhwu(r0, i.InputRegister(0), i.InputRegister(1), i.OutputRCBit());
15261524
// High 32 bits are undefined and need to be cleared.
1527-
__ li(r0, Operand(-1));
1528-
__ clrldi(r0, r0, Operand(32));
1529-
__ and_(i.OutputRegister(), ip, r0);
1525+
__ clrldi(i.OutputRegister(), r0, Operand(32));
15301526
break;
15311527
case kPPC_MulDouble:
15321528
ASSEMBLE_FLOAT_BINOP_RC(fmul, MiscField::decode(instr->opcode()));

0 commit comments

Comments
 (0)