[vectorIntrinsics+compress] RFR: 8274971: Add VectorMask.compress API [v4]

Joshua Zhu jzhu at openjdk.java.net
Tue Oct 12 09:06:23 UTC 2021


> I separate my implementation of "compress" API into several patches for easy review.
> This change is to import PrefixMask API for VectorMask.
> It cooperates with compress/expand API. (See the usage in ALIBABA selectiveStore use case.)
> It returns a prefix mask, based on the true count of the mask.
> Assume "N" is the true count of the mask, the mask bit is set from the beginning lane till the lane numbered "N-1", otherwise it is unset.
> Temporarily mask.prefixMask() is implemented by
> 
>     vectorSpecies.iota().compare(VectorOperators.LT, trueCount());
> 
> The alternative implementation is:
> 
>     vectorSpecies().indexInRange(0, m.trueCount())
> 
> I choose the former implementation since the latter depends on the Intrinsic support of indexVector.
> 
> I'm looking for instructions that could be used to accelerate indexVector/iota, so that vector-to-vector operations together with a store/load and prefix mask could be optimized further into single memory version instruction. 
> Intel experts, do you have any suggestions on SIMD instructions for iota vector generation?

Joshua Zhu has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains two new commits since the last revision:

 - update
 - 8274971: Add VectorMask.compress API

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

Changes:
  - all: https://git.openjdk.java.net/panama-vector/pull/148/files
  - new: https://git.openjdk.java.net/panama-vector/pull/148/files/04dd0173..2c538799

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=panama-vector&pr=148&range=03
 - incr: https://webrevs.openjdk.java.net/?repo=panama-vector&pr=148&range=02-03

  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/panama-vector/pull/148.diff
  Fetch: git fetch https://git.openjdk.java.net/panama-vector pull/148/head:pull/148

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


More information about the panama-dev mailing list