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

Sandhya Viswanathan sviswanathan at openjdk.org
Fri Sep 13 22:33:18 UTC 2024


On Fri, 13 Sep 2024 19:45:11 GMT, Paul Sandoz <psandoz 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.
>
>> 
>> 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.
> 
> Yes, we are trying to take smaller incremental steps. Once the we are done with this work we can step back and discuss/review what to do about shuffles.

@PaulSandoz Thanks a lot for the review. I have addressed your review comments.

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

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


More information about the hotspot-dev mailing list