On Wed, 11 Oct 2023 23:25:30 GMT, Vladimir Ivanov <vliva...@openjdk.org> wrote:

>> src/java.base/share/classes/java/util/DualPivotQuicksort.java line 157:
>> 
>>> 155:     @ForceInline
>>> 156:     private static <A> void sort(Class<?> elemType, A array, long 
>>> offset, int low, int high, SortOperation<A> so) {
>>> 157:         so.sort(array, low, high);
>> 
>> I'm late to the party, but how does the fallback implementation work (or is 
>> intended to) for off-heap case (null + absolute base address)?
>
> Also, for on-heap case the fallback implementation is equivalent to 
> intrinsified case only when offset points at the 0th element of the array.

@iwanowww Yes, you are late to the party :). The fallback implementation could 
be similar to the vectorizedMismatch regarding base/offset for non heap case. 
Please see 
java.base/share/classes/jdk/internal/foreign/AbstractMemorySegmentImpl.java.
Yes, the fallback implementation for non intrinsic case is kept to be 
equivalent to what was before the SIMD sort PR. This is done to not affect the 
fallback performance on other platforms.

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

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

Reply via email to