summaryrefslogtreecommitdiffstats
path: root/modules/brotli/enc/find_match_length.h
diff options
context:
space:
mode:
Diffstat (limited to 'modules/brotli/enc/find_match_length.h')
-rw-r--r--modules/brotli/enc/find_match_length.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/brotli/enc/find_match_length.h b/modules/brotli/enc/find_match_length.h
index bc428cffd..f8853a70f 100644
--- a/modules/brotli/enc/find_match_length.h
+++ b/modules/brotli/enc/find_match_length.h
@@ -17,8 +17,7 @@ extern "C" {
#endif
/* Separate implementation for little-endian 64-bit targets, for speed. */
-#if defined(__GNUC__) && defined(_LP64) && defined(BROTLI_LITTLE_ENDIAN)
-
+#if defined(BROTLI_TZCNT64) && BROTLI_64_BITS && BROTLI_LITTLE_ENDIAN
static BROTLI_INLINE size_t FindMatchLengthWithLimit(const uint8_t* s1,
const uint8_t* s2,
size_t limit) {
@@ -32,7 +31,7 @@ static BROTLI_INLINE size_t FindMatchLengthWithLimit(const uint8_t* s1,
} else {
uint64_t x = BROTLI_UNALIGNED_LOAD64LE(s2) ^
BROTLI_UNALIGNED_LOAD64LE(s1 + matched);
- size_t matching_bits = (size_t)__builtin_ctzll(x);
+ size_t matching_bits = (size_t)BROTLI_TZCNT64(x);
matched += matching_bits >> 3;
return matched;
}