Death package
Proxy definitions for documentation purposes.
Definitions from this package are usually supplied via a compiler flag by CMake or by including CommonBase.h.
Namespaces
- namespace Death
- Shared root namespace.
Defines
- #define DEATH_DEBUG
- Whether the current build is for debugging purposes.
- #define DEATH_TRACE
- Whether runtime event tracing is enabled.
- #define DEATH_CPU_USE_RUNTIME_DISPATCH
- Build with runtime CPU dispatch.
- #define DEATH_CPU_USE_IFUNC
- GNU IFUNC is allowed to be used for runtime dispatch.
- #define DEATH_MSVC2015_COMPATIBILITY
- MSVC 2015 compatibility.
- #define DEATH_MSVC2017_COMPATIBILITY
- MSVC 2017 compatibility.
- #define DEATH_MSVC2019_COMPATIBILITY
- MSVC 2019 compatibility.
- #define DEATH_TARGET_UNIX
- Unix target.
- #define DEATH_TARGET_APPLE
- Apple target.
- #define DEATH_TARGET_IOS
- iOS target
- #define DEATH_TARGET_IOS_SIMULATOR
- iOS Simulator target
- #define DEATH_TARGET_WINDOWS
- Windows target.
- #define DEATH_TARGET_WINDOWS_RT
- Windows RT target.
- #define DEATH_TARGET_EMSCRIPTEN
- Emscripten target.
- #define DEATH_TARGET_ANDROID
- Android target.
- #define DEATH_TARGET_SWITCH
- Nintendo Switch target.
- #define DEATH_TARGET_X86
- x86 target
- #define DEATH_TARGET_ARM
- ARM target.
- #define DEATH_TARGET_POWERPC
- PowerPC target.
- #define DEATH_TARGET_RISCV
- RISC-V target.
- #define DEATH_TARGET_WASM
- WebAssembly target.
- #define DEATH_TARGET_32BIT
- Whether the library is built for a 32-bit target.
- #define DEATH_TARGET_BIG_ENDIAN
- Whether the platform defaults to big-endian.
- #define DEATH_TARGET_GCC
- GCC compiler.
- #define DEATH_TARGET_CLANG
- Clang compiler.
- #define DEATH_TARGET_APPLE_CLANG
- Apple's Clang compiler.
- #define DEATH_TARGET_CLANG_CL
- Clang-CL compiler.
- #define DEATH_TARGET_INTEL_LLVM
- Intel LLVM compiler.
- #define DEATH_TARGET_MSVC
- MSVC compiler.
- #define DEATH_TARGET_CYGWIN
- Cygwin compiler.
- #define DEATH_TARGET_MINGW
- MinGW compiler.
- #define DEATH_TARGET_LIBCXX
- STL libc++ target.
- #define DEATH_TARGET_LIBSTDCXX
- STL libstdc++ target.
- #define DEATH_TARGET_DINKUMWARE
- STL Dinkumware target.
- #define DEATH_TARGET_SSE2
- SSE2 target.
- #define DEATH_TARGET_SSE3
- SSE3 target.
- #define DEATH_TARGET_SSSE3
- SSSE3 target.
- #define DEATH_TARGET_SSE41
- SSE4.1 target.
- #define DEATH_TARGET_SSE42
- SSE4.2 target.
- #define DEATH_TARGET_POPCNT
- Target with POPCNT instructions.
- #define DEATH_TARGET_LZCNT
- Target with LZCNT instructions.
- #define DEATH_TARGET_BMI1
- Target with BMI1 instructions.
- #define DEATH_TARGET_BMI2
- Target with BMI2 instructions.
- #define DEATH_TARGET_CLFLUSHOPT
- Target with CLFLUSHOPT instruction.
- #define DEATH_TARGET_AVX
- AVX target.
- #define DEATH_TARGET_AVX_F16C
- AVX target with F16C.
- #define DEATH_TARGET_AVX_FMA
- AVX target with FMA.
- #define DEATH_TARGET_AVX2
- AVX2 target.
- #define DEATH_TARGET_AVX512F
- AVX-512 Foundation target.
- #define DEATH_TARGET_NEON
- NEON target.
- #define DEATH_TARGET_NEON_FMA
- NEON target with FMA.
- #define DEATH_TARGET_NEON_FP16
- NEON target with FP16 vector arithmetic.
- #define DEATH_TARGET_SIMD128
- SIMD128 target.
Define documentation
#define DEATH_DEBUG
Whether the current build is for debugging purposes.
No need to #include
anything for this macro to be defined, it's supplied via a compiler flag by CMake. Usually present when the build configuration is set to Debug
.
#define DEATH_TRACE
Whether runtime event tracing is enabled.
No need to #include
anything for this macro to be defined, it's supplied via a compiler flag by CMake.
#define DEATH_CPU_USE_RUNTIME_DISPATCH
Build with runtime CPU dispatch.
Defined if the library is built with performance-critical code paths optimized for multiple architectures (such as SSE or AVX on x86), with the best matching variant selected at runtime based on detected CPU features. If not defined, the library is built with just a single variant that's picked at compile time depending on target architecture flags being passed to the compiler.
The actual feature detection and dispatch both in the runtime and compile-time scenario is performed by the Cpu library.
No need to #include
anything for this macro to be defined, it's supplied via a compiler flag by CMake.
#define DEATH_CPU_USE_IFUNC
GNU IFUNC is allowed to be used for runtime dispatch.
Defined if the Cpu library can perform runtime dispatch using GNU IFUNC, exposing the DEATH_
No need to #include
anything for this macro to be defined, it's supplied via a compiler flag by CMake.
#define DEATH_MSVC2015_COMPATIBILITY
MSVC 2015 compatibility.
Defined if compatibility mode for MSVC 2015 is enabled.
#define DEATH_MSVC2017_COMPATIBILITY
MSVC 2017 compatibility.
Defined if compatibility mode for MSVC 2017 is enabled.
#define DEATH_MSVC2019_COMPATIBILITY
MSVC 2019 compatibility.
Defined if compatibility mode for MSVC 2019 is enabled.
#define DEATH_TARGET_UNIX
Unix target.
Defined if the library is built for some Unix flavor (Linux, BSD, macOS, iOS, Android...). Note that while the behavior of Emscripten is closely emulating Unix systems, DEATH_
#define DEATH_TARGET_APPLE
Apple target.
Defined if the library is built for Apple platforms (macOS, iOS).
#define DEATH_TARGET_IOS_SIMULATOR
iOS Simulator target
Defined if the library is built for iOS Simulator.
#define DEATH_TARGET_WINDOWS
Windows target.
Defined if the library is built for Windows (desktop, Windows Store, Phone or Xbox).
#define DEATH_TARGET_WINDOWS_RT
Windows RT target.
Defined if the library is built for Universal Windows Platform (Windows Store, Phone or Xbox). In this case, DEATH_
#define DEATH_TARGET_EMSCRIPTEN
Emscripten target.
Defined if the library is built for Emscripten. Note that while the behavior of Emscripten is closely emulating Unix systems, DEATH_
#define DEATH_TARGET_SWITCH
Nintendo Switch target.
Defined if the library is built for Nintendo Switch.
#define DEATH_TARGET_X86
x86 target
Defined if the library is built for x86 platforms (32 or 64-bit). Note that unlike other DEATH_TARGET_*
variables, this variable, DEATH_
#define DEATH_TARGET_ARM
ARM target.
Defined if the library is built for ARM platforms (32 or 64-bit). Note that unlike other DEATH_TARGET_*
variables, this variable, DEATH_
#define DEATH_TARGET_POWERPC
PowerPC target.
Defined if the library is built for PowerPC platforms (32 or 64-bit). Note that unlike other DEATH_TARGET_*
variables, this variable, DEATH_
#define DEATH_TARGET_RISCV
RISC-V target.
Defined if the library is built for RISC-V platforms (32 or 64-bit). Note that unlike other DEATH_TARGET_*
variables, this variable, DEATH_
#define DEATH_TARGET_WASM
WebAssembly target.
Defined if the library is built for WebAssembly (32 or 64-bit). Note that unlike other DEATH_TARGET_*
variables, this variable, DEATH_
#define DEATH_TARGET_32BIT
Whether the library is built for a 32-bit target.
Defined if the library is built for a 32-bit target. Not defined on 64-bit platforms.
#define DEATH_TARGET_BIG_ENDIAN
Whether the platform defaults to big-endian.
Defined when the platform defaults to big-endian (such as HP/PA RISC, Motorola 68k, Big-Endian MIPS, PowerPC and SPARC). Not defined on little-endian platforms (such as x86 and ARM). This macro only reflects the usual architecture default.
#define DEATH_TARGET_GCC
GCC compiler.
Defined if the code is being compiled by GCC or GCC-compatible Clang (which is DEATH_
Major GCC version number can be accessed using the __GNUC__
macro. Clang always reports itself as GCC 4.4, its version is reported in __clang_major__
instead.
#define DEATH_TARGET_CLANG
Clang compiler.
Defined if the code is being compiled by Clang or any of its variants (DEATH_
Major Clang version number can be accessed using the __clang_major__
macro, however note that Apple Clang (in Xcode) uses its own numbering — for example Clang 10 is actually Apple Clang 12.
#define DEATH_TARGET_APPLE_CLANG
Apple's Clang compiler.
Defined if the code is being compiled by Apple's Clang. If this variable is defined, DEATH_
Major Apple Clang version number can be accessed using the __clang_major__
macro, which is the same macro as vanilla Clang. There is no macro that exposes the matching vanilla Clang version, the only option is to use an external mapping table — for example Apple Clang 12 is actually Clang 10.
#define DEATH_TARGET_CLANG_CL
Clang-CL compiler.
Defined if the code is being compiled by Clang with a MSVC frontend. If this variable is defined, DEATH_
Clang-CL uses the same versioning scheme as vanilla Clang, accessible using the __clang_major__
macro. It also exposes the _MSC_VER
macro, reporting the MSVC version it's compatible with.
#define DEATH_TARGET_INTEL_LLVM
Intel LLVM compiler.
Defined if the code is being compiled by Intel LLVM (oneAPI) compiler. While this variable is exposed in CMake as well, it's not guaranteed that the reported compiler is consistent between CMake and C++ — for example, a library can be built with Intel LLVM and then used via Clang.
#define DEATH_TARGET_MSVC
MSVC compiler.
Defined if the code is being compiled by MSVC or Clang with a MSVC frontend. If this variable is defined, DEATH_
MSVC version can be accessed using the _MSC_VER
macro. The macro uses an internal version numbering, so for example MSVC 2019 16.7 (14.27) is reported as 1927.
#define DEATH_TARGET_CYGWIN
Cygwin compiler.
Defined if the code is being compiled by Cygwin toolchain. If this variable is defined, DEATH_
#define DEATH_TARGET_MINGW
MinGW compiler.
Defined if the code is being compiled by GCC / Clang running under MinGW. If this variable is defined, DEATH_
#define DEATH_TARGET_LIBCXX
STL libc++ target.
Defined if the library is built against Clang libc++ STL implementation. This is most common on Apple acOS and iOS and on newer Android NDKs, it's also sometimes used on Linux. Note that unlike other DEATH_TARGET_*
variables, this variable, DEATH_
Major libc++ version number can be accessed using the _LIBCPP_VERSION
version macro. While libc++ can only be used with Clang (and not GCC), its version might or might not be the same as __clang_major__
.
#define DEATH_TARGET_LIBSTDCXX
STL libstdc++ target.
Defined if the library is built against GCC libstdc++ STL implementation. This is most common on Linux and under MinGW, note that Clang is able to use libstdc++ as well. Note that unlike other DEATH_TARGET_*
variables, this variable, DEATH_
Major libstdc++ version number can be accessed using the _GLIBCXX_RELEASE
macro, however it's available only since libstdc++ 7. Older versions define just __GLIBCXX__
, which contains a release date (and the dates, of course, overlap for patch releases and can be just anything for custom GCC forks). If libstdc++ is used together with GCC, it can be assumed both have the same version; if libstdc++ is used together with Clang, the versions can be arbitrary.
#define DEATH_TARGET_DINKUMWARE
STL Dinkumware target.
Defined if the library is built against Dinkumware STL implementation (used by MSVC). Note that Clang is able to use this implementation as well. Note that unlike other DEATH_TARGET_*
variables, this variable, DEATH_
The MSVC standard library is closely tied to a compiler version, thus _MSC_VER
can be used to determine its version on both MSVC and Clang-CL.
#define DEATH_TARGET_SSE2
SSE2 target.
Defined on x86 if Streaming SIMD Extensions 2 are enabled at compile time (-msse2
or higher on GCC/Clang, /arch:SSE2
or higher on MSVC). All x86-64 targets support SSE2. Implied by DEATH_
#define DEATH_TARGET_SSE3
SSE3 target.
Defined on x86 if Streaming SIMD Extensions 3 are enabled at compile time (on GCC/Clang it's -msse3
and higher, MSVC doesn't have a direct option and it's only implied by /arch:AVX
). Superset of DEATH_
#define DEATH_TARGET_SSSE3
SSSE3 target.
Defined on x86 if Supplemental Streaming SIMD Extensions 3 are enabled at compile time (on GCC/Clang it's -mssse3
and higher, MSVC doesn't have a direct option and it's only implied by /arch:AVX
). Superset of DEATH_
Note that certain older AMD processors have SSE4a but neither SSSE3 nor SSE4.1. Both can be however treated as a subset of SSE4.1 to a large extent, and it's recommended to use DEATH_
#define DEATH_TARGET_SSE41
SSE4.1 target.
Defined on x86 if Streaming SIMD Extensions 4.1 are enabled at compile time (on GCC/Clang it's -msse4.1
and higher, MSVC doesn't have a direct option and it's only implied by /arch:AVX
). Superset of DEATH_
Note that certain older AMD processors have SSE4a but neither SSSE3 nor SSE4.1. Both can be however treated as a subset of SSE4.1 to a large extent, and it's recommended to use DEATH_
#define DEATH_TARGET_SSE42
SSE4.2 target.
Defined on x86 if Streaming SIMD Extensions 4.2 are enabled at compile time (on GCC/Clang it's -msse4.2
and higher, MSVC doesn't have a direct option and it's only implied by /arch:AVX
). Superset of DEATH_
#define DEATH_TARGET_POPCNT
Target with POPCNT instructions.
Defined on x86 if POPCNT is enabled at compile time. On GCC/Clang it's -mpopcnt
and is also implied by -msse4.2
and higher, MSVC doesn't have a direct option but it's assumed to be implied by /arch:AVX
. To avoid failures at runtime, prefer to detect its presence with Cpu::
#define DEATH_TARGET_LZCNT
Target with LZCNT instructions.
Defined on x86 if LZCNT is enabled at compile time (on GCC/Clang it's -mlznct
, MSVC doesn't have a direct option but it's assumed to be implied by /arch:AVX2
). However note that this instruction has encoding compatible with an earlier BSR
instruction which has a slightly different behavior. To avoid wrong results if it isn't available, prefer to detect its presence with Cpu::
#define DEATH_TARGET_BMI1
Target with BMI1 instructions.
Defined on x86 if BMI1 including the TZCNT
instruction is enabled at compile time (on GCC/Clang it's -mbmi
, MSVC doesn't have a direct option but it's assumed to be implied by /arch:AVX2
). However note that the TZCNT
instruction has encoding compatible with an earlier BSF
instruction which has a slightly different behavior. To avoid wrong results if it isn't available, prefer to detect its presence with Cpu::
Presence of this instruction set is not implied by DEATH_
#define DEATH_TARGET_BMI2
Target with BMI2 instructions.
Defined on x86 if BMI2 is enabled at compile time. On GCC/Clang it's -mbmi2
, MSVC doesn't have a direct option but it's assumed to be implied by /arch:AVX2
. To avoid failures at runtime, prefer to detect its presence with Cpu::
Presence of this instruction set does not imply DEATH_
#define DEATH_TARGET_CLFLUSHOPT
Target with CLFLUSHOPT instruction.
Defined on x86 if CLFLUSHOPT (Flush Cache Line Optimized) instruction is enabled at compile time. On GCC/Clang it's -mclflushopt
, MSVC doesn't have a direct option.
#define DEATH_TARGET_AVX
AVX target.
Defined on x86 if Advanced Vector Extensions are enabled at compile time (-mavx
and higher on GCC/Clang, /arch:AVX
on MSVC). Superset of DEATH_
#define DEATH_TARGET_AVX_F16C
AVX target with F16C.
Defined on x86 if the F16C instruction set is enabled at compile time. On GCC/Clang it's -mf16c
, MSVC doesn't have a direct option but it's assumed to be implied by /arch:AVX2
. To avoid failures at runtime, prefer to detect its presence with Cpu::
#define DEATH_TARGET_AVX_FMA
AVX target with FMA.
Defined on x86 if the FMA3 instruction set is enabled at compile time. On GCC/Clang it's -mfma
, MSVC doesn't have a direct option but it's assumes to be implied by /arch:AVX2
. To avoid failures at runtime, prefer to detect its presence with Cpu::
The FMA4 instruction set, which used to be supported only in certain range of AMD processors and isn't anymore, is not detected, and AMD switched to FMA3 since.
#define DEATH_TARGET_AVX2
AVX2 target.
Defined on x86 if Advanced Vector Extensions 2 are enabled at compile time (-mavx2
and higher on GCC/Clang, /arch:AVX2
on MSVC). Superset of DEATH_
#define DEATH_TARGET_AVX512F
AVX-512 Foundation target.
Defined on x86 if AVX-512 Foundation instructions are enabled at compile time (-mavx512f
and higher on GCC/Clang, /arch:AVX512
on MSVC). Superset of DEATH_
#define DEATH_TARGET_NEON
NEON target.
Defined on ARM if ARM NEON instructions are enabled at compile time (-mfpu=neon
on GCC/Clang, implicitly supported on ARM64). Implied by DEATH_
Apart from NEON, there's several other mutually incompatible ARM instruction sets. Detection for these will be added when the platforms become more widespread:
- Helium, which is a low-power alternative to NEON
- SVE, which is a HPC-focused alternative to NEON, in 2021 found mostly just on AWS Graviton
- SVE2, which is a next-generation vector instruction set designed to be a successor to both NEON and SVE, scheduled to appear in production in around 2022
- AMX, which is Apple's proprietary and patented instruction set available only on their own hardware
#define DEATH_TARGET_NEON_FMA
NEON target with FMA.
Defined on ARM if NEON FMA instructions are enabled at compile time (-mfpu=neon-vfpv4
on GCC/Clang on 32-bit ARM, implicitly supported on ARM64). Not defined if FMA is only available for scalar code and not for NEON. Superset of DEATH_
#define DEATH_TARGET_NEON_FP16
NEON target with FP16 vector arithmetic.
Defined on ARM if ARMv8.2-a NEON FP16 vector arithmetic support is enabled at compile time (-march=armv8.2-a+fp16
on GCC/Clang). Superset of DEATH_
#define DEATH_TARGET_SIMD128
SIMD128 target.
Defined on WebAssembly if 128-bit SIMD instructions are enabled at compile time (-msimd128
passed to Clang), and the compiler supports the finalized version of the intrinsics, which is since Clang 13 and Emscripten 2.0.18. Emscripten SDK 2.0.13 to 2.0.17 ship with a Clang that reports as 13 but isn't actually the final version.