On Fri, 18 Sep 2026 04:29:14 GMT, Jatin Bhateja <[email protected]> wrote:

> Hi All,
> 
> Currently, 
> [ReplHF_reg](https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/x86/x86.ad#L18646)
>  selection pattern
> which accepts regF src operand, first copies it to a GPR using _evmovw_ 
> instruction (which has 3 cycles latency on x86 targets supporting AVX512-FP16 
> feature) and then broadcast it using _vpbroadcastw_ instruction.
> 
> On targets supporting AVX512BW feature this sequence can be replaced by a 
> single _vpbroadcastw_ instruction which can directly broadcast XMM source 
> thus saving costly XMM to GPR move.
> 
> This shows 2-3% performance improvement on AVX512-FP16 systems for benchmark 
> included with the patch.
> 
> 
> Baseline:-
> Benchmark                           Mode  Cnt   Score   Error   Units
> ReplHFRegBenchmark.manyBroadcasts  thrpt    5  16.587 ± 0.041  ops/ms
> Withchange:-
> Benchmark                           Mode  Cnt   Score   Error   Units
> ReplHFRegBenchmark.manyBroadcasts  thrpt    5  16.978 ± 0.033  ops/ms
> 
> 
> 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).

This pull request has now been integrated.

Changeset: 042f64e8
Author:    Jatin Bhateja <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/042f64e81f8e11e677062717d0f5bfc43212e7ab
Stats:     97 lines in 3 files changed: 90 ins; 2 del; 5 mod

8392548: Optimize instruction sequence for x86 ReplHF_reg instruction selection 
pattern

Reviewed-by: sviswanathan, qamai

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

PR: https://git.openjdk.org/jdk/pull/32938

Reply via email to