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

Pavel Rappo prappo at openjdk.org
Thu Jul 13 08:46:54 UTC 2023


On Thu, 13 Jul 2023 07:15:57 GMT, Quan Anh Mai <qamai at openjdk.org> 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.mismatch to ArraysSupport.vectorizedMismatch. In either pair, the first method is applicable to some generic array, whereas the second method is applicable to an array that would definitely benefit from vectorized processing.

When I see a call to ArraysSupport.vectorizedHashCode, it reads like a statement: this particular computation must be vectorized. Now, was it author's intention, or there simply were no alternatives to compute hash code of an array subrange or with a different initial value?

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

PR Comment: https://git.openjdk.org/jdk/pull/14831#issuecomment-1633821479


More information about the core-libs-dev mailing list