On Fri, 6 Sep 2024 18:08:04 GMT, Jatin Bhateja <jbhat...@openjdk.org> wrote:

>> test/jdk/jdk/incubator/vector/ShortMaxVectorTests.java line 1048:
>> 
>>> 1046:         return 
>>> SHORT_GENERATOR_SELECT_FROM_TRIPLES.stream().map(List::toArray).
>>> 1047:                 toArray(Object[][]::new);
>>> 1048:     }
>> 
>> Just a control question: does this also occasionally generate examples with 
>> out-of-bounds indices? Negative out of bounds and positive out of bounds?
>
> Original API did throw IndexOutOfBoundsException, but later on we have moved 
> away from exception throwing semantics to wrapping semantics.
> Please find details at following comment
> https://github.com/openjdk/jdk/pull/20508#issuecomment-2306344606

And do we test that the wrapping works correctly?

>> test/jdk/jdk/incubator/vector/ShortMaxVectorTests.java line 5812:
>> 
>>> 5810:                 ShortVector bv = ShortVector.fromArray(SPECIES, b, i);
>>> 5811:                 ShortVector idxv = ShortVector.fromArray(SPECIES, 
>>> idx, i);
>>> 5812:                 idxv.selectFrom(av, bv).intoArray(r, i);
>> 
>> Would this test catch a bug where the backend would generate vectors that 
>> are too long or too short?
>
> Existing vectorAPI inline expansion entry points explicitly pass lane type 
> and count as intrinsic arguments, this is used to create concrete ideal 
> vector types.

That does not answer my question. If the backend operations you implemented 
would have the wrong vector-length: do we have any tests that would catch that? 
Often that requires not just going "up" with a loop but also "counting down" 
with the loop iv. Do you know what I mean?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20508#discussion_r1758999902
PR Review Comment: https://git.openjdk.org/jdk/pull/20508#discussion_r1759002531

Reply via email to