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

AARCH64: optimize the construction of the value from the bits of the other two

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 16
    • Fix Version/s: tbd
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • CPU:
      aarch64
    • OS:
      generic

      Description

      It's possible to reduce number of instructions for the following code sequence:

      v1 = (v2 & 0xFF) | ((v3 & 0xFF) << 8);

      0x0000ffffa4a7920c: ubfiz x11, x2, #8, #8
      0x0000ffffa4a79210: and x10, x1, #0xff
      0x0000ffffa4a79214: orr x0, x10, x11
      -->
      0x0000ffffa4a7920c: ubfiz x0, x2, #8, #8
      0x0000ffffa4a79210: bfxil x0, x1, #0, #8

      Such sequences are seen in lucene: https://github.com/apache/lucene-solr/blob/master/lucene/core/src/java/org/apache/lucene/util/compress/LZ4.java#L111 and sometimes in JDK:
      http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/f4c62eecf7fa/src/share/classes/com/sun/crypto/provider/RC2Crypt.java#l166

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bulasevich Boris Ulasevich
                Reporter:
                bulasevich Boris Ulasevich
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: