[vectorIntrinsics] RFR: 8253680: Vector API VectorMask and VectorSpecies tests for coverage [v2]

Sandhya Viswanathan sviswanathan at openjdk.java.net
Mon Sep 28 20:29:18 UTC 2020


On Mon, 28 Sep 2020 18:06:49 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

>> Sandhya Viswanathan has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Implement review comments
>
> test/jdk/jdk/incubator/vector/templates/Unit-Miscellaneous.template line 424:
> 
>> 422:             int expectedTcount = Long.bitCount(vmask.toLong());
>> 423: #else[!MaxBit]
>> 424:             int expectedTcount = 0;
> 
> I think you should consistently derive the expected count from the source `a` regardless of the kind of vector.

Done.

> test/jdk/jdk/incubator/vector/templates/Unit-Miscellaneous.template line 487:
> 
>> 485:         for (int i = 0; i < limit; i += SPECIES.length()) {
>> 486:             var actualMask = SPECIES.indexInRange(i+offset, limit);
>> 487:             var expectedMask = SPECIES.maskAll(true).indexInRange(i+offset, limit);
> 
> `i+offset` -> `i + offset` and for other expressions

Done.

> test/jdk/jdk/incubator/vector/templates/Unit-Miscellaneous.template line 467:
> 
>> 465:         var vmask = VectorMask.fromLong(SPECIES, inputLong);
>> 466:         long outputLong = vmask.toLong();
>> 467:         Assert.assertEquals(outputLong, inputLong & (((1l << (SPECIES.length()-1)) << 1)-1));
> 
> Recommend using `L` for the identifier of a long value (see also array declaration in `longMaskProvider`)
> since lower case letter `l` is hard to distinguish from the digit `1`, and placing spaces in the subtracting
> expression. Alternatively could use `SPECIES.maskAll(true).toLong()` to avoid a complex expression dealing with the
> edge case of 64 lanes.

Added L and missing spaces. Kept the complex expression as the test itself is for fromLong and toLong so using toLong
in expectedValue may not be preferable.

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

PR: https://git.openjdk.java.net/panama-vector/pull/9


More information about the panama-dev mailing list