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

Sandhya Viswanathan sviswanathan at openjdk.java.net
Thu Apr 14 01:10:31 UTC 2022


On Wed, 13 Apr 2022 08:39:57 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
>
> Jatin Bhateja has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains three commits:
> 
>  - 8284459: Adding an exponent based leading zero count algorithm for integer vectors, its showing around 10-15% gain.
>  - Merge branch 'vectorIntrinsics' of http://github.com/openjdk/panama-vector into JDK-8284459
>  - 8284459: Add x86 back-end implementation for LEADING_ZERO_COUNT operation

src/hotspot/cpu/x86/assembler_x86.cpp line 7957:

> 7955:   assert(VM_Version::supports_avx512cd() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), "");
> 7956:   InstructionAttr attributes(vector_len, /* vex_w */ false,/* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true);
> 7957:   attributes.set_address_attributes(/* tuple_type */ EVEX_FV,/* input_size_in_bits */ EVEX_32bit);

set_address_attributes not needed as there is no memory address in this instruction. It is only register to register.

src/hotspot/cpu/x86/assembler_x86.cpp line 7970:

> 7968:   assert(VM_Version::supports_avx512cd() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), "");
> 7969:   InstructionAttr attributes(vector_len, /* vex_w */ true,/* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true);
> 7970:   attributes.set_address_attributes(/* tuple_type */ EVEX_FV,/* input_size_in_bits */ EVEX_32bit);

set_address_attributes not needed as there is no memory address in this instruction. It is only register to register.

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

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


More information about the panama-dev mailing list