[vectorIntrinsics] RFR: 8284459: Add x86 back-end implementation for LEADING_ZEROS_COUNT operation

Eric Liu eliu at openjdk.java.net
Wed Apr 13 04:52:42 UTC 2022


On Thu, 7 Apr 2022 07:30:24 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

> Summary of changes:
> - Patch extends SLP vectorizer to auto-vectorize Integer.numberOfLeadingZeros() and Long.numberOfLeadingZeros() APIs.
> - Adds optimized target feature specific X86 backend implementation for LEADING_ZEROS_COUNT operation for all integral types. 
> 
> Kindly review and share your feedback.
> 
> Best Regards,
> Jatin

src/hotspot/share/opto/loopTransform.cpp line 981:

> 979:         const TypeVect* vt = n->bottom_type()->is_vect();
> 980:         body_size += Matcher::vector_op_pre_select_sz_estimate(n->Opcode(), vt->element_basic_type(), vt->length());
> 981:       } break;

It can share the same code with Op_PopCountVI/L.

src/hotspot/share/opto/vectornode.hpp line 94:

> 92:   static bool is_vshift_cnt(Node* n);
> 93:   static bool is_type_transition_short_to_int(Node* n);
> 94:   static bool is_type_transition_to_int(Node* n);

Not sure if we should add these 2 l2i candidates into `is_type_transition_to_int`. As they are indeed transformed to int.

src/hotspot/share/opto/vectornode.hpp line 96:

> 94:   static bool is_type_transition_to_int(Node* n);
> 95:   static bool is_muladds2i(Node* n);
> 96:   static bool is_downcasting_l2i_candidate(Node* n);

I noticed there is  `static bool is_type_transition_short_to_int(Node* n)` above, how do you think about `is_type_transition_long_to_int`?

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

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


More information about the panama-dev mailing list