Skip to content

Commit 93a1a3c

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: #38509 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Ash Cripps <acripps@redhat.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
1 parent 499e56b commit 93a1a3c

File tree

4 files changed

+23
-6
lines changed

4 files changed

+23
-6
lines changed

common.gypi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
# Reset this number to 0 on major V8 upgrades.
3636
# Increment by one for each non-official patch applied to deps/v8.
37-
'v8_embedder_string': '-node.46',
37+
'v8_embedder_string': '-node.47',
3838

3939
##### V8 defaults for Node.js #####
4040

deps/v8/src/base/cpu.cc

Lines changed: 10 additions & 1 deletion
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()
@@ -639,7 +642,10 @@ CPU::CPU()
639642

640643
part_ = -1;
641644
if (auxv_cpu_type) {
642-
if (strcmp(auxv_cpu_type, "power9") == 0) {
645+
if (strcmp(auxv_cpu_type, "power10") == 0) {
646+
part_ = PPC_POWER10;
647+
}
648+
else if (strcmp(auxv_cpu_type, "power9") == 0) {
643649
part_ = PPC_POWER9;
644650
} else if (strcmp(auxv_cpu_type, "power8") == 0) {
645651
part_ = PPC_POWER8;
@@ -660,6 +666,9 @@ CPU::CPU()
660666

661667
#elif V8_OS_AIX
662668
switch (_system_configuration.implementation) {
669+
case POWER_10:
670+
part_ = PPC_POWER10;
671+
break;
663672
case POWER_9:
664673
part_ = PPC_POWER9;
665674
break;

deps/v8/src/base/cpu.h

Lines changed: 1 addition & 0 deletions
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

Lines changed: 11 additions & 4 deletions
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)