[vectorIntrinsics] RFR: 8278468: AArch64: [vectorapi] SVE backend support for CompressM and CompressV(B/H)

Eric Liu eliu at openjdk.java.net
Tue Dec 28 14:06:05 UTC 2021


This patch adds the backend rules for CompressM and CompressV on BYTE
and SHORT types. The basic idea is to use SVE compact instruction which
supports INT type. The general process for vector compression is as
below:

1. Split and extend the vector into INT type.
2. Compresse the extended vectors by COMPACT(S) and narrow the
   results back to original type.
3. Merge the results by concatenating the compressed elements together.

The generated code by "ShortVector.compress" is as follows:


        mov       z19.h, #0
        sunpklo   z17.s, z16.h
        punpklo   p0.h, p1.b
        compact   z17.s, p0, z17.s
        uzp1      z17.h, z17.h, z19.h
        cntp      x8, p7, p0.s
        punpkhi   p0.h, p1.b
        sunpkhi   z18.s, z16.h
        compact   z18.s, p0, z18.s
        uzp1      z18.h, z18.h, z19.h
        neg       x8, x8
        index     z19.h, w8, #1
        tbl       z18.h, {z18.h}, z19.h
        orr       z17.d, z17.d, z18.d


The performance has a significant improvement in my test machines.

-------------

Commit messages:
 - 8278468: AArch64: [vectorapi] SVE backend support for CompressM and CompressV(B/H)

Changes: https://git.openjdk.java.net/panama-vector/pull/171/files
 Webrev: https://webrevs.openjdk.java.net/?repo=panama-vector&pr=171&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8278468
  Stats: 276 lines in 8 files changed: 245 ins; 4 del; 27 mod
  Patch: https://git.openjdk.java.net/panama-vector/pull/171.diff
  Fetch: git fetch https://git.openjdk.java.net/panama-vector pull/171/head:pull/171

PR: https://git.openjdk.java.net/panama-vector/pull/171


More information about the panama-dev mailing list