[vectorIntrinsics] RFR: 8283598: [vectorapi] Add new vector operation for compress bits

Smita Kamath svkamath at openjdk.java.net
Thu Mar 24 20:39:13 UTC 2022


On Thu, 24 Mar 2022 08:48:45 GMT, Quan Anh Mai <duke at openjdk.java.net> wrote:

>> Hi,
>> 
>> I've added support for new vector operations for compressing bits of integral vector types(Byte/Short/Integer/Long).
>> The implementation is based on Compress or Generalized Extract mentioned in Hackers Delight by Henry S. Warren, Jr.
>> The implementation does the following: given a mask and the number to be compressed, the bits of the number corresponding to the set mask bit are selected and compressed. 
>> 
>> Currently, this PR addresses only Java changes for compress bits operation. I've also updated the test framework.
>> Do review and share feedback.
>
> Hi, what do you think about adding this operation for scalar first, and then adding it to vector api later. We could add several other bit manipulation operations such as `bitCount` and `numberOfLeadingZeros` for `Byte` and `Short` also.
> Thanks.

Hi @merykitty, That is a good idea. However, the effort to bring it to scalar is much larger as we need to file a JEP and follow the required processes. This is why we plan to introduce it in Vector API first.

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

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


More information about the panama-dev mailing list