JDK-8289551 : Conversions between bit representations of half precision values and floats
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-06-30
  • Updated: 2024-10-27
  • Resolved: 2022-07-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 20
20 b08Fixed
Related Reports
Blocks :  
CSR :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
Add static methods to `Float` that convert between the bit representation of a half precision floating point (float16) value and float.

The bit representation of a float16 value is a short value.

These methods will enable superior interoperation with machine learning models and native machine learning libraries.

The implementations will conform to the IEEE 754-2008 standard.

Additional work beyond the scope of this issue can improve the performance of these implementations:
- they can be made intrinsic leveraging hardware instructions on appropriate platforms; and 
- if the hardware platform supports vector instructions it may be possible to enhance C2's auto-vectorizer
Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/9422 Date: 2022-07-08 06:11:22 +0000
27-10-2024

Changeset: 7318b222 Author: Joe Darcy <darcy@openjdk.org> Date: 2022-07-26 16:54:32 +0000 URL: https://git.openjdk.org/jdk/commit/7318b22209a83c593176ec600647a9b050362932
26-07-2022

From IEEE 754-2019 table 3.5 -- Binary interchange formats, the binary16 format: * is 16 bits wide * has 11 precision bits (including the implicit bit) * has one sign bit * has 5 exponent bits (max exponent of 15)
30-06-2022