[lworld+fp16] RFR: 8339473: Add support for FP16 isFinite, isInfinite and isNaN [v4]

Jatin Bhateja jbhateja at openjdk.org
Thu Sep 26 03:54:53 UTC 2024


On Mon, 23 Sep 2024 16:53:12 GMT, Bhavana Kilambi <bkilambi at openjdk.org> wrote:

>> This patch adds intrinsic support for FP16 isNaN, isFinite and isInfinite methods and also adds aarch64 backend for these intrinsics.
>> 
>> Tested all FP16 related tests successfully on aarch64.
>
> Bhavana Kilambi has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add more regression tests for FP16 isFinite, isInfinite, isNaN

Since Float16 is a value type, hence C2 will always create a scalarized IR "InlineTypeNode" for it even if we don't intrinsify it. 
Consider following byte code sequence of Float16.abs
![image](https://github.com/user-attachments/assets/c30b0c41-2139-4663-af6a-c0724033ce83)

getfiled will directly return the scalar 'short' field which after subsequent logical and will return absolute value. I checked SVE does have direct instruction to negate IEEE 754 binary16 encoded value, but don't know about its latency and performance compared to logical operations.  For x86, FP16 ISA does not have a direct negation instruction so java implementation should be equally performant.

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

PR Comment: https://git.openjdk.org/valhalla/pull/1239#issuecomment-2375810571


More information about the valhalla-dev mailing list