On Wed, 2 Sep 2026 04:23:31 GMT, Xueming Shen <[email protected]> wrote:

>> VectorOperators.IS_FINITE, IS_NAN, and IS_INFINITE are floating-point-only 
>> test operators. Applying one of these operators to an integral vector 
>> currently reaches the **_if (opKind(op, VO_SPECIAL)) {...}_** handing branch 
>> implemented in testTemplate and throws AssertionError, instead of reporting 
>> an unsupported operation.
>> 
>> This change:
>> 
>> - Checks VectorOperators.Test.compatibleWith(...) before executing specially 
>> implemented test operations.
>> - Throws UnsupportedOperationException for incompatible element types in 
>> both masked and unmasked test(...) operations.
>> - Documents UnsupportedOperationException in both public Vector.test(...) 
>> overloads.
>> - Updates VectorLanewiseOpCompatibleWithTest to cover supported and 
>> unsupported test operators, with and without masks, across the available 
>> vector species.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Xueming Shen has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   update

test/jdk/jdk/incubator/vector/VectorLanewiseOpCompatibleWithTest.java line 178:

> 176:                 vector.lanewise(ternary, vector, vector, mask);
> 177:             }
> 178:             default -> throw new AssertionError("Not a lanewise 
> operator: " + op);

Isn't it better to add a new case like:

case VectorOperators.Test test -> {
    vector.test(op);
    vector.test(op, mask);
}


Same for `testUnsupportedOperator`. Don't need all these new unit tests.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/32633#discussion_r3916597035

Reply via email to