Skip to content

Commit 530080c

Browse files
Milad FaV8 LUCI CQ
authored andcommitted
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}
1 parent 55ae1a5 commit 530080c

3 files changed

Lines changed: 20 additions & 6 deletions

File tree

src/base/cpu.cc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
#ifndef POWER_9
3232
#define POWER_9 0x20000
3333
#endif
34+
#ifndef POWER_10
35+
#define POWER_10 0x40000
36+
#endif
3437
#endif
3538
#if V8_OS_POSIX
3639
#include <unistd.h> // sysconf()
@@ -804,7 +807,9 @@ CPU::CPU()
804807

805808
part_ = -1;
806809
if (auxv_cpu_type) {
807-
if (strcmp(auxv_cpu_type, "power9") == 0) {
810+
if (strcmp(auxv_cpu_type, "power10") == 0) {
811+
part_ = kPPCPower10;
812+
} else if (strcmp(auxv_cpu_type, "power9") == 0) {
808813
part_ = kPPCPower9;
809814
} else if (strcmp(auxv_cpu_type, "power8") == 0) {
810815
part_ = kPPCPower8;
@@ -825,6 +830,9 @@ CPU::CPU()
825830

826831
#elif V8_OS_AIX
827832
switch (_system_configuration.implementation) {
833+
case POWER_10:
834+
part_ = kPPCPower10;
835+
break;
828836
case POWER_9:
829837
part_ = kPPCPower9;
830838
break;

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
kPPCPower7,
7171
kPPCPower8,
7272
kPPCPower9,
73+
kPPCPower10,
7374
kPPCG4,
7475
kPPCG5,
7576
kPPCPA6T

src/codegen/ppc/assembler-ppc.cc

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,28 +73,33 @@ void CpuFeatures::ProbeImpl(bool cross_compile) {
7373
#ifndef USE_SIMULATOR
7474
// Probe for additional features at runtime.
7575
base::CPU cpu;
76-
if (cpu.part() == base::CPU::kPPCPower9) {
76+
if (cpu.part() == base::CPU::kPPCPower9 ||
77+
cpu.part() == base::CPU::kPPCPower10) {
7778
supported_ |= (1u << MODULO);
7879
}
7980
#if V8_TARGET_ARCH_PPC64
8081
if (cpu.part() == base::CPU::kPPCPower8 ||
81-
cpu.part() == base::CPU::kPPCPower9) {
82+
cpu.part() == base::CPU::kPPCPower9 ||
83+
cpu.part() == base::CPU::kPPCPower10) {
8284
supported_ |= (1u << FPR_GPR_MOV);
8385
}
8486
// V8 PPC Simd implementations need P9 at a minimum.
85-
if (cpu.part() == base::CPU::kPPCPower9) {
87+
if (cpu.part() == base::CPU::kPPCPower9 ||
88+
cpu.part() == base::CPU::kPPCPower10) {
8689
supported_ |= (1u << SIMD);
8790
}
8891
#endif
8992
if (cpu.part() == base::CPU::kPPCPower6 ||
9093
cpu.part() == base::CPU::kPPCPower7 ||
9194
cpu.part() == base::CPU::kPPCPower8 ||
92-
cpu.part() == base::CPU::kPPCPower9) {
95+
cpu.part() == base::CPU::kPPCPower9 ||
96+
cpu.part() == base::CPU::kPPCPower10) {
9397
supported_ |= (1u << LWSYNC);
9498
}
9599
if (cpu.part() == base::CPU::kPPCPower7 ||
96100
cpu.part() == base::CPU::kPPCPower8 ||
97-
cpu.part() == base::CPU::kPPCPower9) {
101+
cpu.part() == base::CPU::kPPCPower9 ||
102+
cpu.part() == base::CPU::kPPCPower10) {
98103
supported_ |= (1u << ISELECT);
99104
supported_ |= (1u << VSX);
100105
}

0 commit comments

Comments
 (0)