RFR: 8309130: x86_64 AVX512 intrinsics for Arrays.sort methods (int, long, float and double arrays) [v26]

Srinivas Vamsi Parasa duke at openjdk.org
Fri Aug 25 01:51:15 UTC 2023


On Thu, 24 Aug 2023 18:08:44 GMT, Sandhya Viswanathan <sviswanathan at openjdk.org> wrote:

>> Srinivas Vamsi Parasa has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   add parallelSort benchmarking
>
> src/java.base/share/classes/java/util/Arrays.java line 102:
> 
>> 100:     static void arraySort(Class<?> elemType, Object array, long offset, int fromIndex, int toIndex, int end) {
>> 101:         DualPivotQuicksort.smallArraySort(array, fromIndex, toIndex, end);
>> 102:     }
> 
> The arraySort and arrayPartition methods could be part of DualPivotQuicksort.java now.
> Then we can also remove the extra indirection from arraySort to smallArraySort and from arrayPartition to partitionSinglePivot and partitionDualPivot.

Please see  arraySort and arrayPartition methods moved to DualPivotQuicksort.java in the latest commit.

> src/java.base/share/classes/java/util/DualPivotQuicksort.java line 389:
> 
>> 387:                  */
>> 388:                 pivotIndices = new int[] {e1, e5};
>> 389:                 Arrays.arrayPartition(int.class, a, baseOffset, low, high, pivotIndices, Unsafe.ARRAY_INT_BASE_OFFSET, isDualPivot);
> 
> The Unsafe.ARRAY_INT_BASE_OFFSET parameter after pivotIndices is not needed.

pivotIndices array is being passed as a parameter to the partition intrinsic as it is updated in-place with the new pivot indices after partitioning. The Unsafe.ARRAY_INT_BASE_OFFSET is being used in libary_call.cpp to get the address of pivotIndices.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14227#discussion_r1305026970
PR Review Comment: https://git.openjdk.org/jdk/pull/14227#discussion_r1304970521


More information about the hotspot-compiler-dev mailing list