Skip to content

Commit 2edf9c3

Browse files
vamsi-parasaVladimir Kozlov
authored andcommitted
8317763: Follow-up to AVX512 intrinsics for Arrays.sort() PR
Reviewed-by: jbhateja, kvn, ihse, sviswanathan
1 parent 839cb19 commit 2edf9c3

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

make/modules/java.base/Lib.gmk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ ifeq ($(ENABLE_FALLBACK_LINKER), true)
227227
NAME := fallbackLinker, \
228228
CFLAGS := $(CFLAGS_JDKLIB) $(LIBFFI_CFLAGS), \
229229
LDFLAGS := $(LDFLAGS_JDKLIB) \
230-
$(call SET_SHARED_LIBRARY_ORIGIN), \
230+
$(call SET_SHARED_LIBRARY_ORIGIN), \
231231
LIBS := $(LIBFFI_LIBS), \
232232
LIBS_windows := $(LIBFFI_LIBS) ws2_32.lib, \
233233
))

src/hotspot/cpu/x86/stubGenerator_x86_64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4173,7 +4173,7 @@ void StubGenerator::generate_compiler_stubs() {
41734173
}
41744174

41754175
// Load x86_64_sort library on supported hardware to enable avx512 sort and partition intrinsics
4176-
if (UseAVX > 2 && VM_Version::supports_avx512dq()) {
4176+
if (VM_Version::is_intel() && VM_Version::supports_avx512dq()) {
41774177
void *libsimdsort = nullptr;
41784178
char ebuf_[1024];
41794179
char dll_name_simd_sort[JVM_MAXPATHLEN];

src/java.base/linux/native/libsimdsort/avx512-common-qsort.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,18 @@
5757
#include <cmath>
5858
#include <cstdint>
5959
#include <cstring>
60-
#include <immintrin.h>
6160
#include <limits>
6261

62+
/*
63+
Workaround for the bug in GCC12 (that was fixed in GCC 12.3.1).
64+
More details are available at: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105593
65+
*/
66+
#pragma GCC diagnostic push
67+
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
68+
#pragma GCC diagnostic ignored "-Wuninitialized"
69+
#include <immintrin.h>
70+
#pragma GCC diagnostic pop
71+
6372
#define X86_SIMD_SORT_INFINITY std::numeric_limits<double>::infinity()
6473
#define X86_SIMD_SORT_INFINITYF std::numeric_limits<float>::infinity()
6574
#define X86_SIMD_SORT_INFINITYH 0x7c00

src/java.base/share/classes/java/util/DualPivotQuicksort.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ interface PartitionOperation<A> {
166166
/**
167167
* Partitions the specified range of the array using the given pivots.
168168
*
169-
* @param a the array to be sorted
170-
* @param low the index of the first element, inclusive, to be sorted
171-
* @param high the index of the last element, exclusive, to be sorted
169+
* @param a the array to be partitioned
170+
* @param low the index of the first element, inclusive, to be partitioned
171+
* @param high the index of the last element, exclusive, to be partitioned
172172
* @param pivotIndex1 the index of pivot1, the first pivot
173173
* @param pivotIndex2 the index of pivot2, the second pivot
174174
*/
@@ -178,13 +178,13 @@ interface PartitionOperation<A> {
178178
/**
179179
* Partitions the specified range of the array using the two pivots provided.
180180
*
181-
* @param elemType the class of the array to be sorted
182-
* @param array the array to be sorted
181+
* @param elemType the class of the array to be partitioned
182+
* @param array the array to be partitioned
183183
* @param offset the relative offset, in bytes, from the base address of
184184
* the array to partition, otherwise if the array is {@code null},an absolute
185185
* address pointing to the first element to partition from.
186-
* @param low the index of the first element, inclusive, to be sorted
187-
* @param high the index of the last element, exclusive, to be sorted
186+
* @param low the index of the first element, inclusive, to be partitioned
187+
* @param high the index of the last element, exclusive, to be partitioned
188188
* @param pivotIndex1 the index of pivot1, the first pivot
189189
* @param pivotIndex2 the index of pivot2, the second pivot
190190
* @param po the method reference for the fallback implementation

0 commit comments

Comments
 (0)