C++20 <bit> provides std::countl_zero and std::countr_zero, which are both constexpr. However, they only support unsigned types, so we would probably want to keep the names of the existing HotSpot functions (count_leading_zeros and count_trailing_zeros) as wrappers that also handle signed types.
- relates to
-
JDK-8253386 Improve population_count using C++20 popcount
-
- Closed
-