diff options
Diffstat (limited to 'c/enc/find_match_length.h')
-rw-r--r-- | c/enc/find_match_length.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/c/enc/find_match_length.h b/c/enc/find_match_length.h index b3e3d80..4184531 100644 --- a/c/enc/find_match_length.h +++ b/c/enc/find_match_length.h @@ -17,7 +17,7 @@ extern "C" { #endif /* Separate implementation for little-endian 64-bit targets, for speed. */ -#if defined(__GNUC__) && defined(_LP64) && defined(IS_LITTLE_ENDIAN) +#if defined(__GNUC__) && defined(_LP64) && defined(BROTLI_LITTLE_ENDIAN) static BROTLI_INLINE size_t FindMatchLengthWithLimit(const uint8_t* s1, const uint8_t* s2, @@ -25,13 +25,13 @@ static BROTLI_INLINE size_t FindMatchLengthWithLimit(const uint8_t* s1, size_t matched = 0; size_t limit2 = (limit >> 3) + 1; /* + 1 is for pre-decrement in while */ while (BROTLI_PREDICT_TRUE(--limit2)) { - if (BROTLI_PREDICT_FALSE(BROTLI_UNALIGNED_LOAD64(s2) == - BROTLI_UNALIGNED_LOAD64(s1 + matched))) { + if (BROTLI_PREDICT_FALSE(BROTLI_UNALIGNED_LOAD64LE(s2) == + BROTLI_UNALIGNED_LOAD64LE(s1 + matched))) { s2 += 8; matched += 8; } else { - uint64_t x = - BROTLI_UNALIGNED_LOAD64(s2) ^ BROTLI_UNALIGNED_LOAD64(s1 + matched); + uint64_t x = BROTLI_UNALIGNED_LOAD64LE(s2) ^ + BROTLI_UNALIGNED_LOAD64LE(s1 + matched); size_t matching_bits = (size_t)__builtin_ctzll(x); matched += matching_bits >> 3; return matched; |