[vectorIntrinsics] RFR: 8278468: AArch64: [vectorapi] SVE backend support for CompressM and CompressV(B/H)
Ningsheng Jian
njian at openjdk.java.net
Thu Dec 30 02:37:32 UTC 2021
On Tue, 28 Dec 2021 14:00:08 GMT, Eric Liu <eliu at openjdk.org> wrote:
> 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.
I've reviewed this patch internally.
-------------
Marked as reviewed by njian (Committer).
PR: https://git.openjdk.java.net/panama-vector/pull/171
More information about the panama-dev
mailing list