24#ifndef BROTLI_COMMON_PLATFORM_H_
25#define BROTLI_COMMON_PLATFORM_H_
29#include <brotli/port.h>
34#if BROTLI_MSVC_VERSION_CHECK(18, 0, 0)
38#if defined(BROTLI_ENABLE_LOG) || defined(BROTLI_DEBUG)
66#if BROTLI_GNUC_HAS_BUILTIN(__builtin_expect, 3, 0, 0) || \
67 BROTLI_INTEL_VERSION_CHECK(16, 0, 0) || \
68 BROTLI_SUNPRO_VERSION_CHECK(5, 15, 0) || \
69 BROTLI_ARM_VERSION_CHECK(4, 1, 0) || \
70 BROTLI_IBM_VERSION_CHECK(10, 1, 0) || \
71 BROTLI_TI_VERSION_CHECK(7, 3, 0) || \
72 BROTLI_TINYC_VERSION_CHECK(0, 9, 27)
73#define BROTLI_PREDICT_TRUE(x) (__builtin_expect(!!(x), 1))
74#define BROTLI_PREDICT_FALSE(x) (__builtin_expect(x, 0))
76#define BROTLI_PREDICT_FALSE(x) (x)
77#define BROTLI_PREDICT_TRUE(x) (x)
80#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
82#define BROTLI_RESTRICT restrict
83#elif BROTLI_GNUC_VERSION_CHECK(3, 1, 0) || \
84 BROTLI_MSVC_VERSION_CHECK(14, 0, 0) || \
85 BROTLI_INTEL_VERSION_CHECK(16, 0, 0) || \
86 BROTLI_ARM_VERSION_CHECK(4, 1, 0) || \
87 BROTLI_IBM_VERSION_CHECK(10, 1, 0) || \
88 BROTLI_PGI_VERSION_CHECK(17, 10, 0) || \
89 BROTLI_TI_VERSION_CHECK(8, 0, 0) || \
90 BROTLI_IAR_VERSION_CHECK(8, 0, 0) || \
91 (BROTLI_SUNPRO_VERSION_CHECK(5, 14, 0) && defined(__cplusplus))
92#define BROTLI_RESTRICT __restrict
93#elif BROTLI_SUNPRO_VERSION_CHECK(5, 3, 0) && !defined(__cplusplus)
94#define BROTLI_RESTRICT _Restrict
96#define BROTLI_RESTRICT
99#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \
100 (defined(__cplusplus) && (__cplusplus >= 199711L))
101#define BROTLI_MAYBE_INLINE inline
102#elif defined(__GNUC_STDC_INLINE__) || defined(__GNUC_GNU_INLINE__) || \
103 BROTLI_ARM_VERSION_CHECK(6, 2, 0)
104#define BROTLI_MAYBE_INLINE __inline__
105#elif BROTLI_MSVC_VERSION_CHECK(12, 0, 0) || \
106 BROTLI_ARM_VERSION_CHECK(4, 1, 0) || BROTLI_TI_VERSION_CHECK(8, 0, 0)
107#define BROTLI_MAYBE_INLINE __inline
109#define BROTLI_MAYBE_INLINE
112#if BROTLI_GNUC_HAS_ATTRIBUTE(always_inline, 4, 0, 0) || \
113 BROTLI_INTEL_VERSION_CHECK(16, 0, 0) || \
114 BROTLI_SUNPRO_VERSION_CHECK(5, 11, 0) || \
115 BROTLI_ARM_VERSION_CHECK(4, 1, 0) || \
116 BROTLI_IBM_VERSION_CHECK(10, 1, 0) || \
117 BROTLI_TI_VERSION_CHECK(8, 0, 0) || \
118 (BROTLI_TI_VERSION_CHECK(7, 3, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__))
119#define BROTLI_INLINE BROTLI_MAYBE_INLINE __attribute__((__always_inline__))
120#elif BROTLI_MSVC_VERSION_CHECK(12, 0, 0)
121#define BROTLI_INLINE BROTLI_MAYBE_INLINE __forceinline
122#elif BROTLI_TI_VERSION_CHECK(7, 0, 0) && defined(__cplusplus)
123#define BROTLI_INLINE BROTLI_MAYBE_INLINE _Pragma("FUNC_ALWAYS_INLINE;")
124#elif BROTLI_IAR_VERSION_CHECK(8, 0, 0)
125#define BROTLI_INLINE BROTLI_MAYBE_INLINE _Pragma("inline=forced")
127#define BROTLI_INLINE BROTLI_MAYBE_INLINE
130#if BROTLI_GNUC_HAS_ATTRIBUTE(noinline, 4, 0, 0) || \
131 BROTLI_INTEL_VERSION_CHECK(16, 0, 0) || \
132 BROTLI_SUNPRO_VERSION_CHECK(5, 11, 0) || \
133 BROTLI_ARM_VERSION_CHECK(4, 1, 0) || \
134 BROTLI_IBM_VERSION_CHECK(10, 1, 0) || \
135 BROTLI_TI_VERSION_CHECK(8, 0, 0) || \
136 (BROTLI_TI_VERSION_CHECK(7, 3, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__))
137#define BROTLI_NOINLINE __attribute__((__noinline__))
138#elif BROTLI_MSVC_VERSION_CHECK(13, 10, 0)
139#define BROTLI_NOINLINE __declspec(noinline)
140#elif BROTLI_PGI_VERSION_CHECK(10, 2, 0)
141#define BROTLI_NOINLINE _Pragma("noinline")
142#elif BROTLI_TI_VERSION_CHECK(6, 0, 0) && defined(__cplusplus)
143#define BROTLI_NOINLINE _Pragma("FUNC_CANNOT_INLINE;")
144#elif BROTLI_IAR_VERSION_CHECK(8, 0, 0)
145#define BROTLI_NOINLINE _Pragma("inline=never")
147#define BROTLI_NOINLINE
152#if BROTLI_GNUC_HAS_ATTRIBUTE(unused, 2, 7, 0) || \
153 BROTLI_INTEL_VERSION_CHECK(16, 0, 0)
154#define BROTLI_UNUSED_FUNCTION static BROTLI_INLINE __attribute__ ((unused))
156#define BROTLI_UNUSED_FUNCTION static BROTLI_INLINE
159#if BROTLI_GNUC_HAS_ATTRIBUTE(aligned, 2, 7, 0)
160#define BROTLI_ALIGNED(N) __attribute__((aligned(N)))
162#define BROTLI_ALIGNED(N)
165#if (defined(__ARM_ARCH) && (__ARM_ARCH == 7)) || \
166 (defined(M_ARM) && (M_ARM == 7))
167#define BROTLI_TARGET_ARMV7
170#if (defined(__ARM_ARCH) && (__ARM_ARCH == 8)) || \
171 defined(__aarch64__) || defined(__ARM64_ARCH_8__)
172#define BROTLI_TARGET_ARMV8_ANY
174#if defined(__ARM_32BIT_STATE)
175#define BROTLI_TARGET_ARMV8_32
176#elif defined(__ARM_64BIT_STATE)
177#define BROTLI_TARGET_ARMV8_64
182#if defined(__ARM_NEON__) || defined(__ARM_NEON)
183#define BROTLI_TARGET_NEON
186#if defined(__i386) || defined(_M_IX86)
187#define BROTLI_TARGET_X86
190#if defined(__x86_64__) || defined(_M_X64)
191#define BROTLI_TARGET_X64
194#if defined(__PPC64__)
195#define BROTLI_TARGET_POWERPC64
198#if defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64
199#define BROTLI_TARGET_RISCV64
202#if defined(__loongarch_lp64)
203#define BROTLI_TARGET_LOONGARCH64
206#if defined(BROTLI_TARGET_X64) || defined(BROTLI_TARGET_ARMV8_64) || \
207 defined(BROTLI_TARGET_POWERPC64) || defined(BROTLI_TARGET_RISCV64) || \
208 defined(BROTLI_TARGET_LOONGARCH64)
209#define BROTLI_TARGET_64_BITS 1
211#define BROTLI_TARGET_64_BITS 0
214#if defined(BROTLI_BUILD_64_BIT)
215#define BROTLI_64_BITS 1
216#elif defined(BROTLI_BUILD_32_BIT)
217#define BROTLI_64_BITS 0
219#define BROTLI_64_BITS BROTLI_TARGET_64_BITS
223#define brotli_reg_t uint64_t
225#define brotli_reg_t uint32_t
228#if defined(BROTLI_BUILD_BIG_ENDIAN)
229#define BROTLI_BIG_ENDIAN 1
230#elif defined(BROTLI_BUILD_LITTLE_ENDIAN)
231#define BROTLI_LITTLE_ENDIAN 1
232#elif defined(BROTLI_BUILD_ENDIAN_NEUTRAL)
234#elif defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
235#define BROTLI_LITTLE_ENDIAN 1
236#elif defined(_WIN32) || defined(BROTLI_TARGET_X64)
238#define BROTLI_LITTLE_ENDIAN 1
239#elif defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
240#define BROTLI_BIG_ENDIAN 1
242#elif defined(BYTE_ORDER) && (BYTE_ORDER == LITTLE_ENDIAN)
243#define BROTLI_LITTLE_ENDIAN 1
244#elif defined(BYTE_ORDER) && (BYTE_ORDER == BIG_ENDIAN)
245#define BROTLI_BIG_ENDIAN 1
248#if !defined(BROTLI_LITTLE_ENDIAN)
249#define BROTLI_LITTLE_ENDIAN 0
252#if !defined(BROTLI_BIG_ENDIAN)
253#define BROTLI_BIG_ENDIAN 0
256#if defined(BROTLI_BUILD_NO_UNALIGNED_READ_FAST)
257#define BROTLI_UNALIGNED_READ_FAST (!!0)
258#elif defined(BROTLI_TARGET_X86) || defined(BROTLI_TARGET_X64) || \
259 defined(BROTLI_TARGET_ARMV7) || defined(BROTLI_TARGET_ARMV8_ANY) || \
260 defined(BROTLI_TARGET_RISCV64) || defined(BROTLI_TARGET_LOONGARCH64)
264#define BROTLI_UNALIGNED_READ_FAST (!!1)
266#define BROTLI_UNALIGNED_READ_FAST (!!0)
270static BROTLI_INLINE uint16_t BrotliUnalignedRead16(
const void* p) {
272 memcpy(&t, p,
sizeof t);
275static BROTLI_INLINE uint32_t BrotliUnalignedRead32(
const void* p) {
277 memcpy(&t, p,
sizeof t);
280static BROTLI_INLINE uint64_t BrotliUnalignedRead64(
const void* p) {
282 memcpy(&t, p,
sizeof t);
285static BROTLI_INLINE
size_t BrotliUnalignedReadSizeT(
const void* p) {
287 memcpy(&t, p,
sizeof t);
290static BROTLI_INLINE
void BrotliUnalignedWrite64(
void* p, uint64_t v) {
291 memcpy(p, &v,
sizeof v);
294#if BROTLI_LITTLE_ENDIAN
296#define BROTLI_UNALIGNED_LOAD16LE BrotliUnalignedRead16
297#define BROTLI_UNALIGNED_LOAD32LE BrotliUnalignedRead32
298#define BROTLI_UNALIGNED_LOAD64LE BrotliUnalignedRead64
299#define BROTLI_UNALIGNED_STORE64LE BrotliUnalignedWrite64
300#elif BROTLI_BIG_ENDIAN
302#define BROTLI_BSWAP16_(V) ((uint16_t)( \
303 (((V) & 0xFFU) << 8) | \
304 (((V) >> 8) & 0xFFU)))
305static BROTLI_INLINE uint16_t BROTLI_UNALIGNED_LOAD16LE(
const void* p) {
306 uint16_t value = BrotliUnalignedRead16(p);
307 return BROTLI_BSWAP16_(value);
309#define BROTLI_BSWAP32_(V) ( \
310 (((V) & 0xFFU) << 24) | (((V) & 0xFF00U) << 8) | \
311 (((V) >> 8) & 0xFF00U) | (((V) >> 24) & 0xFFU))
312static BROTLI_INLINE uint32_t BROTLI_UNALIGNED_LOAD32LE(
const void* p) {
313 uint32_t value = BrotliUnalignedRead32(p);
314 return BROTLI_BSWAP32_(value);
316#define BROTLI_BSWAP64_(V) ( \
317 (((V) & 0xFFU) << 56) | (((V) & 0xFF00U) << 40) | \
318 (((V) & 0xFF0000U) << 24) | (((V) & 0xFF000000U) << 8) | \
319 (((V) >> 8) & 0xFF000000U) | (((V) >> 24) & 0xFF0000U) | \
320 (((V) >> 40) & 0xFF00U) | (((V) >> 56) & 0xFFU))
321static BROTLI_INLINE uint64_t BROTLI_UNALIGNED_LOAD64LE(
const void* p) {
322 uint64_t value = BrotliUnalignedRead64(p);
323 return BROTLI_BSWAP64_(value);
325static BROTLI_INLINE
void BROTLI_UNALIGNED_STORE64LE(
void* p, uint64_t v) {
326 uint64_t value = BROTLI_BSWAP64_(v);
327 BrotliUnalignedWrite64(p, value);
331static BROTLI_INLINE uint16_t BROTLI_UNALIGNED_LOAD16LE(
const void* p) {
332 const uint8_t* in = (
const uint8_t*)p;
333 return (uint16_t)(in[0] | (in[1] << 8));
335static BROTLI_INLINE uint32_t BROTLI_UNALIGNED_LOAD32LE(
const void* p) {
336 const uint8_t* in = (
const uint8_t*)p;
337 uint32_t value = (uint32_t)(in[0]);
338 value |= (uint32_t)(in[1]) << 8;
339 value |= (uint32_t)(in[2]) << 16;
340 value |= (uint32_t)(in[3]) << 24;
343static BROTLI_INLINE uint64_t BROTLI_UNALIGNED_LOAD64LE(
const void* p) {
344 const uint8_t* in = (
const uint8_t*)p;
345 uint64_t value = (uint64_t)(in[0]);
346 value |= (uint64_t)(in[1]) << 8;
347 value |= (uint64_t)(in[2]) << 16;
348 value |= (uint64_t)(in[3]) << 24;
349 value |= (uint64_t)(in[4]) << 32;
350 value |= (uint64_t)(in[5]) << 40;
351 value |= (uint64_t)(in[6]) << 48;
352 value |= (uint64_t)(in[7]) << 56;
355static BROTLI_INLINE
void BROTLI_UNALIGNED_STORE64LE(
void* p, uint64_t v) {
356 uint8_t* out = (uint8_t*)p;
358 out[1] = (uint8_t)(v >> 8);
359 out[2] = (uint8_t)(v >> 16);
360 out[3] = (uint8_t)(v >> 24);
361 out[4] = (uint8_t)(v >> 32);
362 out[5] = (uint8_t)(v >> 40);
363 out[6] = (uint8_t)(v >> 48);
364 out[7] = (uint8_t)(v >> 56);
368static BROTLI_INLINE
void* BROTLI_UNALIGNED_LOAD_PTR(
const void* p) {
370 memcpy(&v, p,
sizeof(
void*));
374static BROTLI_INLINE
void BROTLI_UNALIGNED_STORE_PTR(
void* p,
const void* v) {
375 memcpy(p, &v,
sizeof(
void*));
379#if BROTLI_GNUC_HAS_BUILTIN(__builtin_constant_p, 3, 0, 1) || \
380 BROTLI_INTEL_VERSION_CHECK(16, 0, 0)
381#define BROTLI_IS_CONSTANT(x) (!!__builtin_constant_p(x))
383#define BROTLI_IS_CONSTANT(x) (!!0)
386#if defined(BROTLI_TARGET_ARMV7) || defined(BROTLI_TARGET_ARMV8_ANY)
387#define BROTLI_HAS_UBFX (!!1)
389#define BROTLI_HAS_UBFX (!!0)
392#if defined(BROTLI_ENABLE_LOG)
393#define BROTLI_LOG(x) printf x
398#if defined(BROTLI_DEBUG) || defined(BROTLI_ENABLE_LOG)
399#define BROTLI_ENABLE_DUMP_DEFAULT 1
400#define BROTLI_DCHECK(x) assert(x)
402#define BROTLI_ENABLE_DUMP_DEFAULT 0
403#define BROTLI_DCHECK(x)
406#if !defined(BROTLI_ENABLE_DUMP)
407#define BROTLI_ENABLE_DUMP BROTLI_ENABLE_DUMP_DEFAULT
410#if BROTLI_ENABLE_DUMP
411static BROTLI_INLINE
void BrotliDump(
const char* f,
int l,
const char* fn) {
412 fprintf(stderr,
"%s:%d (%s)\n", f, l, fn);
415#define BROTLI_DUMP() BrotliDump(__FILE__, __LINE__, __FUNCTION__)
417#define BROTLI_DUMP() (void)(0)
421#if (BROTLI_64_BITS == BROTLI_TARGET_64_BITS)
423#if (BROTLI_GNUC_VERSION_CHECK(3, 0, 0) || defined(__llvm__)) && \
424 !defined(BROTLI_BUILD_NO_RBIT)
425#if defined(BROTLI_TARGET_ARMV7) || defined(BROTLI_TARGET_ARMV8_ANY)
427static BROTLI_INLINE brotli_reg_t BrotliRBit(brotli_reg_t input) {
429 __asm__(
"rbit %0, %1\n" :
"=r"(output) :
"r"(input));
432#define BROTLI_RBIT(x) BrotliRBit(x)
436#if !defined(BROTLI_RBIT)
437static BROTLI_INLINE
void BrotliRBit(
void) { }
440#define BROTLI_REPEAT_4(X) {X; X; X; X;}
441#define BROTLI_REPEAT_5(X) {X; X; X; X; X;}
442#define BROTLI_REPEAT_6(X) {X; X; X; X; X; X;}
444#define BROTLI_UNUSED(X) (void)(X)
446#define BROTLI_MIN_MAX(T) \
447 static BROTLI_INLINE T brotli_min_ ## T (T a, T b) { return a < b ? a : b; } \
448 static BROTLI_INLINE T brotli_max_ ## T (T a, T b) { return a > b ? a : b; }
449BROTLI_MIN_MAX(
double) BROTLI_MIN_MAX(
float) BROTLI_MIN_MAX(
int)
450BROTLI_MIN_MAX(
size_t) BROTLI_MIN_MAX(uint32_t) BROTLI_MIN_MAX(uint8_t)
452#define BROTLI_MIN(T, A, B) (brotli_min_ ## T((A), (B)))
453#define BROTLI_MAX(T, A, B) (brotli_max_ ## T((A), (B)))
455#define BROTLI_SWAP(T, A, I, J) { \
456 T __brotli_swap_tmp = (A)[(I)]; \
457 (A)[(I)] = (A)[(J)]; \
458 (A)[(J)] = __brotli_swap_tmp; \
462#if BROTLI_GNUC_HAS_BUILTIN(__builtin_ctzll, 3, 4, 0) || \
463 BROTLI_INTEL_VERSION_CHECK(16, 0, 0)
464#define BROTLI_TZCNT64 __builtin_ctzll
465#elif BROTLI_MSVC_VERSION_CHECK(18, 0, 0)
466#if defined(BROTLI_TARGET_X64) && !defined(_M_ARM64EC)
467#define BROTLI_TZCNT64 _tzcnt_u64
469static BROTLI_INLINE uint32_t BrotliBsf64Msvc(uint64_t x) {
471 _BitScanForward64(&lsb, x);
474#define BROTLI_TZCNT64 BrotliBsf64Msvc
479#if BROTLI_GNUC_HAS_BUILTIN(__builtin_clz, 3, 4, 0) || \
480 BROTLI_INTEL_VERSION_CHECK(16, 0, 0)
481#define BROTLI_BSR32(x) (31u ^ (uint32_t)__builtin_clz(x))
482#elif BROTLI_MSVC_VERSION_CHECK(18, 0, 0)
483static BROTLI_INLINE uint32_t BrotliBsr32Msvc(uint32_t x) {
485 _BitScanReverse(&msb, x);
486 return (uint32_t)msb;
488#define BROTLI_BSR32 BrotliBsr32Msvc
492BROTLI_COMMON_API
void* BrotliDefaultAllocFunc(
void* opaque,
size_t size);
495BROTLI_COMMON_API
void BrotliDefaultFreeFunc(
void* opaque,
void* address);
498static BROTLI_INLINE uint16_t BrotliRotateRight16(uint16_t
const value,
501 return (value >> count) | (uint16_t)(value << ((0U - count) & 0x0F));
503static BROTLI_INLINE uint32_t BrotliRotateRight32(uint32_t
const value,
506 return (value >> count) | (uint32_t)(value << ((0U - count) & 0x1F));
508static BROTLI_INLINE uint64_t BrotliRotateRight64(uint64_t
const value,
511 return (value >> count) | (uint64_t)(value << ((0U - count) & 0x3F));
514BROTLI_UNUSED_FUNCTION
void BrotliSuppressUnusedFunctions(
void) {
515 BROTLI_UNUSED(&BrotliSuppressUnusedFunctions);
516 BROTLI_UNUSED(&BrotliUnalignedRead16);
517 BROTLI_UNUSED(&BrotliUnalignedRead32);
518 BROTLI_UNUSED(&BrotliUnalignedRead64);
519 BROTLI_UNUSED(&BrotliUnalignedReadSizeT);
520 BROTLI_UNUSED(&BrotliUnalignedWrite64);
521 BROTLI_UNUSED(&BROTLI_UNALIGNED_LOAD16LE);
522 BROTLI_UNUSED(&BROTLI_UNALIGNED_LOAD32LE);
523 BROTLI_UNUSED(&BROTLI_UNALIGNED_LOAD64LE);
524 BROTLI_UNUSED(&BROTLI_UNALIGNED_STORE64LE);
525 BROTLI_UNUSED(&BROTLI_UNALIGNED_LOAD_PTR);
526 BROTLI_UNUSED(&BROTLI_UNALIGNED_STORE_PTR);
527 BROTLI_UNUSED(&BrotliRBit);
528 BROTLI_UNUSED(&brotli_min_double);
529 BROTLI_UNUSED(&brotli_max_double);
530 BROTLI_UNUSED(&brotli_min_float);
531 BROTLI_UNUSED(&brotli_max_float);
532 BROTLI_UNUSED(&brotli_min_int);
533 BROTLI_UNUSED(&brotli_max_int);
534 BROTLI_UNUSED(&brotli_min_size_t);
535 BROTLI_UNUSED(&brotli_max_size_t);
536 BROTLI_UNUSED(&brotli_min_uint32_t);
537 BROTLI_UNUSED(&brotli_max_uint32_t);
538 BROTLI_UNUSED(&brotli_min_uint8_t);
539 BROTLI_UNUSED(&brotli_max_uint8_t);
540 BROTLI_UNUSED(&BrotliDefaultAllocFunc);
541 BROTLI_UNUSED(&BrotliDefaultFreeFunc);
542 BROTLI_UNUSED(&BrotliRotateRight16);
543 BROTLI_UNUSED(&BrotliRotateRight32);
544 BROTLI_UNUSED(&BrotliRotateRight64);
545#if BROTLI_ENABLE_DUMP
546 BROTLI_UNUSED(&BrotliDump);
549#if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_I86)) && !defined(_M_ARM64EC)
550# include <mmintrin.h>
551# define PREFETCH_L1(ptr) _mm_prefetch((const char*)(ptr), _MM_HINT_T0)
552# define PREFETCH_L2(ptr) _mm_prefetch((const char*)(ptr), _MM_HINT_T1)
553#elif BROTLI_GNUC_HAS_BUILTIN(__builtin_prefetch, 3, 1, 0)
554# define PREFETCH_L1(ptr) __builtin_prefetch((ptr), 0 , 3 )
555# define PREFETCH_L2(ptr) __builtin_prefetch((ptr), 0 , 2 )
556#elif defined(__aarch64__)
557# define PREFETCH_L1(ptr) do { __asm__ __volatile__("prfm pldl1keep, %0" ::"Q"(*(ptr))); } while (0)
558# define PREFETCH_L2(ptr) do { __asm__ __volatile__("prfm pldl2keep, %0" ::"Q"(*(ptr))); } while (0)
560# define PREFETCH_L1(ptr) do { (void)(ptr); } while (0)
561# define PREFETCH_L2(ptr) do { (void)(ptr); } while (0)
565#if defined(_M_X64) && defined(BROTLI_TZCNT64)
566#define BROTLI_MAX_SIMD_QUALITY 7
567#elif defined(BROTLI_TZCNT64)
568#define BROTLI_MAX_SIMD_QUALITY 6
@ count
Not a check: the number of checks.
Common types used in decoder and encoder API.