From a4cf1918c963cbe0b0eee6db580f0769c0cbdbcc Mon Sep 17 00:00:00 2001 From: Jatin Bhateja Date: Tue, 17 Sep 2024 01:41:53 +0000 Subject: [PATCH] 8339793: Fix incorrect APX feature enabling with -XX:-UseAPX Reviewed-by: kvn, thartmann, sviswanathan --- src/hotspot/cpu/x86/vm_version_x86.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hotspot/cpu/x86/vm_version_x86.cpp b/src/hotspot/cpu/x86/vm_version_x86.cpp index 6216cf44b88..2549feb8a40 100644 --- a/src/hotspot/cpu/x86/vm_version_x86.cpp +++ b/src/hotspot/cpu/x86/vm_version_x86.cpp @@ -1045,6 +1045,10 @@ void VM_Version::get_processor_features() { FLAG_SET_DEFAULT(UseAPX, apx_supported ? true : false); } + if (!UseAPX) { + _features &= ~CPU_APX_F; + } + if (UseAVX < 2) { _features &= ~CPU_AVX2; _features &= ~CPU_AVX_IFMA;