Skip to content

Commit

Permalink
deps: V8: cherry-pick 530080c44af2
Browse files Browse the repository at this point in the history
    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 <[email protected]>
    Reviewed-by: Junliang Yan <[email protected]>
    Reviewed-by: Vasili Skurydzin <[email protected]>
    Commit-Queue: Milad Fa <[email protected]>
    Cr-Commit-Position: refs/heads/master@{#74279}
    ```

Refs: v8/v8@530080c

PR-URL: #38489
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Ash Cripps <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
  • Loading branch information
miladfarca authored and richardlau committed May 14, 2021
1 parent b51b4fe commit f31a611
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -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 #####

Expand Down
10 changes: 9 additions & 1 deletion deps/v8/src/base/cpu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 <unistd.h> // sysconf()
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
1 change: 1 addition & 0 deletions deps/v8/src/base/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class V8_BASE_EXPORT CPU final {
PPC_POWER7,
PPC_POWER8,
PPC_POWER9,
PPC_POWER10,
PPC_G4,
PPC_G5,
PPC_PA6T
Expand Down
12 changes: 8 additions & 4 deletions deps/v8/src/codegen/ppc/assembler-ppc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit f31a611

Please sign in to comment.