Lines 167-173
CountLeadingZeroes32(uint32_t x) {
Link Here
|
167 |
|
167 |
|
168 |
ABSL_ATTRIBUTE_ALWAYS_INLINE ABSL_INTERNAL_CONSTEXPR_CLZ inline int |
168 |
ABSL_ATTRIBUTE_ALWAYS_INLINE ABSL_INTERNAL_CONSTEXPR_CLZ inline int |
169 |
CountLeadingZeroes16(uint16_t x) { |
169 |
CountLeadingZeroes16(uint16_t x) { |
170 |
#if ABSL_HAVE_BUILTIN(__builtin_clzs) |
170 |
#if ABSL_HAVE_BUILTIN(__builtin_clzg) |
|
|
171 |
return x == 0 ? 16 : __builtin_clzg(x); |
172 |
#elif ABSL_HAVE_BUILTIN(__builtin_clzs) |
171 |
static_assert(sizeof(unsigned short) == sizeof(x), // NOLINT(runtime/int) |
173 |
static_assert(sizeof(unsigned short) == sizeof(x), // NOLINT(runtime/int) |
172 |
"__builtin_clzs does not take 16-bit arg"); |
174 |
"__builtin_clzs does not take 16-bit arg"); |
173 |
return x == 0 ? 16 : __builtin_clzs(x); |
175 |
return x == 0 ? 16 : __builtin_clzs(x); |
Lines 303-309
CountTrailingZeroesNonzero64(uint64_t x) {
Link Here
|
303 |
|
305 |
|
304 |
ABSL_ATTRIBUTE_ALWAYS_INLINE ABSL_INTERNAL_CONSTEXPR_CTZ inline int |
306 |
ABSL_ATTRIBUTE_ALWAYS_INLINE ABSL_INTERNAL_CONSTEXPR_CTZ inline int |
305 |
CountTrailingZeroesNonzero16(uint16_t x) { |
307 |
CountTrailingZeroesNonzero16(uint16_t x) { |
306 |
#if ABSL_HAVE_BUILTIN(__builtin_ctzs) |
308 |
#if ABSL_HAVE_BUILTIN(__builtin_ctzg) |
|
|
309 |
return __builtin_ctzg(x); |
310 |
#elif ABSL_HAVE_BUILTIN(__builtin_ctzs) |
307 |
static_assert(sizeof(unsigned short) == sizeof(x), // NOLINT(runtime/int) |
311 |
static_assert(sizeof(unsigned short) == sizeof(x), // NOLINT(runtime/int) |
308 |
"__builtin_ctzs does not take 16-bit arg"); |
312 |
"__builtin_ctzs does not take 16-bit arg"); |
309 |
return __builtin_ctzs(x); |
313 |
return __builtin_ctzs(x); |