Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8209783

AArch64: Combine Multiply and Neg operations in C2

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 12
    • Fix Version/s: 12
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b09
    • CPU:
      aarch64
    • OS:
      linux

      Description

      Below Java code patterns

      int c = a * (-b);
      int d = (-a) * b;
      long p = m * (-n);
      long q = (-m) * n;

      generates code like

      0x0000ffff88ae66d4: neg w10, w2
      0x0000ffff88ae66d8: mul w0, w1, w10

      OR

      0x0000ffff88ae66d4: neg x10, x2
      0x0000ffff88ae66d8: mul x0, x1, x10

      The neg & mul instructions can be combined into one single mneg instruction like

      mneg w0, w1, w2

      OR

      mneg x0, x1, x2

        Attachments

          Activity

            People

            • Assignee:
              zyao Zhongwei Yao
              Reporter:
              zyao Zhongwei Yao
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: