Intel xvec
Experimental C++ simd class library
Loading...
Searching...
No Matches
core.hpp
1//===----------------------------------------------------------------------===//
2//
3// Copyright (C) 2021 Intel Corporation
4//
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#pragma once
10
11#include <bitset>
12#include <concepts> // std::same_as, std::convertible_to, std::integral, ...
13#include <cstddef> // std::size_t
14#include <cstdint> // std::uint64_t
15#include <cstring> // std::memcpy
16#include <algorithm> // std::min, std::max
17#include <bit> // std::has_single_bit, std::bit_ceil
18#include <functional> // std::less, std::greater, ... (used by mask_operator)
19#include <limits> // std::numeric_limits
20#include <ranges> // std::ranges::contiguous_range, sized_range
21#include <type_traits>
22#include <utility> // std::index_sequence, std::in_range
23
24#include <xvec/detail/config.hpp>
25#include <xvec/detail/utilities.hpp>
26
27namespace _XVEC_NAMESPACE::simd {
28
34template<simd_size_type _Np, typename _TARGET_TAG = target_tag> struct simd_fixed_size_abi {
35 static constexpr simd_size_type num_elements = _Np;
36};
37
38template<typename _Tp, typename _Abi = simd_fixed_size_abi<detail::maxBytesInVec / sizeof(_Tp)>> class basic_vec;
39template<std::size_t _Bytes, typename _Abi = simd_fixed_size_abi<detail::maxBytesInVec / _Bytes>> class basic_mask;
40
42template<typename _Tp> using simd_native_abi = simd_fixed_size_abi<detail::max_native_size<_Tp>>;
43
45// :TODO: Should be zero on unsupported types.
46template<class _Tp, class _Abi = simd_native_abi<_Tp>> inline constexpr simd_size_type simd_size_v = _Abi::num_elements;
47
49template<class _Tp> struct simd_mask_element_size : std::integral_constant<std::size_t, 0> {};
50template<std::size_t _Bytes, typename _Abi> struct simd_mask_element_size<basic_mask<_Bytes, _Abi>> : std::integral_constant<std::size_t, _Bytes> {};
51template <typename _Tp> inline constexpr std::size_t simd_mask_element_size_v = simd_mask_element_size<_Tp>::value;
52
53namespace detail {
54 template <typename> inline constexpr bool is_vec_v = false;
55 template <typename _Tp, typename _Abi> inline constexpr bool is_vec_v<basic_vec<_Tp, _Abi>> = true;
56
57 template <typename> inline constexpr bool is_mask_v = false;
58 template <std::size_t _Bytes, typename _Abi> inline constexpr bool is_mask_v<basic_mask<_Bytes, _Abi>> = true;
59}
60
61template<typename _Vp> concept vec_type = detail::is_vec_v<std::remove_cvref_t<_Vp>>;
62template<typename _Mp> concept mask_type = detail::is_mask_v<std::remove_cvref_t<_Mp>>;
63template<typename _Vp> concept vec_or_mask_type = vec_type<_Vp> || mask_type<_Vp>;
64
65template<typename _V> concept vec_integral = vec_type<_V> && std::integral<typename _V::value_type>;
66template<typename _V> concept vec_signed_integral = vec_type<_V> && std::signed_integral<typename _V::value_type>;
67template<typename _V> concept vec_unsigned_integral = vec_type<_V> && std::unsigned_integral<typename _V::value_type>;
69template<typename _V> concept vec_floating_point = vec_type<_V> && detail::is_floating_point_v<typename _V::value_type>;
71template<typename _V> concept vec_arithmetic = vec_integral<_V> || vec_floating_point<_V>;
72template<typename _V> concept vec_totally_ordered = vec_type<_V> && std::totally_ordered<typename _V::value_type>;
73
75template<typename _Vp, typename _Tp> concept vec_of = vec_type<_Vp> && std::same_as<typename _Vp::value_type, _Tp>;
76
78template<typename _V0, typename _V1> concept simd_same_size = vec_or_mask_type<_V0> && vec_or_mask_type<_V1> && (_V0::size == _V1::size);
79
81template<typename _V0, typename _V1> concept vec_or_mask_same_element_type =
82 (vec_type<_V0> && vec_type<_V1> && std::same_as<typename _V0::value_type, typename _V1::value_type>) ||
83 (mask_type<_V0> && mask_type<_V1> && simd_mask_element_size_v<_V0> == simd_mask_element_size_v<_V1>);
84
85namespace detail
86{
87
88// Concepts to check whether a type is a promotable (i.e., where T op T gives something bigger).
89template<class _Tp>
91 std::is_arithmetic_v<_Tp> ||
92 (std::is_enum_v<_Tp> && !detail::is_scoped_enum<_Tp>);
93
94// The op must exist; and if _Tp is not promotable then the result type must be
95// exactly _Tp (no implicit promotions allowed).
96template<class _Tp, class _Op>
98 requires(_Tp a) { _Op{}(a); } &&
99 (promotable_type<_Tp> || requires(_Tp a) { { _Op{}(a) } -> std::same_as<_Tp>; });
100
101template<class _Tp, class _Op>
103 requires(_Tp a, _Tp b) { _Op{}(a, b); } &&
104 (promotable_type<_Tp> || requires(_Tp a, _Tp b) { { _Op{}(a, b) } -> std::same_as<_Tp>; });
105
106template<class _Tp, class _Op>
107concept supported_relational_op = (requires(_Tp a, _Tp b) { {_Op{}(a, b)} -> std::same_as<bool>; });
108
109
112template<typename _From, typename _To>
113inline constexpr bool value_preserving_convertible_to_v = []{
114 using BareFrom = std::remove_cvref_t<_From>;
115 using BareTo = std::remove_cvref_t<_To>;
116
117 if constexpr (std::same_as<BareFrom, BareTo>)
118 return true;
119 else if constexpr (complex_number<BareTo>)
120 {
121 using ToComponent = typename BareTo::value_type;
122 if constexpr (complex_number<BareFrom>)
124 else
126 }
127 else if constexpr (std::integral<BareFrom> && std::integral<BareTo>)
128 {
129 if constexpr (std::is_signed_v<BareFrom> == std::is_signed_v<BareTo>)
130 return (sizeof(BareFrom) <= sizeof(BareTo));
131 else if constexpr (std::is_unsigned_v<BareFrom> && std::is_signed_v<BareTo>)
132 return (sizeof(BareFrom) < sizeof(BareTo));
133 else
134 return false;
135 }
136 else if constexpr (std::integral<BareFrom> && is_floating_point_v<BareTo>)
137 return std::numeric_limits<BareTo>::digits >= std::numeric_limits<BareFrom>::digits;
138 else if constexpr (is_floating_point_v<BareFrom> && is_floating_point_v<BareTo>)
139 return (std::numeric_limits<BareTo>::digits >= std::numeric_limits<BareFrom>::digits &&
140 std::numeric_limits<BareTo>::max_exponent >= std::numeric_limits<BareFrom>::max_exponent &&
141 std::numeric_limits<BareTo>::lowest() <= std::numeric_limits<BareFrom>::lowest() &&
142 std::numeric_limits<BareTo>::max() >= std::numeric_limits<BareFrom>::max());
143 else
144 return false;
145}();
146
147template<typename _From, typename _To>
149
150// std::convertible_to only checks implicit conversions. This concept also
151// allows explicit conversions (e.g., static_cast), which is needed for types
152// that have explicit constructors or explicit conversion operators.
153template<class _From, class _To> concept explicitly_convertible_to =
154 requires {
155 static_cast<_To>(std::declval<_From>());
156 };
157
158template <typename _From, typename _To>
159concept higher_floating_point_rank = is_floating_point_v<_From> && is_floating_point_v<_To>
160 && std::same_as<std::common_type_t<_From, _To>, _From>
161 && !std::same_as<_From, _To>;
162
166template <typename _From, typename _To>
167concept higher_integer_rank = std::integral<_From> && std::integral<_To> && (sizeof(_From) > sizeof(_To));
168
170template<typename _Range> concept contiguous_sized_range = std::ranges::contiguous_range<_Range> && std::ranges::sized_range<_Range>;
171
173template<typename _Tp>
175 sizeof(_Tp) <= 8 &&
176 ((std::integral<_Tp> && !std::same_as<bool, _Tp>) ||
177 is_floating_point_v<_Tp> ||
178 std::same_as<std::byte, _Tp>);
179
182template<typename _Tp>
184
188template<typename _Tp>
193
196template<typename _Tp>
197inline constexpr bool disable_vectorization =
198 std::is_pointer_v<_Tp> ||
199 std::is_member_pointer_v<_Tp> ||
200 std::is_union_v<_Tp> ||
201 std::is_const_v<_Tp> ||
202 std::is_volatile_v<_Tp> ||
203 std::is_empty_v<_Tp> ||
204 std::same_as<_Tp, long double> ||
206 // Users can specialize this for their own types
207 // Implementations add specializations for specific std types
208
209template<typename _Tp>
211 std::is_trivially_copyable_v<_Tp> &&
212 (sizeof(_Tp) == 1 || sizeof(_Tp) == 2 || sizeof(_Tp) == 4 ||
213 sizeof(_Tp) == 8 || sizeof(_Tp) == 16) &&
215
216template<typename _Tp>
218
227template<typename _From, typename _To>
228inline constexpr bool needs_explicit_conversion_v = [] {
233 else
234 return !std::is_convertible_v<_From, _To>;
235}();
236
237template<typename _From, typename _To>
239
243template<class T>
245 requires { T::value; } &&
246 requires {
247 requires std::convertible_to<T, std::remove_cvref_t<decltype(T::value)>>;
248 requires std::equality_comparable_with<T, std::remove_cvref_t<decltype(T::value)>>;
249 requires std::bool_constant<(T{} == T::value)>::value;
250 requires std::bool_constant<
251 (static_cast<std::remove_cvref_t<decltype(T::value)>>(T{}) == T::value)
252 >::value;
253 };
254
255template<class From, class To>
257 std::is_convertible_v<From, To> &&
258 std::is_convertible_v<To, From> &&
259 requires(From x) {
260 { static_cast<From>(static_cast<To>(x)) == x } -> std::convertible_to<bool>;
261 };
262
263template<class To, class From>
265constexpr bool roundtrip_preserves_value(From x) { return static_cast<From>(static_cast<To>(x)) == x; }
266
267template<class Wrapper, class To>
268inline constexpr bool wrapped_value_is_representable_by_v = []{
269 using From = std::remove_cvref_t<decltype(Wrapper::value)>;
270
271 if constexpr (std::is_integral_v<From> && std::is_integral_v<To>) {
272 return std::in_range<To>(Wrapper::value);
273 } else if constexpr (roundtrippable<From, To>) {
274 return roundtrip_preserves_value<To>(Wrapper::value);
275 } else {
276 return false;
277 }
278}();
279
280template<class Wrapper, class To>
281concept wrapped_value_is_representable_by = wrapped_value_is_representable_by_v<Wrapper, To>;
282
283template<class From, class To>
285 std::convertible_to<From, To> &&
286 (
287 // 1) From is not arithmetic-like and not a constexpr-wrapper-like
288 (!is_arithmetic_like_v<From> && !constexpr_wrapper_like<From>)
289
290 // 2) From is arithmetic-like and conversion From -> value_type is value-preserving
291 || (is_arithmetic_like_v<From> && value_preserving_convertible_to<From, To>)
292
293 // 3) From is constexpr-wrapper-like, its ::value type is arithmetic-like,
294 // and that value is representable by value_type
296 is_arithmetic_like_v<std::remove_cvref_t<decltype(From::value)>> &&
298 );
299
300template<typename _Gen> concept index_generator_function_with_size = requires { { std::declval<_Gen>()(0, 0) } -> std::integral; };
301template<typename _Gen> concept index_generator_function_without_size = requires { { std::declval<_Gen>()(0) } -> std::integral; };
303
305template<typename _Tp> concept vec_container_element = std::unsigned_integral<_Tp> || std::same_as<unsigned __int128, _Tp>;
306
310template<typename _From, typename _To>
312 std::convertible_to<_From, _To> &&
313 (!is_arithmetic_like_v<_From> || // !arithmetic
315
316template<typename _Gen, typename _Tp, simd_size_type _Idx>
318 requires(_Gen __gen) {
319 { __gen(std::integral_constant<simd_size_type, _Idx>{}) }
321 };
322
323template<typename _Gen, typename _Tp, int _Size>
325 !std::constructible_from<_Tp, _Gen> && // if the generator can be used as a constructor argument, it shouldn't be used as a generator
326 []<simd_size_type... _Idx>(std::integer_sequence<simd_size_type, _Idx... >) {
327 // Note - avoiding folds because older compilers have size limitations with them.
328 bool checks[] = { generator_invocable_at<_Gen, _Tp, _Idx>... };
329 for (bool check : checks) if (!check) return false;
330 return true;
331 }(std::make_integer_sequence<simd_size_type, _Size>{});
332
333
334template<typename Op>
336 std::less<>, std::greater<>, std::less_equal<>, std::greater_equal<>,
337 std::equal_to<>, std::not_equal_to<>,
338 std::logical_and<>, std::logical_or<>, std::logical_not<>>;
339
340// [simd.expos.defn]
341template <class _Tp> using deduced_vec_t = decltype(std::declval<const _Tp&>() + std::declval<const _Tp&>());
342template <class _Tp> using deduced_mask_t = typename deduced_vec_t<_Tp>::mask_type;
344
345} // namespace detail
346
354
356template<class _Tp, class _Vp> struct rebind {};
357template<class _Tp, class _Sp, class _Abi> struct rebind<_Tp, basic_vec<_Sp, _Abi>> {
359};
360template<class _Tp, std::size_t _Bytes, class _Abi> struct rebind<_Tp, basic_mask<_Bytes, _Abi>> {
361 using type = basic_mask<sizeof(_Tp), simd_fixed_size_abi<_Abi::num_elements>>;
362};
363template<class _Tp, class _Vp> using rebind_t = typename rebind<_Tp, _Vp>::type;
364
366template<simd_size_type _Np, class _Vp> struct resize { };
367template<simd_size_type _Np, class _Tp, class _Abi> struct resize<_Np, basic_vec<_Tp, _Abi>> {
369};
370template<simd_size_type _Np, std::size_t _Bytes, class _Abi> struct resize<_Np, basic_mask<_Bytes, _Abi>> {
372};
373template<simd_size_type _Np, class _Vp> using resize_t = typename resize<_Np, _Vp>::type;
374
376
379template<class _Tp, simd_size_type _Np = basic_vec<_Tp>::size()> using vec = basic_vec<_Tp, simd_fixed_size_abi<_Np>>;
380
383template<class _Tp, simd_size_type _Np = basic_mask<sizeof(_Tp)>::size()> using mask = basic_mask<sizeof(_Tp), simd_fixed_size_abi<_Np>>;
384
392
393template <class... _Flags> struct flags {
394 template <class... _Others>
395 friend consteval auto operator|(flags, flags<_Others...>) {
396 // :TODO: Remove duplicates? What happens if overaligned is specified multiple times?
397 return flags<_Flags..., _Others...>();
398 }
399};
400
402
403namespace detail {
404 class flag_convert {};
405 class flag_aligned {};
406 template<std::size_t _N> class flag_overaligned {};
408
409 // Add extra flags to the existing flags.
410 constexpr auto add_unchecked_flag(auto f) { return f | flags<flag_unchecked>{}; };
411 constexpr auto add_convert_flag(auto f) { return f | flags<flag_convert>{}; };
412
414 template<typename _F, typename... _Flags>
415 constexpr bool contains_flag(flags<_Flags...>) { return (std::is_same_v<_F, _Flags> || ...); }
416}
417
420
422inline constexpr flags<> flag_default{};
423inline constexpr flags<detail::flag_convert> flag_convert{};
424inline constexpr flags<detail::flag_aligned> flag_aligned{};
425
426template<std::size_t _N> requires (std::has_single_bit(_N)) inline constexpr flags<detail::flag_overaligned<_N>> flag_overaligned{};
427
429
432
434template<typename _Tp>
435struct convert_to_t {
436 using type = _Tp;
437 constexpr explicit convert_to_t() noexcept = default;
438};
439
440template<class _Tp> inline constexpr convert_to_t<_Tp> convert_to{};
441
443
444namespace detail
445{
446
449template<typename _Vendor, typename _Tp, simd_size_type _Np>
451{
452 static_assert(isLlvm || _Np <= 256, "gcc has limits on size");
453
455 static constexpr simd_size_type _numDataElements = complex_number<_Tp> ? 2 * _Np : _Np;
456
458 static constexpr simd_size_type _numStorageElements = isLlvm ? _numDataElements : std::bit_ceil((std::uint64_t)_numDataElements);
459
464 using element_type = element_storage_t<_Tp>;
465 using element_container_type = container_for_type<_Tp>;
466
468 using builtin_type __attribute__((__vector_size__(sizeof(element_type) * _numStorageElements))) = element_type;
469
475
488 static constexpr register_type to_register(builtin_type v) {
489 constexpr auto _regSize = register_size<_Tp, _Np>;
490 static_assert(_Np <= _regSize, "Converting to a smaller register loses data");
491
492 auto r = [=]<int... _Idx>(std::integer_sequence<int, _Idx...>) {
493 return __builtin_shufflevector(v, v, (_Idx < _Np ? _Idx : -1)...);
494 }(std::make_integer_sequence<int, _regSize>());
495
496 return register_type(r);
497 }
498
502 static constexpr builtin_type from_register(register_type r) {
503 constexpr auto _regSize = register_size<_Tp, _Np>;
504 static_assert(_Np <= _regSize, "Converting from a smaller register creates undefined values");
505 if constexpr (_Np == _regSize)
506 return builtin_type(r);
507 else
508 {
509 // Convert to a full register of the builtin elements.
510 using FullRegBuiltin = typename vec<element_container_type, _regSize>::builtin_type;
511 auto b = FullRegBuiltin(r);
512
513 // Then shuffle down to the correct number of elements.
514 return builtin_type([=]<std::size_t... _Idx>(std::index_sequence<_Idx...>) {
515 return __builtin_shufflevector(b, b, _Idx...);
516 }(std::make_index_sequence<_numStorageElements>()));
517 }
518 }
519
520};
521
524template<typename _Vendor, std::size_t _Bytes, simd_size_type _Np>
526{
527 using element_container_type = detail::container_for_num_bytes<_Bytes>;
528 using element_signed_container_type = detail::make_signed_t<element_container_type>;
529
530 using signed_vec_for_mask = vec<element_signed_container_type, _Np>;
531 using unsigned_vec_for_mask = vec<element_container_type, _Np>;
532
533 // Round up to the next power of 2 to ensure efficient storage. Although
534 // clang/icx handle arbitrary sizes, they don't handle non-byte sizes very
535 // well, and introduce lots of unnecessary code.
536 static constexpr int internalNp = std::bit_ceil(std::max<unsigned>(8, _Np));
537
538#if defined (__llvm__)
539
540 // Two different names for ExtInt/BitInt - choose one explicitly to avoid warnings about deprecations.
541 #if defined(__INTEL_LLVM_COMPILER)
542 #if __INTEL_LLVM_COMPILER > 20220000
543 using compact_builtin_type = unsigned _BitInt(internalNp);
544 #else
545 using compact_builtin_type = unsigned _ExtInt(internalNp);
546 #endif
547 #elif defined(__clang_major__)
548 #if __clang_major__ >= 14
549 using compact_builtin_type = unsigned _BitInt(internalNp);
550 #else
551 using compact_builtin_type = unsigned _ExtInt(internalNp);
552 #endif
553 #else
554 #error "Unknown LLVM-based compiler: choose a bit-precise integer type"
555 #endif
556
557 static constexpr auto all_bits_set = (_Np == internalNp) ? ~compact_builtin_type() : ((compact_builtin_type(1) << _Np) - 1);
558
559#else
560 using compact_builtin_type = __uint128_t;
561 static constexpr auto all_bits_set = (_Np == 128) ? ~compact_builtin_type() : ((compact_builtin_type(1) << _Np) - 1);
562#endif
563
564 using builtin_type =
565 std::conditional_t<has_compact_mask<_Vendor>, compact_builtin_type, typename vec_traits<_Vendor, element_container_type, _Np>::builtin_type>;
566
567 static constexpr builtin_type truncate_to_size(builtin_type m) {
568 if constexpr (has_compact_mask<_Vendor>) return m & all_bits_set;
569 else return m;
570 }
571
572 static constexpr auto to_register(const builtin_type& m) noexcept {
573 if constexpr (has_compact_mask<_Vendor>) return m;
575 }
576};
577
578} // namespace detail
579
582
584template<typename _To, typename _From>
585constexpr auto simd_bit_cast(const _From& v) noexcept { return std::bit_cast<_To>(v); }
586
589template<detail::vectorizable _To, vec_type _From>
590constexpr
591auto simd_bit_cast(const _From& v) noexcept
592{
593 // If the user attempts to convert to a type which cannot form a whole number
594 // of elements from the source then they probably misunderstood what the size
595 // was. In this situation it is more helpful to raise an error to correct the
596 // misunderstanding than have a constraint which prevents the bit cast from
597 // even being matched.
598 static_assert((_From::size() * sizeof(typename _From::value_type)) % sizeof(_To) == 0);
599
600 // Two steps are necessary to figure out the new type - change the element type of the vec while retaining the same abi,
601 // and then resize it to match the bit-size of the original object.
602 constexpr int newNumElements = _From::size() * sizeof(typename _From::value_type) / sizeof(_To);
603 using new_type = vec<_To, newNumElements>;
604 if constexpr (detail::isLlvm)
605 // LLVM/oneAPI are happy to assign any vector type to any other vector type, which is good because bit_cast doesn't work for them.
606 // NOTE: If -flax-vector-conversions is enabled, this line reports an error though. Disable that option in that case.
607 return new_type{v.to_builtin()};
608 else
609 // GCC requires a bit cast to get things to work properly. This code doesn't work on LLVM.
610 return new_type{__builtin_bit_cast(typename new_type::builtin_type, v.to_builtin())};
611}
612
614
615} // namespace _XVEC_NAMESPACE::simd
A mask containing boolean elements.
Definition mask.hpp:121
Vector of elements sharing an element type and ABI.
Definition simd:161
Definition core.hpp:405
Definition core.hpp:404
Definition core.hpp:407
Detect whether a given type is std::complex.
Definition utilities.hpp:53
Check for contiguous range with a finite range.
Definition core.hpp:170
Detect a fundamental unsigned integer type.
Definition utilities.hpp:62
Definition compat.hpp:29
Definition core.hpp:335
Definition core.hpp:256
Detect a simple vectorizable type.
Definition core.hpp:174
Concepts used to simplify some function signature requirements.
Definition core.hpp:305
Definition core.hpp:210
Definition target_config.hpp:175
Definition core.hpp:62
Check that two simdable values (mask, simds, or a mixture) have the same number of elements.
Definition core.hpp:78
Definition core.hpp:71
Definition core.hpp:70
Definition core.hpp:69
Definition core.hpp:65
Detect a vec_type with arbitrary length whose elements are of a given type.
Definition core.hpp:75
Check that the two simdable values have the same type/size of elements.
Definition core.hpp:81
Definition core.hpp:63
Definition core.hpp:66
Definition core.hpp:72
Definition core.hpp:61
Definition core.hpp:68
Definition core.hpp:67
constexpr flags flag_default
Standard flags.
Definition core.hpp:422
basic_mask< sizeof(_Tp), simd_fixed_size_abi< _Np > > mask
Definition core.hpp:383
basic_vec< _Tp, simd_fixed_size_abi< _Np > > vec
Definition core.hpp:379
constexpr bool disable_vectorization
Definition core.hpp:197
constexpr auto simd_bit_cast(const _From &v) noexcept
A simd-generic version of simd_bit_cast which directly invokes std::bit_cast.
Definition core.hpp:585
Detect a scoped enum. This will be provided in C++23 onwards.
Definition compat.hpp:27
constexpr bool any_same_v
Definition utilities.hpp:58
consteval auto get_register_type()
Definition target_config.hpp:157
constexpr bool value_preserving_convertible_to_v
Definition core.hpp:113
constexpr bool contains_flag(flags< _Flags... >)
Query whether the given flags contains the specified type.
Definition core.hpp:415
constexpr bool needs_explicit_conversion_v
Definition core.hpp:228
constexpr bool isLlvm
Compile time flag to indicate whether the LLVM compiler is being used.
Definition utilities.hpp:41
constexpr int maxBytesInVec
Definition target_config.hpp:148
Conversion flag, used to pass destination type to a simd_convert customisation point.
Definition core.hpp:435
Definition core.hpp:526
Definition core.hpp:451
decltype(detail::get_register_type< builtin_type >()) register_type
The register to use for intrinsic operations on this vec (e.g., for vec<double, 3> it would be __m256...
Definition core.hpp:474
element_storage_t< _Tp > element_type
Definition core.hpp:464
static constexpr simd_size_type _numDataElements
Definition core.hpp:455
static constexpr simd_size_type _numStorageElements
Definition core.hpp:458
static constexpr builtin_type from_register(register_type r)
A named constructor for creating a builtin type from a register value.
Definition core.hpp:502
static constexpr register_type to_register(builtin_type v)
Definition core.hpp:488
Definition core.hpp:393
Given a simd type (vec or mask), create a new type which has the same size but a different element.
Definition core.hpp:356
Given a vec or mask type, create a new type which has the same element type but a different size.
Definition core.hpp:366
An implementation ABI type which is used to specify a simd::vec with a fixed number of elements.
Definition core.hpp:34
static constexpr simd_size_type num_elements
Definition core.hpp:35
Query the number of bytes in an element of a simd::mask.
Definition core.hpp:49