11#include <xvec/detail/config.hpp>
20namespace _XVEC_NAMESPACE::simd
31 constexpr auto get_array = [](
auto &&...x) {
return std::array{std::forward<decltype(x)>(x)...}; };
32 return std::apply(get_array, std::forward<_Tuple>(tuple));
43template<simd_
size_type _Begin, simd_
size_type _Np, vec_or_mask_type _Sp>
46 constexpr simd_size_type remaining = _Sp::size - _Begin;
47 constexpr simd_size_type numInBlock = std::min(remaining, _Np);
49 const auto headTuple = std::make_tuple(extract<_Begin, _Begin + numInBlock>(v));
51 if constexpr (remaining <= _Np)
56 return std::tuple_cat(headTuple, tailTuple);
69template<simd_
size_type _Begin,
typename _Result,
typename _Sp>
76 if (std::is_constant_evaluated())
77 r = _Result([=](
auto i) {
if (i >= _Begin && i < (_Begin + _Sp::size()))
return head[i - _Begin];
else return container[i]; });
79 r = insert<_Begin>(container, head);
81 if constexpr (
sizeof...(tail) == 0)
105template<simd_
size_type _Np, vec_or_mask_type _S>
107chunk(
const _S& container)
noexcept {
112 if constexpr (_S::size % _Np == 0)
125template<
typename _V,
typename _Abi>
134template<mask_type _M,
typename _Abi>
143template<std::size_t _Bytes,
typename... _Abis>
162template<
typename _Tp,
typename... _Abis>
A mask containing boolean elements.
Definition mask.hpp:121
Vector of elements sharing an element type and ABI.
Definition simd:161
static constexpr auto size
Return the number of elements contained in the vec.
Definition simd:187
constexpr auto chunk(const _S &container) noexcept
Definition split_concat.hpp:107
constexpr auto cat(const basic_mask< _Bytes, _Abis > &... masks) noexcept
Concatenate several smaller mask values with the same element size into a single large mask value.
Definition split_concat.hpp:144
static constexpr auto size
Return the number of elements contained in the mask.
Definition mask.hpp:148
basic_vec< _Tp, simd_fixed_size_abi< _Np > > vec
Definition core.hpp:379
constexpr _Result concatHelper(const _Result &container, const _Sp &head, const vec_or_mask_type auto &... tail)
Definition split_concat.hpp:70
constexpr auto splitNHelper(const _Sp &v)
Definition split_concat.hpp:44
constexpr auto get_array_from_tuple(_Tuple &&tuple)
Definition split_concat.hpp:30