aboutsummaryrefslogtreecommitdiff
path: root/c/enc/fast_log.h
diff options
context:
space:
mode:
Diffstat (limited to 'c/enc/fast_log.h')
-rw-r--r--c/enc/fast_log.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/c/enc/fast_log.h b/c/enc/fast_log.h
index b1268e0..eca58e8 100644
--- a/c/enc/fast_log.h
+++ b/c/enc/fast_log.h
@@ -19,10 +19,8 @@ extern "C" {
#endif
static BROTLI_INLINE uint32_t Log2FloorNonZero(size_t n) {
- /* TODO: generalize and move to platform.h */
-#if BROTLI_GNUC_HAS_BUILTIN(__builtin_clz, 3, 4, 0) || \
- BROTLI_INTEL_VERSION_CHECK(16, 0, 0)
- return 31u ^ (uint32_t)__builtin_clz((uint32_t)n);
+#if defined(BROTLI_BSR32)
+ return BROTLI_BSR32((uint32_t)n);
#else
uint32_t result = 0;
while (n >>= 1) result++;