RFR: 8340079: Modify rearrange/selectFrom Vector API methods to perform wrapIndexes instead of checkIndexes

Sandhya Viswanathan sviswanathan at openjdk.org
Fri Sep 13 18:20:07 UTC 2024


On Fri, 13 Sep 2024 17:20:40 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

> Given `rearrange` with 1 vector gets wrapping indices semantics. I think we should stop normalizing indices when converting a `Vector` into a `VectorShuffle` (currently we wrap all out-of-bound elements to `[-VLEN, 0)`). Then the rearrange with 2 vectors will also wrap similarly (all indices are `& (VLEN * 2 - 1)`, then indices `[0, VLEN)` maps to the first vector and indices `[VLEN, 2 * VLEN)` map to the second vector). We will normalize the indices when we invoke `VectorShuffle::toVector` which I think is much less used than `Vector::toShuffle`. What do you think?

The guidance from Paul Sandoz and John Rose is to keep the the partial wrapping at shuffle construction as is for now and only change the rearrange and selectFrom apis.

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

PR Comment: https://git.openjdk.org/jdk/pull/20634#issuecomment-2349763832


More information about the core-libs-dev mailing list