Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.
/ jdk21 Public archive

Commit

Permalink
8310105: LoongArch64 builds are broken after JDK-8304913
Browse files Browse the repository at this point in the history
Reviewed-by: shade
Backport-of: 137a5f7c2ce35258702b28565f6feb7cb7f1d68e
  • Loading branch information
Glavo authored and shipilev committed Jun 20, 2023
1 parent fb6f5f1 commit 7e78893
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public enum Architecture {
AARCH64,
ARM,
RISCV64,
LOONGARCH64,
S390,
PPC64,
;
Expand Down Expand Up @@ -69,6 +70,14 @@ public static boolean isRISCV64() {
return PlatformProps.TARGET_ARCH_IS_RISCV64;
}

/**
* {@return {@code true} if the current architecture is LOONGARCH64}
*/
@ForceInline
public static boolean isLOONGARCH64() {
return PlatformProps.TARGET_ARCH_IS_LOONGARCH64;
}

/**
* {@return {@code true} if the current architecture is S390}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class PlatformProps {
static final boolean TARGET_ARCH_IS_AARCH64 = "@@OPENJDK_TARGET_CPU@@" == "aarch64";
static final boolean TARGET_ARCH_IS_ARM = "@@OPENJDK_TARGET_CPU@@" == "arm";
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_PPC64 = "@@OPENJDK_TARGET_CPU@@" == "ppc64";
}
3 changes: 3 additions & 0 deletions test/jdk/jdk/internal/util/ArchTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import static jdk.internal.util.Architecture.ARM;
import static jdk.internal.util.Architecture.PPC64;
import static jdk.internal.util.Architecture.RISCV64;
import static jdk.internal.util.Architecture.LOONGARCH64;
import static jdk.internal.util.Architecture.S390;
import static jdk.internal.util.Architecture.X64;
import static jdk.internal.util.Architecture.X86;
Expand Down Expand Up @@ -70,6 +71,7 @@ public void nameVsCurrent() {
case "aarch64" -> AARCH64;
case "arm" -> ARM;
case "riscv64" -> RISCV64;
case "loongarch64" -> LOONGARCH64;
case "s390x", "s390" -> S390;
case "ppc64", "ppc64le" -> PPC64;
default -> OTHER;
Expand All @@ -88,6 +90,7 @@ private static Stream<Arguments> archParams() {
Arguments.of(AARCH64, Architecture.isAARCH64()),
Arguments.of(ARM, Architecture.isARM()),
Arguments.of(RISCV64, Architecture.isRISCV64()),
Arguments.of(LOONGARCH64, Architecture.isLOONGARCH64()),
Arguments.of(S390, Architecture.isS390()),
Arguments.of(PPC64, Architecture.isPPC64())
);
Expand Down

1 comment on commit 7e78893

@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.