@@ -139,7 +139,7 @@ class VM_Version_StubGenerator: public StubCodeGenerator {
139139 const uint32_t CPU_FAMILY_486 = (4 << CPU_FAMILY_SHIFT);
140140 bool use_evex = FLAG_IS_DEFAULT (UseAVX) || (UseAVX > 2 );
141141
142- Label detect_486, cpu486, detect_586, std_cpuid1, std_cpuid4, std_cpuid24;
142+ Label detect_486, cpu486, detect_586, std_cpuid1, std_cpuid4, std_cpuid24, std_cpuid29 ;
143143 Label sef_cpuid, sefsl1_cpuid, ext_cpuid, ext_cpuid1, ext_cpuid5, ext_cpuid7;
144144 Label ext_cpuid8, done, wrapup, vector_save_restore, apx_save_restore_warning;
145145 Label legacy_setup, save_restore_except, legacy_save_restore, start_simd_check;
@@ -338,6 +338,16 @@ class VM_Version_StubGenerator: public StubCodeGenerator {
338338 __ movl (Address (rsi, 0 ), rax);
339339 __ movl (Address (rsi, 4 ), rdx);
340340
341+ //
342+ // cpuid(0x29) APX NCI NDD NF (EAX = 29H, ECX = 0).
343+ //
344+ __ bind (std_cpuid29);
345+ __ movl (rax, 0x29 );
346+ __ movl (rcx, 0 );
347+ __ cpuid ();
348+ __ lea (rsi, Address (rbp, in_bytes (VM_Version::std_cpuid29_offset ())));
349+ __ movl (Address (rsi, 0 ), rbx);
350+
341351 //
342352 // cpuid(0x24) Converged Vector ISA Main Leaf (EAX = 24H, ECX = 0).
343353 //
@@ -2914,7 +2924,8 @@ VM_Version::VM_Features VM_Version::CpuidInfo::feature_flags() const {
29142924 if (std_cpuid1_ecx.bits .popcnt != 0 )
29152925 vm_features.set_feature (CPU_POPCNT);
29162926 if (sefsl1_cpuid7_edx.bits .apx_f != 0 &&
2917- xem_xcr0_eax.bits .apx_f != 0 ) {
2927+ xem_xcr0_eax.bits .apx_f != 0 &&
2928+ std_cpuid29_ebx.bits .apx_nci_ndd_nf != 0 ) {
29182929 vm_features.set_feature (CPU_APX_F);
29192930 }
29202931 if (std_cpuid1_ecx.bits .avx != 0 &&
0 commit comments