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

PPC64: Improve performance of Long.reverseBytes() and Integer.reverseBytes() on Power9

    Details

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

      Description

      In the Power9 instruction set, there are several instructions available for doing byte reversal within a
      VSX register. xxbrd can be used for reversing bytes in a 64-bit Long, and xxbrw can be used to reverse bytes in a 32-bit Integer.

      There is also an instruction for reversing 16-bit short types, but the cost overhead of using a VSX operation for this is prohibitive compared with the existing instruction sequence.

      These two instructions can be used to perform the byte reversal by moving the contents of the source general purpose register to a vector register, performing the reversal, and moving the vector register to the destination general purpose register.

      A simple benchmark shows an overall minimum of 38% performance improvement for Long.reverseBytes() and a 15% improvement for Integer.reverseBytes().

        Attachments

          Activity

            People

            • Assignee:
              mhorie Michihiro Horie
              Reporter:
              gromero Gustavo Romero
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: