RFR: 8266054: VectorAPI rotate operation optimization [v13]

Jatin Bhateja jbhateja at openjdk.java.net
Tue Jul 27 06:48:34 UTC 2021


On Tue, 27 Jul 2021 01:54:01 GMT, Sandhya Viswanathan <sviswanathan at openjdk.org> wrote:

>> Jatin Bhateja has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 19 commits:
>> 
>>  - 8266054: Re-designing benchmark to remove noise.
>>  - Merge branch 'master' of http://github.com/openjdk/jdk into JDK-8266054
>>  - 8266054: Formal argument name change to be more appropriate.
>>  - 8266054: Review comments resolution.
>>  - 8266054: Incorporating styling changes based on reviews.
>>  - Merge branch 'master' of http://github.com/openjdk/jdk into JDK-8266054
>>  - Merge http://github.com/openjdk/jdk into JDK-8266054
>>  - Merge http://github.com/openjdk/jdk into JDK-8266054
>>  - Merge http://github.com/openjdk/jdk into JDK-8266054
>>  - Merge branch 'JDK-8266054' of http://github.com/jatin-bhateja/jdk into JDK-8266054
>>  - ... and 9 more: https://git.openjdk.java.net/jdk/compare/a8f15427...b20404e2
>
> src/hotspot/share/opto/vectornode.cpp line 1199:
> 
>> 1197:                                              (Node*)(phase->intcon(shift_mask + 1));
>> 1198:     Node* vector_mask = phase->transform(VectorNode::scalar2vector(shift_mask_node,vlen, elem_ty));
>> 1199:     int subVopc = VectorNode::opcode((bt == T_LONG) ? Op_SubL : Op_SubI, bt);
> 
> There seems to be an assumption here that the vector type is INT or LONG only and not subword type. From Vector API you can get the sub word types as well.
> Also if this path is coming from auto-vectorizer, don't we need masking here?

Subtype is being passed to VectorNode::opcode for correct opcode selection. Also shift_mask_node is a constant value node, so there is no assumption on vector type. Wrap around (masking) for shift value may not be needed here since we are degenerating rotate into shifts (logical left and rights).

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

PR: https://git.openjdk.java.net/jdk/pull/3720


More information about the core-libs-dev mailing list