diff --git a/src/hotspot/cpu/x86/assembler_x86.cpp b/src/hotspot/cpu/x86/assembler_x86.cpp index 63d6ec9b00f..9482537d84f 100644 --- a/src/hotspot/cpu/x86/assembler_x86.cpp +++ b/src/hotspot/cpu/x86/assembler_x86.cpp @@ -1089,7 +1089,7 @@ address Assembler::locate_operand(address inst, WhichOperand which) { break; case 0x62: // EVEX_4bytes - assert(VM_Version::supports_evex(), "shouldn't have EVEX prefix"); + assert(VM_Version::cpu_supports_evex(), "shouldn't have EVEX prefix"); assert(ip == inst+1, "no prefixes allowed"); // no EVEX collisions, all instructions that have 0x62 opcodes // have EVEX versions and are subopcodes of 0x66 diff --git a/src/hotspot/cpu/x86/vm_version_x86.cpp b/src/hotspot/cpu/x86/vm_version_x86.cpp index df1ea6edd30..2412c053106 100644 --- a/src/hotspot/cpu/x86/vm_version_x86.cpp +++ b/src/hotspot/cpu/x86/vm_version_x86.cpp @@ -809,7 +809,8 @@ void VM_Version::get_processor_features() { _stepping = cpu_stepping(); if (cpu_family() > 4) { // it supports CPUID - _features = feature_flags(); + _features = feature_flags(); // These can be changed by VM settings + _cpu_features = _features; // Preserve features // Logical processors are only available on P4s and above, // and only if hyperthreading is available. _logical_processors_per_package = logical_processor_count(); diff --git a/src/hotspot/cpu/x86/vm_version_x86.hpp b/src/hotspot/cpu/x86/vm_version_x86.hpp index e521a6ee3bc..cfc16acabc6 100644 --- a/src/hotspot/cpu/x86/vm_version_x86.hpp +++ b/src/hotspot/cpu/x86/vm_version_x86.hpp @@ -640,7 +640,7 @@ public: } // - // Feature identification + // Feature identification which can be affected by VM settings // static bool supports_cpuid() { return _features != 0; } static bool supports_cmov() { return (_features & CPU_CMOV) != 0; } @@ -703,6 +703,11 @@ public: static bool supports_cet_ss() { return (_features & CPU_CET_SS) != 0; } static bool supports_cet_ibt() { return (_features & CPU_CET_IBT) != 0; } + // + // Feature identification not affected by VM flags + // + static bool cpu_supports_evex() { return (_cpu_features & CPU_AVX512F) != 0; } + // Intel features static bool is_intel_family_core() { return is_intel() && extended_cpu_family() == CPU_FAMILY_INTEL_CORE; } diff --git a/src/hotspot/share/runtime/abstract_vm_version.cpp b/src/hotspot/share/runtime/abstract_vm_version.cpp index f1f8888653e..9fada531d0b 100644 --- a/src/hotspot/share/runtime/abstract_vm_version.cpp +++ b/src/hotspot/share/runtime/abstract_vm_version.cpp @@ -34,6 +34,7 @@ const char* Abstract_VM_Version::_s_internal_vm_info_string = Abstract_VM_Versio uint64_t Abstract_VM_Version::_features = 0; const char* Abstract_VM_Version::_features_string = ""; +uint64_t Abstract_VM_Version::_cpu_features = 0; #ifndef SUPPORTS_NATIVE_CX8 bool Abstract_VM_Version::_supports_cx8 = false; diff --git a/src/hotspot/share/runtime/abstract_vm_version.hpp b/src/hotspot/share/runtime/abstract_vm_version.hpp index d8ffca8de81..ec3b7177a66 100644 --- a/src/hotspot/share/runtime/abstract_vm_version.hpp +++ b/src/hotspot/share/runtime/abstract_vm_version.hpp @@ -54,10 +54,13 @@ class Abstract_VM_Version: AllStatic { static const char* _s_vm_release; static const char* _s_internal_vm_info_string; - // CPU feature flags. + // CPU feature flags, can be affected by VM settings. static uint64_t _features; static const char* _features_string; + // Original CPU feature flags, not affected by VM settings. + static uint64_t _cpu_features; + // These are set by machine-dependent initializations #ifndef SUPPORTS_NATIVE_CX8 static bool _supports_cx8;