From a347360a5fa6a9aa0af40fa769e494b111e185b2 Mon Sep 17 00:00:00 2001 From: Mohamed Issa Date: Sun, 2 Aug 2026 22:39:44 -0700 Subject: [PATCH] Disable UseFPUForSpilling on families starting with Haswell. --- src/hotspot/cpu/x86/vm_version_x86.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/hotspot/cpu/x86/vm_version_x86.cpp b/src/hotspot/cpu/x86/vm_version_x86.cpp index ff32d79176c..0c021cba916 100644 --- a/src/hotspot/cpu/x86/vm_version_x86.cpp +++ b/src/hotspot/cpu/x86/vm_version_x86.cpp @@ -1794,7 +1794,12 @@ void VM_Version::get_processor_features() { } #ifdef COMPILER2 if (FLAG_IS_DEFAULT(UseFPUForSpilling) && supports_sse4_2()) { - FLAG_SET_DEFAULT(UseFPUForSpilling, false); + // Spilling to FPU registers not beneficial on Haswell and beyond + if (UseAVX > 1) { + FLAG_SET_DEFAULT(UseFPUForSpilling, false); + } else { + FLAG_SET_DEFAULT(UseFPUForSpilling, true); + } } #endif }