RFR: 8331196: vector api: Remove unnecessary index check in Byte/ShortVector.fromArray/fromArray0Template
Paul Sandoz
psandoz at openjdk.org
Mon May 20 19:24:00 UTC 2024
On Fri, 26 Apr 2024 14:06:02 GMT, Hamlin Li <mli at openjdk.org> wrote:
> Hi,
> Can you help to review this simple patch?
> Some index check in Byte/ShortVector.fromArray/fromArray0Template seems not necessary, could be removed.
> Thanks
That does not look correct and will only check a prefix indexes. A `ByteVector` with a shape of 256 bits has 32 lanes, whereas an `IntVector` of the same shape has 8 lanes. The `mapOffset` array will hold 32 indexes that need checking, so we need to loop through `mapOffset` array four times.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/18977#issuecomment-2121057883
More information about the core-libs-dev
mailing list