RFR: 8256820: AArch64: Optimize vector rotate (immediate) with shift and insert instructions [v2]

Andrew Haley aph at redhat.com
Tue Dec 15 10:47:33 UTC 2020


On 14/12/2020 11:48, Dong Bo wrote:

> We tested this on the two servers we have by hand now. It is a pity
> for us that we didn't see performance improvements on `Cortex-A72`.
> Because we have detected microarchitecture in the code already, I
> thought we could make full use of the flexibility it provided.
>
> We find the shift and insert instructions are used in Linux OS for
> serveral crypto algorithms for all CPUs [1, 2, 3].

I don't want to be unfair to you. There are many small optimizations
that we have made for which we don't require large-scale benchmarks.
I'm not going to start insisting that every small change shows a
gain on such benchmarks.

But this patch seems to be very marginal: not only does it offer a
modest gain one one machine, it also shows a modest loss on another.
Not only that, but we do not know if auto-vectorization is at all
effective on these OpenJDK's algorithms.

My reason for pushing back here is that I want HotSpot to generate "good"
code for all AArch64 platforms, rather than containing special patterns
for microarchitectures. There are risks if we allow that. For example,
mistakes which affect only one machine might be made by accident, and
they cannot be tested by anyone who does not have that machine. Also,
the AArch64 back end becomes complex and hard to maintain.

For example, a simple mistake made during a critical patch update
might break Kunpeng920, and unless everybody tests on all machines, we
might not know until it's too late to fix it.

So, any change which causes divergence between microarchitectures must
be needed, or it isn't worth the risk. It's not in your interest for
that to happen, either.

-- 
Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671



More information about the hotspot-dev mailing list