ZXC 1.0.2
High-performance asymmetric lossless compression library
Loading...
Searching...
No Matches
zxc_build.h
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * ZXC - High-performance lossless compression
4 *
5 * Copyright (c) Bertrand Lebonnois and contributors.
6 */
7
16#ifndef ZXC_BUILD_H
17#define ZXC_BUILD_H
18
19#if defined(ZXC_BUILD_SIMD_VARIANTS_DECODER) || defined(ZXC_BUILD_SIMD_VARIANTS_MINIMAL)
20#define ZXC_SIMD_TRIMMED
21#endif
22
23// Nothing to dispatch: no SIMD, or trimmed variants on a baseline-only target.
24#if !defined(ZXC_ONLY_DEFAULT) && \
25 (defined(ZXC_DISABLE_SIMD) || (defined(ZXC_SIMD_TRIMMED) && !defined(__x86_64__) && \
26 !defined(_M_X64) && !defined(__arm__) && !defined(_M_ARM)))
27#define ZXC_ONLY_DEFAULT
28#endif
29
30// Roles bound to the _default variant.
31#if defined(ZXC_ONLY_DEFAULT) || defined(ZXC_SIMD_TRIMMED)
32#define ZXC_ENCODER_DEFAULT
33#endif
34#if defined(ZXC_ONLY_DEFAULT) || defined(ZXC_BUILD_SIMD_VARIANTS_MINIMAL)
35#define ZXC_LZ_DECODER_DEFAULT
36#endif
37#if defined(ZXC_ONLY_DEFAULT)
38#define ZXC_ENTROPY_DECODER_DEFAULT
39#endif
40
41// minimal: the entropy decoder is dispatched on its own, the LZ decoder calling it.
42#if defined(ZXC_BUILD_SIMD_VARIANTS_MINIMAL) && !defined(ZXC_ONLY_DEFAULT)
43#define ZXC_DISPATCH_ENTROPY
44#endif
45
46// Trimmed variants include no AVX-512 one: AVX-512 CPUs run the AVX2 one.
47#ifdef ZXC_SIMD_TRIMMED
48#define ZXC_NO_AVX512
49#endif
50
51#endif // ZXC_BUILD_H