[vectorIntrinsics] RFR: 8283709: Add x86 back-end implementation for bit BIT_COUNT operation [v9]
Jatin Bhateja
jbhateja at openjdk.java.net
Tue Apr 12 00:35:56 UTC 2022
On Tue, 12 Apr 2022 00:26:02 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:
>> src/hotspot/cpu/x86/vm_version_x86.cpp line 1705:
>>
>>> 1703:
>>> 1704: // Use population count instruction if available.
>>> 1705: if (supports_popcnt() || supports_avx512_vpopcntdq() || supports_avx512_bitalg()) {
>>
>> The UsePopCountInstruction is only for scalar popcont. Extending it to Vector popcount is causing lot of confustion. Let us keep it for scalar only as below:
>> if (supports_popcnt()) {
>> ...
>> }
>
> UsePopcountInstruction implies generating direct popcount instruction for targets which support it. A bit count operation can also be implemented without popcount as depicted by this patch.
I agree its adding some confusion since user may turn off UsePopcountInstruction and may want to generate optimized instructions for bit count over AVX2 targets using Vector API.
For SLP turning off UsePopcountInstruction will prevent creating scalar IR which will also inhabit interacting of vector operation by auto vectorizer.
-------------
PR: https://git.openjdk.java.net/panama-vector/pull/185
More information about the panama-dev
mailing list