[lworld+fp16] RFR: 8329817: Augment prototype Float16 class [v5]
Joe Darcy
darcy at openjdk.org
Tue Jun 11 20:35:40 UTC 2024
On Tue, 11 Jun 2024 19:46:30 GMT, Joe Darcy <darcy at openjdk.org> wrote:
>> Sketch of a more full-featured API for Float16.
>
> Joe Darcy has updated the pull request incrementally with one additional commit since the last revision:
>
> Update regression tests.
A few comments on the proposed revised API of Float16:
The Float16 class was generally brought up to static field and method level parity with java.lang.{Float, Double}. Additionally, a number of low-level floating-point handling methods from Math/StrictMath were added to, such as getExponent. These methods are usually an operation or recommended function from IEEE 754. Methods for arithmetic operators {+, -, *, /} and square root were also added. The value(short) method was changed from a bit-level conversion to a value-based one; bit-level conversion is provided by a new shortBitsToFloat16 method.
The current API favors static methods over instances one. Methods to extend the Number abstract class and implement Comparable are of necessity instance methods.
Some more work is needed on the decimal <-> binary conversion methods.
-------------
PR Comment: https://git.openjdk.org/valhalla/pull/1117#issuecomment-2161559278
More information about the valhalla-dev
mailing list