On Thu, 17 Oct 2024 23:11:07 GMT, Joe Darcy <da...@openjdk.org> wrote:

> Port of Float16 from java.lang in the lworld+fp16 branch to 
> jdk.incubabor.vector.

Comparing with https://github.com/openjdk/jdk/pull/21490 we can see that there 
are more than minimum number of intrinsics I recommended above, but (crucially) 
the intrinsics are decoupled from the box type, and refactored into 
`Float16Math.java`.

https://github.com/openjdk/jdk/pull/21490/files#diff-105a2bf4929174c594b5bcc54f749e93d9fca1b5371ca301fff02badd0e8da5a

For example, see the max intrinsics line 53.  These intrinsics are better 
structured for the JIT, because there is no extraneous boxing to deal with.  
(Boxes involve null checks and heap allocation and other details which are just 
extra overhead.)

Apart from intrinsic classification, a simpler thing to do that may help the 
box methods to fold up correctly would be a `@ForceInline` annotation.  But for 
the simple methods in this PR that is usually overkill.

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

PR Comment: https://git.openjdk.org/jdk/pull/21574#issuecomment-2424347511

Reply via email to