On Wed, 8 Jan 2025 09:04:47 GMT, Nicole Xu <d...@openjdk.org> wrote: > Suite `MaskedLogicOpts.maskedLogicOperationsLong512()` failed on both x86 and > AArch64 with the following error: > > > java.lang.IndexOutOfBoundsException: Index 252 out of bounds for length 249 > > > The variable `long256_arr_idx` is misused when indexing `LongVector l2`, > `l3`, `l4`, `l5` in function `maskedLogicOperationsLongKernel()` resulting in > the IndexOutOfBoundsException error. On the other hand, the unified index for > 128-bit, 256-bit and 512-bit species might not be proper since it leaves gaps > in between when accessing the data for 128-bit and 256-bit species. This will > unnecessarily include the noise due to cache misses or (on some targets) > prefetching additional cache lines which are not usable, thereby impacting > the crispness of microbenchmark. > > Hence, we improved the benchmark from several aspects, > 1. Used sufficient number of predicated operations within the vector loop > while minimizing the noise due to memory operations. > 2. Modified the index computation logic which can now withstand any ARRAYLEN > without resulting in an IOOBE. > 3. Removed redundant vector read/writes to instance fields, thus eliminating > significant boxing penalty which translates into throughput gains.
This pull request has now been integrated. Changeset: 107ee878 Author: Nicole Xu <yuya...@nvidia.com> URL: https://git.openjdk.org/jdk/commit/107ee878d66f4006f102c1fd12af3bf156a25757 Stats: 145 lines in 1 file changed: 5 ins; 29 del; 111 mod 8346954: [JMH] jdk.incubator.vector.MaskedLogicOpts fails due to IndexOutOfBoundsException Co-authored-by: Jatin Bhateja <jbhat...@openjdk.org> Reviewed-by: jbhateja, xgong ------------- PR: https://git.openjdk.org/jdk/pull/22963