RFR: 8279508: Auto-vectorize Math.round API [v15]
Jatin Bhateja
jbhateja at openjdk.java.net
Sun Mar 13 04:33:47 UTC 2022
On Sun, 13 Mar 2022 00:06:07 GMT, Quan Anh Mai <duke at openjdk.java.net> wrote:
>> src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp line 4161:
>>
>>> 4159: movl(scratch, 1056964608);
>>> 4160: movq(xtmp1, scratch);
>>> 4161: vbroadcastss(xtmp1, xtmp1, vec_enc);
>>
>> An `evpbroadcastd` would reduce this by one instruction I guess?
>
> Anyway an `evpbroadcastd xmm, r` has around 5 latency on the gpr so I think you could just put the constant in the constant table and use `vbroadcastsd`
It was done to save redundant floating point to integer domain switch over penalties.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7094
More information about the core-libs-dev
mailing list