Re: RFR: 8311864: Add ArraysSupport.hashCode(int[] a, fromIndex, length, initialValue) [v6]

2024-05-08 Thread Pavel Rappo
> This PR adds an internal method to calculate hash code from the provided > integer array, offset and length into that array, and the initial hash code > value. > > Current options for calculating a hash code for int[] are inflexible. It's > either ArraysSupport.vectorizedHashCode with an offs

Re: RFR: 8311864: Add ArraysSupport.hashCode(int[] a, fromIndex, length, initialValue) [v5]

2024-03-27 Thread Pavel Rappo
> This PR adds an internal method to calculate hash code from the provided > integer array, offset and length into that array, and the initial hash code > value. > > Current options for calculating a hash code for int[] are inflexible. It's > either ArraysSupport.vectorizedHashCode with an offs

Re: RFR: 8311864: Add ArraysSupport.hashCode(int[] a, fromIndex, length, initialValue) [v4]

2024-02-12 Thread Pavel Rappo
On Tue, 2 Jan 2024 14:37:16 GMT, Pavel Rappo wrote: >> This PR adds an internal method to calculate hash code from the provided >> integer array, offset and length into that array, and the initial hash code >> value. >> >> Current options for calculating a hash code for int[] are inflexible. I

Re: RFR: 8311864: Add ArraysSupport.hashCode(int[] a, fromIndex, length, initialValue) [v4]

2024-01-17 Thread Pavel Rappo
On Tue, 2 Jan 2024 14:37:16 GMT, Pavel Rappo wrote: >> This PR adds an internal method to calculate hash code from the provided >> integer array, offset and length into that array, and the initial hash code >> value. >> >> Current options for calculating a hash code for int[] are inflexible. I

Re: RFR: 8311864: Add ArraysSupport.hashCode(int[] a, fromIndex, length, initialValue) [v4]

2024-01-02 Thread Pavel Rappo
> This PR adds an internal method to calculate hash code from the provided > integer array, offset and length into that array, and the initial hash code > value. > > Current options for calculating a hash code for int[] are inflexible. It's > either ArraysSupport.vectorizedHashCode with an offs

Re: RFR: 8311864: Add ArraysSupport.hashCode(int[] a, fromIndex, length, initialValue) [v3]

2023-12-14 Thread Pavel Rappo
> This PR adds an internal method to calculate hash code from the provided > integer array, offset and length into that array, and the initial hash code > value. > > Current options for calculating a hash code for int[] are inflexible. It's > either ArraysSupport.vectorizedHashCode with an offs

Re: RFR: 8311864: Add ArraysSupport.hashCode(int[] a, fromIndex, length, initialValue) [v2]

2023-11-07 Thread Pavel Rappo
> This PR adds an internal method to calculate hash code from the provided > integer array, offset and length into that array, and the initial hash code > value. > > Current options for calculating a hash code for int[] are inflexible. It's > either ArraysSupport.vectorizedHashCode with an offs

Re: RFR: 8311864: Add ArraysSupport.hashCode(int[] a, fromIndex, length, initialValue)

2023-10-11 Thread Pavel Rappo
On Tue, 11 Jul 2023 16:35:51 GMT, Pavel Rappo wrote: > This PR adds an internal method to calculate hash code from the provided > integer array, offset and length into that array, and the initial hash code > value. > > Current options for calculating a hash code for int[] are inflexible. It's

Re: RFR: 8311864: Add ArraysSupport.hashCode(int[] a, fromIndex, length, initialValue)

2023-08-25 Thread Pavel Rappo
On Tue, 11 Jul 2023 16:35:51 GMT, Pavel Rappo wrote: > This PR adds an internal method to calculate hash code from the provided > integer array, offset and length into that array, and the initial hash code > value. > > Current options for calculating a hash code for int[] are inflexible. It's

Re: RFR: 8311864: Add ArraysSupport.hashCode(int[] a, fromIndex, length, initialValue)

2023-07-28 Thread Pavel Rappo
On Fri, 28 Jul 2023 10:05:01 GMT, Claes Redestad wrote: > I think we could consider dropping `vectorized` from `vectorizedHashCode`: > there's nothing in the library-side implementation for this that is > explicitly setting up for vectorization of each case (unlike the > `mismatch/vectorizedMi

Re: RFR: 8311864: Add ArraysSupport.hashCode(int[] a, fromIndex, length, initialValue)

2023-07-28 Thread Pavel Rappo
On Tue, 11 Jul 2023 16:35:51 GMT, Pavel Rappo wrote: > This PR adds an internal method to calculate hash code from the provided > integer array, offset and length into that array, and the initial hash code > value. > > Current options for calculating a hash code for int[] are inflexible. It's

Re: RFR: 8311864: Add ArraysSupport.hashCode(int[] a, fromIndex, length, initialValue)

2023-07-28 Thread Pavel Rappo
On Tue, 11 Jul 2023 16:35:51 GMT, Pavel Rappo wrote: > This PR adds an internal method to calculate hash code from the provided > integer array, offset and length into that array, and the initial hash code > value. > > Current options for calculating a hash code for int[] are inflexible. It's

Re: RFR: 8311864: Add ArraysSupport.hashCode(int[] a, fromIndex, length, initialValue)

2023-07-28 Thread Pavel Rappo
On Fri, 28 Jul 2023 12:37:13 GMT, Claes Redestad wrote: > > Perhaps surprisingly, we don't need int[]; what JDK seems to use is these: > > > > * byte[] > > * unsigned byte[] > > * Object[] > > All `vectorizedHashCode` variants are exposed (and testable) via the public > `java.util.Arrays.hashC

Re: RFR: 8311864: Add ArraysSupport.hashCode(int[] a, fromIndex, length, initialValue)

2023-07-28 Thread Claes Redestad
On Fri, 28 Jul 2023 10:49:34 GMT, Pavel Rappo wrote: > Perhaps surprisingly, we don't need int[]; what JDK seems to use is these: > > * byte[] > * unsigned byte[] > * Object[] All `vectorizedHashCode` variants are exposed (and testable) via the public `java.util.Arrays.hashCode(byte/char/short

Re: RFR: 8311864: Add ArraysSupport.hashCode(int[] a, fromIndex, length, initialValue)

2023-07-28 Thread Claes Redestad
On Tue, 11 Jul 2023 16:35:51 GMT, Pavel Rappo wrote: > This PR adds an internal method to calculate hash code from the provided > integer array, offset and length into that array, and the initial hash code > value. > > Current options for calculating a hash code for int[] are inflexible. It's

Re: RFR: 8311864: Add ArraysSupport.hashCode(int[] a, fromIndex, length, initialValue)

2023-07-28 Thread Claes Redestad
On Tue, 11 Jul 2023 16:35:51 GMT, Pavel Rappo wrote: > This PR adds an internal method to calculate hash code from the provided > integer array, offset and length into that array, and the initial hash code > value. > > Current options for calculating a hash code for int[] are inflexible. It's

Re: RFR: 8311864: Add ArraysSupport.hashCode(int[] a, fromIndex, length, initialValue)

2023-07-14 Thread Pavel Rappo
On Tue, 11 Jul 2023 16:35:51 GMT, Pavel Rappo wrote: > This PR adds an internal method to calculate hash code from the provided > integer array, offset and length into that array, and the initial hash code > value. > > Current options for calculating a hash code for int[] are inflexible. It's

Re: RFR: 8311864: Add ArraysSupport.hashCode(int[] a, fromIndex, length, initialValue)

2023-07-13 Thread Roger Riggs
On Tue, 11 Jul 2023 16:35:51 GMT, Pavel Rappo wrote: > This PR adds an internal method to calculate hash code from the provided > integer array, offset and length into that array, and the initial hash code > value. > > Current options for calculating a hash code for int[] are inflexible. It's

Re: RFR: 8311864: Add ArraysSupport.hashCode(int[] a, fromIndex, length, initialValue)

2023-07-13 Thread Glavo
On Thu, 13 Jul 2023 09:27:03 GMT, Pavel Rappo wrote: > > @pavelrappo Actually I look at the implementation of > > `ArraySupport.vectorizedHashCode` and it does branching and only uses > > vector instructions if the length is sufficiently large. Please do > > benchmarking if you are uncertain w

Re: RFR: 8311864: Add ArraysSupport.hashCode(int[] a, fromIndex, length, initialValue)

2023-07-13 Thread Pavel Rappo
On Thu, 13 Jul 2023 08:44:02 GMT, Pavel Rappo wrote: >>> For an arbitrary int[], unconditional vectorization might be unwarranted or >>> puzzling. >> >> Could you clarify this statement? Thanks a lot. > >> > For an arbitrary int[], unconditional vectorization might be unwarranted >> > or puzzl

Re: RFR: 8311864: Add ArraysSupport.hashCode(int[] a, fromIndex, length, initialValue)

2023-07-13 Thread Quan Anh Mai
On Thu, 13 Jul 2023 08:44:02 GMT, Pavel Rappo wrote: >>> For an arbitrary int[], unconditional vectorization might be unwarranted or >>> puzzling. >> >> Could you clarify this statement? Thanks a lot. > >> > For an arbitrary int[], unconditional vectorization might be unwarranted >> > or puzzl

Re: RFR: 8311864: Add ArraysSupport.hashCode(int[] a, fromIndex, length, initialValue)

2023-07-13 Thread Pavel Rappo
On Thu, 13 Jul 2023 07:15:57 GMT, Quan Anh Mai wrote: > > For an arbitrary int[], unconditional vectorization might be unwarranted or > > puzzling. > > Could you clarify this statement? Thanks a lot. My mental model is that Arrays.hashCode is to ArraysSupport.vectorizedHashCode as Arrays.mism

Re: RFR: 8311864: Add ArraysSupport.hashCode(int[] a, fromIndex, length, initialValue)

2023-07-13 Thread Quan Anh Mai
On Tue, 11 Jul 2023 16:35:51 GMT, Pavel Rappo wrote: > For an arbitrary int[], unconditional vectorization might be unwarranted or > puzzling. Could you clarify this statement? Thanks a lot. - PR Comment: https://git.openjdk.org/jdk/pull/14831#issuecomment-1633696435

Re: RFR: 8311864: Add ArraysSupport.hashCode(int[] a, fromIndex, length, initialValue)

2023-07-11 Thread Pavel Rappo
On Tue, 11 Jul 2023 16:35:51 GMT, Pavel Rappo wrote: > This PR adds an internal method to calculate hash code from the provided > integer array, offset and length into that array, and the initial hash code > value. > > Current options for calculating a hash code for int[] are inflexible. It's

RFR: 8311864: Add ArraysSupport.hashCode(int[] a, fromIndex, length, initialValue)

2023-07-11 Thread Pavel Rappo
This PR adds an internal method to calculate hash code from the provided integer array, offset and length into that array, and the initial hash code value. Current options for calculating a hash code for int[] are inflexible. It's either ArraysSupport.vectorizedHashCode with an offset, length a