From f31a6114a4139f4988a0eadb4b1766deee221de8 Mon Sep 17 00:00:00 2001 From: Milad Fa Date: Fri, 30 Apr 2021 14:15:53 -0400 Subject: [PATCH] deps: V8: cherry-pick 530080c44af2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original commit message: ``` PPC: Add Power10 to the supported list and enable related features This CL adds Power10 recognition to Linux, AIX as well as IBMi. Enabled features include: MODULO FPR_GPR_MOV SIMD LWSYNC ISELECT VSX Change-Id: Ifc337e6497a3efe9697bcf03063a2b94471f96e9 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2855041 Reviewed-by: Clemens Backes Reviewed-by: Junliang Yan Reviewed-by: Vasili Skurydzin Commit-Queue: Milad Fa Cr-Commit-Position: refs/heads/master@{#74279} ``` Refs: https://github.com/v8/v8/commit/530080c44af254646a3cc3f364aac26b1b5ac10c PR-URL: https://github.com/nodejs/node/pull/38489 Reviewed-By: Richard Lau Reviewed-By: Rich Trott Reviewed-By: Michaƫl Zasso Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Gireesh Punathil Reviewed-By: Ash Cripps Reviewed-By: Michael Dawson --- common.gypi | 2 +- deps/v8/src/base/cpu.cc | 10 +++++++++- deps/v8/src/base/cpu.h | 1 + deps/v8/src/codegen/ppc/assembler-ppc.cc | 12 ++++++++---- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/common.gypi b/common.gypi index be7c06d4c81882..e5f01195e63850 100644 --- a/common.gypi +++ b/common.gypi @@ -36,7 +36,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.11', + 'v8_embedder_string': '-node.12', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/base/cpu.cc b/deps/v8/src/base/cpu.cc index abfd048ee46ecb..36f2e5f5e3b5e2 100644 --- a/deps/v8/src/base/cpu.cc +++ b/deps/v8/src/base/cpu.cc @@ -31,6 +31,9 @@ #ifndef POWER_9 #define POWER_9 0x20000 #endif +#ifndef POWER_10 +#define POWER_10 0x40000 +#endif #endif #if V8_OS_POSIX #include // sysconf() @@ -780,7 +783,10 @@ CPU::CPU() part_ = -1; if (auxv_cpu_type) { - if (strcmp(auxv_cpu_type, "power9") == 0) { + if (strcmp(auxv_cpu_type, "power10") == 0) { + part_ = PPC_POWER10; + } + else if (strcmp(auxv_cpu_type, "power9") == 0) { part_ = PPC_POWER9; } else if (strcmp(auxv_cpu_type, "power8") == 0) { part_ = PPC_POWER8; @@ -801,6 +807,8 @@ CPU::CPU() #elif V8_OS_AIX switch (_system_configuration.implementation) { + case POWER_10: + part_ = PPC_POWER10; case POWER_9: part_ = PPC_POWER9; break; diff --git a/deps/v8/src/base/cpu.h b/deps/v8/src/base/cpu.h index 5086584c130020..bfb7d7818a5186 100644 --- a/deps/v8/src/base/cpu.h +++ b/deps/v8/src/base/cpu.h @@ -70,6 +70,7 @@ class V8_BASE_EXPORT CPU final { PPC_POWER7, PPC_POWER8, PPC_POWER9, + PPC_POWER10, PPC_G4, PPC_G5, PPC_PA6T diff --git a/deps/v8/src/codegen/ppc/assembler-ppc.cc b/deps/v8/src/codegen/ppc/assembler-ppc.cc index 02e50e5fa3f1ac..7ea115ee401cc3 100644 --- a/deps/v8/src/codegen/ppc/assembler-ppc.cc +++ b/deps/v8/src/codegen/ppc/assembler-ppc.cc @@ -67,24 +67,28 @@ void CpuFeatures::ProbeImpl(bool cross_compile) { #ifndef USE_SIMULATOR // Probe for additional features at runtime. base::CPU cpu; - if (cpu.part() == base::CPU::PPC_POWER9) { + if (cpu.part() == base::CPU::PPC_POWER9 || + cpu.part() == base::CPU::PPC_POWER10) { supported_ |= (1u << MODULO); } #if V8_TARGET_ARCH_PPC64 if (cpu.part() == base::CPU::PPC_POWER8 || - cpu.part() == base::CPU::PPC_POWER9) { + cpu.part() == base::CPU::PPC_POWER9 || + cpu.part() == base::CPU::PPC_POWER10) { supported_ |= (1u << FPR_GPR_MOV); } #endif if (cpu.part() == base::CPU::PPC_POWER6 || cpu.part() == base::CPU::PPC_POWER7 || cpu.part() == base::CPU::PPC_POWER8 || - cpu.part() == base::CPU::PPC_POWER9) { + cpu.part() == base::CPU::PPC_POWER9 || + cpu.part() == base::CPU::PPC_POWER10) { supported_ |= (1u << LWSYNC); } if (cpu.part() == base::CPU::PPC_POWER7 || cpu.part() == base::CPU::PPC_POWER8 || - cpu.part() == base::CPU::PPC_POWER9) { + cpu.part() == base::CPU::PPC_POWER9 || + cpu.part() == base::CPU::PPC_POWER10) { supported_ |= (1u << ISELECT); supported_ |= (1u << VSX); }