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

Improve Unsafe.get*Unaligned on SPARC

    XMLWordPrintable

    Details

      Description

      The fix JDK-8151163 updates ByteBuffer and views to consistently leverage the Unsafe.get*Unaligned methods.

      On platforms where those methods are intrinsic performance is improved, such as on x86, which supports unaligned loads/stores.

      On SPARC, which does not natively support unaligned loads/stores, those methods are not intrinsic, and the Java implementation is leveraged. Initial performance analysis indicates that JDK-8151163 introduces a regression on SPARC for misalignment when loading/storing bytes is necessary, which requires 3 misalignment checks before such bytes are accessed.

      Analysis of generated code is required to better understand how Unsafe access behaves, especially in unrolled loops.

      A new Unsafe method that explicitly separates out the possibly misaligned base from an aligned (per unit size) offset may help, since the base misalignment check could be hoisted out of a loop.

      Making get*Unaligned intrinsic may also help. For example, performing two aligned load instructions and then extracting the misaligned value (see instructions FALIGNDATA and ALIGNADDRESS http://www.oracle.com/technetwork/server-storage/sun-sparc-enterprise/documentation/sparc-architecture-2015-2868130.pdf).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              psandoz Paul Sandoz
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: