RFR: 8277155: Compress and expand vector operations
Paul Sandoz
psandoz at openjdk.java.net
Thu Jan 20 22:20:53 UTC 2022
On Wed, 24 Nov 2021 19:20:08 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:
> Add two new cross-lane vector operations, `compress` and `expand`.
>
> An example of such usage might be code that selects elements from array `a` and stores those selected elements in array `z`:
>
>
> int[] a = ...;
>
> int[] z = ...;
> int ai = 0, zi = 0;
> while (ai < a.length) {
> IntVector av = IntVector.fromArray(SPECIES, a, ai);
> // query over elements of vector av
> // returning a mask marking elements of interest
> VectorMask<Integer> m = interestingBits(av, ...);
> IntVector zv = av.compress(m);
> zv.intoArray(z, zi, m.compress());
> ai += SPECIES.length();
> zi += m.trueCount();
> }
>
>
> (There's also a more sophisticated version using `unslice` to coalesce matching elements with non-masked stores.)
>
> Given RDP 1 for 18 is getting close, 2021/12/09, we may not get this reviewed in time and included in [JEP 417](https://openjdk.java.net/jeps/417). Still I think I think it worth starting the review now (the CSR is marked provisional).
Withdrawing and will create a new PR corresponding to a new incubating JEP.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6545
More information about the core-libs-dev
mailing list