13 #ifndef LZMA_MEMCMPLEN_H
14 #define LZMA_MEMCMPLEN_H
18 #ifdef HAVE_IMMINTRIN_H
19 # include <immintrin.h>
49 #if defined(TUKLIB_FAST_UNALIGNED_ACCESS) \
50 && ((TUKLIB_GNUC_REQ(3, 4) && defined(__x86_64__)) \
51 || (defined(__INTEL_COMPILER) && defined(__x86_64__)) \
52 || (defined(__INTEL_COMPILER) && defined(_M_X64)) \
53 || (defined(_MSC_VER) && defined(_M_X64)))
62 #define LZMA_MEMCMPLEN_EXTRA 8
68 _BitScanForward64(&
tmp,
x);
81 #elif defined(TUKLIB_FAST_UNALIGNED_ACCESS) \
82 && defined(HAVE__MM_MOVEMASK_EPI8) \
83 && ((defined(__GNUC__) && defined(__SSE2_MATH__)) \
84 || (defined(__INTEL_COMPILER) && defined(__SSE2__)) \
85 || (defined(_MSC_VER) && defined(_M_IX86_FP) \
94 # define LZMA_MEMCMPLEN_EXTRA 16
96 const uint32_t x = 0xFFFF ^ _mm_movemask_epi8(_mm_cmpeq_epi8(
97 _mm_loadu_si128((
const __m128i *)(buf1 +
len)),
98 _mm_loadu_si128((
const __m128i *)(
buf2 +
len))));
110 #elif defined(TUKLIB_FAST_UNALIGNED_ACCESS) && !defined(WORDS_BIGENDIAN)
112 # define LZMA_MEMCMPLEN_EXTRA 4
116 if ((
x & 0xFFFF) == 0) {
132 #elif defined(TUKLIB_FAST_UNALIGNED_ACCESS) && defined(WORDS_BIGENDIAN)
134 # define LZMA_MEMCMPLEN_EXTRA 4
138 if ((
x & 0xFFFF0000) == 0) {
143 if ((
x & 0xFF000000) == 0)
156 # define LZMA_MEMCMPLEN_EXTRA 0
static uint32_t lzma_attribute((__always_inline__)) lzma_memcmplen(const uint8_t *buf1
assert(limit<=UINT32_MAX/2)
static uint32_t const uint8_t uint32_t len
static uint32_t const uint8_t * buf2
static uint32_t const uint8_t uint32_t uint32_t limit
Definitions common to the whole liblzma library.
static uint32_t ctz32(uint32_t n)
static uint32_t read32ne(const uint8_t *buf)
static uint64_t read64ne(const uint8_t *buf)