On Mon, 3 Aug 2026 05:52:53 GMT, Jatin Bhateja <[email protected]> wrote:

>> Patch optimizes Float16 to integral conversion operations. Currently, its a 
>> two step process where by first a Float16 value is
>> converted to a single precision floating point value followed by a 
>> conversion to an integral value.
>> 
>> x86 targets supporting AVX512-FP16 feature (Intel Sapphire Rapids+ and 
>> upcoming AMD Zen6) provides direct instruction to convert a Float16 value to 
>> integral value.
>> 
>> Following are the performance numbers of micro benchmark included with the 
>> patch on Granite Rapids with and without auto-vectorization.
>> 
>> <img width="1125" height="636" alt="image" 
>> src="https://github.com/user-attachments/assets/ca6e6757-1579-475f-8307-9454c7c025c1";
>>  />
>> 
>> Kindly review and share your feedback.
>> 
>> Best Regards,
>> Jatin
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Jatin Bhateja has updated the pull request with a new target base due to a 
> merge or a rebase. The incremental webrev excludes the unrelated changes 
> brought in by the merge/rebase. The pull request contains seven additional 
> commits since the last revision:
> 
>  - Merge branch 'master' of http://github.com/openjdk/jdk into JDK-8382523
>  - Review comments resolution
>  - Review comments resolution
>  - Review comments resolution
>  - Review comments resolution
>  - Review comments resolution
>  - 8382523: Optimize Float16 to integral conversion operations for 
> AVX512-FP16 targets

I ran the new tests and micros on machine that supports AVX512-FP16. All runs 
went through without issue. Once minor code updates are made, I'll add my 
approval to PR.

src/hotspot/cpu/x86/assembler_x86.cpp line 2375:

> 2373: }
> 2374: 
> 2375: void Assembler::evcvttph2dq(XMMRegister dst, XMMRegister src, int 
> vector_len) {

Please move evcvttph2dq and evcvttph2qq definitions to be just after vcvttps2dq 
definition. That way the two evcvttps2dqs definitions stay next to each other.

src/hotspot/cpu/x86/assembler_x86.hpp line 1328:

> 1326:   void evcvttsd2sisq(Register dst, Address src);
> 1327: 
> 1328:   void evcvttsh2sil(Register dst, XMMRegister src);

Please add a comment above these declarations that is similar to other ones 
(e.g., "//Convert with Truncation Scalar Half-Precision Floating-Point Value to 
Doubleword Integer").

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

Changes requested by missa (Author).

PR Review: https://git.openjdk.org/jdk/pull/30928#pullrequestreview-4857832909
PR Review Comment: https://git.openjdk.org/jdk/pull/30928#discussion_r3715296357
PR Review Comment: https://git.openjdk.org/jdk/pull/30928#discussion_r3715269859

Reply via email to