[vectorIntrinsics] RFR: 8283598: [vectorapi] Add new vector operation for compress bits
Paul Sandoz
psandoz at openjdk.java.net
Tue Mar 29 15:12:15 UTC 2022
On Tue, 29 Mar 2022 04:37:35 GMT, Eric Liu <eliu at openjdk.org> wrote:
>> Hi @PaulSandoz, do you think this implementation of compress bits is fine? I can plan to create a separate PR for expand bits operation. Do let me know. Thanks.
>
>> I think i mistook the intended implementation when writing the JEP.
>>
>> Since there is no scalar equivalent the operation is currently under specified, and in this case I think the expand operation also makes sense so `compress(expand(x, m), m) = x`
>
> If the true count of `m` is less than the significant bits of `x` , I think `x` will lost bits so that this equation doesn't work. E.g., m = 0b00000001, x = 0b11111111. It's 0b00000001 after expand(x, m) , and if compressed it back with the same bitmask `m`, it will get 0b00000001.
Yes, thanks, it only works for certain cases, i did not think it through carefully.
-------------
PR: https://git.openjdk.java.net/panama-vector/pull/184
More information about the panama-dev
mailing list