From 301d21b10b7e3ae747be18ad2883b1a040e1b93e Mon Sep 17 00:00:00 2001 From: Yudi Zheng Date: Wed, 20 Nov 2024 08:59:27 +0100 Subject: [PATCH 1/2] Adapt JDK-8342103: C2 compiler support for Float16 type and associated operations --- .../src/com/oracle/svm/core/amd64/AMD64LibCHelper.java | 4 ++++ .../include/amd64cpufeatures.h | 1 + .../include/amd64hotspotcpuinfo.h | 4 +++- substratevm/src/com.oracle.svm.native.libchelper/src/cpuid.c | 3 +++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/amd64/AMD64LibCHelper.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/amd64/AMD64LibCHelper.java index b2bf8a5fd718..530b24d7f4ec 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/amd64/AMD64LibCHelper.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/amd64/AMD64LibCHelper.java @@ -310,6 +310,10 @@ public interface CPUFeatures extends PointerBase { @AllowNarrowingCast @CField boolean fSHA512(); + + @AllowNarrowingCast + @CField + boolean fAVX512_FP16(); } // Checkstyle: resume } diff --git a/substratevm/src/com.oracle.svm.native.libchelper/include/amd64cpufeatures.h b/substratevm/src/com.oracle.svm.native.libchelper/include/amd64cpufeatures.h index 3572afa7f244..9954a02f3586 100644 --- a/substratevm/src/com.oracle.svm.native.libchelper/include/amd64cpufeatures.h +++ b/substratevm/src/com.oracle.svm.native.libchelper/include/amd64cpufeatures.h @@ -88,4 +88,5 @@ typedef struct { uint8_t fAVX_IFMA; uint8_t fAPX_F; uint8_t fSHA512; + uint8_t fAVX512_FP16; } CPUFeatures; diff --git a/substratevm/src/com.oracle.svm.native.libchelper/include/amd64hotspotcpuinfo.h b/substratevm/src/com.oracle.svm.native.libchelper/include/amd64hotspotcpuinfo.h index 5c0cda212dd3..b88990baae64 100644 --- a/substratevm/src/com.oracle.svm.native.libchelper/include/amd64hotspotcpuinfo.h +++ b/substratevm/src/com.oracle.svm.native.libchelper/include/amd64hotspotcpuinfo.h @@ -267,7 +267,9 @@ typedef union { serialize : 1, : 5, cet_ibt : 1, - : 11; + : 2, + avx512_fp16 : 1, + : 8; } bits; } SefCpuid7Edx; diff --git a/substratevm/src/com.oracle.svm.native.libchelper/src/cpuid.c b/substratevm/src/com.oracle.svm.native.libchelper/src/cpuid.c index dcc3854cc82c..783c26d7e1bd 100644 --- a/substratevm/src/com.oracle.svm.native.libchelper/src/cpuid.c +++ b/substratevm/src/com.oracle.svm.native.libchelper/src/cpuid.c @@ -547,6 +547,9 @@ NO_INLINE static void set_cpufeatures(CPUFeatures *features, CpuidInfo *_cpuid_i if (_cpuid_info->sef_cpuid7_edx.bits.serialize != 0) { features->fSERIALIZE = 1; } + if (_cpuid_info->sef_cpuid7_edx.bits.avx512_fp16 != 0) { + features->fAVX512_FP16 = 1; + } } // ZX features. From 8acbfac26a64391ef698938cdf980dd012809997 Mon Sep 17 00:00:00 2001 From: Yudi Zheng Date: Wed, 20 Nov 2024 08:59:50 +0100 Subject: [PATCH 2/2] Update galahad jdk. --- common.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.json b/common.json index 3e4d76abaf7e..0da2611308b1 100644 --- a/common.json +++ b/common.json @@ -8,7 +8,7 @@ "COMMENT.jdks": "When adding or removing JDKs keep in sync with JDKs in ci/common.jsonnet", "jdks": { - "galahad-jdk": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-25+2-128", "platformspecific": true, "extrabundles": ["static-libs"]}, + "galahad-jdk": {"name": "jpg-jdk", "version": "24", "build_id": "2024-11-20-0758294.yudi.zheng.jdk", "platformspecific": true, "extrabundles": ["static-libs"]}, "oraclejdk17": {"name": "jpg-jdk", "version": "17.0.7", "build_id": "jdk-17.0.7+8", "platformspecific": true, "extrabundles": ["static-libs"]}, "labsjdk-ce-17": {"name": "labsjdk", "version": "ce-17.0.7+4-jvmci-23.1-b02", "platformspecific": true },