On Fri, 10 Apr 2026 22:44:11 GMT, Xueming Shen <[email protected]> wrote:

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

Backing storage is an VM implementation level detail, even scalar Float16 API 
documentation does not refer to short carrier type 
https://docs.oracle.com/en/java/javase/26/docs/api/jdk.incubator.vector/jdk/incubator/vector/Float16.html
I have updated the documentation of public facing Float16Vector.fromArray API 
to reflect existence of IEEE 754 binary16 encoded values being read from short 
[] 

Kindly check.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28002#discussion_r3071635269

Reply via email to