RFR: 8317976: Optimize SIMD sort for AMD Zen 4 [v2]

Srinivas Vamsi Parasa sparasa at openjdk.org
Wed Mar 26 18:37:21 UTC 2025


On Tue, 25 Mar 2025 23:27:28 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

>> Rohit Arul Raj has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   create a separate method to check for cpu's supporting avx512 version of simd sort
>
> src/hotspot/cpu/x86/vm_version_x86.hpp line 778:
> 
>> 776:   static bool supports_avx512_simd_sort() {
>> 777:     //  Disable AVX512 version of SIMD Sort on AMD Zen4 Processors
>> 778:     return ((is_intel() || (is_amd() && (cpu_family() > CPU_FAMILY_AMD_19H))) && supports_avx512dq()); }
> 
> It's quite hard to parse. The following looks clearer to me:
> 
> if (supports_avx512dq()) {
>   // Disable AVX512 version of SIMD Sort on AMD Zen4 Processors.
>   if (is_amd() && cpu_family() == CPU_FAMILY_AMD_19H) {
>     return false;
>   } 
>   return true;
> }
> return false;

I second the suggested refactoring. Need to make sure the original `is_intel()` check is also included appropriately in the logic :)

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24053#discussion_r2014795963


More information about the hotspot-compiler-dev mailing list