RFR: 8310691: [REDO] [vectorapi] Refactor VectorShuffle implementation [v2]

Paul Sandoz psandoz at openjdk.org
Thu Dec 5 20:50:41 UTC 2024


On Tue, 26 Nov 2024 18:15:47 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

>> src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractVector.java line 228:
>> 
>>> 226:         }
>>> 227: 
>>> 228:         AbstractVector<?> iota = vspecies().asIntegral().iota();
>> 
>> I suspect the non-power of two code is more efficient. (Even better if the MUL could be transformed to a shift for power of two values.)
>> 
>> Separately, it makes me wonder if we should revisit the shuffle factories if it is now much more efficient to construct a shuffle from a vector.
>
> `shuffleFromOp` is a slow path op so I don't think it is. Additionally, our vector multiplication is against a scalar, too. So we can optimize it if `step` is a constant.

I incorrectly read `!=` as `==` :-) as that is the more common pattern used in the code base, so i was thinking the power of two code path was using `shuffleFromOp`. Could you invert the check to be more consistent?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21042#discussion_r1872048156


More information about the hotspot-compiler-dev mailing list