native 0.0.1
Vectors, masks and wide register packs for C++26
Loading...
Searching...
No Matches
native.x86.memory.ccm
1// SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0
2module;
3#include "native/isa_import.h"
4#include "native/config.h"
5#include <hint.h>
6#include <array>
7#include <bit>
8#include <cstring>
9#include <concepts>
10#include <cstddef>
11#include <cstdint>
12#include <limits>
13#if NATIVE_HOST_X86
14#include <immintrin.h>
15#endif
16import native.simd;
17
18#if NATIVE_HOST_X86 || defined(NATIVE_DOXYGEN)
19namespace native::detail::x86_memory {
20 // These checks belong solely to constant evaluation. Runtime addresses are
21 // formed by the gather/scatter instruction, including unaligned byte offsets.
22 inline void constant_offset_requires_complete_elements() noexcept { __builtin_trap(); }
23 inline void constant_offset_out_of_range() noexcept { __builtin_trap(); }
24
25 template<int Scale, class T, class I>
26 constexpr std::ptrdiff_t element_offset(I index) noexcept {
27 std::int64_t value = index;
28 if constexpr (Scale < sizeof(T)) {
29 constexpr auto divisor = static_cast<std::int64_t>(sizeof(T) / Scale);
30 if (value % divisor) constant_offset_requires_complete_elements();
31 value /= divisor;
32 } else {
33 constexpr auto multiplier = static_cast<std::int64_t>(Scale / sizeof(T));
34 if (value > std::numeric_limits<std::ptrdiff_t>::max() / multiplier ||
35 value < std::numeric_limits<std::ptrdiff_t>::min() / multiplier) {
36 constant_offset_out_of_range();
37 }
38 value *= multiplier;
39 }
40 if (value > std::numeric_limits<std::ptrdiff_t>::max() ||
41 value < std::numeric_limits<std::ptrdiff_t>::min()) constant_offset_out_of_range();
42 return static_cast<std::ptrdiff_t>(value);
43 }
44
45 template<class V>
46 constexpr auto array(V value) noexcept {
47 std::array<typename V::value_type, V::lanes> result{};
48 if consteval {
49 value.store(result.data());
50 } else {
51 auto physical = std::bit_cast<std::array<typename V::value_type,
52 sizeof(V) / sizeof(typename V::value_type)>>(value);
53 for (std::size_t i = 0; i < V::lanes; ++i) result[i] = physical[i];
54 }
55 return result;
56 }
57
58 template<class M>
59 constexpr bool active(M mask, std::size_t lane) noexcept {
60 if constexpr (std::same_as<M, std::uint64_t>) return (mask >> lane) & 1;
61 else return array(mask)[lane] < 0;
62 }
63
64 template<int Scale, class V, class I, class M>
65 constexpr V gather(typename V::value_type const * base, I indices, V source, M mask) noexcept {
66 auto result = array(source);
67 auto offsets = array(indices);
68 constexpr auto count = V::lanes < I::lanes ? V::lanes : I::lanes;
69 for (std::size_t lane = 0; lane < count; ++lane) {
70 if (!active(mask, lane)) continue;
71 if consteval {
72 result[lane] = base[element_offset<Scale, typename V::value_type>(offsets[lane])];
73 } else {
74 // Integer address arithmetic matches signed-index byte scaling without
75 // forming a misaligned typed lvalue or touching an inactive address.
76 auto address = reinterpret_cast<std::uintptr_t>(base) +
77 std::uintptr_t(std::intptr_t(offsets[lane])) * Scale;
78 std::memcpy(&result[lane], reinterpret_cast<void const *>(address), sizeof(result[lane]));
79 }
80 }
81 for (std::size_t lane = count; lane < V::lanes; ++lane) result[lane] = {};
82 if consteval {
83 return V(result);
84 } else {
85 std::array<typename V::value_type, sizeof(V) / sizeof(typename V::value_type)> physical{};
86 for (std::size_t i = 0; i < V::lanes; ++i) physical[i] = result[i];
87 return std::bit_cast<V>(physical);
88 }
89 }
90
91 template<int Scale, class V, class I>
92 constexpr void scatter(typename V::value_type * base, I indices, V value, std::uint64_t mask) noexcept {
93 auto values = array(value);
94 auto offsets = array(indices);
95 constexpr auto count = V::lanes < I::lanes ? V::lanes : I::lanes;
96 for (std::size_t lane = 0; lane < count; ++lane) {
97 if (!active(mask, lane)) continue;
98 if consteval {
99 auto offset = element_offset<Scale, typename V::value_type>(offsets[lane]);
100 base[offset] = values[lane];
101 } else {
102 auto address = reinterpret_cast<std::uintptr_t>(base) +
103 std::uintptr_t(std::intptr_t(offsets[lane])) * Scale;
104 std::memcpy(reinterpret_cast<void *>(address), &values[lane], sizeof(values[lane]));
105 }
106 }
107 }
108}
109
110namespace native {
124
126 template<int Scale, std::size_t N, isa<x86> Arch>
127 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4)
128 [[nodiscard]] hint_inline hint_target("avx2")
129 constexpr simd<float, 4, Arch> vgatherdps(float const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
130 if consteval {
131 return detail::x86_memory::gather<Scale>(base, indices, simd<float, 4, Arch>{}, ~std::uint64_t{0});
132 } else {
134 _mm_i32gather_ps(base, indices.to_native(), Scale));
135 }
136 }
137
139 template<int Scale, isa<x86> Arch>
140 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
141 [[nodiscard]] hint_inline hint_target("avx2")
143 float const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
144 if consteval {
145 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
146 } else {
148 _mm_mask_i32gather_ps(source.to_native(), base, indices.to_native(), __builtin_bit_cast(typename decltype(source)::native_type, mask.to_native()), Scale));
149 }
150 }
151
153 template<int Scale, isa<x86> Arch>
154 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
155 [[nodiscard]] hint_inline hint_target("avx512f,avx512vl")
157 float const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
158 if consteval {
159 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
160 } else {
162 _mm_mmask_i32gather_ps(source.to_native(), mask.to_bitset(), indices.to_native(), base, Scale));
163 }
164 }
165
167 template<int Scale, isa<x86> Arch>
168 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
169 hint_inline hint_target("avx512f,avx512vl")
170 constexpr void mask_vscatterdps(float * base, predicate<4, Arch> mask,
171 simd<std::int32_t, 4, Arch> indices, simd<float, 4, Arch> value) noexcept {
172 if consteval {
173 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
174 } else {
175 _mm_mask_i32scatter_ps(base, mask.to_bitset(), indices.to_native(), value.to_native(), Scale);
176 }
177 }
178
180 template<int Scale, std::size_t N, isa<x86> Arch>
181 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 8)
182 [[nodiscard]] hint_inline hint_target("avx2")
183 constexpr simd<float, 8, Arch> vgatherdps(float const * base, simd<std::int32_t, 8, Arch> indices) noexcept {
184 if consteval {
185 return detail::x86_memory::gather<Scale>(base, indices, simd<float, 8, Arch>{}, ~std::uint64_t{0});
186 } else {
188 _mm256_i32gather_ps(base, indices.to_native(), Scale));
189 }
190 }
191
193 template<int Scale, isa<x86> Arch>
194 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
195 [[nodiscard]] hint_inline hint_target("avx2")
197 float const * base, simd<std::int32_t, 8, Arch> indices) noexcept {
198 if consteval {
199 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
200 } else {
202 _mm256_mask_i32gather_ps(source.to_native(), base, indices.to_native(), __builtin_bit_cast(typename decltype(source)::native_type, mask.to_native()), Scale));
203 }
204 }
205
207 template<int Scale, isa<x86> Arch>
208 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
209 [[nodiscard]] hint_inline hint_target("avx512f,avx512vl")
211 float const * base, simd<std::int32_t, 8, Arch> indices) noexcept {
212 if consteval {
213 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
214 } else {
216 _mm256_mmask_i32gather_ps(source.to_native(), mask.to_bitset(), indices.to_native(), base, Scale));
217 }
218 }
219
221 template<int Scale, isa<x86> Arch>
222 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
223 hint_inline hint_target("avx512f,avx512vl")
224 constexpr void mask_vscatterdps(float * base, predicate<8, Arch> mask,
225 simd<std::int32_t, 8, Arch> indices, simd<float, 8, Arch> value) noexcept {
226 if consteval {
227 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
228 } else {
229 _mm256_mask_i32scatter_ps(base, mask.to_bitset(), indices.to_native(), value.to_native(), Scale);
230 }
231 }
232
234 template<int Scale, isa<x86> Arch>
235 requires(Arch.has(x86_feature::avx512f) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
236 [[nodiscard]] hint_inline hint_target("avx512f")
238 float const * base, simd<std::int32_t, 16, Arch> indices) noexcept {
239 if consteval {
240 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
241 } else {
243 _mm512_mask_i32gather_ps(source.to_native(), mask.to_bitset(), indices.to_native(), base, Scale));
244 }
245 }
246
248 template<int Scale, isa<x86> Arch>
249 requires(Arch.has(x86_feature::avx512f) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
250 hint_inline hint_target("avx512f")
251 constexpr void mask_vscatterdps(float * base, predicate<16, Arch> mask,
252 simd<std::int32_t, 16, Arch> indices, simd<float, 16, Arch> value) noexcept {
253 if consteval {
254 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
255 } else {
256 _mm512_mask_i32scatter_ps(base, mask.to_bitset(), indices.to_native(), value.to_native(), Scale);
257 }
258 }
259
261 template<int Scale, std::size_t N, isa<x86> Arch, class T>
262 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4 && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>))
263 [[nodiscard]] hint_inline hint_target("avx2")
264 constexpr simd<T, 4, Arch> vpgatherdd(T const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
265 if consteval {
266 return detail::x86_memory::gather<Scale>(base, indices, simd<T, 4, Arch>{}, ~std::uint64_t{0});
267 } else {
269 _mm_i32gather_epi32(reinterpret_cast<int const *>(base), indices.to_native(), Scale));
270 }
271 }
272
274 template<int Scale, isa<x86> Arch, class T>
275 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>))
276 [[nodiscard]] hint_inline hint_target("avx2")
278 T const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
279 if consteval {
280 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
281 } else {
283 _mm_mask_i32gather_epi32(source.to_native(), reinterpret_cast<int const *>(base), indices.to_native(), mask.to_native(), Scale));
284 }
285 }
286
288 template<int Scale, isa<x86> Arch, class T>
289 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>))
290 [[nodiscard]] hint_inline hint_target("avx512f,avx512vl")
292 T const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
293 if consteval {
294 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
295 } else {
297 _mm_mmask_i32gather_epi32(source.to_native(), mask.to_bitset(), indices.to_native(), base, Scale));
298 }
299 }
300
302 template<int Scale, isa<x86> Arch, class T>
303 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>))
304 hint_inline hint_target("avx512f,avx512vl")
305 constexpr void mask_vpscatterdd(T * base, predicate<4, Arch> mask,
306 simd<std::int32_t, 4, Arch> indices, simd<T, 4, Arch> value) noexcept {
307 if consteval {
308 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
309 } else {
310 _mm_mask_i32scatter_epi32(base, mask.to_bitset(), indices.to_native(), value.to_native(), Scale);
311 }
312 }
313
315 template<int Scale, std::size_t N, isa<x86> Arch, class T>
316 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 8 && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>))
317 [[nodiscard]] hint_inline hint_target("avx2")
318 constexpr simd<T, 8, Arch> vpgatherdd(T const * base, simd<std::int32_t, 8, Arch> indices) noexcept {
319 if consteval {
320 return detail::x86_memory::gather<Scale>(base, indices, simd<T, 8, Arch>{}, ~std::uint64_t{0});
321 } else {
323 _mm256_i32gather_epi32(reinterpret_cast<int const *>(base), indices.to_native(), Scale));
324 }
325 }
326
328 template<int Scale, isa<x86> Arch, class T>
329 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>))
330 [[nodiscard]] hint_inline hint_target("avx2")
332 T const * base, simd<std::int32_t, 8, Arch> indices) noexcept {
333 if consteval {
334 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
335 } else {
337 _mm256_mask_i32gather_epi32(source.to_native(), reinterpret_cast<int const *>(base), indices.to_native(), mask.to_native(), Scale));
338 }
339 }
340
342 template<int Scale, isa<x86> Arch, class T>
343 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>))
344 [[nodiscard]] hint_inline hint_target("avx512f,avx512vl")
346 T const * base, simd<std::int32_t, 8, Arch> indices) noexcept {
347 if consteval {
348 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
349 } else {
351 _mm256_mmask_i32gather_epi32(source.to_native(), mask.to_bitset(), indices.to_native(), base, Scale));
352 }
353 }
354
356 template<int Scale, isa<x86> Arch, class T>
357 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>))
358 hint_inline hint_target("avx512f,avx512vl")
359 constexpr void mask_vpscatterdd(T * base, predicate<8, Arch> mask,
360 simd<std::int32_t, 8, Arch> indices, simd<T, 8, Arch> value) noexcept {
361 if consteval {
362 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
363 } else {
364 _mm256_mask_i32scatter_epi32(base, mask.to_bitset(), indices.to_native(), value.to_native(), Scale);
365 }
366 }
367
369 template<int Scale, isa<x86> Arch, class T>
370 requires(Arch.has(x86_feature::avx512f) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>))
371 [[nodiscard]] hint_inline hint_target("avx512f")
373 T const * base, simd<std::int32_t, 16, Arch> indices) noexcept {
374 if consteval {
375 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
376 } else {
378 _mm512_mask_i32gather_epi32(source.to_native(), mask.to_bitset(), indices.to_native(), base, Scale));
379 }
380 }
381
383 template<int Scale, isa<x86> Arch, class T>
384 requires(Arch.has(x86_feature::avx512f) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>))
385 hint_inline hint_target("avx512f")
386 constexpr void mask_vpscatterdd(T * base, predicate<16, Arch> mask,
387 simd<std::int32_t, 16, Arch> indices, simd<T, 16, Arch> value) noexcept {
388 if consteval {
389 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
390 } else {
391 _mm512_mask_i32scatter_epi32(base, mask.to_bitset(), indices.to_native(), value.to_native(), Scale);
392 }
393 }
394
396 template<int Scale, std::size_t N, isa<x86> Arch>
397 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 2)
398 [[nodiscard]] hint_inline hint_target("avx2")
399 constexpr simd<double, 2, Arch> vgatherdpd(double const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
400 if consteval {
401 return detail::x86_memory::gather<Scale>(base, indices, simd<double, 2, Arch>{}, ~std::uint64_t{0});
402 } else {
404 _mm_i32gather_pd(base, indices.to_native(), Scale));
405 }
406 }
407
409 template<int Scale, isa<x86> Arch>
410 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
411 [[nodiscard]] hint_inline hint_target("avx2")
413 double const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
414 if consteval {
415 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
416 } else {
418 _mm_mask_i32gather_pd(source.to_native(), base, indices.to_native(), __builtin_bit_cast(typename decltype(source)::native_type, mask.to_native()), Scale));
419 }
420 }
421
423 template<int Scale, isa<x86> Arch>
424 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
425 [[nodiscard]] hint_inline hint_target("avx512f,avx512vl")
427 double const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
428 if consteval {
429 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
430 } else {
432 _mm_mmask_i32gather_pd(source.to_native(), mask.to_bitset(), indices.to_native(), base, Scale));
433 }
434 }
435
437 template<int Scale, isa<x86> Arch>
438 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
439 hint_inline hint_target("avx512f,avx512vl")
440 constexpr void mask_vscatterdpd(double * base, predicate<2, Arch> mask,
441 simd<std::int32_t, 4, Arch> indices, simd<double, 2, Arch> value) noexcept {
442 if consteval {
443 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
444 } else {
445 _mm_mask_i32scatter_pd(base, mask.to_bitset(), indices.to_native(), value.to_native(), Scale);
446 }
447 }
448
450 template<int Scale, std::size_t N, isa<x86> Arch>
451 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4)
452 [[nodiscard]] hint_inline hint_target("avx2")
453 constexpr simd<double, 4, Arch> vgatherdpd(double const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
454 if consteval {
455 return detail::x86_memory::gather<Scale>(base, indices, simd<double, 4, Arch>{}, ~std::uint64_t{0});
456 } else {
458 _mm256_i32gather_pd(base, indices.to_native(), Scale));
459 }
460 }
461
463 template<int Scale, isa<x86> Arch>
464 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
465 [[nodiscard]] hint_inline hint_target("avx2")
467 double const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
468 if consteval {
469 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
470 } else {
472 _mm256_mask_i32gather_pd(source.to_native(), base, indices.to_native(), __builtin_bit_cast(typename decltype(source)::native_type, mask.to_native()), Scale));
473 }
474 }
475
477 template<int Scale, isa<x86> Arch>
478 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
479 [[nodiscard]] hint_inline hint_target("avx512f,avx512vl")
481 double const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
482 if consteval {
483 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
484 } else {
486 _mm256_mmask_i32gather_pd(source.to_native(), mask.to_bitset(), indices.to_native(), base, Scale));
487 }
488 }
489
491 template<int Scale, isa<x86> Arch>
492 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
493 hint_inline hint_target("avx512f,avx512vl")
494 constexpr void mask_vscatterdpd(double * base, predicate<4, Arch> mask,
495 simd<std::int32_t, 4, Arch> indices, simd<double, 4, Arch> value) noexcept {
496 if consteval {
497 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
498 } else {
499 _mm256_mask_i32scatter_pd(base, mask.to_bitset(), indices.to_native(), value.to_native(), Scale);
500 }
501 }
502
504 template<int Scale, isa<x86> Arch>
505 requires(Arch.has(x86_feature::avx512f) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
506 [[nodiscard]] hint_inline hint_target("avx512f")
508 double const * base, simd<std::int32_t, 8, Arch> indices) noexcept {
509 if consteval {
510 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
511 } else {
513 _mm512_mask_i32gather_pd(source.to_native(), mask.to_bitset(), indices.to_native(), base, Scale));
514 }
515 }
516
518 template<int Scale, isa<x86> Arch>
519 requires(Arch.has(x86_feature::avx512f) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
520 hint_inline hint_target("avx512f")
521 constexpr void mask_vscatterdpd(double * base, predicate<8, Arch> mask,
522 simd<std::int32_t, 8, Arch> indices, simd<double, 8, Arch> value) noexcept {
523 if consteval {
524 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
525 } else {
526 _mm512_mask_i32scatter_pd(base, mask.to_bitset(), indices.to_native(), value.to_native(), Scale);
527 }
528 }
529
531 template<int Scale, std::size_t N, isa<x86> Arch, class T>
532 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 2 && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>))
533 [[nodiscard]] hint_inline hint_target("avx2")
534 constexpr simd<T, 2, Arch> vpgatherdq(T const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
535 if consteval {
536 return detail::x86_memory::gather<Scale>(base, indices, simd<T, 2, Arch>{}, ~std::uint64_t{0});
537 } else {
539 _mm_i32gather_epi64(reinterpret_cast<long long const *>(base), indices.to_native(), Scale));
540 }
541 }
542
544 template<int Scale, isa<x86> Arch, class T>
545 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>))
546 [[nodiscard]] hint_inline hint_target("avx2")
548 T const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
549 if consteval {
550 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
551 } else {
553 _mm_mask_i32gather_epi64(source.to_native(), reinterpret_cast<long long const *>(base), indices.to_native(), mask.to_native(), Scale));
554 }
555 }
556
558 template<int Scale, isa<x86> Arch, class T>
559 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>))
560 [[nodiscard]] hint_inline hint_target("avx512f,avx512vl")
562 T const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
563 if consteval {
564 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
565 } else {
567 _mm_mmask_i32gather_epi64(source.to_native(), mask.to_bitset(), indices.to_native(), base, Scale));
568 }
569 }
570
572 template<int Scale, isa<x86> Arch, class T>
573 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>))
574 hint_inline hint_target("avx512f,avx512vl")
575 constexpr void mask_vpscatterdq(T * base, predicate<2, Arch> mask,
576 simd<std::int32_t, 4, Arch> indices, simd<T, 2, Arch> value) noexcept {
577 if consteval {
578 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
579 } else {
580 _mm_mask_i32scatter_epi64(base, mask.to_bitset(), indices.to_native(), value.to_native(), Scale);
581 }
582 }
583
585 template<int Scale, std::size_t N, isa<x86> Arch, class T>
586 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4 && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>))
587 [[nodiscard]] hint_inline hint_target("avx2")
588 constexpr simd<T, 4, Arch> vpgatherdq(T const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
589 if consteval {
590 return detail::x86_memory::gather<Scale>(base, indices, simd<T, 4, Arch>{}, ~std::uint64_t{0});
591 } else {
593 _mm256_i32gather_epi64(reinterpret_cast<long long const *>(base), indices.to_native(), Scale));
594 }
595 }
596
598 template<int Scale, isa<x86> Arch, class T>
599 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>))
600 [[nodiscard]] hint_inline hint_target("avx2")
602 T const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
603 if consteval {
604 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
605 } else {
607 _mm256_mask_i32gather_epi64(source.to_native(), reinterpret_cast<long long const *>(base), indices.to_native(), mask.to_native(), Scale));
608 }
609 }
610
612 template<int Scale, isa<x86> Arch, class T>
613 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>))
614 [[nodiscard]] hint_inline hint_target("avx512f,avx512vl")
616 T const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
617 if consteval {
618 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
619 } else {
621 _mm256_mmask_i32gather_epi64(source.to_native(), mask.to_bitset(), indices.to_native(), base, Scale));
622 }
623 }
624
626 template<int Scale, isa<x86> Arch, class T>
627 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>))
628 hint_inline hint_target("avx512f,avx512vl")
629 constexpr void mask_vpscatterdq(T * base, predicate<4, Arch> mask,
630 simd<std::int32_t, 4, Arch> indices, simd<T, 4, Arch> value) noexcept {
631 if consteval {
632 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
633 } else {
634 _mm256_mask_i32scatter_epi64(base, mask.to_bitset(), indices.to_native(), value.to_native(), Scale);
635 }
636 }
637
639 template<int Scale, isa<x86> Arch, class T>
640 requires(Arch.has(x86_feature::avx512f) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>))
641 [[nodiscard]] hint_inline hint_target("avx512f")
643 T const * base, simd<std::int32_t, 8, Arch> indices) noexcept {
644 if consteval {
645 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
646 } else {
648 _mm512_mask_i32gather_epi64(source.to_native(), mask.to_bitset(), indices.to_native(), base, Scale));
649 }
650 }
651
653 template<int Scale, isa<x86> Arch, class T>
654 requires(Arch.has(x86_feature::avx512f) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>))
655 hint_inline hint_target("avx512f")
656 constexpr void mask_vpscatterdq(T * base, predicate<8, Arch> mask,
657 simd<std::int32_t, 8, Arch> indices, simd<T, 8, Arch> value) noexcept {
658 if consteval {
659 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
660 } else {
661 _mm512_mask_i32scatter_epi64(base, mask.to_bitset(), indices.to_native(), value.to_native(), Scale);
662 }
663 }
664
666 template<int Scale, std::size_t N, isa<x86> Arch>
667 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4)
668 [[nodiscard]] hint_inline hint_target("avx2")
669 constexpr simd<float, 4, Arch> vgatherqps(float const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
670 if consteval {
671 return detail::x86_memory::gather<Scale>(base, indices, simd<float, 4, Arch>{}, ~std::uint64_t{0});
672 } else {
674 _mm_i64gather_ps(base, indices.to_native(), Scale));
675 }
676 }
677
679 template<int Scale, isa<x86> Arch>
680 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
681 [[nodiscard]] hint_inline hint_target("avx2")
683 float const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
684 if consteval {
685 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
686 } else {
688 _mm_mask_i64gather_ps(source.to_native(), base, indices.to_native(), __builtin_bit_cast(typename decltype(source)::native_type, mask.to_native()), Scale));
689 }
690 }
691
693 template<int Scale, isa<x86> Arch>
694 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
695 [[nodiscard]] hint_inline hint_target("avx512f,avx512vl")
697 float const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
698 if consteval {
699 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
700 } else {
702 _mm_mmask_i64gather_ps(source.to_native(), mask.to_bitset(), indices.to_native(), base, Scale));
703 }
704 }
705
707 template<int Scale, isa<x86> Arch>
708 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
709 hint_inline hint_target("avx512f,avx512vl")
710 constexpr void mask_vscatterqps(float * base, predicate<4, Arch> mask,
711 simd<std::int64_t, 2, Arch> indices, simd<float, 4, Arch> value) noexcept {
712 if consteval {
713 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
714 } else {
715 _mm_mask_i64scatter_ps(base, mask.to_bitset(), indices.to_native(), value.to_native(), Scale);
716 }
717 }
718
720 template<int Scale, std::size_t N, isa<x86> Arch>
721 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4)
722 [[nodiscard]] hint_inline hint_target("avx2")
723 constexpr simd<float, 4, Arch> vgatherqps(float const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
724 if consteval {
725 return detail::x86_memory::gather<Scale>(base, indices, simd<float, 4, Arch>{}, ~std::uint64_t{0});
726 } else {
728 _mm256_i64gather_ps(base, indices.to_native(), Scale));
729 }
730 }
731
733 template<int Scale, isa<x86> Arch>
734 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
735 [[nodiscard]] hint_inline hint_target("avx2")
737 float const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
738 if consteval {
739 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
740 } else {
742 _mm256_mask_i64gather_ps(source.to_native(), base, indices.to_native(), __builtin_bit_cast(typename decltype(source)::native_type, mask.to_native()), Scale));
743 }
744 }
745
747 template<int Scale, isa<x86> Arch>
748 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
749 [[nodiscard]] hint_inline hint_target("avx512f,avx512vl")
751 float const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
752 if consteval {
753 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
754 } else {
756 _mm256_mmask_i64gather_ps(source.to_native(), mask.to_bitset(), indices.to_native(), base, Scale));
757 }
758 }
759
761 template<int Scale, isa<x86> Arch>
762 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
763 hint_inline hint_target("avx512f,avx512vl")
764 constexpr void mask_vscatterqps(float * base, predicate<4, Arch> mask,
765 simd<std::int64_t, 4, Arch> indices, simd<float, 4, Arch> value) noexcept {
766 if consteval {
767 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
768 } else {
769 _mm256_mask_i64scatter_ps(base, mask.to_bitset(), indices.to_native(), value.to_native(), Scale);
770 }
771 }
772
774 template<int Scale, isa<x86> Arch>
775 requires(Arch.has(x86_feature::avx512f) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
776 [[nodiscard]] hint_inline hint_target("avx512f")
778 float const * base, simd<std::int64_t, 8, Arch> indices) noexcept {
779 if consteval {
780 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
781 } else {
783 _mm512_mask_i64gather_ps(source.to_native(), mask.to_bitset(), indices.to_native(), base, Scale));
784 }
785 }
786
788 template<int Scale, isa<x86> Arch>
789 requires(Arch.has(x86_feature::avx512f) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
790 hint_inline hint_target("avx512f")
791 constexpr void mask_vscatterqps(float * base, predicate<8, Arch> mask,
792 simd<std::int64_t, 8, Arch> indices, simd<float, 8, Arch> value) noexcept {
793 if consteval {
794 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
795 } else {
796 _mm512_mask_i64scatter_ps(base, mask.to_bitset(), indices.to_native(), value.to_native(), Scale);
797 }
798 }
799
801 template<int Scale, std::size_t N, isa<x86> Arch, class T>
802 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4 && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>))
803 [[nodiscard]] hint_inline hint_target("avx2")
804 constexpr simd<T, 4, Arch> vpgatherqd(T const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
805 if consteval {
806 return detail::x86_memory::gather<Scale>(base, indices, simd<T, 4, Arch>{}, ~std::uint64_t{0});
807 } else {
809 _mm_i64gather_epi32(reinterpret_cast<int const *>(base), indices.to_native(), Scale));
810 }
811 }
812
814 template<int Scale, isa<x86> Arch, class T>
815 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>))
816 [[nodiscard]] hint_inline hint_target("avx2")
818 T const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
819 if consteval {
820 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
821 } else {
823 _mm_mask_i64gather_epi32(source.to_native(), reinterpret_cast<int const *>(base), indices.to_native(), mask.to_native(), Scale));
824 }
825 }
826
828 template<int Scale, isa<x86> Arch, class T>
829 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>))
830 [[nodiscard]] hint_inline hint_target("avx512f,avx512vl")
832 T const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
833 if consteval {
834 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
835 } else {
837 _mm_mmask_i64gather_epi32(source.to_native(), mask.to_bitset(), indices.to_native(), base, Scale));
838 }
839 }
840
842 template<int Scale, isa<x86> Arch, class T>
843 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>))
844 hint_inline hint_target("avx512f,avx512vl")
845 constexpr void mask_vpscatterqd(T * base, predicate<4, Arch> mask,
846 simd<std::int64_t, 2, Arch> indices, simd<T, 4, Arch> value) noexcept {
847 if consteval {
848 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
849 } else {
850 _mm_mask_i64scatter_epi32(base, mask.to_bitset(), indices.to_native(), value.to_native(), Scale);
851 }
852 }
853
855 template<int Scale, std::size_t N, isa<x86> Arch, class T>
856 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4 && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>))
857 [[nodiscard]] hint_inline hint_target("avx2")
858 constexpr simd<T, 4, Arch> vpgatherqd(T const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
859 if consteval {
860 return detail::x86_memory::gather<Scale>(base, indices, simd<T, 4, Arch>{}, ~std::uint64_t{0});
861 } else {
863 _mm256_i64gather_epi32(reinterpret_cast<int const *>(base), indices.to_native(), Scale));
864 }
865 }
866
868 template<int Scale, isa<x86> Arch, class T>
869 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>))
870 [[nodiscard]] hint_inline hint_target("avx2")
872 T const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
873 if consteval {
874 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
875 } else {
877 _mm256_mask_i64gather_epi32(source.to_native(), reinterpret_cast<int const *>(base), indices.to_native(), mask.to_native(), Scale));
878 }
879 }
880
882 template<int Scale, isa<x86> Arch, class T>
883 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>))
884 [[nodiscard]] hint_inline hint_target("avx512f,avx512vl")
886 T const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
887 if consteval {
888 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
889 } else {
891 _mm256_mmask_i64gather_epi32(source.to_native(), mask.to_bitset(), indices.to_native(), base, Scale));
892 }
893 }
894
896 template<int Scale, isa<x86> Arch, class T>
897 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>))
898 hint_inline hint_target("avx512f,avx512vl")
899 constexpr void mask_vpscatterqd(T * base, predicate<4, Arch> mask,
900 simd<std::int64_t, 4, Arch> indices, simd<T, 4, Arch> value) noexcept {
901 if consteval {
902 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
903 } else {
904 _mm256_mask_i64scatter_epi32(base, mask.to_bitset(), indices.to_native(), value.to_native(), Scale);
905 }
906 }
907
909 template<int Scale, isa<x86> Arch, class T>
910 requires(Arch.has(x86_feature::avx512f) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>))
911 [[nodiscard]] hint_inline hint_target("avx512f")
913 T const * base, simd<std::int64_t, 8, Arch> indices) noexcept {
914 if consteval {
915 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
916 } else {
918 _mm512_mask_i64gather_epi32(source.to_native(), mask.to_bitset(), indices.to_native(), base, Scale));
919 }
920 }
921
923 template<int Scale, isa<x86> Arch, class T>
924 requires(Arch.has(x86_feature::avx512f) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>))
925 hint_inline hint_target("avx512f")
926 constexpr void mask_vpscatterqd(T * base, predicate<8, Arch> mask,
927 simd<std::int64_t, 8, Arch> indices, simd<T, 8, Arch> value) noexcept {
928 if consteval {
929 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
930 } else {
931 _mm512_mask_i64scatter_epi32(base, mask.to_bitset(), indices.to_native(), value.to_native(), Scale);
932 }
933 }
934
936 template<int Scale, std::size_t N, isa<x86> Arch>
937 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 2)
938 [[nodiscard]] hint_inline hint_target("avx2")
939 constexpr simd<double, 2, Arch> vgatherqpd(double const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
940 if consteval {
941 return detail::x86_memory::gather<Scale>(base, indices, simd<double, 2, Arch>{}, ~std::uint64_t{0});
942 } else {
944 _mm_i64gather_pd(base, indices.to_native(), Scale));
945 }
946 }
947
949 template<int Scale, isa<x86> Arch>
950 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
951 [[nodiscard]] hint_inline hint_target("avx2")
953 double const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
954 if consteval {
955 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
956 } else {
958 _mm_mask_i64gather_pd(source.to_native(), base, indices.to_native(), __builtin_bit_cast(typename decltype(source)::native_type, mask.to_native()), Scale));
959 }
960 }
961
963 template<int Scale, isa<x86> Arch>
964 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
965 [[nodiscard]] hint_inline hint_target("avx512f,avx512vl")
967 double const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
968 if consteval {
969 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
970 } else {
972 _mm_mmask_i64gather_pd(source.to_native(), mask.to_bitset(), indices.to_native(), base, Scale));
973 }
974 }
975
977 template<int Scale, isa<x86> Arch>
978 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
979 hint_inline hint_target("avx512f,avx512vl")
980 constexpr void mask_vscatterqpd(double * base, predicate<2, Arch> mask,
981 simd<std::int64_t, 2, Arch> indices, simd<double, 2, Arch> value) noexcept {
982 if consteval {
983 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
984 } else {
985 _mm_mask_i64scatter_pd(base, mask.to_bitset(), indices.to_native(), value.to_native(), Scale);
986 }
987 }
988
990 template<int Scale, std::size_t N, isa<x86> Arch>
991 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4)
992 [[nodiscard]] hint_inline hint_target("avx2")
993 constexpr simd<double, 4, Arch> vgatherqpd(double const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
994 if consteval {
995 return detail::x86_memory::gather<Scale>(base, indices, simd<double, 4, Arch>{}, ~std::uint64_t{0});
996 } else {
998 _mm256_i64gather_pd(base, indices.to_native(), Scale));
999 }
1000 }
1001
1003 template<int Scale, isa<x86> Arch>
1004 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
1005 [[nodiscard]] hint_inline hint_target("avx2")
1007 double const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
1008 if consteval {
1009 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
1010 } else {
1012 _mm256_mask_i64gather_pd(source.to_native(), base, indices.to_native(), __builtin_bit_cast(typename decltype(source)::native_type, mask.to_native()), Scale));
1013 }
1014 }
1015
1017 template<int Scale, isa<x86> Arch>
1018 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
1019 [[nodiscard]] hint_inline hint_target("avx512f,avx512vl")
1021 double const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
1022 if consteval {
1023 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1024 } else {
1026 _mm256_mmask_i64gather_pd(source.to_native(), mask.to_bitset(), indices.to_native(), base, Scale));
1027 }
1028 }
1029
1031 template<int Scale, isa<x86> Arch>
1032 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
1033 hint_inline hint_target("avx512f,avx512vl")
1034 constexpr void mask_vscatterqpd(double * base, predicate<4, Arch> mask,
1035 simd<std::int64_t, 4, Arch> indices, simd<double, 4, Arch> value) noexcept {
1036 if consteval {
1037 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1038 } else {
1039 _mm256_mask_i64scatter_pd(base, mask.to_bitset(), indices.to_native(), value.to_native(), Scale);
1040 }
1041 }
1042
1044 template<int Scale, isa<x86> Arch>
1045 requires(Arch.has(x86_feature::avx512f) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
1046 [[nodiscard]] hint_inline hint_target("avx512f")
1048 double const * base, simd<std::int64_t, 8, Arch> indices) noexcept {
1049 if consteval {
1050 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1051 } else {
1053 _mm512_mask_i64gather_pd(source.to_native(), mask.to_bitset(), indices.to_native(), base, Scale));
1054 }
1055 }
1056
1058 template<int Scale, isa<x86> Arch>
1059 requires(Arch.has(x86_feature::avx512f) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8))
1060 hint_inline hint_target("avx512f")
1061 constexpr void mask_vscatterqpd(double * base, predicate<8, Arch> mask,
1062 simd<std::int64_t, 8, Arch> indices, simd<double, 8, Arch> value) noexcept {
1063 if consteval {
1064 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1065 } else {
1066 _mm512_mask_i64scatter_pd(base, mask.to_bitset(), indices.to_native(), value.to_native(), Scale);
1067 }
1068 }
1069
1071 template<int Scale, std::size_t N, isa<x86> Arch, class T>
1072 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 2 && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>))
1073 [[nodiscard]] hint_inline hint_target("avx2")
1074 constexpr simd<T, 2, Arch> vpgatherqq(T const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
1075 if consteval {
1076 return detail::x86_memory::gather<Scale>(base, indices, simd<T, 2, Arch>{}, ~std::uint64_t{0});
1077 } else {
1079 _mm_i64gather_epi64(reinterpret_cast<long long const *>(base), indices.to_native(), Scale));
1080 }
1081 }
1082
1084 template<int Scale, isa<x86> Arch, class T>
1085 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>))
1086 [[nodiscard]] hint_inline hint_target("avx2")
1088 T const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
1089 if consteval {
1090 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
1091 } else {
1093 _mm_mask_i64gather_epi64(source.to_native(), reinterpret_cast<long long const *>(base), indices.to_native(), mask.to_native(), Scale));
1094 }
1095 }
1096
1098 template<int Scale, isa<x86> Arch, class T>
1099 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>))
1100 [[nodiscard]] hint_inline hint_target("avx512f,avx512vl")
1102 T const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
1103 if consteval {
1104 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1105 } else {
1107 _mm_mmask_i64gather_epi64(source.to_native(), mask.to_bitset(), indices.to_native(), base, Scale));
1108 }
1109 }
1110
1112 template<int Scale, isa<x86> Arch, class T>
1113 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>))
1114 hint_inline hint_target("avx512f,avx512vl")
1115 constexpr void mask_vpscatterqq(T * base, predicate<2, Arch> mask,
1116 simd<std::int64_t, 2, Arch> indices, simd<T, 2, Arch> value) noexcept {
1117 if consteval {
1118 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1119 } else {
1120 _mm_mask_i64scatter_epi64(base, mask.to_bitset(), indices.to_native(), value.to_native(), Scale);
1121 }
1122 }
1123
1125 template<int Scale, std::size_t N, isa<x86> Arch, class T>
1126 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4 && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>))
1127 [[nodiscard]] hint_inline hint_target("avx2")
1128 constexpr simd<T, 4, Arch> vpgatherqq(T const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
1129 if consteval {
1130 return detail::x86_memory::gather<Scale>(base, indices, simd<T, 4, Arch>{}, ~std::uint64_t{0});
1131 } else {
1133 _mm256_i64gather_epi64(reinterpret_cast<long long const *>(base), indices.to_native(), Scale));
1134 }
1135 }
1136
1138 template<int Scale, isa<x86> Arch, class T>
1139 requires(Arch.has(x86_feature::avx2) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>))
1140 [[nodiscard]] hint_inline hint_target("avx2")
1142 T const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
1143 if consteval {
1144 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
1145 } else {
1147 _mm256_mask_i64gather_epi64(source.to_native(), reinterpret_cast<long long const *>(base), indices.to_native(), mask.to_native(), Scale));
1148 }
1149 }
1150
1152 template<int Scale, isa<x86> Arch, class T>
1153 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>))
1154 [[nodiscard]] hint_inline hint_target("avx512f,avx512vl")
1156 T const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
1157 if consteval {
1158 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1159 } else {
1161 _mm256_mmask_i64gather_epi64(source.to_native(), mask.to_bitset(), indices.to_native(), base, Scale));
1162 }
1163 }
1164
1166 template<int Scale, isa<x86> Arch, class T>
1167 requires(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>))
1168 hint_inline hint_target("avx512f,avx512vl")
1169 constexpr void mask_vpscatterqq(T * base, predicate<4, Arch> mask,
1170 simd<std::int64_t, 4, Arch> indices, simd<T, 4, Arch> value) noexcept {
1171 if consteval {
1172 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1173 } else {
1174 _mm256_mask_i64scatter_epi64(base, mask.to_bitset(), indices.to_native(), value.to_native(), Scale);
1175 }
1176 }
1177
1179 template<int Scale, isa<x86> Arch, class T>
1180 requires(Arch.has(x86_feature::avx512f) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>))
1181 [[nodiscard]] hint_inline hint_target("avx512f")
1183 T const * base, simd<std::int64_t, 8, Arch> indices) noexcept {
1184 if consteval {
1185 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1186 } else {
1188 _mm512_mask_i64gather_epi64(source.to_native(), mask.to_bitset(), indices.to_native(), base, Scale));
1189 }
1190 }
1191
1193 template<int Scale, isa<x86> Arch, class T>
1194 requires(Arch.has(x86_feature::avx512f) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>))
1195 hint_inline hint_target("avx512f")
1196 constexpr void mask_vpscatterqq(T * base, predicate<8, Arch> mask,
1197 simd<std::int64_t, 8, Arch> indices, simd<T, 8, Arch> value) noexcept {
1198 if consteval {
1199 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1200 } else {
1201 _mm512_mask_i64scatter_epi64(base, mask.to_bitset(), indices.to_native(), value.to_native(), Scale);
1202 }
1203 }
1204
1206 template<int Scale, std::size_t N, isa<x86> Arch>
1207 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4 && requires { sizeof(simd<float, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1208 [[nodiscard]] consteval simd<float, 4, Arch> vgatherdps(float const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1209 return detail::x86_memory::gather<Scale>(base, indices, simd<float, 4, Arch>{}, ~std::uint64_t{0});
1210 }
1211
1213 template<int Scale, std::size_t N, isa<x86> Arch>
1214 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4 && requires { sizeof(simd<float, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1215 [[nodiscard]] constexpr simd<float, 4, Arch> vgatherdps(float const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1216 return detail::x86_memory::gather<Scale>(base, indices, simd<float, 4, Arch>{}, ~std::uint64_t{0});
1217 }
1218
1219 template<int Scale, isa<x86> Arch>
1220 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1222 float const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1223 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
1224 }
1225
1227 template<int Scale, isa<x86> Arch>
1228 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1230 float const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1231 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
1232 }
1233
1234 template<int Scale, isa<x86> Arch>
1235 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1237 float const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1238 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1239 }
1240
1242 template<int Scale, isa<x86> Arch>
1243 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1245 float const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1246 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1247 }
1248
1249 template<int Scale, isa<x86> Arch>
1250 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1251 consteval void mask_vscatterdps(float * base, predicate<4, Arch> mask,
1252 simd<std::int32_t, 4, Arch> indices, simd<float, 4, Arch> value) noexcept {
1253 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1254 }
1255
1257 template<int Scale, isa<x86> Arch>
1258 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1259 constexpr void mask_vscatterdps(float * base, predicate<4, Arch> mask,
1260 simd<std::int32_t, 4, Arch> indices, simd<float, 4, Arch> value) noexcept {
1261 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1262 }
1263
1264 template<int Scale, std::size_t N, isa<x86> Arch>
1265 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 8 && requires { sizeof(simd<float, 8, Arch>); sizeof(simd<std::int32_t, 8, Arch>); })
1266 [[nodiscard]] consteval simd<float, 8, Arch> vgatherdps(float const * base, simd<std::int32_t, 8, Arch> indices) noexcept {
1267 return detail::x86_memory::gather<Scale>(base, indices, simd<float, 8, Arch>{}, ~std::uint64_t{0});
1268 }
1269
1271 template<int Scale, std::size_t N, isa<x86> Arch>
1272 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 8 && requires { sizeof(simd<float, 8, Arch>); sizeof(simd<std::int32_t, 8, Arch>); })
1273 [[nodiscard]] constexpr simd<float, 8, Arch> vgatherdps(float const * base, simd<std::int32_t, 8, Arch> indices) noexcept {
1274 return detail::x86_memory::gather<Scale>(base, indices, simd<float, 8, Arch>{}, ~std::uint64_t{0});
1275 }
1276
1277 template<int Scale, isa<x86> Arch>
1278 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 8, Arch>); sizeof(simd<std::int32_t, 8, Arch>); })
1280 float const * base, simd<std::int32_t, 8, Arch> indices) noexcept {
1281 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
1282 }
1283
1285 template<int Scale, isa<x86> Arch>
1286 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 8, Arch>); sizeof(simd<std::int32_t, 8, Arch>); })
1288 float const * base, simd<std::int32_t, 8, Arch> indices) noexcept {
1289 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
1290 }
1291
1292 template<int Scale, isa<x86> Arch>
1293 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 8, Arch>); sizeof(simd<std::int32_t, 8, Arch>); })
1295 float const * base, simd<std::int32_t, 8, Arch> indices) noexcept {
1296 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1297 }
1298
1300 template<int Scale, isa<x86> Arch>
1301 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 8, Arch>); sizeof(simd<std::int32_t, 8, Arch>); })
1303 float const * base, simd<std::int32_t, 8, Arch> indices) noexcept {
1304 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1305 }
1306
1307 template<int Scale, isa<x86> Arch>
1308 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 8, Arch>); sizeof(simd<std::int32_t, 8, Arch>); })
1309 consteval void mask_vscatterdps(float * base, predicate<8, Arch> mask,
1310 simd<std::int32_t, 8, Arch> indices, simd<float, 8, Arch> value) noexcept {
1311 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1312 }
1313
1315 template<int Scale, isa<x86> Arch>
1316 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 8, Arch>); sizeof(simd<std::int32_t, 8, Arch>); })
1317 constexpr void mask_vscatterdps(float * base, predicate<8, Arch> mask,
1318 simd<std::int32_t, 8, Arch> indices, simd<float, 8, Arch> value) noexcept {
1319 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1320 }
1321
1322 template<int Scale, isa<x86> Arch>
1323 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 16, Arch>); sizeof(simd<std::int32_t, 16, Arch>); })
1325 float const * base, simd<std::int32_t, 16, Arch> indices) noexcept {
1326 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1327 }
1328
1330 template<int Scale, isa<x86> Arch>
1331 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 16, Arch>); sizeof(simd<std::int32_t, 16, Arch>); })
1333 float const * base, simd<std::int32_t, 16, Arch> indices) noexcept {
1334 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1335 }
1336
1337 template<int Scale, isa<x86> Arch>
1338 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 16, Arch>); sizeof(simd<std::int32_t, 16, Arch>); })
1339 consteval void mask_vscatterdps(float * base, predicate<16, Arch> mask,
1340 simd<std::int32_t, 16, Arch> indices, simd<float, 16, Arch> value) noexcept {
1341 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1342 }
1343
1345 template<int Scale, isa<x86> Arch>
1346 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 16, Arch>); sizeof(simd<std::int32_t, 16, Arch>); })
1347 constexpr void mask_vscatterdps(float * base, predicate<16, Arch> mask,
1348 simd<std::int32_t, 16, Arch> indices, simd<float, 16, Arch> value) noexcept {
1349 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1350 }
1351
1352 template<int Scale, std::size_t N, isa<x86> Arch, class T>
1353 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4 && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1354 [[nodiscard]] consteval simd<T, 4, Arch> vpgatherdd(T const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1355 return detail::x86_memory::gather<Scale>(base, indices, simd<T, 4, Arch>{}, ~std::uint64_t{0});
1356 }
1357
1359 template<int Scale, std::size_t N, isa<x86> Arch, class T>
1360 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4 && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1361 [[nodiscard]] constexpr simd<T, 4, Arch> vpgatherdd(T const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1362 return detail::x86_memory::gather<Scale>(base, indices, simd<T, 4, Arch>{}, ~std::uint64_t{0});
1363 }
1364
1365 template<int Scale, isa<x86> Arch, class T>
1366 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1368 T const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1369 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
1370 }
1371
1373 template<int Scale, isa<x86> Arch, class T>
1374 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1376 T const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1377 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
1378 }
1379
1380 template<int Scale, isa<x86> Arch, class T>
1381 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1383 T const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1384 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1385 }
1386
1388 template<int Scale, isa<x86> Arch, class T>
1389 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1391 T const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1392 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1393 }
1394
1395 template<int Scale, isa<x86> Arch, class T>
1396 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1397 consteval void mask_vpscatterdd(T * base, predicate<4, Arch> mask,
1398 simd<std::int32_t, 4, Arch> indices, simd<T, 4, Arch> value) noexcept {
1399 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1400 }
1401
1403 template<int Scale, isa<x86> Arch, class T>
1404 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1405 constexpr void mask_vpscatterdd(T * base, predicate<4, Arch> mask,
1406 simd<std::int32_t, 4, Arch> indices, simd<T, 4, Arch> value) noexcept {
1407 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1408 }
1409
1410 template<int Scale, std::size_t N, isa<x86> Arch, class T>
1411 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 8 && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 8, Arch>); sizeof(simd<std::int32_t, 8, Arch>); })
1412 [[nodiscard]] consteval simd<T, 8, Arch> vpgatherdd(T const * base, simd<std::int32_t, 8, Arch> indices) noexcept {
1413 return detail::x86_memory::gather<Scale>(base, indices, simd<T, 8, Arch>{}, ~std::uint64_t{0});
1414 }
1415
1417 template<int Scale, std::size_t N, isa<x86> Arch, class T>
1418 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 8 && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 8, Arch>); sizeof(simd<std::int32_t, 8, Arch>); })
1419 [[nodiscard]] constexpr simd<T, 8, Arch> vpgatherdd(T const * base, simd<std::int32_t, 8, Arch> indices) noexcept {
1420 return detail::x86_memory::gather<Scale>(base, indices, simd<T, 8, Arch>{}, ~std::uint64_t{0});
1421 }
1422
1423 template<int Scale, isa<x86> Arch, class T>
1424 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 8, Arch>); sizeof(simd<std::int32_t, 8, Arch>); })
1426 T const * base, simd<std::int32_t, 8, Arch> indices) noexcept {
1427 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
1428 }
1429
1431 template<int Scale, isa<x86> Arch, class T>
1432 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 8, Arch>); sizeof(simd<std::int32_t, 8, Arch>); })
1434 T const * base, simd<std::int32_t, 8, Arch> indices) noexcept {
1435 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
1436 }
1437
1438 template<int Scale, isa<x86> Arch, class T>
1439 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 8, Arch>); sizeof(simd<std::int32_t, 8, Arch>); })
1441 T const * base, simd<std::int32_t, 8, Arch> indices) noexcept {
1442 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1443 }
1444
1446 template<int Scale, isa<x86> Arch, class T>
1447 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 8, Arch>); sizeof(simd<std::int32_t, 8, Arch>); })
1449 T const * base, simd<std::int32_t, 8, Arch> indices) noexcept {
1450 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1451 }
1452
1453 template<int Scale, isa<x86> Arch, class T>
1454 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 8, Arch>); sizeof(simd<std::int32_t, 8, Arch>); })
1455 consteval void mask_vpscatterdd(T * base, predicate<8, Arch> mask,
1456 simd<std::int32_t, 8, Arch> indices, simd<T, 8, Arch> value) noexcept {
1457 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1458 }
1459
1461 template<int Scale, isa<x86> Arch, class T>
1462 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 8, Arch>); sizeof(simd<std::int32_t, 8, Arch>); })
1463 constexpr void mask_vpscatterdd(T * base, predicate<8, Arch> mask,
1464 simd<std::int32_t, 8, Arch> indices, simd<T, 8, Arch> value) noexcept {
1465 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1466 }
1467
1468 template<int Scale, isa<x86> Arch, class T>
1469 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 16, Arch>); sizeof(simd<std::int32_t, 16, Arch>); })
1471 T const * base, simd<std::int32_t, 16, Arch> indices) noexcept {
1472 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1473 }
1474
1476 template<int Scale, isa<x86> Arch, class T>
1477 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 16, Arch>); sizeof(simd<std::int32_t, 16, Arch>); })
1479 T const * base, simd<std::int32_t, 16, Arch> indices) noexcept {
1480 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1481 }
1482
1483 template<int Scale, isa<x86> Arch, class T>
1484 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 16, Arch>); sizeof(simd<std::int32_t, 16, Arch>); })
1486 simd<std::int32_t, 16, Arch> indices, simd<T, 16, Arch> value) noexcept {
1487 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1488 }
1489
1491 template<int Scale, isa<x86> Arch, class T>
1492 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 16, Arch>); sizeof(simd<std::int32_t, 16, Arch>); })
1494 simd<std::int32_t, 16, Arch> indices, simd<T, 16, Arch> value) noexcept {
1495 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1496 }
1497
1498 template<int Scale, std::size_t N, isa<x86> Arch>
1499 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 2 && requires { sizeof(simd<double, 2, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1500 [[nodiscard]] consteval simd<double, 2, Arch> vgatherdpd(double const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1501 return detail::x86_memory::gather<Scale>(base, indices, simd<double, 2, Arch>{}, ~std::uint64_t{0});
1502 }
1503
1505 template<int Scale, std::size_t N, isa<x86> Arch>
1506 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 2 && requires { sizeof(simd<double, 2, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1507 [[nodiscard]] constexpr simd<double, 2, Arch> vgatherdpd(double const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1508 return detail::x86_memory::gather<Scale>(base, indices, simd<double, 2, Arch>{}, ~std::uint64_t{0});
1509 }
1510
1511 template<int Scale, isa<x86> Arch>
1512 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 2, Arch>); sizeof(simd<std::int32_t, 4, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
1514 double const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1515 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
1516 }
1517
1519 template<int Scale, isa<x86> Arch>
1520 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 2, Arch>); sizeof(simd<std::int32_t, 4, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
1522 double const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1523 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
1524 }
1525
1526 template<int Scale, isa<x86> Arch>
1527 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 2, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1529 double const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1530 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1531 }
1532
1534 template<int Scale, isa<x86> Arch>
1535 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 2, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1537 double const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1538 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1539 }
1540
1541 template<int Scale, isa<x86> Arch>
1542 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 2, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1543 consteval void mask_vscatterdpd(double * base, predicate<2, Arch> mask,
1544 simd<std::int32_t, 4, Arch> indices, simd<double, 2, Arch> value) noexcept {
1545 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1546 }
1547
1549 template<int Scale, isa<x86> Arch>
1550 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 2, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1551 constexpr void mask_vscatterdpd(double * base, predicate<2, Arch> mask,
1552 simd<std::int32_t, 4, Arch> indices, simd<double, 2, Arch> value) noexcept {
1553 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1554 }
1555
1556 template<int Scale, std::size_t N, isa<x86> Arch>
1557 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4 && requires { sizeof(simd<double, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1558 [[nodiscard]] consteval simd<double, 4, Arch> vgatherdpd(double const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1559 return detail::x86_memory::gather<Scale>(base, indices, simd<double, 4, Arch>{}, ~std::uint64_t{0});
1560 }
1561
1563 template<int Scale, std::size_t N, isa<x86> Arch>
1564 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4 && requires { sizeof(simd<double, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1565 [[nodiscard]] constexpr simd<double, 4, Arch> vgatherdpd(double const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1566 return detail::x86_memory::gather<Scale>(base, indices, simd<double, 4, Arch>{}, ~std::uint64_t{0});
1567 }
1568
1569 template<int Scale, isa<x86> Arch>
1570 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
1572 double const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1573 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
1574 }
1575
1577 template<int Scale, isa<x86> Arch>
1578 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
1580 double const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1581 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
1582 }
1583
1584 template<int Scale, isa<x86> Arch>
1585 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1587 double const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1588 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1589 }
1590
1592 template<int Scale, isa<x86> Arch>
1593 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1595 double const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1596 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1597 }
1598
1599 template<int Scale, isa<x86> Arch>
1600 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1601 consteval void mask_vscatterdpd(double * base, predicate<4, Arch> mask,
1602 simd<std::int32_t, 4, Arch> indices, simd<double, 4, Arch> value) noexcept {
1603 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1604 }
1605
1607 template<int Scale, isa<x86> Arch>
1608 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1609 constexpr void mask_vscatterdpd(double * base, predicate<4, Arch> mask,
1610 simd<std::int32_t, 4, Arch> indices, simd<double, 4, Arch> value) noexcept {
1611 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1612 }
1613
1614 template<int Scale, isa<x86> Arch>
1615 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 8, Arch>); sizeof(simd<std::int32_t, 8, Arch>); })
1617 double const * base, simd<std::int32_t, 8, Arch> indices) noexcept {
1618 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1619 }
1620
1622 template<int Scale, isa<x86> Arch>
1623 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 8, Arch>); sizeof(simd<std::int32_t, 8, Arch>); })
1625 double const * base, simd<std::int32_t, 8, Arch> indices) noexcept {
1626 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1627 }
1628
1629 template<int Scale, isa<x86> Arch>
1630 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 8, Arch>); sizeof(simd<std::int32_t, 8, Arch>); })
1631 consteval void mask_vscatterdpd(double * base, predicate<8, Arch> mask,
1632 simd<std::int32_t, 8, Arch> indices, simd<double, 8, Arch> value) noexcept {
1633 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1634 }
1635
1637 template<int Scale, isa<x86> Arch>
1638 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 8, Arch>); sizeof(simd<std::int32_t, 8, Arch>); })
1639 constexpr void mask_vscatterdpd(double * base, predicate<8, Arch> mask,
1640 simd<std::int32_t, 8, Arch> indices, simd<double, 8, Arch> value) noexcept {
1641 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1642 }
1643
1644 template<int Scale, std::size_t N, isa<x86> Arch, class T>
1645 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 2 && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 2, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1646 [[nodiscard]] consteval simd<T, 2, Arch> vpgatherdq(T const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1647 return detail::x86_memory::gather<Scale>(base, indices, simd<T, 2, Arch>{}, ~std::uint64_t{0});
1648 }
1649
1651 template<int Scale, std::size_t N, isa<x86> Arch, class T>
1652 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 2 && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 2, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1653 [[nodiscard]] constexpr simd<T, 2, Arch> vpgatherdq(T const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1654 return detail::x86_memory::gather<Scale>(base, indices, simd<T, 2, Arch>{}, ~std::uint64_t{0});
1655 }
1656
1657 template<int Scale, isa<x86> Arch, class T>
1658 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 2, Arch>); sizeof(simd<std::int32_t, 4, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
1660 T const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1661 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
1662 }
1663
1665 template<int Scale, isa<x86> Arch, class T>
1666 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 2, Arch>); sizeof(simd<std::int32_t, 4, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
1668 T const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1669 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
1670 }
1671
1672 template<int Scale, isa<x86> Arch, class T>
1673 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 2, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1675 T const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1676 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1677 }
1678
1680 template<int Scale, isa<x86> Arch, class T>
1681 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 2, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1683 T const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1684 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1685 }
1686
1687 template<int Scale, isa<x86> Arch, class T>
1688 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 2, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1689 consteval void mask_vpscatterdq(T * base, predicate<2, Arch> mask,
1690 simd<std::int32_t, 4, Arch> indices, simd<T, 2, Arch> value) noexcept {
1691 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1692 }
1693
1695 template<int Scale, isa<x86> Arch, class T>
1696 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 2, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1697 constexpr void mask_vpscatterdq(T * base, predicate<2, Arch> mask,
1698 simd<std::int32_t, 4, Arch> indices, simd<T, 2, Arch> value) noexcept {
1699 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1700 }
1701
1702 template<int Scale, std::size_t N, isa<x86> Arch, class T>
1703 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4 && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1704 [[nodiscard]] consteval simd<T, 4, Arch> vpgatherdq(T const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1705 return detail::x86_memory::gather<Scale>(base, indices, simd<T, 4, Arch>{}, ~std::uint64_t{0});
1706 }
1707
1709 template<int Scale, std::size_t N, isa<x86> Arch, class T>
1710 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4 && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1711 [[nodiscard]] constexpr simd<T, 4, Arch> vpgatherdq(T const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1712 return detail::x86_memory::gather<Scale>(base, indices, simd<T, 4, Arch>{}, ~std::uint64_t{0});
1713 }
1714
1715 template<int Scale, isa<x86> Arch, class T>
1716 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
1718 T const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1719 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
1720 }
1721
1723 template<int Scale, isa<x86> Arch, class T>
1724 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
1726 T const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1727 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
1728 }
1729
1730 template<int Scale, isa<x86> Arch, class T>
1731 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1733 T const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1734 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1735 }
1736
1738 template<int Scale, isa<x86> Arch, class T>
1739 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1741 T const * base, simd<std::int32_t, 4, Arch> indices) noexcept {
1742 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1743 }
1744
1745 template<int Scale, isa<x86> Arch, class T>
1746 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1747 consteval void mask_vpscatterdq(T * base, predicate<4, Arch> mask,
1748 simd<std::int32_t, 4, Arch> indices, simd<T, 4, Arch> value) noexcept {
1749 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1750 }
1751
1753 template<int Scale, isa<x86> Arch, class T>
1754 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); })
1755 constexpr void mask_vpscatterdq(T * base, predicate<4, Arch> mask,
1756 simd<std::int32_t, 4, Arch> indices, simd<T, 4, Arch> value) noexcept {
1757 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1758 }
1759
1760 template<int Scale, isa<x86> Arch, class T>
1761 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 8, Arch>); sizeof(simd<std::int32_t, 8, Arch>); })
1763 T const * base, simd<std::int32_t, 8, Arch> indices) noexcept {
1764 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1765 }
1766
1768 template<int Scale, isa<x86> Arch, class T>
1769 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 8, Arch>); sizeof(simd<std::int32_t, 8, Arch>); })
1771 T const * base, simd<std::int32_t, 8, Arch> indices) noexcept {
1772 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1773 }
1774
1775 template<int Scale, isa<x86> Arch, class T>
1776 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 8, Arch>); sizeof(simd<std::int32_t, 8, Arch>); })
1777 consteval void mask_vpscatterdq(T * base, predicate<8, Arch> mask,
1778 simd<std::int32_t, 8, Arch> indices, simd<T, 8, Arch> value) noexcept {
1779 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1780 }
1781
1783 template<int Scale, isa<x86> Arch, class T>
1784 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 8, Arch>); sizeof(simd<std::int32_t, 8, Arch>); })
1785 constexpr void mask_vpscatterdq(T * base, predicate<8, Arch> mask,
1786 simd<std::int32_t, 8, Arch> indices, simd<T, 8, Arch> value) noexcept {
1787 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1788 }
1789
1790 template<int Scale, std::size_t N, isa<x86> Arch>
1791 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4 && requires { sizeof(simd<float, 4, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
1792 [[nodiscard]] consteval simd<float, 4, Arch> vgatherqps(float const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
1793 return detail::x86_memory::gather<Scale>(base, indices, simd<float, 4, Arch>{}, ~std::uint64_t{0});
1794 }
1795
1797 template<int Scale, std::size_t N, isa<x86> Arch>
1798 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4 && requires { sizeof(simd<float, 4, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
1799 [[nodiscard]] constexpr simd<float, 4, Arch> vgatherqps(float const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
1800 return detail::x86_memory::gather<Scale>(base, indices, simd<float, 4, Arch>{}, ~std::uint64_t{0});
1801 }
1802
1803 template<int Scale, isa<x86> Arch>
1804 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
1806 float const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
1807 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
1808 }
1809
1811 template<int Scale, isa<x86> Arch>
1812 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
1814 float const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
1815 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
1816 }
1817
1818 template<int Scale, isa<x86> Arch>
1819 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 4, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
1821 float const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
1822 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1823 }
1824
1826 template<int Scale, isa<x86> Arch>
1827 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 4, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
1829 float const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
1830 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1831 }
1832
1833 template<int Scale, isa<x86> Arch>
1834 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 4, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
1835 consteval void mask_vscatterqps(float * base, predicate<4, Arch> mask,
1836 simd<std::int64_t, 2, Arch> indices, simd<float, 4, Arch> value) noexcept {
1837 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1838 }
1839
1841 template<int Scale, isa<x86> Arch>
1842 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 4, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
1843 constexpr void mask_vscatterqps(float * base, predicate<4, Arch> mask,
1844 simd<std::int64_t, 2, Arch> indices, simd<float, 4, Arch> value) noexcept {
1845 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1846 }
1847
1848 template<int Scale, std::size_t N, isa<x86> Arch>
1849 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4 && requires { sizeof(simd<float, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
1850 [[nodiscard]] consteval simd<float, 4, Arch> vgatherqps(float const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
1851 return detail::x86_memory::gather<Scale>(base, indices, simd<float, 4, Arch>{}, ~std::uint64_t{0});
1852 }
1853
1855 template<int Scale, std::size_t N, isa<x86> Arch>
1856 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4 && requires { sizeof(simd<float, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
1857 [[nodiscard]] constexpr simd<float, 4, Arch> vgatherqps(float const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
1858 return detail::x86_memory::gather<Scale>(base, indices, simd<float, 4, Arch>{}, ~std::uint64_t{0});
1859 }
1860
1861 template<int Scale, isa<x86> Arch>
1862 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
1864 float const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
1865 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
1866 }
1867
1869 template<int Scale, isa<x86> Arch>
1870 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
1872 float const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
1873 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
1874 }
1875
1876 template<int Scale, isa<x86> Arch>
1877 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
1879 float const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
1880 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1881 }
1882
1884 template<int Scale, isa<x86> Arch>
1885 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
1887 float const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
1888 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1889 }
1890
1891 template<int Scale, isa<x86> Arch>
1892 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
1893 consteval void mask_vscatterqps(float * base, predicate<4, Arch> mask,
1894 simd<std::int64_t, 4, Arch> indices, simd<float, 4, Arch> value) noexcept {
1895 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1896 }
1897
1899 template<int Scale, isa<x86> Arch>
1900 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
1901 constexpr void mask_vscatterqps(float * base, predicate<4, Arch> mask,
1902 simd<std::int64_t, 4, Arch> indices, simd<float, 4, Arch> value) noexcept {
1903 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1904 }
1905
1906 template<int Scale, isa<x86> Arch>
1907 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 8, Arch>); sizeof(simd<std::int64_t, 8, Arch>); })
1909 float const * base, simd<std::int64_t, 8, Arch> indices) noexcept {
1910 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1911 }
1912
1914 template<int Scale, isa<x86> Arch>
1915 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 8, Arch>); sizeof(simd<std::int64_t, 8, Arch>); })
1917 float const * base, simd<std::int64_t, 8, Arch> indices) noexcept {
1918 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1919 }
1920
1921 template<int Scale, isa<x86> Arch>
1922 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 8, Arch>); sizeof(simd<std::int64_t, 8, Arch>); })
1923 consteval void mask_vscatterqps(float * base, predicate<8, Arch> mask,
1924 simd<std::int64_t, 8, Arch> indices, simd<float, 8, Arch> value) noexcept {
1925 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1926 }
1927
1929 template<int Scale, isa<x86> Arch>
1930 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<float, 8, Arch>); sizeof(simd<std::int64_t, 8, Arch>); })
1931 constexpr void mask_vscatterqps(float * base, predicate<8, Arch> mask,
1932 simd<std::int64_t, 8, Arch> indices, simd<float, 8, Arch> value) noexcept {
1933 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1934 }
1935
1936 template<int Scale, std::size_t N, isa<x86> Arch, class T>
1937 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4 && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
1938 [[nodiscard]] consteval simd<T, 4, Arch> vpgatherqd(T const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
1939 return detail::x86_memory::gather<Scale>(base, indices, simd<T, 4, Arch>{}, ~std::uint64_t{0});
1940 }
1941
1943 template<int Scale, std::size_t N, isa<x86> Arch, class T>
1944 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4 && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
1945 [[nodiscard]] constexpr simd<T, 4, Arch> vpgatherqd(T const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
1946 return detail::x86_memory::gather<Scale>(base, indices, simd<T, 4, Arch>{}, ~std::uint64_t{0});
1947 }
1948
1949 template<int Scale, isa<x86> Arch, class T>
1950 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
1952 T const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
1953 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
1954 }
1955
1957 template<int Scale, isa<x86> Arch, class T>
1958 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
1960 T const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
1961 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
1962 }
1963
1964 template<int Scale, isa<x86> Arch, class T>
1965 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
1967 T const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
1968 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1969 }
1970
1972 template<int Scale, isa<x86> Arch, class T>
1973 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
1975 T const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
1976 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
1977 }
1978
1979 template<int Scale, isa<x86> Arch, class T>
1980 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
1981 consteval void mask_vpscatterqd(T * base, predicate<4, Arch> mask,
1982 simd<std::int64_t, 2, Arch> indices, simd<T, 4, Arch> value) noexcept {
1983 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1984 }
1985
1987 template<int Scale, isa<x86> Arch, class T>
1988 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
1989 constexpr void mask_vpscatterqd(T * base, predicate<4, Arch> mask,
1990 simd<std::int64_t, 2, Arch> indices, simd<T, 4, Arch> value) noexcept {
1991 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
1992 }
1993
1994 template<int Scale, std::size_t N, isa<x86> Arch, class T>
1995 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4 && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
1996 [[nodiscard]] consteval simd<T, 4, Arch> vpgatherqd(T const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
1997 return detail::x86_memory::gather<Scale>(base, indices, simd<T, 4, Arch>{}, ~std::uint64_t{0});
1998 }
1999
2001 template<int Scale, std::size_t N, isa<x86> Arch, class T>
2002 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4 && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
2003 [[nodiscard]] constexpr simd<T, 4, Arch> vpgatherqd(T const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
2004 return detail::x86_memory::gather<Scale>(base, indices, simd<T, 4, Arch>{}, ~std::uint64_t{0});
2005 }
2006
2007 template<int Scale, isa<x86> Arch, class T>
2008 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
2010 T const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
2011 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
2012 }
2013
2015 template<int Scale, isa<x86> Arch, class T>
2016 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int32_t, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
2018 T const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
2019 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
2020 }
2021
2022 template<int Scale, isa<x86> Arch, class T>
2023 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
2025 T const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
2026 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
2027 }
2028
2030 template<int Scale, isa<x86> Arch, class T>
2031 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
2033 T const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
2034 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
2035 }
2036
2037 template<int Scale, isa<x86> Arch, class T>
2038 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
2039 consteval void mask_vpscatterqd(T * base, predicate<4, Arch> mask,
2040 simd<std::int64_t, 4, Arch> indices, simd<T, 4, Arch> value) noexcept {
2041 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
2042 }
2043
2045 template<int Scale, isa<x86> Arch, class T>
2046 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
2047 constexpr void mask_vpscatterqd(T * base, predicate<4, Arch> mask,
2048 simd<std::int64_t, 4, Arch> indices, simd<T, 4, Arch> value) noexcept {
2049 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
2050 }
2051
2052 template<int Scale, isa<x86> Arch, class T>
2053 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 8, Arch>); sizeof(simd<std::int64_t, 8, Arch>); })
2055 T const * base, simd<std::int64_t, 8, Arch> indices) noexcept {
2056 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
2057 }
2058
2060 template<int Scale, isa<x86> Arch, class T>
2061 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 8, Arch>); sizeof(simd<std::int64_t, 8, Arch>); })
2063 T const * base, simd<std::int64_t, 8, Arch> indices) noexcept {
2064 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
2065 }
2066
2067 template<int Scale, isa<x86> Arch, class T>
2068 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 8, Arch>); sizeof(simd<std::int64_t, 8, Arch>); })
2069 consteval void mask_vpscatterqd(T * base, predicate<8, Arch> mask,
2070 simd<std::int64_t, 8, Arch> indices, simd<T, 8, Arch> value) noexcept {
2071 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
2072 }
2073
2075 template<int Scale, isa<x86> Arch, class T>
2076 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int32_t> || std::same_as<T, std::uint32_t>) && requires { sizeof(simd<T, 8, Arch>); sizeof(simd<std::int64_t, 8, Arch>); })
2077 constexpr void mask_vpscatterqd(T * base, predicate<8, Arch> mask,
2078 simd<std::int64_t, 8, Arch> indices, simd<T, 8, Arch> value) noexcept {
2079 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
2080 }
2081
2082 template<int Scale, std::size_t N, isa<x86> Arch>
2083 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 2 && requires { sizeof(simd<double, 2, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
2084 [[nodiscard]] consteval simd<double, 2, Arch> vgatherqpd(double const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
2085 return detail::x86_memory::gather<Scale>(base, indices, simd<double, 2, Arch>{}, ~std::uint64_t{0});
2086 }
2087
2089 template<int Scale, std::size_t N, isa<x86> Arch>
2090 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 2 && requires { sizeof(simd<double, 2, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
2091 [[nodiscard]] constexpr simd<double, 2, Arch> vgatherqpd(double const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
2092 return detail::x86_memory::gather<Scale>(base, indices, simd<double, 2, Arch>{}, ~std::uint64_t{0});
2093 }
2094
2095 template<int Scale, isa<x86> Arch>
2096 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 2, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
2098 double const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
2099 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
2100 }
2101
2103 template<int Scale, isa<x86> Arch>
2104 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 2, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
2106 double const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
2107 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
2108 }
2109
2110 template<int Scale, isa<x86> Arch>
2111 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 2, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
2113 double const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
2114 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
2115 }
2116
2118 template<int Scale, isa<x86> Arch>
2119 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 2, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
2121 double const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
2122 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
2123 }
2124
2125 template<int Scale, isa<x86> Arch>
2126 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 2, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
2127 consteval void mask_vscatterqpd(double * base, predicate<2, Arch> mask,
2128 simd<std::int64_t, 2, Arch> indices, simd<double, 2, Arch> value) noexcept {
2129 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
2130 }
2131
2133 template<int Scale, isa<x86> Arch>
2134 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 2, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
2135 constexpr void mask_vscatterqpd(double * base, predicate<2, Arch> mask,
2136 simd<std::int64_t, 2, Arch> indices, simd<double, 2, Arch> value) noexcept {
2137 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
2138 }
2139
2140 template<int Scale, std::size_t N, isa<x86> Arch>
2141 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4 && requires { sizeof(simd<double, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
2142 [[nodiscard]] consteval simd<double, 4, Arch> vgatherqpd(double const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
2143 return detail::x86_memory::gather<Scale>(base, indices, simd<double, 4, Arch>{}, ~std::uint64_t{0});
2144 }
2145
2147 template<int Scale, std::size_t N, isa<x86> Arch>
2148 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4 && requires { sizeof(simd<double, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
2149 [[nodiscard]] constexpr simd<double, 4, Arch> vgatherqpd(double const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
2150 return detail::x86_memory::gather<Scale>(base, indices, simd<double, 4, Arch>{}, ~std::uint64_t{0});
2151 }
2152
2153 template<int Scale, isa<x86> Arch>
2154 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
2156 double const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
2157 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
2158 }
2159
2161 template<int Scale, isa<x86> Arch>
2162 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
2164 double const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
2165 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
2166 }
2167
2168 template<int Scale, isa<x86> Arch>
2169 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
2171 double const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
2172 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
2173 }
2174
2176 template<int Scale, isa<x86> Arch>
2177 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
2179 double const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
2180 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
2181 }
2182
2183 template<int Scale, isa<x86> Arch>
2184 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
2185 consteval void mask_vscatterqpd(double * base, predicate<4, Arch> mask,
2186 simd<std::int64_t, 4, Arch> indices, simd<double, 4, Arch> value) noexcept {
2187 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
2188 }
2189
2191 template<int Scale, isa<x86> Arch>
2192 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
2193 constexpr void mask_vscatterqpd(double * base, predicate<4, Arch> mask,
2194 simd<std::int64_t, 4, Arch> indices, simd<double, 4, Arch> value) noexcept {
2195 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
2196 }
2197
2198 template<int Scale, isa<x86> Arch>
2199 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 8, Arch>); sizeof(simd<std::int64_t, 8, Arch>); })
2201 double const * base, simd<std::int64_t, 8, Arch> indices) noexcept {
2202 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
2203 }
2204
2206 template<int Scale, isa<x86> Arch>
2207 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 8, Arch>); sizeof(simd<std::int64_t, 8, Arch>); })
2209 double const * base, simd<std::int64_t, 8, Arch> indices) noexcept {
2210 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
2211 }
2212
2213 template<int Scale, isa<x86> Arch>
2214 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 8, Arch>); sizeof(simd<std::int64_t, 8, Arch>); })
2215 consteval void mask_vscatterqpd(double * base, predicate<8, Arch> mask,
2216 simd<std::int64_t, 8, Arch> indices, simd<double, 8, Arch> value) noexcept {
2217 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
2218 }
2219
2221 template<int Scale, isa<x86> Arch>
2222 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && requires { sizeof(simd<double, 8, Arch>); sizeof(simd<std::int64_t, 8, Arch>); })
2223 constexpr void mask_vscatterqpd(double * base, predicate<8, Arch> mask,
2224 simd<std::int64_t, 8, Arch> indices, simd<double, 8, Arch> value) noexcept {
2225 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
2226 }
2227
2228 template<int Scale, std::size_t N, isa<x86> Arch, class T>
2229 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 2 && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 2, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
2230 [[nodiscard]] consteval simd<T, 2, Arch> vpgatherqq(T const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
2231 return detail::x86_memory::gather<Scale>(base, indices, simd<T, 2, Arch>{}, ~std::uint64_t{0});
2232 }
2233
2235 template<int Scale, std::size_t N, isa<x86> Arch, class T>
2236 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 2 && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 2, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
2237 [[nodiscard]] constexpr simd<T, 2, Arch> vpgatherqq(T const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
2238 return detail::x86_memory::gather<Scale>(base, indices, simd<T, 2, Arch>{}, ~std::uint64_t{0});
2239 }
2240
2241 template<int Scale, isa<x86> Arch, class T>
2242 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 2, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
2244 T const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
2245 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
2246 }
2247
2249 template<int Scale, isa<x86> Arch, class T>
2250 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 2, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
2252 T const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
2253 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
2254 }
2255
2256 template<int Scale, isa<x86> Arch, class T>
2257 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 2, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
2259 T const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
2260 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
2261 }
2262
2264 template<int Scale, isa<x86> Arch, class T>
2265 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 2, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
2267 T const * base, simd<std::int64_t, 2, Arch> indices) noexcept {
2268 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
2269 }
2270
2271 template<int Scale, isa<x86> Arch, class T>
2272 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 2, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
2273 consteval void mask_vpscatterqq(T * base, predicate<2, Arch> mask,
2274 simd<std::int64_t, 2, Arch> indices, simd<T, 2, Arch> value) noexcept {
2275 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
2276 }
2277
2279 template<int Scale, isa<x86> Arch, class T>
2280 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 2, Arch>); sizeof(simd<std::int64_t, 2, Arch>); })
2281 constexpr void mask_vpscatterqq(T * base, predicate<2, Arch> mask,
2282 simd<std::int64_t, 2, Arch> indices, simd<T, 2, Arch> value) noexcept {
2283 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
2284 }
2285
2286 template<int Scale, std::size_t N, isa<x86> Arch, class T>
2287 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4 && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
2288 [[nodiscard]] consteval simd<T, 4, Arch> vpgatherqq(T const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
2289 return detail::x86_memory::gather<Scale>(base, indices, simd<T, 4, Arch>{}, ~std::uint64_t{0});
2290 }
2291
2293 template<int Scale, std::size_t N, isa<x86> Arch, class T>
2294 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && N == 4 && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
2295 [[nodiscard]] constexpr simd<T, 4, Arch> vpgatherqq(T const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
2296 return detail::x86_memory::gather<Scale>(base, indices, simd<T, 4, Arch>{}, ~std::uint64_t{0});
2297 }
2298
2299 template<int Scale, isa<x86> Arch, class T>
2300 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
2302 T const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
2303 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
2304 }
2305
2307 template<int Scale, isa<x86> Arch, class T>
2308 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx2)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
2310 T const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
2311 return detail::x86_memory::gather<Scale>(base, indices, source, mask);
2312 }
2313
2314 template<int Scale, isa<x86> Arch, class T>
2315 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
2317 T const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
2318 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
2319 }
2320
2322 template<int Scale, isa<x86> Arch, class T>
2323 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
2325 T const * base, simd<std::int64_t, 4, Arch> indices) noexcept {
2326 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
2327 }
2328
2329 template<int Scale, isa<x86> Arch, class T>
2330 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
2331 consteval void mask_vpscatterqq(T * base, predicate<4, Arch> mask,
2332 simd<std::int64_t, 4, Arch> indices, simd<T, 4, Arch> value) noexcept {
2333 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
2334 }
2335
2337 template<int Scale, isa<x86> Arch, class T>
2338 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f) && Arch.has(x86_feature::avx512vl)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 4, Arch>); sizeof(simd<std::int64_t, 4, Arch>); })
2339 constexpr void mask_vpscatterqq(T * base, predicate<4, Arch> mask,
2340 simd<std::int64_t, 4, Arch> indices, simd<T, 4, Arch> value) noexcept {
2341 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
2342 }
2343
2344 template<int Scale, isa<x86> Arch, class T>
2345 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 8, Arch>); sizeof(simd<std::int64_t, 8, Arch>); })
2347 T const * base, simd<std::int64_t, 8, Arch> indices) noexcept {
2348 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
2349 }
2350
2352 template<int Scale, isa<x86> Arch, class T>
2353 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 8, Arch>); sizeof(simd<std::int64_t, 8, Arch>); })
2355 T const * base, simd<std::int64_t, 8, Arch> indices) noexcept {
2356 return detail::x86_memory::gather<Scale>(base, indices, source, static_cast<std::uint64_t>(mask.to_bitset()));
2357 }
2358
2359 template<int Scale, isa<x86> Arch, class T>
2360 requires(!Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 8, Arch>); sizeof(simd<std::int64_t, 8, Arch>); })
2361 consteval void mask_vpscatterqq(T * base, predicate<8, Arch> mask,
2362 simd<std::int64_t, 8, Arch> indices, simd<T, 8, Arch> value) noexcept {
2363 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
2364 }
2365
2367 template<int Scale, isa<x86> Arch, class T>
2368 requires(Arch.has(polyfill) && !(Arch.has(x86_feature::avx512f)) && (Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8) && (std::same_as<T, std::int64_t> || std::same_as<T, std::uint64_t>) && requires { sizeof(simd<T, 8, Arch>); sizeof(simd<std::int64_t, 8, Arch>); })
2369 constexpr void mask_vpscatterqq(T * base, predicate<8, Arch> mask,
2370 simd<std::int64_t, 8, Arch> indices, simd<T, 8, Arch> value) noexcept {
2371 detail::x86_memory::scatter<Scale>(base, indices, value, static_cast<std::uint64_t>(mask.to_bitset()));
2372 }
2373
2375}
2376#endif
2377
2378export module native.x86.memory;
2379export import native.x86.features;
2380export import native.simd;
2381
2382#if NATIVE_HOST_X86 || defined(NATIVE_DOXYGEN)
2383export namespace native {
2400 using ::native::vgatherdpd;
2401 using ::native::vgatherdps;
2402 using ::native::vgatherqpd;
2403 using ::native::vgatherqps;
2404 using ::native::vpgatherdd;
2405 using ::native::vpgatherdq;
2406 using ::native::vpgatherqd;
2407 using ::native::vpgatherqq;
2408}
2409#endif
typename mask_traits< std::remove_cvref_t< T > >::type mask
Definition mask_traits.h:22
constexpr simd< double, 2, Arch > vgatherqpd(double const *base, simd< std::int64_t, 2, Arch > indices) noexcept
Gather all addressable lanes; N specifies the result lane count.
constexpr simd< float, 4, Arch > mask_vgatherdps(simd< float, 4, Arch > source, simd< std::int32_t, 4, Arch > mask, float const *base, simd< std::int32_t, 4, Arch > indices) noexcept
Gather lanes whose full vector mask has its sign bit set; retain source otherwise.
constexpr simd< T, 2, Arch > vpgatherdq(T const *base, simd< std::int32_t, 4, Arch > indices) noexcept
Gather all addressable lanes; N specifies the result lane count.
constexpr void mask_vpscatterdq(T *base, predicate< 2, Arch > mask, simd< std::int32_t, 4, Arch > indices, simd< T, 2, Arch > value) noexcept
Store predicate-selected lanes; inactive addresses are not accessed.
constexpr simd< float, 4, Arch > vgatherqps(float const *base, simd< std::int64_t, 2, Arch > indices) noexcept
Gather all addressable lanes; N specifies the result lane count.
constexpr simd< float, 4, Arch > mask_vgatherqps(simd< float, 4, Arch > source, simd< std::int32_t, 4, Arch > mask, float const *base, simd< std::int64_t, 2, Arch > indices) noexcept
Gather lanes whose full vector mask has its sign bit set; retain source otherwise.
constexpr simd< T, 4, Arch > mask_vpgatherqd(simd< T, 4, Arch > source, simd< std::int32_t, 4, Arch > mask, T const *base, simd< std::int64_t, 2, Arch > indices) noexcept
Gather lanes whose full vector mask has its sign bit set; retain source otherwise.
constexpr void mask_vpscatterqq(T *base, predicate< 2, Arch > mask, simd< std::int64_t, 2, Arch > indices, simd< T, 2, Arch > value) noexcept
Store predicate-selected lanes; inactive addresses are not accessed.
constexpr simd< double, 2, Arch > vgatherdpd(double const *base, simd< std::int32_t, 4, Arch > indices) noexcept
Gather all addressable lanes; N specifies the result lane count.
constexpr void mask_vscatterdps(float *base, predicate< 4, Arch > mask, simd< std::int32_t, 4, Arch > indices, simd< float, 4, Arch > value) noexcept
Store predicate-selected lanes; inactive addresses are not accessed.
constexpr simd< float, 4, Arch > vgatherdps(float const *base, simd< std::int32_t, 4, Arch > indices) noexcept
Gather all addressable lanes; N specifies the result lane count.
constexpr simd< T, 4, Arch > vpgatherdd(T const *base, simd< std::int32_t, 4, Arch > indices) noexcept
Gather all addressable lanes; N specifies the result lane count.
constexpr simd< T, 2, Arch > mask_vpgatherqq(simd< T, 2, Arch > source, simd< std::int64_t, 2, Arch > mask, T const *base, simd< std::int64_t, 2, Arch > indices) noexcept
Gather lanes whose full vector mask has its sign bit set; retain source otherwise.
constexpr simd< double, 2, Arch > mask_vgatherdpd(simd< double, 2, Arch > source, simd< std::int64_t, 2, Arch > mask, double const *base, simd< std::int32_t, 4, Arch > indices) noexcept
Gather lanes whose full vector mask has its sign bit set; retain source otherwise.
constexpr simd< T, 4, Arch > mask_vpgatherdd(simd< T, 4, Arch > source, simd< std::int32_t, 4, Arch > mask, T const *base, simd< std::int32_t, 4, Arch > indices) noexcept
Gather lanes whose full vector mask has its sign bit set; retain source otherwise.
constexpr simd< T, 2, Arch > mask_vpgatherdq(simd< T, 2, Arch > source, simd< std::int64_t, 2, Arch > mask, T const *base, simd< std::int32_t, 4, Arch > indices) noexcept
Gather lanes whose full vector mask has its sign bit set; retain source otherwise.
constexpr simd< T, 2, Arch > vpgatherqq(T const *base, simd< std::int64_t, 2, Arch > indices) noexcept
Gather all addressable lanes; N specifies the result lane count.
constexpr simd< T, 4, Arch > vpgatherqd(T const *base, simd< std::int64_t, 2, Arch > indices) noexcept
Gather all addressable lanes; N specifies the result lane count.
constexpr void mask_vpscatterqd(T *base, predicate< 4, Arch > mask, simd< std::int64_t, 2, Arch > indices, simd< T, 4, Arch > value) noexcept
Store predicate-selected lanes; inactive addresses are not accessed.
constexpr void mask_vscatterdpd(double *base, predicate< 2, Arch > mask, simd< std::int32_t, 4, Arch > indices, simd< double, 2, Arch > value) noexcept
Store predicate-selected lanes; inactive addresses are not accessed.
constexpr void mask_vpscatterdd(T *base, predicate< 4, Arch > mask, simd< std::int32_t, 4, Arch > indices, simd< T, 4, Arch > value) noexcept
Store predicate-selected lanes; inactive addresses are not accessed.
constexpr simd< double, 2, Arch > mask_vgatherqpd(simd< double, 2, Arch > source, simd< std::int64_t, 2, Arch > mask, double const *base, simd< std::int64_t, 2, Arch > indices) noexcept
Gather lanes whose full vector mask has its sign bit set; retain source otherwise.
constexpr void mask_vscatterqpd(double *base, predicate< 2, Arch > mask, simd< std::int64_t, 2, Arch > indices, simd< double, 2, Arch > value) noexcept
Store predicate-selected lanes; inactive addresses are not accessed.
constexpr void mask_vscatterqps(float *base, predicate< 4, Arch > mask, simd< std::int64_t, 2, Arch > indices, simd< float, 4, Arch > value) noexcept
Store predicate-selected lanes; inactive addresses are not accessed.
Architecture-tagged vectors, register packs and supporting value types. Native arithmetic follows its...
Standard-library adaptations documented here for SIMD value types.
Omitted architecture arguments use the native.simd provider's baseline.