Skip to content

Commit

Permalink
8315578: PPC builds are broken after JDK-8304913
Browse files Browse the repository at this point in the history
Backport-of: 9559e035d2692d9d61bec2a13b5239a98db077ac
  • Loading branch information
shipilev committed Sep 22, 2023
1 parent fa64237 commit e2bfc22
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public enum Architecture {
RISCV64(64, ByteOrder.LITTLE_ENDIAN),
LOONGARCH64(64, ByteOrder.LITTLE_ENDIAN),
S390(64, ByteOrder.BIG_ENDIAN),
PPC(32, ByteOrder.BIG_ENDIAN),
PPC64(64, ByteOrder.BIG_ENDIAN),
PPC64LE(64, ByteOrder.LITTLE_ENDIAN),
MIPSEL(32, ByteOrder.LITTLE_ENDIAN),
Expand Down Expand Up @@ -155,6 +156,14 @@ public static boolean isS390() {
return PlatformProps.TARGET_ARCH_IS_S390;
}

/**
* {@return {@code true} if the current architecture is PPC, big-endian}
*/
@ForceInline
public static boolean isPPC() {
return PlatformProps.TARGET_ARCH_IS_PPC;
}

/**
* {@return {@code true} if the current architecture is PPC64, big-endian}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class PlatformProps {
static final boolean TARGET_ARCH_IS_RISCV64 = "@@OPENJDK_TARGET_CPU@@" == "riscv64";
static final boolean TARGET_ARCH_IS_LOONGARCH64 = "@@OPENJDK_TARGET_CPU@@" == "loongarch64";
static final boolean TARGET_ARCH_IS_S390 = "@@OPENJDK_TARGET_CPU@@" == "s390";
static final boolean TARGET_ARCH_IS_PPC = "@@OPENJDK_TARGET_CPU@@" == "ppc";
static final boolean TARGET_ARCH_IS_PPC64 = "@@OPENJDK_TARGET_CPU@@" == "ppc64";
static final boolean TARGET_ARCH_IS_PPC64LE = "@@OPENJDK_TARGET_CPU@@" == "ppc64le";
static final boolean TARGET_ARCH_IS_MIPSEL = "@@OPENJDK_TARGET_CPU@@" == "mipsel";
Expand Down
2 changes: 2 additions & 0 deletions test/jdk/jdk/internal/util/ArchTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

import static jdk.internal.util.Architecture.AARCH64;
import static jdk.internal.util.Architecture.ARM;
import static jdk.internal.util.Architecture.PPC;
import static jdk.internal.util.Architecture.PPC64;
import static jdk.internal.util.Architecture.PPC64LE;
import static jdk.internal.util.Architecture.RISCV64;
Expand Down Expand Up @@ -81,6 +82,7 @@ private static Stream<Arguments> archParams() {
Arguments.of("loongarch64", LOONGARCH64, 64, ByteOrder.LITTLE_ENDIAN, Architecture.isLOONGARCH64()),
Arguments.of("mips64el", MIPS64EL, 64, ByteOrder.LITTLE_ENDIAN, Architecture.isMIPS64EL()),
Arguments.of("mipsel", MIPSEL, 32, ByteOrder.LITTLE_ENDIAN, Architecture.isMIPSEL()),
Arguments.of("ppc", PPC, 32, ByteOrder.BIG_ENDIAN, Architecture.isPPC()),
Arguments.of("ppc64", PPC64, 64, ByteOrder.BIG_ENDIAN, Architecture.isPPC64()),
Arguments.of("ppc64le", PPC64LE, 64, ByteOrder.LITTLE_ENDIAN, Architecture.isPPC64LE()),
Arguments.of("riscv64", RISCV64, 64, ByteOrder.LITTLE_ENDIAN, Architecture.isRISCV64()),
Expand Down

1 comment on commit e2bfc22

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.