Skip to content

Commit d678277

Browse files
miladfarcarichardlau
authored andcommitted
deps: V8: cherry-pick 530080c44af2
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 <clemensb@chromium.org> Reviewed-by: Junliang Yan <junyan@redhat.com> Reviewed-by: Vasili Skurydzin <vasili.skurydzin@ibm.com> Commit-Queue: Milad Fa <mfarazma@redhat.com> Cr-Commit-Position: refs/heads/master@{#74279} ``` Refs: v8/v8@530080c PR-URL: #38508 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Ash Cripps <acripps@redhat.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
1 parent 3ce447f commit d678277

File tree

4 files changed

+23
-6
lines changed

4 files changed

+23
-6
lines changed

common.gypi

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
# Reset this number to 0 on major V8 upgrades.
3838
# Increment by one for each non-official patch applied to deps/v8.
39-
'v8_embedder_string': '-node.63',
39+
'v8_embedder_string': '-node.64',
4040

4141
##### V8 defaults for Node.js #####
4242

deps/v8/src/base/cpu.cc

+10-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
#ifndef POWER_9
2828
#define POWER_9 0x20000
2929
#endif
30+
#ifndef POWER_10
31+
#define POWER_10 0x40000
32+
#endif
3033
#endif
3134
#if V8_OS_POSIX
3235
#include <unistd.h> // sysconf()
@@ -646,7 +649,10 @@ CPU::CPU()
646649

647650
part_ = -1;
648651
if (auxv_cpu_type) {
649-
if (strcmp(auxv_cpu_type, "power9") == 0) {
652+
if (strcmp(auxv_cpu_type, "power10") == 0) {
653+
part_ = PPC_POWER10;
654+
}
655+
else if (strcmp(auxv_cpu_type, "power9") == 0) {
650656
part_ = PPC_POWER9;
651657
} else if (strcmp(auxv_cpu_type, "power8") == 0) {
652658
part_ = PPC_POWER8;
@@ -667,6 +673,9 @@ CPU::CPU()
667673

668674
#elif V8_OS_AIX
669675
switch (_system_configuration.implementation) {
676+
case POWER_10:
677+
part_ = PPC_POWER10;
678+
break;
670679
case POWER_9:
671680
part_ = PPC_POWER9;
672681
break;

deps/v8/src/base/cpu.h

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class V8_BASE_EXPORT CPU final {
7070
PPC_POWER7,
7171
PPC_POWER8,
7272
PPC_POWER9,
73+
PPC_POWER10,
7374
PPC_G4,
7475
PPC_G5,
7576
PPC_PA6T

deps/v8/src/codegen/ppc/assembler-ppc.cc

+11-4
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,28 @@ void CpuFeatures::ProbeImpl(bool cross_compile) {
6767
#ifndef USE_SIMULATOR
6868
// Probe for additional features at runtime.
6969
base::CPU cpu;
70-
if (cpu.part() == base::CPU::PPC_POWER9) {
70+
if (cpu.part() == base::CPU::PPC_POWER9 ||
71+
cpu.part() == base::CPU::PPC_POWER10) {
7172
supported_ |= (1u << MODULO);
7273
}
7374
#if V8_TARGET_ARCH_PPC64
74-
if (cpu.part() == base::CPU::PPC_POWER8) {
75+
if (cpu.part() == base::CPU::PPC_POWER8 ||
76+
cpu.part() == base::CPU::PPC_POWER9 ||
77+
cpu.part() == base::CPU::PPC_POWER10) {
7578
supported_ |= (1u << FPR_GPR_MOV);
7679
}
7780
#endif
7881
if (cpu.part() == base::CPU::PPC_POWER6 ||
7982
cpu.part() == base::CPU::PPC_POWER7 ||
80-
cpu.part() == base::CPU::PPC_POWER8) {
83+
cpu.part() == base::CPU::PPC_POWER8 ||
84+
cpu.part() == base::CPU::PPC_POWER9 ||
85+
cpu.part() == base::CPU::PPC_POWER10) {
8186
supported_ |= (1u << LWSYNC);
8287
}
8388
if (cpu.part() == base::CPU::PPC_POWER7 ||
84-
cpu.part() == base::CPU::PPC_POWER8) {
89+
cpu.part() == base::CPU::PPC_POWER8 ||
90+
cpu.part() == base::CPU::PPC_POWER9 ||
91+
cpu.part() == base::CPU::PPC_POWER10) {
8592
supported_ |= (1u << ISELECT);
8693
supported_ |= (1u << VSX);
8794
}

0 commit comments

Comments
 (0)