Skip to content

Commit f0024f5

Browse files
rkennkeVladimir Kozlov
andcommitted
8324734: Relax too-strict assert(VM_Version::supports_evex()) in Assembler::locate_operand()
Co-authored-by: Vladimir Kozlov <kvn@openjdk.org> Reviewed-by: kvn, shade
1 parent fd8adf3 commit f0024f5

File tree

5 files changed

+14
-4
lines changed

5 files changed

+14
-4
lines changed

src/hotspot/cpu/x86/assembler_x86.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,7 @@ address Assembler::locate_operand(address inst, WhichOperand which) {
10891089
break;
10901090

10911091
case 0x62: // EVEX_4bytes
1092-
assert(VM_Version::supports_evex(), "shouldn't have EVEX prefix");
1092+
assert(VM_Version::cpu_supports_evex(), "shouldn't have EVEX prefix");
10931093
assert(ip == inst+1, "no prefixes allowed");
10941094
// no EVEX collisions, all instructions that have 0x62 opcodes
10951095
// have EVEX versions and are subopcodes of 0x66

src/hotspot/cpu/x86/vm_version_x86.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,8 @@ void VM_Version::get_processor_features() {
809809
_stepping = cpu_stepping();
810810

811811
if (cpu_family() > 4) { // it supports CPUID
812-
_features = feature_flags();
812+
_features = feature_flags(); // These can be changed by VM settings
813+
_cpu_features = _features; // Preserve features
813814
// Logical processors are only available on P4s and above,
814815
// and only if hyperthreading is available.
815816
_logical_processors_per_package = logical_processor_count();

src/hotspot/cpu/x86/vm_version_x86.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ class VM_Version : public Abstract_VM_Version {
640640
}
641641

642642
//
643-
// Feature identification
643+
// Feature identification which can be affected by VM settings
644644
//
645645
static bool supports_cpuid() { return _features != 0; }
646646
static bool supports_cmov() { return (_features & CPU_CMOV) != 0; }
@@ -703,6 +703,11 @@ class VM_Version : public Abstract_VM_Version {
703703
static bool supports_cet_ss() { return (_features & CPU_CET_SS) != 0; }
704704
static bool supports_cet_ibt() { return (_features & CPU_CET_IBT) != 0; }
705705

706+
//
707+
// Feature identification not affected by VM flags
708+
//
709+
static bool cpu_supports_evex() { return (_cpu_features & CPU_AVX512F) != 0; }
710+
706711
// Intel features
707712
static bool is_intel_family_core() { return is_intel() &&
708713
extended_cpu_family() == CPU_FAMILY_INTEL_CORE; }

src/hotspot/share/runtime/abstract_vm_version.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const char* Abstract_VM_Version::_s_internal_vm_info_string = Abstract_VM_Versio
3434

3535
uint64_t Abstract_VM_Version::_features = 0;
3636
const char* Abstract_VM_Version::_features_string = "";
37+
uint64_t Abstract_VM_Version::_cpu_features = 0;
3738

3839
#ifndef SUPPORTS_NATIVE_CX8
3940
bool Abstract_VM_Version::_supports_cx8 = false;

src/hotspot/share/runtime/abstract_vm_version.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,13 @@ class Abstract_VM_Version: AllStatic {
5454
static const char* _s_vm_release;
5555
static const char* _s_internal_vm_info_string;
5656

57-
// CPU feature flags.
57+
// CPU feature flags, can be affected by VM settings.
5858
static uint64_t _features;
5959
static const char* _features_string;
6060

61+
// Original CPU feature flags, not affected by VM settings.
62+
static uint64_t _cpu_features;
63+
6164
// These are set by machine-dependent initializations
6265
#ifndef SUPPORTS_NATIVE_CX8
6366
static bool _supports_cx8;

0 commit comments

Comments
 (0)