[vectorIntrinsics] RFR: 8282389: Add new vector operations to count leading and trailing zeros.

Xiaohong Gong xgong at openjdk.java.net
Mon Feb 28 09:28:17 UTC 2022


On Fri, 25 Feb 2022 18:59:34 GMT, Swati Sharma <duke at openjdk.java.net> wrote:

> Hi All,
> 
> Added support for new vector operations CLZ (count number of leading zeros) and CTZ (could number of trailing zeros) for all the integral vector types(Byte/Short/Integer/Long).
> Added validation and performance tests corresponding the these operations in existing VectorAPI JTREG/JMH suite.
> 
> Kindly review and share your feedback.
> 
> Thanks and Regards,
> Swati Sharma
> Intel

test/jdk/jdk/incubator/vector/Byte128VectorTests.java line 5323:

> 5321: 
> 5322:     static byte CTZ(byte a) {
> 5323:         return (byte)(CTZ_scalar(a));

Why not directly `return (byte) (a != 0 ? Integer.numberOfTrailingZeros(a) : 8);` in this method?

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

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


More information about the panama-dev mailing list