On Fri, 10 Apr 2026 10:25:39 GMT, Jatin Bhateja <[email protected]> wrote:
>> src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float16Vector.java
>> line 52:
>>
>>> 50: /**
>>> 51: * A specialized {@link Vector} representing an ordered immutable
>>> sequence of
>>> 52: * {@code short} values.
>>
>> I’m not sure whether this has been discussed and decided before, but should
>> we use “sequence of Float16 values” instead of “short”?
>
> In order to load/store a vector, backing storage needs to have contiguous
> layout of float16 values. Like all other vector types, backing storage for
> Float16Vector is a primitive type array of short values, as short is a
> carrier type for Float16. In long term once Valhalla flat arrays are
> integrated, we will migrate existing backing storage to Float16![]. Please
> refer to following comments in the support.
> https://github.com/openjdk/jdk/pull/28002#issuecomment-3523722566
> https://github.com/openjdk/jdk/pull/28002#pullrequestreview-3636482293
Understand why short is used here as the current carrier type for the backing
storage. My only concern is whether this implementation detail should be
reflected directly in the Java API documentation.
At the Java surface, Float16Vector reads as a vector of Float16 values (16-bit
data in IEEE 754 binary16 format), not a vector of short values. I wonder
whether the class-level doc should describe the semantic value type (Float16)
and leave the carrier/storage detail to implementation notes instead.
New here, so just my 2 cents. :-)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28002#discussion_r3067040615