xxHash 0.8.2
Extremely fast non-cryptographic hash function
|
Macros | |
#define | XXH_X86DISPATCH_ALLOW_AVX |
Disables the AVX sanity check. | |
#define | XXH_DISPATCH_SCALAR 1 |
Enables/dispatching the scalar code path. | |
#define | XXH_DISPATCH_AVX2 0 |
Enables/disables dispatching for AVX2. | |
#define | XXH_DISPATCH_AVX512 0 |
Enables/disables dispatching for AVX512. | |
#define | XXH_TARGET_SSE2 /* disable attribute target */ |
Allows a function to be compiled with SSE2 intrinsics. | |
#define | XXH_TARGET_AVX2 /* disable attribute target */ |
Like XXH_TARGET_SSE2, but for AVX2. | |
#define | XXH_TARGET_AVX512 /* disable attribute target */ |
Like XXH_TARGET_SSE2, but for AVX512. | |
#define XXH_X86DISPATCH_ALLOW_AVX |
Disables the AVX sanity check.
xxh_x86dispatch.c is intended to be compiled for the minimum target, and it selectively enables SSE2, AVX2, and AVX512 when it is needed.
Compiling with options like -mavx*
, -march=native
, or /arch:AVX*
globally will always enable this feature, and therefore makes it undefined behavior to execute on any CPU without said feature.
Even if the source code isn't directly using AVX intrinsics in a function, the compiler can still generate AVX code from autovectorization and by "upgrading" SSE2 intrinsics to use the VEX prefixes (a.k.a. AVX128).
Define XXH_X86DISPATCH_ALLOW_AVX to ignore this check, thus accepting that the produced binary will not work correctly on any CPU with less features than the ones stated at compilation time.
#define XXH_DISPATCH_SCALAR 1 |
Enables/dispatching the scalar code path.
If this is defined to 0, SSE2 support is assumed. This reduces code size when the scalar path is not needed.
This is automatically defined to 0 when...
#define XXH_DISPATCH_AVX2 0 |
Enables/disables dispatching for AVX2.
This is automatically detected if it is not defined.
<avx2intrin.h>
is detected. While this is not allowed to be included directly, it still appears in the builtin include path and is detectable with __has_include
.#define XXH_DISPATCH_AVX512 0 |
Enables/disables dispatching for AVX512.
Automatically detected if one of the following conditions is met:
<avx512fintrin.h>
is detected. While this is not allowed to be included directly, it still appears in the builtin include path and is detectable with __has_include
.#define XXH_TARGET_SSE2 /* disable attribute target */ |
Allows a function to be compiled with SSE2 intrinsics.
Uses __attribute__((__target__("sse2")))
on GCC to allow SSE2 to be used even with -mno-sse2
.
#define XXH_TARGET_AVX2 /* disable attribute target */ |
Like XXH_TARGET_SSE2, but for AVX2.
#define XXH_TARGET_AVX512 /* disable attribute target */ |
Like XXH_TARGET_SSE2, but for AVX512.