9#ifndef BROTLI_ENC_FIND_MATCH_LENGTH_H_
10#define BROTLI_ENC_FIND_MATCH_LENGTH_H_
13#include <brotli/types.h>
15#if defined(__cplusplus) || defined(c_plusplus)
20#if defined(BROTLI_TZCNT64) && BROTLI_64_BITS && BROTLI_LITTLE_ENDIAN
25 size_t limit2 = (
limit >> 3) + 1;
28 BROTLI_UNALIGNED_LOAD64LE(
s1 + matched))) {
32 uint64_t x = BROTLI_UNALIGNED_LOAD64LE(s2) ^
33 BROTLI_UNALIGNED_LOAD64LE(
s1 + matched);
34 size_t matching_bits = (size_t)BROTLI_TZCNT64(x);
35 matched += matching_bits >> 3;
55 const uint8_t* s2_limit = s2 +
limit;
56 const uint8_t* s2_ptr = s2;
61 while (s2_ptr <= s2_limit - 4 &&
62 BrotliUnalignedRead32(s2_ptr) ==
63 BrotliUnalignedRead32(
s1 + matched)) {
67 while ((s2_ptr < s2_limit) && (
s1[matched] == *s2_ptr)) {
75#if defined(__cplusplus) || defined(c_plusplus)
#define s1(x)
Definition Sha256.c:142
static uint32_t const uint8_t uint32_t uint32_t limit
Definition memcmplen.h:45