JDK-8342567 : Add Float16 to jdk.incubator.vector
  • Type: CSR
  • Component: core-libs
  • Sub-Component: java.lang
  • Priority: P4
  • Status: Provisional
  • Resolution: Unresolved
  • Fix Versions: 24
  • Submitted: 2024-10-17
  • Updated: 2024-11-12
Related Reports
CSR :  
Description
Summary
-------

Add `Float16` to `jdk.incubator.vector`.

Problem
-------
IEEE 754 defines a 16-bit "float16" binary floating-point format. This smaller format is useful in various ML and AI settings and has some degree of hardware support in various processor lines.

Solution
--------

Includes a `Float16` class as part of the incubating Vector API to facilitate greater usage of this type.

The design of this type is analogous to `java.lang.`{`Float`, `Double`} with the addition of methods for various arithmetic operators.

Specification
-------------

See attached pdf.


Comments
Updated API attached as Float16-2024-11-11.pdf; largest changes from the original was updates to the decimal <-> binary conversion specs to align with the more stringent conventions used for converting float and double values.
12-11-2024

This CSR probably doesn't need a subcomponent, as vector API issues currently only have the vector-api label. We should use that label instead.
23-10-2024

For some reason, the pdf rendering of MAX_VALUE looks weird. Although the description is partially present, the `static final int MAX_VALUE` is not visible, as if a line was not converted to pdf.
23-10-2024

As mentioned in the PR review there is a slight inconsistency in referencing the JLS with respect to binary operations and the unary negate operation.
22-10-2024

Moving to Provisional.
22-10-2024