Files
cppdraft_translate/cppdraft/simd/expos/defn.md
2025-10-25 03:02:53 +03:00

5.3 KiB
Raw Blame History

[simd.expos.defn]

29 Numerics library [numerics]

29.10 Data-parallel types [simd]

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

29.10.2.1 Exposition-only helpers [simd.expos.defn]

🔗

using simd-size-type = see below;

1

#

simd-size-type is an alias for a signed integer type.

🔗

template<size_t Bytes> using integer-from = see below;

2

#

integer-from is an alias for a signed integer typeT such that sizeof(T) equals Bytes.

🔗

template<class T, class Abi> constexpr simd-size-type simd-size-v = see below;

3

#

simd-size-v<T, Abi> denotes the width of basic_vec<T, Abi> if the specialization basic_vec<T, Abi> is enabled, or 0 otherwise.

🔗

template<class T> constexpr size_t mask-element-size = see below;

4

#

mask-element-size<basic_mask<Bytes, Abi>> has the valueBytes.

🔗

template<class T> using deduced-vec-t = see below;

5

#

Let x denote an lvalue of type const T.

6

#

deduced-vec-t is an alias for

decltype(x + x), if the type of x + x is an enabled specialization of basic_vec; otherwise

void.

🔗

template<class V, class T> using make-compatible-simd-t = see below;

7

#

Let x denote an lvalue of type const T.

8

#

make-compatible-simd-t<V, T> is an alias for

deduced-vec-t, if that type is not void, otherwise

vec<decltype(x + x), V::size()>.

🔗

template<class... Ts> requires [math-floating-point](simd.expos#concept:math-floating-point "29.10.2Exposition-only types, variables, and concepts[simd.expos]")<Ts...> using math-common-simd-t = see below;

9

#

Let T0 denote Ts...[0].

Let T1 denote Ts...[1].

Let TRest denote a pack such that T0, T1, TRest... is equivalent to Ts....

10

#

Let math-common-simd-t<Ts...> be an alias for

deduced-vec-t, if sizeof...(Ts) equals 1; otherwise

common_type_t<deduced-vec-t, deduced-vec-t>, if sizeof...(Ts) equals 2 and math-floating-point &&math-floating-point is true; otherwise

common_type_t<deduced-vec-t, T1>, if sizeof...(Ts) equals 2 and math-floating-point<T0> is true; otherwise

common_type_t<T0, deduced-vec-t>, if sizeof...(Ts) equals 2; otherwise

common_type_t<math-common-simd-t<T0, T1>, TRest...>, if math-common-simd-t<T0, T1> is valid and denotes a type; otherwise

common_type_t<math-common-simd-t<TRest...>, T0, T1>.

🔗

template<class BinaryOperation, class T> concept [reduction-binary-operation](#concept:reduction-binary-operation "29.10.2.1Exposition-only helpers[simd.expos.defn]") = requires (const BinaryOperation binary_op, const vec<T, 1> v) { { binary_op(v, v) } -> [same_as](concept.same#concept:same_as "18.4.2Concept same_­as[concept.same]")<vec<T, 1>>; };

11

#

Types BinaryOperation and T modelreduction-binary-operation<BinaryOperation, T> only if:

  • (11.1)

    BinaryOperation is a binary element-wise operation and the operation is commutative.

  • (11.2)

    An object of type BinaryOperation can be invoked with two arguments of type basic_vec<T, Abi>, with unspecified ABI tagAbi, returning a basic_vec<T, Abi>.