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

[AArch64] Create intrinsics compress and expand

XMLWordPrintable

    • b10
    • aarch64
    • generic

      The java.lang.Long and java.lang.Integer classes have the methods "compress(i, mask)" and "expand(i, mask)". when compiled they results in about two hundred instructions being emitted. To make it more efficient in an intrinsic would be difficult as there are no scalar instructions that perform the equivalent functions on aarch64.
      The intrinsics can be implemented with vector instructions included in SVE2; expand with BDEP, compress with BEXT .

      Only the first lane of each vector will be used, two MOV instructions will move the GPR inputs into temporary vector registers, and another to do the reverse for the result.

      In total there will be 4 instructions per intrinsic, as opposed to the dozens of instructions of compiled Java code.

      Autovectorization for this functionality is/will be implemented in a separate item.

            smonteith Stuart Monteith
            smonteith Stuart Monteith
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: