Files
2025-10-25 03:02:53 +03:00

3.7 KiB

[simd.expos.abi]

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;

1

#

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]

2

#

[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]

3

#

An implementation defines ABI tag types as necessary for the following aliases.

4

#

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 forN is not smaller than 64 and can differ depending on T.

5

#

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_vec<T, deduce-abi-t<T, N>> is enabled ([simd.overview]), and

basic_mask<sizeof(T), deduce-abi-t<integer-from<sizeof(T)>, N>> is enabled.

6

#

native-abi is an implementation-defined alias for an ABI tag.

basic_vec<T, native-abi> 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 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 as an alias for

__simd256 if T is a floating-point type, and

__simd128 otherwise.

— end example]