Skip to content

Commit b325b35

Browse files
committed
Adapt JDK-8342103: C2 compiler support for Float16 type and associated operations
1 parent 341e105 commit b325b35

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/amd64/AMD64LibCHelper.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,10 @@ public interface CPUFeatures extends PointerBase {
310310
@AllowNarrowingCast
311311
@CField
312312
boolean fSHA512();
313+
314+
@AllowNarrowingCast
315+
@CField
316+
boolean fAVX512_FP16();
313317
}
314318
// Checkstyle: resume
315319
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,5 @@ typedef struct {
8888
uint8_t fAVX_IFMA;
8989
uint8_t fAPX_F;
9090
uint8_t fSHA512;
91+
uint8_t fAVX512_FP16;
9192
} CPUFeatures;

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,9 @@ typedef union {
267267
serialize : 1,
268268
: 5,
269269
cet_ibt : 1,
270-
: 11;
270+
: 2,
271+
avx512_fp16 : 1,
272+
: 8;
271273
} bits;
272274
} SefCpuid7Edx;
273275

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,9 @@ NO_INLINE static void set_cpufeatures(CPUFeatures *features, CpuidInfo *_cpuid_i
547547
if (_cpuid_info->sef_cpuid7_edx.bits.serialize != 0) {
548548
features->fSERIALIZE = 1;
549549
}
550+
if (_cpuid_info->sef_cpuid7_edx.bits.avx512_fp16 != 0) {
551+
features->fAVX512_FP16 = 1;
552+
}
550553
}
551554

552555
// ZX features.

0 commit comments

Comments
 (0)