RFR: 8309130: x86_64 AVX512 intrinsics for Arrays.sort methods (int, long, float and double arrays) [v30]
Srinivas Vamsi Parasa
duke at openjdk.org
Wed Aug 30 15:14:28 UTC 2023
On Wed, 30 Aug 2023 08:48:09 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>>> > > Hi, We already have correctness tests. See test/jdk/java/util/Arrays/Sorting.java
>>> > > The latest version you can find in PR https://github.com/openjdk/jdk/pull/13568/files
>>> >
>>> >
>>> > Does test/jdk/java/util/Arrays/Sorting.java trigger usage of this intrinsic without additional flags? @vamsi-parasa can you check?
>>>
>>> Sure Vladimir (@vnkozlov). Will check if test/jdk/java/util/Arrays/Sorting.java is triggering the intrinsic without additional flags and let you know.
>>
>> Hi Vladimir,
>> Just verified that the test/jdk/java/util/Arrays/Sorting.java is triggering the intrinsic without additional flags as shown in the output snapshot below:
>> 
>
>> Hi Vladimir, Just verified that the test/jdk/java/util/Arrays/Sorting.java is triggering the intrinsic without additional flags
>
> Just to add that Sorting.java has short and long run modes. The default when running with jtreg or make run-test is the short run so that it doesn't take too long. It might be useful to try it without -shortrun to give the intrinsic a better work out.
> @AlanBateman If it helps, the changes made by @vamsi-parasa to DualPivotQuickSort.java don't change the logic as written in Java. They only carve out the functionality into separate Java methods retaining the meaning exactly as before. These Java methods are then optimized through a stub.
Hi Alan,
As Sandhya (@sviswa7) mentioned, this PR does not make any logic changes to the DualPivotQuickSort.java.
The code was refactored to separate out the partitioning logic (dual pivot and single pivot) into separate methods. These methods are being intrinsified using AVX512 to do vectorized partitioning preserving the logic of Java side. Similarly, the methods to sort small arrays (insertionSort/mixedInsertionSort) are being intrinsified as well to use AVX512 sort while preserving the logic on Java side.
Could you please go through the changes and provide your comments and suggestions?
Thanks,
Vamsi
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14227#issuecomment-1699367300
More information about the build-dev
mailing list