Skip to content

Commit 9ac2e24

Browse files
committed
svm: sync with AARCH64.CPUFeature in JDK 19
1 parent f1a0f80 commit 9ac2e24

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/aarch64/AArch64LibCHelper.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,14 @@ public interface CPUFeatures extends PointerBase {
123123
@AllowNarrowingCast
124124
@CField
125125
boolean fDMB_ATOMICS();
126+
127+
@AllowNarrowingCast
128+
@CField
129+
boolean fPACA();
130+
131+
@AllowNarrowingCast
132+
@CField
133+
boolean fSVEBITPERM();
126134
}
127135
// Checkstyle: resume
128136
}

substratevm/src/com.oracle.svm.native.libchelper/include/aarch64cpufeatures.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,6 @@ typedef struct {
4242
char fSTXR_PREFETCH;
4343
char fA53MAC;
4444
char fDMB_ATOMICS;
45+
char fPACA;
46+
char fSVEBITPERM;
4547
} CPUFeatures;

substratevm/src/com.oracle.svm.native.libchelper/src/cpuid.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,8 @@ void determineCPUFeatures(CPUFeatures* features) {
623623
features->fSTXR_PREFETCH = 0;
624624
features->fA53MAC = 0;
625625
features->fDMB_ATOMICS = 0;
626+
features->fPACA = 0;
627+
features->fSVEBITPERM = 0;
626628
}
627629

628630
/*
@@ -674,9 +676,15 @@ void determineCPUFeatures(CPUFeatures* features) {
674676
#ifndef HWCAP_SVE
675677
#define HWCAP_SVE (1L << 22)
676678
#endif
679+
#ifndef HWCAP_PACA
680+
#define HWCAP_PACA (1L << 30)
681+
#endif
677682
#ifndef HWCAP2_SVE2
678683
#define HWCAP2_SVE2 (1L << 1)
679684
#endif
685+
#ifndef HWCAP2_SVEBITPERM
686+
#define HWCAP2_SVEBITPERM (1L << 4)
687+
#endif
680688

681689
#define CPU_ARM 'A'
682690
#define CPU_CAVIUM 'C'
@@ -706,6 +714,8 @@ void determineCPUFeatures(CPUFeatures* features) {
706714
features->fSTXR_PREFETCH = 0;
707715
features->fA53MAC = 0;
708716
features->fDMB_ATOMICS = 0;
717+
features->fPACA = !!(auxv & HWCAP_PACA);
718+
features->fSVEBITPERM = !!(auxv2 & HWCAP2_SVEBITPERM);
709719

710720
//checking for features signaled in another way
711721

0 commit comments

Comments
 (0)