Skip to content

Commit

Permalink
PPC: Optimize clearing higher bits of mulhw/mulhwu
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
Milad Farazmand authored and Commit Bot committed Aug 11, 2020
1 parent f6af044 commit 3f071e3
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/compiler/backend/ppc/code-generator-ppc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1515,18 +1515,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
}
break;
case kPPC_MulHigh32:
__ mulhw(ip, i.InputRegister(0), i.InputRegister(1), i.OutputRCBit());
__ mulhw(r0, i.InputRegister(0), i.InputRegister(1), i.OutputRCBit());
// High 32 bits are undefined and need to be cleared.
__ li(r0, Operand(-1));
__ clrldi(r0, r0, Operand(32));
__ and_(i.OutputRegister(), ip, r0);
__ clrldi(i.OutputRegister(), r0, Operand(32));
break;
case kPPC_MulHighU32:
__ mulhwu(ip, i.InputRegister(0), i.InputRegister(1), i.OutputRCBit());
__ mulhwu(r0, i.InputRegister(0), i.InputRegister(1), i.OutputRCBit());
// High 32 bits are undefined and need to be cleared.
__ li(r0, Operand(-1));
__ clrldi(r0, r0, Operand(32));
__ and_(i.OutputRegister(), ip, r0);
__ clrldi(i.OutputRegister(), r0, Operand(32));
break;
case kPPC_MulDouble:
ASSEMBLE_FLOAT_BINOP_RC(fmul, MiscField::decode(instr->opcode()));
Expand Down

0 comments on commit 3f071e3

Please sign in to comment.