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

Jatin Bhateja jbhateja at openjdk.java.net
Sun Apr 10 02:39:06 UTC 2022


On Thu, 7 Apr 2022 12:05:40 GMT, Quan Anh Mai <duke at openjdk.java.net> wrote:

> Hi, for int vectors, I think you could convert it to float and look at the exponent part. For long vectors, the results can be obtained by counting each half and combined together. Thanks.

Hi, nice suggestion!, for almost all AVX512 targets (AVX512CD) we do have direct instruction to compute leading zero count for both integer and long vectors, in addition quad word to double precision conversion instruction is supported only for AVX512DQ targets. But I think we can still manage to generate efficient sequence for integer vectors for AVX2 target by extracting biased exponents.

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

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


More information about the panama-dev mailing list