RFR: 8157906: aarch64: some more integer rotate instructions are never emitted

Felix Yang felix.yang at linaro.org
Thu May 26 17:26:49 UTC 2016


  Please review webrev:  http://cr.openjdk.java.net/~fyang/8157906/webrev.00
  JIRA issue:  https://bugs.openjdk.java.net/browse/JDK-8157906

  This patch has been contributed by teng.lu at linaro.org
  The left rotate instructions have the same issue with
  (src << shift) | src >>> -shift) with src an int have some support in the
aarch64.ad ad file: rolI_rReg_Var_C_32 and rolI_rReg_Var_C0, but their
definitions is broken and never match any ideal graph subtree.

  Tested with fastdebug jtreg hotspot and langtools, OK to push?

Simple test case:
import java.lang.Integer.*;

public class test {
  public static int foo (int x) {
    return Integer.rotateLeft(x, 1);

  public static void main(String[] args) {
    int x = 0x1234;

    for (int i = 0; i < 50000; i++) {
      x = foo(x);

JIT code snippet before change:
  0x0000007f74d13454: neg   w11, w2
  0x0000007f74d13458: lsr   w12, w1, w11
  0x0000007f74d1345c: lsl   w10, w1, w2
  0x0000007f74d13460: orr   w0, w10, w12    ;*ior {reexecute=0 rethrow=0
                                                ; -
java.lang.Integer::rotateLeft at 7 (line 1751)
JIT code snippet after change:
  0x0000007f6cd135d4: neg   w8, w2
  0x0000007f6cd135d8: ror   w0, w1, w8      ;*ior {reexecute=0 rethrow=0
                                                ; -
java.lang.Integer::rotateLeft at 7 (line 1751)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20160527/d06f2c2e/attachment.html>

More information about the hotspot-compiler-dev mailing list