JDK-8317976 : Optimize SIMD sort for AMD Zen 4
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 22
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: x86
  • Submitted: 2023-10-11
  • Updated: 2025-05-14
  • Resolved: 2025-03-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 25
25 b17Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
In JDK-8309130 Array sort was optimized using SIMD instructions for x86_64. 
This optimization needed to be disabled for AMD Zen 4 in JDK-8317763 due to bad performance of compressstoreu as per https://www.reddit.com/r/java/comments/171t5sj/heads_up_openjdk_implementation_of_avx512_based/.
Comments
Changeset: 8cbadf78 Branch: master Author: Rohit Arul Raj <rraj@openjdk.org> Committer: SendaoYan <syan@openjdk.org> Date: 2025-03-30 13:22:21 +0000 URL: https://git.openjdk.org/jdk/commit/8cbadf78d04d0e3d1136a5582f281de099fc5e49
30-03-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/24053 Date: 2025-03-14 10:48:09 +0000
14-03-2025

One approach to keep it simple is to revert to AVX2 on zen4 as suggested here https://github.com/intel/x86-simd-sort/issues/6#issuecomment-2506476505. Refining the code here https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp#L4179: if (VM_Version::is_intel() && (VM_Version::supports_avx512dq() || VM_Version::supports_avx2())) {
05-12-2024