Commit 1a9c676a authored by Milad Farazmand's avatar Milad Farazmand Committed by Commit Bot

PPC: clear high 32 bits from the result of mulhw.

The hight 32 bits of the result of mulhw are undefined and need
to be cleared manually.

Change-Id: I0e746898aa26a7970ab59b89c374afd1377028ea
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2347208Reviewed-by: 's avatarJunliang Yan <jyan@ca.ibm.com>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#69318}
parent a36f40cb
......@@ -1515,12 +1515,18 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
}
break;
case kPPC_MulHigh32:
__ mulhw(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
i.OutputRCBit());
__ mulhw(ip, 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);
break;
case kPPC_MulHighU32:
__ mulhwu(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
i.OutputRCBit());
__ mulhwu(ip, 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);
break;
case kPPC_MulDouble:
ASSEMBLE_FLOAT_BINOP_RC(fmul, MiscField::decode(instr->opcode()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment