[aarch64-port-dev ] AARCH64 optimization: using TBZ instruction for bit check

Andrew Haley aph at redhat.com
Mon Jun 15 09:28:59 UTC 2020


On 12/06/2020 19:10, Boris Ulasevich wrote:
> Please review the new AARCH64 instruction selection rules.
> The change applies TBZ instruction for bit checks: "if ((var&16) == 16)".
> This makes 17% performance improvement on the benchmark and 5% on a real
> application.

Please forgive me if I am misunderstanding, but...

This is strange Java for anyone to write. The expression "((var&16) == 16)"
is, I think, equivalent to "((var&16) != 0)". Do you believe that it
is wise to add new patterns to do this to (potentially) every HotSpot
back end rather than canonicalize the expression during the
machine-independent part of C2? This would have the same improvement
on all targets.

-- 
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 aarch64-port-dev mailing list