49template <
typename scalar_t,
size_t length>
54template <
typename scalar_t,
size_t length>
59#if SEQAN3_DOXYGEN_ONLY(1) 0
60 using type = scalar_t __attribute__((vector_size(
sizeof(scalar_t) * length))));
62#elif defined(__clang__)
63 using type = scalar_t __attribute__((ext_vector_type(length)));
65 using type [[gnu::vector_size(
sizeof(scalar_t) * length)]] = scalar_t;
73template <
typename builtin_simd_t>
81template <
typename builtin_simd_t>
85 requires (!std::is_pointer_v<std::decay_t<builtin_simd_t>>) &&
requires (builtin_simd_t simd) {
96 static constexpr auto length =
sizeof(builtin_simd_t) /
sizeof(
scalar_type);
100 static constexpr bool value =
102 && std::is_same_v<builtin_simd_t, transformation_trait_or_t<builtin_simd<scalar_type, length>,
void>>;
113template <
typename builtin_simd_t>
122template <
typename builtin_simd_t>
136#if defined(__AVX512F__)
137 return min_viable_uint_v<64u>;
138#elif defined(__AVX2__)
139 return min_viable_uint_v<32u>;
140#elif defined(__SSE4_1__) && defined(__SSE4_2__)
141 return min_viable_uint_v<16u>;
143 return min_viable_uint_v<0u>;
159template <
typename builtin_simd_t>
162 && ((builtin_simd_traits_helper<builtin_simd_t>::length
163 * sizeof(typename builtin_simd_traits_helper<builtin_simd_t>::scalar_type))
165 && ((builtin_simd_traits_helper<builtin_simd_t>::length
166 * sizeof(typename builtin_simd_traits_helper<builtin_simd_t>::scalar_type))
175template <
typename builtin_simd_t>
191template <
typename builtin_simd_t>
204 static_assert(std::is_integral_v<scalar_type>,
"For now we assume that builtin simd can only be integers");
206 using mask_type =
decltype(std::declval<builtin_simd_t>() == std::declval<builtin_simd_t>());
211 template <
typename new_scalar_type>
213 requires (
sizeof(
scalar_type) ==
sizeof(new_scalar_type))
Provides seqan3::detail::default_simd_length and seqan3::detail::default_simd_max_length.
constexpr bool is_builtin_simd_v
Helper variable to test whether a type is a simd builtin type.
Definition builtin_simd.hpp:123
constexpr bool is_native_builtin_simd_v
Helper variable to test whether a type is a native simd builtin type.
Definition builtin_simd.hpp:176
constexpr auto default_simd_max_length< builtin_simd >
This function specializes seqan3::detail::default_simd_max_length for seqan3::detail::builtin_simd.
Definition builtin_simd.hpp:134
T has_single_bit(T... args)
Provides metaprogramming utilities for integer types.
The internal SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
Provides seqan3::simd::simd_traits.
scalar_t __attribute__((vector_size(sizeof(scalar_t) *length)))) type
The type of the builtin simd.
Definition builtin_simd.hpp:60
Helper struct for seqan3::detail::is_builtin_simd.
Definition builtin_simd.hpp:75
A class that holds the type of a simd implementation called [vector extension] (https://gcc....
Definition builtin_simd.hpp:50
This class inherits from std::true_type, iff seqan3::detail::builtin_simd<scalar_t,...
Definition builtin_simd.hpp:115
This class inherits from std::true_type, iff the builtin simd type is supported by the current archit...
Definition builtin_simd.hpp:168
typename detail::builtin_simd< uint8_t, max_length >::type swizzle_type
The type used to define how to swizzle a simd vector (is not defined if simd_t does not model seqan3:...
Definition builtin_simd.hpp:208
decltype(std::declval< builtin_simd_t >()==std::declval< builtin_simd_t >()) mask_type
The type returned by comparison operators (is not defined if simd_t does not model seqan3::simd::simd...
Definition builtin_simd.hpp:206
typename detail::builtin_simd< new_scalar_type, length >::type rebind
The type used to rebind a simd vector to another scalar_type (is not defined if simd_t does not model...
Definition builtin_simd.hpp:215
typename detail::builtin_simd_traits_helper< builtin_simd_t >::scalar_type scalar_type
The underlying type of a simd vector (is not defined if simd_t does not model seqan3::simd::simd)
Definition builtin_simd.hpp:198
seqan3::simd::simd_traits is the trait class that provides uniform interface to the properties of sim...
Definition simd_traits.hpp:38
static constexpr auto length
The number of packed values in a simd vector (is not defined if simd_t does not model seqan3::simd::s...
Definition simd_traits.hpp:46
IMPLEMENTATION_DEFINED scalar_type
The underlying type of a simd vector (is not defined if simd_t does not model seqan3::simd::simd)
Definition simd_traits.hpp:42
static constexpr auto max_length
The maximum number of packable values in a simd vector, if the underlying type would be [u]int8_t (is...
Definition simd_traits.hpp:51