Commit 530080c4 authored by Milad Fa's avatar Milad Fa Committed by V8 LUCI CQ

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/+/2855041Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Reviewed-by: 's avatarJunliang Yan <junyan@redhat.com>
Reviewed-by: 's avatarVasili Skurydzin <vasili.skurydzin@ibm.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#74279}
parent 55ae1a52
...@@ -31,6 +31,9 @@ ...@@ -31,6 +31,9 @@
#ifndef POWER_9 #ifndef POWER_9
#define POWER_9 0x20000 #define POWER_9 0x20000
#endif #endif
#ifndef POWER_10
#define POWER_10 0x40000
#endif
#endif #endif
#if V8_OS_POSIX #if V8_OS_POSIX
#include <unistd.h> // sysconf() #include <unistd.h> // sysconf()
...@@ -804,7 +807,9 @@ CPU::CPU() ...@@ -804,7 +807,9 @@ CPU::CPU()
part_ = -1; part_ = -1;
if (auxv_cpu_type) { if (auxv_cpu_type) {
if (strcmp(auxv_cpu_type, "power9") == 0) { if (strcmp(auxv_cpu_type, "power10") == 0) {
part_ = kPPCPower10;
} else if (strcmp(auxv_cpu_type, "power9") == 0) {
part_ = kPPCPower9; part_ = kPPCPower9;
} else if (strcmp(auxv_cpu_type, "power8") == 0) { } else if (strcmp(auxv_cpu_type, "power8") == 0) {
part_ = kPPCPower8; part_ = kPPCPower8;
...@@ -825,6 +830,9 @@ CPU::CPU() ...@@ -825,6 +830,9 @@ CPU::CPU()
#elif V8_OS_AIX #elif V8_OS_AIX
switch (_system_configuration.implementation) { switch (_system_configuration.implementation) {
case POWER_10:
part_ = kPPCPower10;
break;
case POWER_9: case POWER_9:
part_ = kPPCPower9; part_ = kPPCPower9;
break; break;
......
...@@ -70,6 +70,7 @@ class V8_BASE_EXPORT CPU final { ...@@ -70,6 +70,7 @@ class V8_BASE_EXPORT CPU final {
kPPCPower7, kPPCPower7,
kPPCPower8, kPPCPower8,
kPPCPower9, kPPCPower9,
kPPCPower10,
kPPCG4, kPPCG4,
kPPCG5, kPPCG5,
kPPCPA6T kPPCPA6T
......
...@@ -73,28 +73,33 @@ void CpuFeatures::ProbeImpl(bool cross_compile) { ...@@ -73,28 +73,33 @@ void CpuFeatures::ProbeImpl(bool cross_compile) {
#ifndef USE_SIMULATOR #ifndef USE_SIMULATOR
// Probe for additional features at runtime. // Probe for additional features at runtime.
base::CPU cpu; base::CPU cpu;
if (cpu.part() == base::CPU::kPPCPower9) { if (cpu.part() == base::CPU::kPPCPower9 ||
cpu.part() == base::CPU::kPPCPower10) {
supported_ |= (1u << MODULO); supported_ |= (1u << MODULO);
} }
#if V8_TARGET_ARCH_PPC64 #if V8_TARGET_ARCH_PPC64
if (cpu.part() == base::CPU::kPPCPower8 || if (cpu.part() == base::CPU::kPPCPower8 ||
cpu.part() == base::CPU::kPPCPower9) { cpu.part() == base::CPU::kPPCPower9 ||
cpu.part() == base::CPU::kPPCPower10) {
supported_ |= (1u << FPR_GPR_MOV); supported_ |= (1u << FPR_GPR_MOV);
} }
// V8 PPC Simd implementations need P9 at a minimum. // V8 PPC Simd implementations need P9 at a minimum.
if (cpu.part() == base::CPU::kPPCPower9) { if (cpu.part() == base::CPU::kPPCPower9 ||
cpu.part() == base::CPU::kPPCPower10) {
supported_ |= (1u << SIMD); supported_ |= (1u << SIMD);
} }
#endif #endif
if (cpu.part() == base::CPU::kPPCPower6 || if (cpu.part() == base::CPU::kPPCPower6 ||
cpu.part() == base::CPU::kPPCPower7 || cpu.part() == base::CPU::kPPCPower7 ||
cpu.part() == base::CPU::kPPCPower8 || cpu.part() == base::CPU::kPPCPower8 ||
cpu.part() == base::CPU::kPPCPower9) { cpu.part() == base::CPU::kPPCPower9 ||
cpu.part() == base::CPU::kPPCPower10) {
supported_ |= (1u << LWSYNC); supported_ |= (1u << LWSYNC);
} }
if (cpu.part() == base::CPU::kPPCPower7 || if (cpu.part() == base::CPU::kPPCPower7 ||
cpu.part() == base::CPU::kPPCPower8 || cpu.part() == base::CPU::kPPCPower8 ||
cpu.part() == base::CPU::kPPCPower9) { cpu.part() == base::CPU::kPPCPower9 ||
cpu.part() == base::CPU::kPPCPower10) {
supported_ |= (1u << ISELECT); supported_ |= (1u << ISELECT);
supported_ |= (1u << VSX); supported_ |= (1u << VSX);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment