29 Numerics library [numerics]

29.10 Data-parallel types [simd]

29.10.2 Exposition-only types, variables, and concepts [simd.expos]

29.10.2.2 simd ABI tags [simd.expos.abi]

template<class T> using native-abi = see below; template<class T, simd-size-type N> using deduce-abi-t = see below;
An ABI tag is a type that indicates a choice of size and binary representation for objects of data-parallel type.
[Note 1: 
The intent is for the size and binary representation to depend on the target architecture and compiler flags.
The ABI tag, together with a given element type, implies the width.
— end note]
[Note 2: 
The ABI tag is orthogonal to selecting the machine instruction set.
The selected machine instruction set limits the usable ABI tag types, though (see [simd.overview]).
The ABI tags enable users to safely pass objects of data-parallel type between translation unit boundaries (e.g., function calls or I/O).
— end note]
An implementation defines ABI tag types as necessary for the following aliases.
deduce-abi-t<T, N> is defined if
  • T is a vectorizable type,
  • N is greater than zero, and
  • N is not larger than an implementation-defined maximum.
The implementation-defined maximum for N is not smaller than 64 and can differ depending on T.
Where present, deduce-abi-t<T, N> names an ABI tag type such that
  • simd-size-v<T, deduce-abi-t<T, N>> equals N,
  • basic_simd<T, deduce-abi-t<T, N>> is enabled ([simd.overview]), and
  • basic_simd_mask<sizeof(T), deduce-abi-t<integer-from<sizeof(T)>, N>> is enabled.
native-abi<T> is an implementation-defined alias for an ABI tag.
basic_simd<T, native-abi<T>> is an enabled specialization.
[Note 3: 
The intent is to use the ABI tag producing the most efficient data-parallel execution for the element type T on the currently targeted system.
For target architectures with ISA extensions, compiler flags can change the type of the native-abi<T> alias.
— end note]
[Example 1: 
Consider a target architecture supporting the ABI tags __simd128 and __simd256, where hardware support for __simd256 exists only for floating-point types.
The implementation therefore defines native-abi<T> as an alias for
  • __simd256 if T is a floating-point type, and
  • __simd128 otherwise.
— end example]