Title
§[simd.expos.abi] deduce-abi-t is underspecified and incorrectly referenced from `rebind` and `resize`
Status
new
Section
[simd.expos.abi][simd.traits]
Submitter
Matthias Kretz

Created on 2025-10-15.00:00:00 last changed 1 month ago

Messages

Date: 2025-10-25.13:56:58

Proposed resolution:

This wording is relative to N5014.

  1. Modify [simd.expos.abi] as indicated:

    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.

    […]

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

    -4- deduce-abi-t<T, N> is definednames an ABI tag type if and only if

    1. (4.1) — `T` is a vectorizable type,

    2. (4.2) — `N` is greater than zero, and

    3. (4.3) — `N` is not larger than an implementation-defined maximum.

    Otherwise, deduce-abi-t<T, N> names an unspecified type.

    The implementation-defined maximum for `N` is not smaller than 64 and can differ depending on `T`. […]

    -5- Where present,If deduce-abi-t<T, N> names an ABI tag type such that, the following is `true`:

    1. (5.1) — simd-size-v<T, deduce-abi-t<T, N>> equals `N`,

    2. (5.2) — basic_vec<T, deduce-abi-t<T, N>> is enabled ([simd.overview]), and

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

  2. Modify [simd.traits] as indicated:

    template<class T, class V> struct rebind { using type = see below; };
    

    -4- The member `type` is present if and only if

    1. (4.1) — `V` is a data-parallel type,

    2. (4.2) — `T` is a vectorizable type, and

    3. (4.3) — deduce-abi-t<T, V::size()> has a member type `type` names an ABI tag type.

    […]
    template<simd-size-type N, class V> struct resize { using type = see below; };
    

    -7- Let `T` denote […]

    -8- The member `type` is present if and only if

    1. (8.1) — `V` is a data-parallel type, and

    2. (8.2) — deduce-abi-t<T, N> has a member type `type` names an ABI tag type.

Date: 2025-10-15.00:00:00

[ 2025-10-21; Matthias Kretz improves discussion and proposed wording ]

Date: 2025-10-25.13:56:58

In [simd.expos.abi], deduce-abi-t is specified to be defined for some arguments. For all remaining arguments, nothing is specified. This could be interpreted to make such specializations ill-formed. But that does not match the intent of making

simd::vec<std::string>

and

simd::vec<int, INT_MAX>

disabled specializations of `basic_vec`. (If `INT_MAX` is not supported by the implementation.)

The wording needs to clarify what happens in those cases.

In [simd.traits], `rebind` and `resize` say "deduce-abi-t<T, V::size()> has a member type `type`". But that's not how deduce-abi-t is specified.

This wording is relative to N5014.

  1. Modify [simd.traits] as indicated:

    template<class T, class V> struct rebind { using type = see below; };
    

    -4- The member `type` is present if and only if

    1. (4.1) — `V` is a data-parallel type,

    2. (4.2) — `T` is a vectorizable type, and

    3. (4.3) — deduce-abi-t<T, V::size()> has a member type `type` is defined.

    […]
    template<simd-size-type N, class V> struct resize { using type = see below; };
    

    -7- Let `T` denote […]

    -8- The member `type` is present if and only if

    1. (8.1) — `V` is a data-parallel type, and

    2. (8.2) — deduce-abi-t<T, N> has a member type `type` is defined.

History
Date User Action Args
2025-10-25 13:56:58adminsetmessages: + msg15424
2025-10-18 16:40:11adminsetmessages: + msg15250
2025-10-15 00:00:00admincreate