From e9e3390b18e787ee05fdb578fffe36ec62338af1 Mon Sep 17 00:00:00 2001 From: Milad Fa Date: Tue, 22 Sep 2020 22:12:29 +0000 Subject: [PATCH] deps: V8: backport 3f071e3e7e15 Original commit message: 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 Commit-Queue: Milad Farazmand Cr-Commit-Position: refs/heads/master@{#69343} Refs: https://github.com/v8/v8/commit/3f071e3e7e15af187267af6c3b369029e27c8cf5 Backport-PR-URL: https://github.com/nodejs/node/pull/35305 PR-URL: https://github.com/nodejs/node/pull/35305 Reviewed-By: Richard Lau Reviewed-By: Ash Cripps --- common.gypi | 2 +- deps/v8/src/compiler/backend/ppc/code-generator-ppc.cc | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/common.gypi b/common.gypi index 43a2fcb8167351..5fe20d8a8ee693 100644 --- a/common.gypi +++ b/common.gypi @@ -34,7 +34,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.41', + 'v8_embedder_string': '-node.42', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/compiler/backend/ppc/code-generator-ppc.cc b/deps/v8/src/compiler/backend/ppc/code-generator-ppc.cc index 7147448e210bfb..d91d9f1e9a95a8 100644 --- a/deps/v8/src/compiler/backend/ppc/code-generator-ppc.cc +++ b/deps/v8/src/compiler/backend/ppc/code-generator-ppc.cc @@ -1480,12 +1480,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( } break; case kPPC_MulHigh32: - __ mulhw(i.OutputRegister(), 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. + __ clrldi(i.OutputRegister(), r0, Operand(32)); break; case kPPC_MulHighU32: - __ mulhwu(i.OutputRegister(), 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. + __ clrldi(i.OutputRegister(), r0, Operand(32)); break; case kPPC_MulDouble: ASSEMBLE_FLOAT_BINOP_RC(fmul, MiscField::decode(instr->opcode()));