On Tue, 18 Aug 2026 20:24:33 GMT, Xueming Shen <[email protected]> wrote:

> The API note currently says:
> 
> "If the mask is for a float-point species, then the resulting vector will 
> have the same shape and lane size, but an integral type."
> 
> This does not match the method signature or its implementation:
> 
>     public abstract Vector<E> toVector();
> 
> For a floating-point mask, toVector() returns a vector of the same 
> floating-point element type and species as the mask. For example:
> 
>     VectorMask<Float> fm = VectorMask.fromValues(
>             FloatVector.SPECIES_128,
>             true, false, true, false);
> 
>     Vector<Float> fv = fm.toVector();
> 
>     fv // [-1.0, 0.0, -1.0, 0.0]
>     fv.elementType() // float
>     fv.species() // Species[float, 4, S_128_BIT]
>     fv.getClass().getName() // jdk.incubator.vector.FloatVector128
> 
> Similarly, VectorMask<Double/Float16>.toVector() returns a FP Vector, not a 
> integral Vector.
> 
> This behavior also agrees with the main method description, which states that 
> the resulting lanes contain the arithmetic values 0 or -1 for both integral 
> and floating-point element types.
> 
> This is a doc-only fix to correct the API note.  (Note: an alternative is to 
> simply remove this API note)
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

@PaulSandoz

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

PR Comment: https://git.openjdk.org/jdk/pull/32430#issuecomment-5333931738

Reply via email to