Skip to content

Commit 6437539

Browse files
Milad FaV8 LUCI CQ
authored andcommitted
PPC: remove support for ppc 32-bit, part 1
ppc32 has been out of support for a long time now. This CL removes the following from v8 codebase: - V8_TARGET_ARCH_PPC_LE and V8_TARGET_ARCH_PPC_BE - V8_TARGET_ARCH_PPC - V8_HOST_ARCH_PPC - v8_current_cpu == "ppc" - arch == ppc Change-Id: I452b9fc04b8fa7b7909c5a7cb4b12587ef5ccb7d Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5796844 Reviewed-by: Jakob Kummerow <[email protected]> Reviewed-by: Leszek Swirski <[email protected]> Commit-Queue: Milad Farazmand <[email protected]> Cr-Commit-Position: refs/heads/main@{#95773}
1 parent 224d39a commit 6437539

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+142
-225
lines changed

BUILD.bazel

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,8 +490,7 @@ v8_config(
490490
],
491491
"@v8//bazel/config:v8_target_ppc64le": [
492492
# NOTE: Bazel rules for ppc64le weren't tested on a real system.
493-
"V8_TARGET_ARCH_PPC64",
494-
"V8_TARGET_ARCH_PPC_LE",
493+
"V8_TARGET_ARCH_PPC64"
495494
],
496495
},
497496
no_match_error = "Please specify a target cpu supported by v8",

BUILD.gn

Lines changed: 13 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,27 +1422,18 @@ config("toolchain") {
14221422
cflags += [ "-march=z196" ]
14231423
}
14241424
}
1425-
if (v8_current_cpu == "ppc" || v8_current_cpu == "ppc64") {
1426-
if (v8_current_cpu == "ppc") {
1427-
defines += [ "V8_TARGET_ARCH_PPC" ]
1428-
} else if (v8_current_cpu == "ppc64") {
1429-
defines += [ "V8_TARGET_ARCH_PPC64" ]
1430-
cflags += [ "-ffp-contract=off" ]
1431-
}
1432-
if (host_byteorder == "little") {
1433-
defines += [ "V8_TARGET_ARCH_PPC_LE" ]
1434-
} else if (host_byteorder == "big") {
1435-
defines += [ "V8_TARGET_ARCH_PPC_BE" ]
1436-
if (current_os == "aix") {
1437-
cflags += [
1438-
# Work around AIX ceil, trunc and round oddities.
1439-
"-mcpu=power5+",
1440-
"-mfprnd",
1441-
1442-
# Work around AIX assembler popcntb bug.
1443-
"-mno-popcntb",
1444-
]
1445-
}
1425+
if (v8_current_cpu == "ppc64") {
1426+
defines += [ "V8_TARGET_ARCH_PPC64" ]
1427+
cflags += [ "-ffp-contract=off" ]
1428+
if (current_os == "aix") {
1429+
cflags += [
1430+
# Work around AIX ceil, trunc and round oddities.
1431+
"-mcpu=power5+",
1432+
"-mfprnd",
1433+
1434+
# Work around AIX assembler popcntb bug.
1435+
"-mno-popcntb",
1436+
]
14461437
}
14471438
}
14481439

@@ -3029,11 +3020,6 @@ v8_source_set("v8_initializers") {
30293020
### gcmole(loong64) ###
30303021
"src/builtins/loong64/builtins-loong64.cc",
30313022
]
3032-
} else if (v8_current_cpu == "ppc") {
3033-
sources += [
3034-
### gcmole(ppc) ###
3035-
"src/builtins/ppc/builtins-ppc.cc",
3036-
]
30373023
} else if (v8_current_cpu == "ppc64") {
30383024
sources += [
30393025
### gcmole(ppc64) ###
@@ -4706,23 +4692,6 @@ v8_header_set("v8_internal_headers") {
47064692
sources += [ "src/trap-handler/trap-handler-simulator.h" ]
47074693
}
47084694
}
4709-
} else if (v8_current_cpu == "ppc") {
4710-
sources += [
4711-
### gcmole(ppc) ###
4712-
"src/codegen/ppc/assembler-ppc-inl.h",
4713-
"src/codegen/ppc/assembler-ppc.h",
4714-
"src/codegen/ppc/constants-ppc.h",
4715-
"src/codegen/ppc/interface-descriptors-ppc-inl.h",
4716-
"src/codegen/ppc/macro-assembler-ppc.h",
4717-
"src/codegen/ppc/register-ppc.h",
4718-
"src/codegen/ppc/reglist-ppc.h",
4719-
"src/compiler/backend/ppc/instruction-codes-ppc.h",
4720-
"src/compiler/backend/ppc/unwinding-info-writer-ppc.h",
4721-
"src/execution/ppc/frame-constants-ppc.h",
4722-
"src/execution/ppc/simulator-ppc.h",
4723-
"src/regexp/ppc/regexp-macro-assembler-ppc.h",
4724-
"src/wasm/baseline/ppc/liftoff-assembler-ppc-inl.h",
4725-
]
47264695
} else if (v8_current_cpu == "ppc64") {
47274696
sources += [
47284697
### gcmole(ppc64) ###
@@ -5060,14 +5029,6 @@ if (v8_current_cpu == "x86") {
50605029
"src/compiler/backend/loong64/instruction-scheduler-loong64.cc",
50615030
"src/compiler/backend/loong64/instruction-selector-loong64.cc",
50625031
]
5063-
} else if (v8_current_cpu == "ppc") {
5064-
v8_compiler_sources += [
5065-
### gcmole(ppc) ###
5066-
"src/compiler/backend/ppc/code-generator-ppc.cc",
5067-
"src/compiler/backend/ppc/instruction-scheduler-ppc.cc",
5068-
"src/compiler/backend/ppc/instruction-selector-ppc.cc",
5069-
"src/compiler/backend/ppc/unwinding-info-writer-ppc.cc",
5070-
]
50715032
} else if (v8_current_cpu == "ppc64") {
50725033
v8_compiler_sources += [
50735034
### gcmole(ppc64) ###
@@ -6094,21 +6055,6 @@ v8_source_set("v8_base_without_compiler") {
60946055
sources += [ "src/trap-handler/handler-outside-simulator.cc" ]
60956056
}
60966057
}
6097-
} else if (v8_current_cpu == "ppc") {
6098-
sources += [
6099-
### gcmole(ppc) ###
6100-
"src/codegen/ppc/assembler-ppc.cc",
6101-
"src/codegen/ppc/constants-ppc.cc",
6102-
"src/codegen/ppc/cpu-ppc.cc",
6103-
"src/codegen/ppc/macro-assembler-ppc.cc",
6104-
"src/deoptimizer/ppc/deoptimizer-ppc.cc",
6105-
"src/diagnostics/ppc/disasm-ppc.cc",
6106-
"src/diagnostics/ppc/eh-frame-ppc.cc",
6107-
"src/diagnostics/ppc/unwinder-ppc.cc",
6108-
"src/execution/ppc/frame-constants-ppc.cc",
6109-
"src/execution/ppc/simulator-ppc.cc",
6110-
"src/regexp/ppc/regexp-macro-assembler-ppc.cc",
6111-
]
61126058
} else if (v8_current_cpu == "ppc64") {
61136059
sources += [
61146060
### gcmole(ppc64) ###
@@ -6299,7 +6245,7 @@ v8_source_set("v8_base_without_compiler") {
62996245
# Platforms that don't have CAS support need to link atomic library
63006246
# to implement atomic memory access
63016247
if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el" ||
6302-
v8_current_cpu == "ppc" || v8_current_cpu == "ppc64" ||
6248+
v8_current_cpu == "ppc64" ||
63036249
(current_os != "zos" &&
63046250
(v8_current_cpu == "s390" || v8_current_cpu == "s390x")) ||
63056251
v8_current_cpu == "riscv64" || v8_current_cpu == "riscv32") {

include/v8-unwinder-state.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ struct CalleeSavedRegisters {
1818
void* arm_r10;
1919
};
2020
#elif V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM64 || \
21-
V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_PPC64 || \
22-
V8_TARGET_ARCH_RISCV64 || V8_TARGET_ARCH_S390 || V8_TARGET_ARCH_LOONG64 || \
23-
V8_TARGET_ARCH_RISCV32
21+
V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC64 || V8_TARGET_ARCH_RISCV64 || \
22+
V8_TARGET_ARCH_S390 || V8_TARGET_ARCH_LOONG64 || V8_TARGET_ARCH_RISCV32
2423
struct CalleeSavedRegisters {};
2524
#else
2625
#error Target architecture was not detected as supported by v8

include/v8config.h

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -829,9 +829,6 @@ V8 shared library set USING_V8_SHARED.
829829
#elif defined(__PPC64__) || defined(_ARCH_PPC64)
830830
#define V8_HOST_ARCH_PPC64 1
831831
#define V8_HOST_ARCH_64_BIT 1
832-
#elif defined(__PPC__) || defined(_ARCH_PPC)
833-
#define V8_HOST_ARCH_PPC 1
834-
#define V8_HOST_ARCH_32_BIT 1
835832
#elif defined(__s390__) || defined(__s390x__)
836833
#define V8_HOST_ARCH_S390 1
837834
#if defined(__s390x__)
@@ -858,10 +855,10 @@ V8 shared library set USING_V8_SHARED.
858855
// The macros may be set externally. If not, detect in the same way as the host
859856
// architecture, that is, target the native environment as presented by the
860857
// compiler.
861-
#if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_IA32 && !V8_TARGET_ARCH_ARM && \
862-
!V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS64 && !V8_TARGET_ARCH_PPC && \
863-
!V8_TARGET_ARCH_PPC64 && !V8_TARGET_ARCH_S390 && \
864-
!V8_TARGET_ARCH_RISCV64 && !V8_TARGET_ARCH_LOONG64 && \
858+
#if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_IA32 && !V8_TARGET_ARCH_ARM && \
859+
!V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS64 && \
860+
!V8_TARGET_ARCH_PPC64 && !V8_TARGET_ARCH_S390 && \
861+
!V8_TARGET_ARCH_RISCV64 && !V8_TARGET_ARCH_LOONG64 && \
865862
!V8_TARGET_ARCH_RISCV32
866863
#if defined(_M_X64) || defined(__x86_64__)
867864
#define V8_TARGET_ARCH_X64 1
@@ -877,8 +874,6 @@ V8 shared library set USING_V8_SHARED.
877874
#define V8_TARGET_ARCH_LOONG64 1
878875
#elif defined(_ARCH_PPC64)
879876
#define V8_TARGET_ARCH_PPC64 1
880-
#elif defined(_ARCH_PPC)
881-
#define V8_TARGET_ARCH_PPC 1
882877
#elif defined(__s390__)
883878
#define V8_TARGET_ARCH_S390 1
884879
#if defined(__s390x__)
@@ -916,8 +911,6 @@ V8 shared library set USING_V8_SHARED.
916911
#define V8_TARGET_ARCH_64_BIT 1
917912
#elif V8_TARGET_ARCH_LOONG64
918913
#define V8_TARGET_ARCH_64_BIT 1
919-
#elif V8_TARGET_ARCH_PPC
920-
#define V8_TARGET_ARCH_32_BIT 1
921914
#elif V8_TARGET_ARCH_PPC64
922915
#define V8_TARGET_ARCH_64_BIT 1
923916
#elif V8_TARGET_ARCH_S390
@@ -982,12 +975,12 @@ V8 shared library set USING_V8_SHARED.
982975
#else
983976
#define V8_TARGET_LITTLE_ENDIAN 1
984977
#endif
985-
#elif defined(__BIG_ENDIAN__) // FOR PPCGR on AIX
978+
#elif V8_TARGET_ARCH_PPC64
979+
#if V8_OS_AIX
986980
#define V8_TARGET_BIG_ENDIAN 1
987-
#elif V8_TARGET_ARCH_PPC_LE
981+
#else
988982
#define V8_TARGET_LITTLE_ENDIAN 1
989-
#elif V8_TARGET_ARCH_PPC_BE
990-
#define V8_TARGET_BIG_ENDIAN 1
983+
#endif
991984
#elif V8_TARGET_ARCH_S390
992985
#if V8_TARGET_ARCH_S390_LE_SIM
993986
#define V8_TARGET_LITTLE_ENDIAN 1

src/base/build_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ constexpr int kReturnAddressStackSlotCount =
5858
V8_TARGET_ARCH_STORES_RETURN_ADDRESS_ON_STACK ? 1 : 0;
5959

6060
// Number of bits to represent the page size for paged spaces.
61-
#if (defined(V8_HOST_ARCH_PPC) || defined(V8_HOST_ARCH_PPC64)) && !defined(_AIX)
61+
#if defined(V8_HOST_ARCH_PPC64) && !defined(V8_OS_AIX)
6262
// Native PPC linux has large (64KB) physical pages.
6363
// Simulator (and Aix) need to use the same value as x64.
6464
constexpr int kPageSizeBits = 19;

src/base/compiler-specific.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,9 @@
9898
// do not support adding noexcept to default members.
9999
// Disabled on MSVC because constructors of standard containers are not noexcept
100100
// there.
101-
#if ((!defined(V8_CC_GNU) && !defined(V8_CC_MSVC) && \
102-
!defined(V8_TARGET_ARCH_MIPS64) && !defined(V8_TARGET_ARCH_PPC) && \
103-
!defined(V8_TARGET_ARCH_PPC64) && !defined(V8_TARGET_ARCH_RISCV64) && \
104-
!defined(V8_TARGET_ARCH_RISCV32)) || \
101+
#if ((!defined(V8_CC_GNU) && !defined(V8_CC_MSVC) && \
102+
!defined(V8_TARGET_ARCH_MIPS64) && !defined(V8_TARGET_ARCH_PPC64) && \
103+
!defined(V8_TARGET_ARCH_RISCV64) && !defined(V8_TARGET_ARCH_RISCV32)) || \
105104
defined(__clang__))
106105
#define V8_NOEXCEPT noexcept
107106
#else

src/base/cpu.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#if V8_OS_QNX
2121
#include <sys/syspage.h> // cpuinfo
2222
#endif
23-
#if V8_OS_LINUX && (V8_HOST_ARCH_PPC || V8_HOST_ARCH_PPC64)
23+
#if V8_OS_LINUX && V8_HOST_ARCH_PPC64
2424
#include <elf.h>
2525
#endif
2626
#if V8_OS_AIX
@@ -900,7 +900,7 @@ CPU::CPU()
900900
#endif // V8_OS_IOS
901901
#endif // V8_OS_WIN
902902

903-
#elif V8_HOST_ARCH_PPC || V8_HOST_ARCH_PPC64
903+
#elif V8_HOST_ARCH_PPC64
904904

905905
#ifndef USE_SIMULATOR
906906
#if V8_OS_LINUX

src/base/platform/platform-posix.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ void OS::DebugBreak() {
745745
asm("break");
746746
#elif V8_HOST_ARCH_LOONG64
747747
asm("break 0");
748-
#elif V8_HOST_ARCH_PPC || V8_HOST_ARCH_PPC64
748+
#elif V8_HOST_ARCH_PPC64
749749
asm("twge 2,2");
750750
#elif V8_HOST_ARCH_IA32
751751
asm("int $3");

src/builtins/ppc/builtins-ppc.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
#if V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_PPC64
5+
#if V8_TARGET_ARCH_PPC64
66

77
#include "src/api/api-arguments.h"
88
#include "src/builtins/builtins-inl.h"
@@ -4263,4 +4263,4 @@ void Builtins::Generate_RestartFrameTrampoline(MacroAssembler* masm) {
42634263
} // namespace internal
42644264
} // namespace v8
42654265

4266-
#endif // V8_TARGET_ARCH_PPC64 || V8_TARGET_ARCH_PPC64
4266+
#endif // V8_TARGET_ARCH_PPC64

src/codegen/assembler-arch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include "src/codegen/arm64/assembler-arm64.h"
1616
#elif V8_TARGET_ARCH_ARM
1717
#include "src/codegen/arm/assembler-arm.h"
18-
#elif V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_PPC64
18+
#elif V8_TARGET_ARCH_PPC64
1919
#include "src/codegen/ppc/assembler-ppc.h"
2020
#elif V8_TARGET_ARCH_MIPS64
2121
#include "src/codegen/mips64/assembler-mips64.h"

0 commit comments

Comments
 (0)