28#ifndef VC_COMMON_DETAIL_H_
29#define VC_COMMON_DETAIL_H_
35namespace Vc_VERSIONED_NAMESPACE
42Vc_INTRINSIC enable_if<(Traits::is_simd_vector<IV>::value &&
43 sizeof(
typename IV::EntryType) >=
sizeof(
int)),
45convertIndexVector(
const IV &indexVector)
53Vc_INTRINSIC enable_if<(Traits::is_simd_vector<IV>::value &&
54 sizeof(
typename IV::EntryType) <
sizeof(
int)),
55 fixed_size_simd<int, IV::Size>>
56convertIndexVector(
const IV &indexVector)
58 return static_cast<fixed_size_simd<int, IV::Size>
>(indexVector);
62template <
class T>
using promoted_type =
decltype(std::declval<T>() + 1);
66template <
typename T, std::
size_t N>
67Vc_INTRINSIC enable_if<std::is_integral<T>::value, fixed_size_simd<promoted_type<T>, N>>
68convertIndexVector(
const std::array<T, N> &indexVector)
70 return fixed_size_simd<promoted_type<T>, N>{std::addressof(indexVector[0]),
73template <
typename T, std::
size_t N>
74Vc_INTRINSIC enable_if<std::is_integral<T>::value, fixed_size_simd<promoted_type<T>, N>>
77 return fixed_size_simd<promoted_type<T>, N>{std::addressof(indexVector[0]),
80template <
typename T, std::
size_t N>
81Vc_INTRINSIC enable_if<std::is_integral<T>::value, fixed_size_simd<promoted_type<T>, N>>
82convertIndexVector(
const T (&indexVector)[N])
84 return fixed_size_simd<promoted_type<T>, N>{std::addressof(indexVector[0]),
94enable_if<std::is_pointer<T>::value,
void> convertIndexVector(T indexVector) =
delete;
100Vc_INTRINSIC std::vector<promoted_type<T>> convertIndexVector(
101 const std::initializer_list<T> &indexVector)
103 return {begin(indexVector), end(indexVector)};
109 enable_if<(std::is_integral<T>::value &&
sizeof(T) >=
sizeof(
int)), std::vector<T>>
110 convertIndexVector(
const std::vector<T> &indexVector)
115Vc_INTRINSIC enable_if<(std::is_integral<T>::value &&
sizeof(T) <
sizeof(
int)),
116 std::vector<promoted_type<T>>>
117convertIndexVector(
const std::vector<T> &indexVector)
119 return {std::begin(indexVector), std::end(indexVector)};
124 (!std::is_pointer<T>::value && !Traits::is_simd_vector<T>::value &&
125 !std::is_lvalue_reference<decltype(std::declval<const T &>()[0])>::value)>>
126Vc_INTRINSIC
const T &convertIndexVector(
const T &i)
constexpr UnalignedTag Unaligned
Use this object for a flags parameter to request unaligned loads and stores.
This is std::array with additional subscript operators supporting gather and scatter operations.