RFR: 8338023: Support two vector selectFrom API [v13]
Sandhya Viswanathan
sviswanathan at openjdk.org
Tue Oct 1 18:05:44 UTC 2024
On Tue, 1 Oct 2024 09:53:02 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:
>> Thanks for the example. Yes, you have a point there. So we would need to do:
>> src1.rearrange(this.lanewise(VectorOperators.AND, 2 * VLENGTH - 1).toShuffle(), src2);
>
>> This could instead be: src1.rearrange(this.lanewise(VectorOperators.AND, 2 * VLENGTH - 1).toShuffle(), src2); Or even simplified to: src1.rearrange(this.toShuffle(), src2);
>
> Yes, this may save additional allocation penalty of result array allocation which may slightly improve fall back performance, but logical operation cannot be directly applied over floating point vectors. so, we will need an explicit conversion to integral vector, which is why I opted for current fallback implementation which is in line with rest of the code.
I see the problem with float/double vectors. Let us do the rearrange form only for Integral (byte, short, int, long) vectors then. For float/double vector we could keep the code that you have currently.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20508#discussion_r1783278063
More information about the core-libs-dev
mailing list