Intel xvec
Experimental C++ simd class library
Loading...
Searching...
No Matches
Extended element types

Support for user-defined, enumeration, and byte element types. More...

Classes

struct  xvec::simd::convert_to_t< _Tp >
 Conversion flag, used to pass destination type to a simd_convert customisation point. More...

Functions

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.

Variables

template<typename _Tp>
constexpr bool xvec::simd::detail::disable_vectorization
template<class _Tp>
constexpr convert_to_t< _Tp > xvec::simd::convert_to {}

Detailed Description

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

Function Documentation

◆ 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
_TpThe integral type to convert to.
_VpThe input vector type, whose elements must be std::byte.
Parameters
bThe 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
_TpThe enumeration type.
_AbiThe ABI of the vector.
Parameters
xThe vector of enumeration values to convert.
Returns
A vector whose elements have the enumeration's underlying type.

Variable Documentation

◆ 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> ||
Definition core.hpp:61

Trait-based form of vectorization concept.