[lworld+fp16] RFR: 8334432: Refine Float16.fma

Jatin Bhateja jbhateja at openjdk.org
Fri Jul 5 12:05:26 UTC 2024


On Fri, 21 Jun 2024 04:36:52 GMT, Joe Darcy <darcy at openjdk.org> wrote:

> Adding comments and test cases for Float16.fma.

Hi @jddarcy , Some queries / comments.

src/java.base/share/classes/java/lang/Float16.java line 728:

> 726:      *
> 727:      * https://www.arithmazium.org/classroom/lib/Lecture_08_notes_slides.pdf
> 728:      * https://www.arithmazium.org/classroom/lib/Lecture_09_notes_slides.pdf

👍  🖖

src/java.base/share/classes/java/lang/Float16.java line 903:

> 901:          * positions representable in the intermediate
> 902:          * product-sum. For a Float16 value, the bit positions
> 903:          * representable in the format range from 2^(-14), MIN_VALUE,

Suggestion:

         * representable in the format range from MIN_SUB_NORMAL (2^-14), MIN_VALUE,

test/jdk/java/lang/Float16/BasicFloat16ArithTests.java line 555:

> 553: 
> 554:                 {0x1.0p-24f, 0x1.0p-24f, 0x1.0p14f,
> 555:                  0x1.0p14f},

Your tests only covers overflow conditions, a few going below minimum sub-normal value (0x0.004P-14) and minimum normal value (0x1.000P-14) will also be useful.

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

PR Review: https://git.openjdk.org/valhalla/pull/1143#pullrequestreview-2160489574
PR Review Comment: https://git.openjdk.org/valhalla/pull/1143#discussion_r1666669207
PR Review Comment: https://git.openjdk.org/valhalla/pull/1143#discussion_r1666691420
PR Review Comment: https://git.openjdk.org/valhalla/pull/1143#discussion_r1666724768


More information about the valhalla-dev mailing list