Support for user-defined, enumeration, and byte element types.
More...
|
template<typename _Tp, typename _Abi>
requires (std::is_enum_v<_Tp>) |
| constexpr auto | xvec::simd::to_underlying (const basic_vec< _Tp, _Abi > &x) |
| | Convert each enumeration element to its underlying type.
|
| template<std::integral _Tp, vec_of< std::byte > _Vp> |
| constexpr rebind_t< _Tp, _Vp > | xvec::simd::to_integer (const _Vp &b) noexcept |
| | Convert each std::byte element to an integer type.
|
Support for user-defined, enumeration, and byte element types.
Proposed in P2964, "Allowing user-defined types in std::simd". Includes conversion of enumeration and byte vectors to integral vectors.
- See also
- https://wg21.link/P2964
◆ to_integer()
template<std::integral _Tp, vec_of< std::byte > _Vp>
| rebind_t< _Tp, _Vp > xvec::simd::to_integer |
( |
const _Vp & | b | ) |
|
|
constexprnoexcept |
Convert each std::byte element to an integer type.
- Template Parameters
-
| _Tp | The integral type to convert to. |
| _Vp | The input vector type, whose elements must be std::byte. |
- Parameters
-
| b | The vector of byte values to convert. |
- Returns
- A vector whose elements have the specified integer type.
◆ to_underlying()
template<typename _Tp, typename _Abi>
requires (std::is_enum_v<_Tp>)
| auto xvec::simd::to_underlying |
( |
const basic_vec< _Tp, _Abi > & | x | ) |
|
|
constexpr |
Convert each enumeration element to its underlying type.
- Template Parameters
-
| _Tp | The enumeration type. |
| _Abi | The ABI of the vector. |
- Parameters
-
| x | The vector of enumeration values to convert. |
- Returns
- A vector whose elements have the enumeration's underlying type.
◆ disable_vectorization
template<typename _Tp>
| bool xvec::simd::detail::disable_vectorization |
|
inlineconstexpr |
Initial value:=
std::is_pointer_v<_Tp> ||
std::is_member_pointer_v<_Tp> ||
std::is_union_v<_Tp> ||
std::is_const_v<_Tp> ||
std::is_volatile_v<_Tp> ||
std::is_empty_v<_Tp> ||
std::same_as<_Tp, long double> ||
Trait-based form of vectorization concept.