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).

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

Commit messages:
 - 8389858: Correct VectorMask.toVector API note for floating-point species

Changes: https://git.openjdk.org/jdk/pull/32430/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=32430&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8389858
  Stats: 7 lines in 1 file changed: 0 ins; 3 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/32430.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/32430/head:pull/32430

PR: https://git.openjdk.org/jdk/pull/32430

Reply via email to