-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8317976: Optimize SIMD sort for AMD Zen 4 #24053
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
8de2e2c
4201191
b369de6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -432,6 +432,8 @@ class VM_Version : public Abstract_VM_Version { | |
| enum Extended_Family { | ||
| // AMD | ||
| CPU_FAMILY_AMD_11H = 0x11, | ||
| CPU_FAMILY_AMD_17H = 0x17, /* Zen1 & Zen2 */ | ||
| CPU_FAMILY_AMD_19H = 0x19, /* Zen3 & Zen4 */ | ||
| // ZX | ||
| CPU_FAMILY_ZX_CORE_F6 = 6, | ||
| CPU_FAMILY_ZX_CORE_F7 = 7, | ||
|
|
@@ -771,6 +773,10 @@ class VM_Version : public Abstract_VM_Version { | |
| // | ||
| static bool cpu_supports_evex() { return (_cpu_features & CPU_AVX512F) != 0; } | ||
|
|
||
| static bool supports_avx512_simd_sort() { | ||
| // Disable AVX512 version of SIMD Sort on AMD Zen4 Processors | ||
|
||
| return ((is_intel() || (is_amd() && (cpu_family() > CPU_FAMILY_AMD_19H))) && supports_avx512dq()); } | ||
|
||
|
|
||
| // Intel features | ||
| static bool is_intel_family_core() { return is_intel() && | ||
| extended_cpu_family() == CPU_FAMILY_INTEL_CORE; } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't you check for
VM_Version::supports_avx512_simd_sort()here as well?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The above condition will hold for all AMD processors. Only for Zen4, even though AVX512 is supported, we want to pick AVX2 version of SIMD sort (due to the regression) which is handled by the code below:
snprintf(ebuf_, sizeof(ebuf_), VM_Version::supports_avx512_simd_sort() ? "avx512_sort" : "avx2_sort");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the clarification!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, please update the PR description summarizing the main high-level changes in this PR. Will make it easy for others.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Vamsi, updated the PR description accordingly.