Utilities

From libsimdpp-docs

Alignment[edit]

SIMDPP_ALIGN(N)
when used immediately before the declaration of a variable, results in it being aligned to N bytes
(function macro)
a standard allocator that allocates aligned memory
(class template)

Vector size macros[edit]

SIMDPP_FAST_INT8_SIZE
optimal number of elements in int8, uint8 and mask_int8 vectors
(macro constant)
SIMDPP_FAST_INT16_SIZE
optimal number of elements in int16, uint16 and mask_int16 vectors
(macro constant)
SIMDPP_FAST_INT32_SIZE
optimal number of elements in int32, uint32 and mask_int32 vectors
(macro constant)
SIMDPP_FAST_INT64_SIZE
optimal number of elements in int64, uint64 and mask_int64 vectors
(macro constant)
SIMDPP_FAST_FLOAT32_SIZE
optimal number of elements in float32 and mask_float32 vectors
(macro constant)
SIMDPP_FAST_FLOAT64_SIZE
optimal number of elements in float64 and mask_float64 vectors
(macro constant)

Enabled instruction set[edit]

The following higher-level interface is provided to query enabled instruction sets.

bitmask type that describes a set of instruction sets
(enum)
queries currently enabled instruction sets
(function)

A low-level, macro-based interface is also provided. It's mostly useful when a fallback to native intrinsics is needed for part of the code path.

The following macros differ from the user-defined instruction set selection macros in that regardless of what the latter expand to, the former always expand to 0 or 1.

Architecture
SIMDPP_32_BITS
1 if compiling for 32-bit architecture, 0 otherwise
(macro constant)
SIMDPP_64_BITS
1 if compiling for 64-bit architecture is available, 0 otherwise
(macro constant)
SIMDPP_X86
1 if compiling for x86, 0 otherwise
(macro constant)
SIMDPP_ARM
1 if compiling for ARM, 0 otherwise
(macro constant)
SIMDPP_PPC
1 if compiling for PowerPC, 0 otherwise
(macro constant)
SIMDPP_MIPS
1 if compiling for MIPS, 0 otherwise
(macro constant)
Instruction sets
SIMDPP_USE_NULL
1 if SIMD instruction set is available, 0 otherwise
(macro constant)
SIMDPP_USE_SSE2
1 if SSE2 is available, 0 otherwise
(macro constant)
SIMDPP_USE_SSE3
1 if SSE3 is available, 0 otherwise
(macro constant)
SIMDPP_USE_SSSE3
1 if SSSE3 is available, 0 otherwise
(macro constant)
SIMDPP_USE_SSE4_1
1 if SSE4.1 is available, 0 otherwise
(macro constant)
SIMDPP_USE_X86_POPCNT_INSN
1 if popcnt instruction is available, 0 otherwise
(macro constant)
SIMDPP_USE_AVX
1 if AVX is available, 0 otherwise
(macro constant)
SIMDPP_USE_FMA3
1 if FMA3 is available, 0 otherwise
(macro constant)
SIMDPP_USE_FMA4
1 if FMA4 is available, 0 otherwise
(macro constant)
SIMDPP_USE_XOP
1 if XOP is available, 0 otherwise
(macro constant)
SIMDPP_USE_AVX2
1 if AVX2 is available, 0 otherwise
(macro constant)
SIMDPP_USE_AVX512F
1 if AVX512F is available, 0 otherwise
(macro constant)
SIMDPP_USE_AVX512BW
1 if AVX512BW is available, 0 otherwise
(macro constant)
SIMDPP_USE_AVX512DQ
1 if AVX512DQ is available, 0 otherwise
(macro constant)
SIMDPP_USE_AVX512VL
1 if AVX512VL is available, 0 otherwise
(macro constant)
SIMDPP_USE_NEON
1 if NEON except floating-point support is available, 0 otherwise
(macro constant)
SIMDPP_USE_NEON_FLT_SP
1 if NEON with floating-point support is available, 0 otherwise
(macro constant)
SIMDPP_USE_ALTIVEC
1 if Altivec is available, 0 otherwise
(macro constant)
SIMDPP_USE_VSX_206
1 if Power 2.06 VSX is available, 0 otherwise
(macro constant)
SIMDPP_USE_VSX_207
1 if Power 2.07 VSX is available, 0 otherwise
(macro constant)