JDK-8309130 : x86_64 AVX512 intrinsics for Arrays.sort methods (int, long, float and double arrays)
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 21,22
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: x86
  • Submitted: 2023-05-30
  • Updated: 2024-11-23
  • Resolved: 2023-10-06
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 22
22 b19Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
The goal is to develop faster sort routines for x68_64 CPUs by taking advantage of AVX512 instructions. This enhancement provides an order of magnitude speedup for Arrays.sort() using int, long, float and double arrays. 
Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/14227 Date: 2023-05-30 18:54:50 +0000
23-11-2024

Hello Matthias, This is a bug in GCC 12 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105593) and this issue seems to be resolved in GCC 12.3.1 as I was able to successfully build OpenJDK using GCC 12.3.1. Thanks, Vamsi
09-10-2023

Adding DISABLED_WARNINGS_gcc := uninitialized, \ to BUILD_LIB_SIMD_SORT makes the build pass on the problematic Alpine 3.17 environment. The error can be observed as well on Alpine 3.18.2 .
09-10-2023

In the Linux musl (Alpine x86_64) build, we run now into a ton of warnings as errors like this : /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/include/avx512fintrin.h:4459:50: error: '__Y' is used uninitialized [-Werror=uninitialized] Should we disable this warning ? Or is it a problematic warning? We use 12.2.1 on our Alpine box running Alpine 3.17.4 . details : In function '__m512i _mm512_shuffle_epi32(__m512i, _MM_PERM_ENUM)', inlined from 'static zmm_vector<int>::zmm_t zmm_vector<int>::shuffle(zmm_t) [with unsigned char mask = 177]' at /openjdk/linuxmuslx86_64/jdk-dev/src/java.base/linux/native/libsimdsort/avx512-32bit-qsort.hpp:96:36, inlined from 'zmm_t sort_zmm_32bit(zmm_t) [with vtype = zmm_vector<int>; zmm_t = __vector(8) long long int]' at /openjdk/linuxmuslx86_64/jdk-dev/src/java.base/linux/native/libsimdsort/avx512-32bit-qsort.hpp:181:27: /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/include/avx512fintrin.h:4459:50: error: '__Y' is used uninitialized [-Werror=uninitialized] 4459 | return (__m512i) __builtin_ia32_pshufd512_mask ((__v16si) __A, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~ 4460 | __mask, | ~~~~~~~ 4461 | (__v16si) | ~~~~~~~~~ 4462 | _mm512_undefined_epi32 (), | ~~~~~~~~~~~~~~~~~~~~~~~~~~ 4463 | (__mmask16) -1); | ~~~~~~~~~~~~~~~ /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/include/avx512fintrin.h: In function 'zmm_t sort_zmm_32bit(zmm_t) [with vtype = zmm_vector<int>; zmm_t = __vector(8) long long int]': /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/include/avx512fintrin.h:206:11: note: '__Y' was declared here 206 | __m512i __Y = __Y; | ^~~
09-10-2023

Changeset: a4e9168b Author: vamsi-parasa <srinivas.vamsi.parasa@intel.com> Committer: Sandhya Viswanathan <sviswanathan@openjdk.org> Date: 2023-10-06 20:15:30 +0000 URL: https://git.openjdk.org/jdk/commit/a4e9168bab1c2872ce2dbc7971a45c259270271f
06-10-2023