[vectorIntrinsics] RFR: 8283598: [vectorapi] Add new vector operation for compress bits
Smita Kamath
svkamath at openjdk.java.net
Wed Mar 30 16:53:08 UTC 2022
On Tue, 29 Mar 2022 08:45:29 GMT, Xiaohong Gong <xgong at openjdk.org> 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.
>
> src/hotspot/share/opto/mulnode.hpp line 396:
>
>> 394: class CompressBitsNode : public Node {
>> 395: public:
>> 396: CompressBitsNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {}
>
> Style: the spaces are not needed after `"("` and before `")"`. And spaces are needed between the arguments. And `"*"` is better to be next close to the type. So suggest to modify as:
> `CompressBitsNode(Node* in1, Node* in2) : Node(0, in1, in2) {}`
Thank you. Will fix this.
> test/jdk/jdk/incubator/vector/templates/Unit-header.template line 1507:
>
>> 1505: a = ($type$) (a & b);
>> 1506: $type$ count_mask = ($type$) (~b << 1);
>> 1507: $type$ mp, mv, t;
>
> These are not used?
Thanks for pointing this out. Will fix it.
-------------
PR: https://git.openjdk.java.net/panama-vector/pull/184
More information about the panama-dev
mailing list