8248830 : RFR[S] : C2 : Rotate API intrinsification for X86

Andrew Haley aph at redhat.com
Sat Jul 11 08:54:07 UTC 2020


On 10/07/2020 18:32, Vladimir Ivanov wrote:

 > High-level comment: so far, there were no pressing need in
 > explicitly marking the methods as intrinsics. ROR/ROL instructions
 > were selected during matching [1]. Now the patch introduces
 > dedicated nodes (RotateLeft/RotateRight) specifically for intrinsics
 > which partly duplicates existing logic.

The lack of rotate nodes in the IR has always meant that AArch64 doesn't
generate optimal code for e.g.

   (Set dst (XorL reg1 (RotateLeftL reg2 imm)))

because, with the RotateLeft expanded to its full combination of ORs
and shifts, it's to complicated to match. At the time I put this to
one side because it wasn't urgent. This is a shame because although
such combinations are unusual they are used in some crypto operations.

If we can generate immediate-form rotate nodes early by pattern
matching during parsing (rather than depending on intrinsics) we'll
get more value than by depending on programmers calling intrinsics.

-- 
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-compiler-dev mailing list