Skip to main content

core/stdarch/crates/core_arch/src/x86/
avx512bw.rs

1use crate::{
2    core_arch::{simd::*, x86::*},
3    intrinsics::simd::*,
4    ptr,
5};
6
7#[cfg(test)]
8use stdarch_test::assert_instr;
9
10/// Compute the absolute value of packed signed 16-bit integers in a, and store the unsigned results in dst.
11///
12/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_abs_epi16&expand=30)
13#[inline]
14#[target_feature(enable = "avx512bw")]
15#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
16#[cfg_attr(test, assert_instr(vpabsw))]
17#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
18pub const fn _mm512_abs_epi16(a: __m512i) -> __m512i {
19    unsafe {
20        let a = a.as_i16x32();
21        let cmp: i16x32 = simd_gt(a, i16x32::ZERO);
22        transmute(simd_select(cmp, a, simd_neg(a)))
23    }
24}
25
26/// Compute the absolute value of packed signed 16-bit integers in a, and store the unsigned results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
27///
28/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_abs_epi16&expand=31)
29#[inline]
30#[target_feature(enable = "avx512bw")]
31#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
32#[cfg_attr(test, assert_instr(vpabsw))]
33#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
34pub const fn _mm512_mask_abs_epi16(src: __m512i, k: __mmask32, a: __m512i) -> __m512i {
35    unsafe {
36        let abs = _mm512_abs_epi16(a).as_i16x32();
37        transmute(simd_select_bitmask(k, abs, src.as_i16x32()))
38    }
39}
40
41/// Compute the absolute value of packed signed 16-bit integers in a, and store the unsigned results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
42///
43/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_abs_epi16&expand=32)
44#[inline]
45#[target_feature(enable = "avx512bw")]
46#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
47#[cfg_attr(test, assert_instr(vpabsw))]
48#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
49pub const fn _mm512_maskz_abs_epi16(k: __mmask32, a: __m512i) -> __m512i {
50    unsafe {
51        let abs = _mm512_abs_epi16(a).as_i16x32();
52        transmute(simd_select_bitmask(k, abs, i16x32::ZERO))
53    }
54}
55
56/// Compute the absolute value of packed signed 16-bit integers in a, and store the unsigned results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
57///
58/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_abs_epi16&expand=28)
59#[inline]
60#[target_feature(enable = "avx512bw,avx512vl")]
61#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
62#[cfg_attr(test, assert_instr(vpabsw))]
63#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
64pub const fn _mm256_mask_abs_epi16(src: __m256i, k: __mmask16, a: __m256i) -> __m256i {
65    unsafe {
66        let abs = _mm256_abs_epi16(a).as_i16x16();
67        transmute(simd_select_bitmask(k, abs, src.as_i16x16()))
68    }
69}
70
71/// Compute the absolute value of packed signed 16-bit integers in a, and store the unsigned results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
72///
73/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_abs_epi16&expand=29)
74#[inline]
75#[target_feature(enable = "avx512bw,avx512vl")]
76#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
77#[cfg_attr(test, assert_instr(vpabsw))]
78#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
79pub const fn _mm256_maskz_abs_epi16(k: __mmask16, a: __m256i) -> __m256i {
80    unsafe {
81        let abs = _mm256_abs_epi16(a).as_i16x16();
82        transmute(simd_select_bitmask(k, abs, i16x16::ZERO))
83    }
84}
85
86/// Compute the absolute value of packed signed 16-bit integers in a, and store the unsigned results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
87///
88/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_abs_epi16&expand=25)
89#[inline]
90#[target_feature(enable = "avx512bw,avx512vl")]
91#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
92#[cfg_attr(test, assert_instr(vpabsw))]
93#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
94pub const fn _mm_mask_abs_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
95    unsafe {
96        let abs = _mm_abs_epi16(a).as_i16x8();
97        transmute(simd_select_bitmask(k, abs, src.as_i16x8()))
98    }
99}
100
101/// Compute the absolute value of packed signed 16-bit integers in a, and store the unsigned results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
102///
103/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_abs_epi16&expand=26)
104#[inline]
105#[target_feature(enable = "avx512bw,avx512vl")]
106#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
107#[cfg_attr(test, assert_instr(vpabsw))]
108#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
109pub const fn _mm_maskz_abs_epi16(k: __mmask8, a: __m128i) -> __m128i {
110    unsafe {
111        let abs = _mm_abs_epi16(a).as_i16x8();
112        transmute(simd_select_bitmask(k, abs, i16x8::ZERO))
113    }
114}
115
116/// Compute the absolute value of packed signed 8-bit integers in a, and store the unsigned results in dst.
117///
118/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_abs_epi8&expand=57)
119#[inline]
120#[target_feature(enable = "avx512bw")]
121#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
122#[cfg_attr(test, assert_instr(vpabsb))]
123#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
124pub const fn _mm512_abs_epi8(a: __m512i) -> __m512i {
125    unsafe {
126        let a = a.as_i8x64();
127        let cmp: i8x64 = simd_gt(a, i8x64::ZERO);
128        transmute(simd_select(cmp, a, simd_neg(a)))
129    }
130}
131
132/// Compute the absolute value of packed signed 8-bit integers in a, and store the unsigned results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
133///
134/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_abs_epi8&expand=58)
135#[inline]
136#[target_feature(enable = "avx512bw")]
137#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
138#[cfg_attr(test, assert_instr(vpabsb))]
139#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
140pub const fn _mm512_mask_abs_epi8(src: __m512i, k: __mmask64, a: __m512i) -> __m512i {
141    unsafe {
142        let abs = _mm512_abs_epi8(a).as_i8x64();
143        transmute(simd_select_bitmask(k, abs, src.as_i8x64()))
144    }
145}
146
147/// Compute the absolute value of packed signed 8-bit integers in a, and store the unsigned results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
148///
149/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_abs_epi8&expand=59)
150#[inline]
151#[target_feature(enable = "avx512bw")]
152#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
153#[cfg_attr(test, assert_instr(vpabsb))]
154#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
155pub const fn _mm512_maskz_abs_epi8(k: __mmask64, a: __m512i) -> __m512i {
156    unsafe {
157        let abs = _mm512_abs_epi8(a).as_i8x64();
158        transmute(simd_select_bitmask(k, abs, i8x64::ZERO))
159    }
160}
161
162/// Compute the absolute value of packed signed 8-bit integers in a, and store the unsigned results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
163///
164/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_abs_epi8&expand=55)
165#[inline]
166#[target_feature(enable = "avx512bw,avx512vl")]
167#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
168#[cfg_attr(test, assert_instr(vpabsb))]
169#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
170pub const fn _mm256_mask_abs_epi8(src: __m256i, k: __mmask32, a: __m256i) -> __m256i {
171    unsafe {
172        let abs = _mm256_abs_epi8(a).as_i8x32();
173        transmute(simd_select_bitmask(k, abs, src.as_i8x32()))
174    }
175}
176
177/// Compute the absolute value of packed signed 8-bit integers in a, and store the unsigned results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
178///
179/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_abs_epi8&expand=56)
180#[inline]
181#[target_feature(enable = "avx512bw,avx512vl")]
182#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
183#[cfg_attr(test, assert_instr(vpabsb))]
184#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
185pub const fn _mm256_maskz_abs_epi8(k: __mmask32, a: __m256i) -> __m256i {
186    unsafe {
187        let abs = _mm256_abs_epi8(a).as_i8x32();
188        transmute(simd_select_bitmask(k, abs, i8x32::ZERO))
189    }
190}
191
192/// Compute the absolute value of packed signed 8-bit integers in a, and store the unsigned results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set)
193///
194/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_abs_epi8&expand=52)
195#[inline]
196#[target_feature(enable = "avx512bw,avx512vl")]
197#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
198#[cfg_attr(test, assert_instr(vpabsb))]
199#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
200pub const fn _mm_mask_abs_epi8(src: __m128i, k: __mmask16, a: __m128i) -> __m128i {
201    unsafe {
202        let abs = _mm_abs_epi8(a).as_i8x16();
203        transmute(simd_select_bitmask(k, abs, src.as_i8x16()))
204    }
205}
206
207/// Compute the absolute value of packed signed 8-bit integers in a, and store the unsigned results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
208///
209/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_abs_epi8&expand=53)
210#[inline]
211#[target_feature(enable = "avx512bw,avx512vl")]
212#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
213#[cfg_attr(test, assert_instr(vpabsb))]
214#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
215pub const fn _mm_maskz_abs_epi8(k: __mmask16, a: __m128i) -> __m128i {
216    unsafe {
217        let abs = _mm_abs_epi8(a).as_i8x16();
218        transmute(simd_select_bitmask(k, abs, i8x16::ZERO))
219    }
220}
221
222/// Add packed 16-bit integers in a and b, and store the results in dst.
223///
224/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_add_epi16&expand=91)
225#[inline]
226#[target_feature(enable = "avx512bw")]
227#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
228#[cfg_attr(test, assert_instr(vpaddw))]
229#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
230pub const fn _mm512_add_epi16(a: __m512i, b: __m512i) -> __m512i {
231    unsafe { transmute(simd_add(a.as_i16x32(), b.as_i16x32())) }
232}
233
234/// Add packed 16-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
235///
236/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_add_epi16&expand=92)
237#[inline]
238#[target_feature(enable = "avx512bw")]
239#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
240#[cfg_attr(test, assert_instr(vpaddw))]
241#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
242pub const fn _mm512_mask_add_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
243    unsafe {
244        let add = _mm512_add_epi16(a, b).as_i16x32();
245        transmute(simd_select_bitmask(k, add, src.as_i16x32()))
246    }
247}
248
249/// Add packed 16-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
250///
251/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_add_epi16&expand=93)
252#[inline]
253#[target_feature(enable = "avx512bw")]
254#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
255#[cfg_attr(test, assert_instr(vpaddw))]
256#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
257pub const fn _mm512_maskz_add_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
258    unsafe {
259        let add = _mm512_add_epi16(a, b).as_i16x32();
260        transmute(simd_select_bitmask(k, add, i16x32::ZERO))
261    }
262}
263
264/// Add packed 16-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
265///
266/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_add_epi16&expand=89)
267#[inline]
268#[target_feature(enable = "avx512bw,avx512vl")]
269#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
270#[cfg_attr(test, assert_instr(vpaddw))]
271#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
272pub const fn _mm256_mask_add_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
273    unsafe {
274        let add = _mm256_add_epi16(a, b).as_i16x16();
275        transmute(simd_select_bitmask(k, add, src.as_i16x16()))
276    }
277}
278
279/// Add packed 16-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
280///
281/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_add_epi16&expand=90)
282#[inline]
283#[target_feature(enable = "avx512bw,avx512vl")]
284#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
285#[cfg_attr(test, assert_instr(vpaddw))]
286#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
287pub const fn _mm256_maskz_add_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
288    unsafe {
289        let add = _mm256_add_epi16(a, b).as_i16x16();
290        transmute(simd_select_bitmask(k, add, i16x16::ZERO))
291    }
292}
293
294/// Add packed 16-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
295///
296/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_add_epi16&expand=86)
297#[inline]
298#[target_feature(enable = "avx512bw,avx512vl")]
299#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
300#[cfg_attr(test, assert_instr(vpaddw))]
301#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
302pub const fn _mm_mask_add_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
303    unsafe {
304        let add = _mm_add_epi16(a, b).as_i16x8();
305        transmute(simd_select_bitmask(k, add, src.as_i16x8()))
306    }
307}
308
309/// Add packed 16-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
310///
311/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_add_epi16&expand=87)
312#[inline]
313#[target_feature(enable = "avx512bw,avx512vl")]
314#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
315#[cfg_attr(test, assert_instr(vpaddw))]
316#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
317pub const fn _mm_maskz_add_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
318    unsafe {
319        let add = _mm_add_epi16(a, b).as_i16x8();
320        transmute(simd_select_bitmask(k, add, i16x8::ZERO))
321    }
322}
323
324/// Add packed 8-bit integers in a and b, and store the results in dst.
325///
326/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_add_epi8&expand=118)
327#[inline]
328#[target_feature(enable = "avx512bw")]
329#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
330#[cfg_attr(test, assert_instr(vpaddb))]
331#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
332pub const fn _mm512_add_epi8(a: __m512i, b: __m512i) -> __m512i {
333    unsafe { transmute(simd_add(a.as_i8x64(), b.as_i8x64())) }
334}
335
336/// Add packed 8-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
337///
338/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_add_epi8&expand=119)
339#[inline]
340#[target_feature(enable = "avx512bw")]
341#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
342#[cfg_attr(test, assert_instr(vpaddb))]
343#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
344pub const fn _mm512_mask_add_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
345    unsafe {
346        let add = _mm512_add_epi8(a, b).as_i8x64();
347        transmute(simd_select_bitmask(k, add, src.as_i8x64()))
348    }
349}
350
351/// Add packed 8-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
352///
353/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_add_epi8&expand=120)
354#[inline]
355#[target_feature(enable = "avx512bw")]
356#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
357#[cfg_attr(test, assert_instr(vpaddb))]
358#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
359pub const fn _mm512_maskz_add_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
360    unsafe {
361        let add = _mm512_add_epi8(a, b).as_i8x64();
362        transmute(simd_select_bitmask(k, add, i8x64::ZERO))
363    }
364}
365
366/// Add packed 8-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
367///
368/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_add_epi8&expand=116)
369#[inline]
370#[target_feature(enable = "avx512bw,avx512vl")]
371#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
372#[cfg_attr(test, assert_instr(vpaddb))]
373#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
374pub const fn _mm256_mask_add_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
375    unsafe {
376        let add = _mm256_add_epi8(a, b).as_i8x32();
377        transmute(simd_select_bitmask(k, add, src.as_i8x32()))
378    }
379}
380
381/// Add packed 8-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
382///
383/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_add_epi8&expand=117)
384#[inline]
385#[target_feature(enable = "avx512bw,avx512vl")]
386#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
387#[cfg_attr(test, assert_instr(vpaddb))]
388#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
389pub const fn _mm256_maskz_add_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
390    unsafe {
391        let add = _mm256_add_epi8(a, b).as_i8x32();
392        transmute(simd_select_bitmask(k, add, i8x32::ZERO))
393    }
394}
395
396/// Add packed 8-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
397///
398/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_add_epi8&expand=113)
399#[inline]
400#[target_feature(enable = "avx512bw,avx512vl")]
401#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
402#[cfg_attr(test, assert_instr(vpaddb))]
403#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
404pub const fn _mm_mask_add_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
405    unsafe {
406        let add = _mm_add_epi8(a, b).as_i8x16();
407        transmute(simd_select_bitmask(k, add, src.as_i8x16()))
408    }
409}
410
411/// Add packed 8-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
412///
413/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_add_epi8&expand=114)
414#[inline]
415#[target_feature(enable = "avx512bw,avx512vl")]
416#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
417#[cfg_attr(test, assert_instr(vpaddb))]
418#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
419pub const fn _mm_maskz_add_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
420    unsafe {
421        let add = _mm_add_epi8(a, b).as_i8x16();
422        transmute(simd_select_bitmask(k, add, i8x16::ZERO))
423    }
424}
425
426/// Add packed unsigned 16-bit integers in a and b using saturation, and store the results in dst.
427///
428/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_adds_epu16&expand=197)
429#[inline]
430#[target_feature(enable = "avx512bw")]
431#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
432#[cfg_attr(test, assert_instr(vpaddusw))]
433#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
434pub const fn _mm512_adds_epu16(a: __m512i, b: __m512i) -> __m512i {
435    unsafe { transmute(simd_saturating_add(a.as_u16x32(), b.as_u16x32())) }
436}
437
438/// Add packed unsigned 16-bit integers in a and b using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
439///
440/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_adds_epu16&expand=198)
441#[inline]
442#[target_feature(enable = "avx512bw")]
443#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
444#[cfg_attr(test, assert_instr(vpaddusw))]
445#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
446pub const fn _mm512_mask_adds_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
447    unsafe {
448        let add = _mm512_adds_epu16(a, b).as_u16x32();
449        transmute(simd_select_bitmask(k, add, src.as_u16x32()))
450    }
451}
452
453/// Add packed unsigned 16-bit integers in a and b using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
454///
455/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_adds_epu16&expand=199)
456#[inline]
457#[target_feature(enable = "avx512bw")]
458#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
459#[cfg_attr(test, assert_instr(vpaddusw))]
460#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
461pub const fn _mm512_maskz_adds_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
462    unsafe {
463        let add = _mm512_adds_epu16(a, b).as_u16x32();
464        transmute(simd_select_bitmask(k, add, u16x32::ZERO))
465    }
466}
467
468/// Add packed unsigned 16-bit integers in a and b using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
469///
470/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_adds_epu16&expand=195)
471#[inline]
472#[target_feature(enable = "avx512bw,avx512vl")]
473#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
474#[cfg_attr(test, assert_instr(vpaddusw))]
475#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
476pub const fn _mm256_mask_adds_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
477    unsafe {
478        let add = _mm256_adds_epu16(a, b).as_u16x16();
479        transmute(simd_select_bitmask(k, add, src.as_u16x16()))
480    }
481}
482
483/// Add packed unsigned 16-bit integers in a and b using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
484///
485/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_adds_epu16&expand=196)
486#[inline]
487#[target_feature(enable = "avx512bw,avx512vl")]
488#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
489#[cfg_attr(test, assert_instr(vpaddusw))]
490#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
491pub const fn _mm256_maskz_adds_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
492    unsafe {
493        let add = _mm256_adds_epu16(a, b).as_u16x16();
494        transmute(simd_select_bitmask(k, add, u16x16::ZERO))
495    }
496}
497
498/// Add packed unsigned 16-bit integers in a and b using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
499///
500/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_adds_epu16&expand=192)
501#[inline]
502#[target_feature(enable = "avx512bw,avx512vl")]
503#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
504#[cfg_attr(test, assert_instr(vpaddusw))]
505#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
506pub const fn _mm_mask_adds_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
507    unsafe {
508        let add = _mm_adds_epu16(a, b).as_u16x8();
509        transmute(simd_select_bitmask(k, add, src.as_u16x8()))
510    }
511}
512
513/// Add packed unsigned 16-bit integers in a and b using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
514///
515/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_adds_epu16&expand=193)
516#[inline]
517#[target_feature(enable = "avx512bw,avx512vl")]
518#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
519#[cfg_attr(test, assert_instr(vpaddusw))]
520#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
521pub const fn _mm_maskz_adds_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
522    unsafe {
523        let add = _mm_adds_epu16(a, b).as_u16x8();
524        transmute(simd_select_bitmask(k, add, u16x8::ZERO))
525    }
526}
527
528/// Add packed unsigned 8-bit integers in a and b using saturation, and store the results in dst.
529///
530/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_adds_epu8&expand=206)
531#[inline]
532#[target_feature(enable = "avx512bw")]
533#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
534#[cfg_attr(test, assert_instr(vpaddusb))]
535#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
536pub const fn _mm512_adds_epu8(a: __m512i, b: __m512i) -> __m512i {
537    unsafe { transmute(simd_saturating_add(a.as_u8x64(), b.as_u8x64())) }
538}
539
540/// Add packed unsigned 8-bit integers in a and b using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
541///
542/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_adds_epu8&expand=207)
543#[inline]
544#[target_feature(enable = "avx512bw")]
545#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
546#[cfg_attr(test, assert_instr(vpaddusb))]
547#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
548pub const fn _mm512_mask_adds_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
549    unsafe {
550        let add = _mm512_adds_epu8(a, b).as_u8x64();
551        transmute(simd_select_bitmask(k, add, src.as_u8x64()))
552    }
553}
554
555/// Add packed unsigned 8-bit integers in a and b using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
556///
557/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_adds_epu8&expand=208)
558#[inline]
559#[target_feature(enable = "avx512bw")]
560#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
561#[cfg_attr(test, assert_instr(vpaddusb))]
562#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
563pub const fn _mm512_maskz_adds_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
564    unsafe {
565        let add = _mm512_adds_epu8(a, b).as_u8x64();
566        transmute(simd_select_bitmask(k, add, u8x64::ZERO))
567    }
568}
569
570/// Add packed unsigned 8-bit integers in a and b using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
571///
572/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_adds_epu8&expand=204)
573#[inline]
574#[target_feature(enable = "avx512bw,avx512vl")]
575#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
576#[cfg_attr(test, assert_instr(vpaddusb))]
577#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
578pub const fn _mm256_mask_adds_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
579    unsafe {
580        let add = _mm256_adds_epu8(a, b).as_u8x32();
581        transmute(simd_select_bitmask(k, add, src.as_u8x32()))
582    }
583}
584
585/// Add packed unsigned 8-bit integers in a and b using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
586///
587/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_adds_epu8&expand=205)
588#[inline]
589#[target_feature(enable = "avx512bw,avx512vl")]
590#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
591#[cfg_attr(test, assert_instr(vpaddusb))]
592#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
593pub const fn _mm256_maskz_adds_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
594    unsafe {
595        let add = _mm256_adds_epu8(a, b).as_u8x32();
596        transmute(simd_select_bitmask(k, add, u8x32::ZERO))
597    }
598}
599
600/// Add packed unsigned 8-bit integers in a and b using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
601///
602/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_adds_epu8&expand=201)
603#[inline]
604#[target_feature(enable = "avx512bw,avx512vl")]
605#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
606#[cfg_attr(test, assert_instr(vpaddusb))]
607#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
608pub const fn _mm_mask_adds_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
609    unsafe {
610        let add = _mm_adds_epu8(a, b).as_u8x16();
611        transmute(simd_select_bitmask(k, add, src.as_u8x16()))
612    }
613}
614
615/// Add packed unsigned 8-bit integers in a and b using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
616///
617/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_adds_epu8&expand=202)
618#[inline]
619#[target_feature(enable = "avx512bw,avx512vl")]
620#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
621#[cfg_attr(test, assert_instr(vpaddusb))]
622#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
623pub const fn _mm_maskz_adds_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
624    unsafe {
625        let add = _mm_adds_epu8(a, b).as_u8x16();
626        transmute(simd_select_bitmask(k, add, u8x16::ZERO))
627    }
628}
629
630/// Add packed signed 16-bit integers in a and b using saturation, and store the results in dst.
631///
632/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_adds_epi16&expand=179)
633#[inline]
634#[target_feature(enable = "avx512bw")]
635#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
636#[cfg_attr(test, assert_instr(vpaddsw))]
637#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
638pub const fn _mm512_adds_epi16(a: __m512i, b: __m512i) -> __m512i {
639    unsafe { transmute(simd_saturating_add(a.as_i16x32(), b.as_i16x32())) }
640}
641
642/// Add packed signed 16-bit integers in a and b using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
643///
644/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_adds_epi16&expand=180)
645#[inline]
646#[target_feature(enable = "avx512bw")]
647#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
648#[cfg_attr(test, assert_instr(vpaddsw))]
649#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
650pub const fn _mm512_mask_adds_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
651    unsafe {
652        let add = _mm512_adds_epi16(a, b).as_i16x32();
653        transmute(simd_select_bitmask(k, add, src.as_i16x32()))
654    }
655}
656
657/// Add packed signed 16-bit integers in a and b using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
658///
659/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_adds_epi16&expand=181)
660#[inline]
661#[target_feature(enable = "avx512bw")]
662#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
663#[cfg_attr(test, assert_instr(vpaddsw))]
664#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
665pub const fn _mm512_maskz_adds_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
666    unsafe {
667        let add = _mm512_adds_epi16(a, b).as_i16x32();
668        transmute(simd_select_bitmask(k, add, i16x32::ZERO))
669    }
670}
671
672/// Add packed signed 16-bit integers in a and b using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
673///
674/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_adds_epi16&expand=177)
675#[inline]
676#[target_feature(enable = "avx512bw,avx512vl")]
677#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
678#[cfg_attr(test, assert_instr(vpaddsw))]
679#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
680pub const fn _mm256_mask_adds_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
681    unsafe {
682        let add = _mm256_adds_epi16(a, b).as_i16x16();
683        transmute(simd_select_bitmask(k, add, src.as_i16x16()))
684    }
685}
686
687/// Add packed signed 16-bit integers in a and b using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
688///
689/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_adds_epi16&expand=178)
690#[inline]
691#[target_feature(enable = "avx512bw,avx512vl")]
692#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
693#[cfg_attr(test, assert_instr(vpaddsw))]
694#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
695pub const fn _mm256_maskz_adds_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
696    unsafe {
697        let add = _mm256_adds_epi16(a, b).as_i16x16();
698        transmute(simd_select_bitmask(k, add, i16x16::ZERO))
699    }
700}
701
702/// Add packed signed 16-bit integers in a and b using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
703///
704/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_adds_epi16&expand=174)
705#[inline]
706#[target_feature(enable = "avx512bw,avx512vl")]
707#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
708#[cfg_attr(test, assert_instr(vpaddsw))]
709#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
710pub const fn _mm_mask_adds_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
711    unsafe {
712        let add = _mm_adds_epi16(a, b).as_i16x8();
713        transmute(simd_select_bitmask(k, add, src.as_i16x8()))
714    }
715}
716
717/// Add packed signed 16-bit integers in a and b using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
718///
719/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_adds_epi16&expand=175)
720#[inline]
721#[target_feature(enable = "avx512bw,avx512vl")]
722#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
723#[cfg_attr(test, assert_instr(vpaddsw))]
724#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
725pub const fn _mm_maskz_adds_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
726    unsafe {
727        let add = _mm_adds_epi16(a, b).as_i16x8();
728        transmute(simd_select_bitmask(k, add, i16x8::ZERO))
729    }
730}
731
732/// Add packed signed 8-bit integers in a and b using saturation, and store the results in dst.
733///
734/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_adds_epi8&expand=188)
735#[inline]
736#[target_feature(enable = "avx512bw")]
737#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
738#[cfg_attr(test, assert_instr(vpaddsb))]
739#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
740pub const fn _mm512_adds_epi8(a: __m512i, b: __m512i) -> __m512i {
741    unsafe { transmute(simd_saturating_add(a.as_i8x64(), b.as_i8x64())) }
742}
743
744/// Add packed signed 8-bit integers in a and b using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
745///
746/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_adds_epi8&expand=189)
747#[inline]
748#[target_feature(enable = "avx512bw")]
749#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
750#[cfg_attr(test, assert_instr(vpaddsb))]
751#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
752pub const fn _mm512_mask_adds_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
753    unsafe {
754        let add = _mm512_adds_epi8(a, b).as_i8x64();
755        transmute(simd_select_bitmask(k, add, src.as_i8x64()))
756    }
757}
758
759/// Add packed signed 8-bit integers in a and b using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
760///
761/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_adds_epi8&expand=190)
762#[inline]
763#[target_feature(enable = "avx512bw")]
764#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
765#[cfg_attr(test, assert_instr(vpaddsb))]
766#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
767pub const fn _mm512_maskz_adds_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
768    unsafe {
769        let add = _mm512_adds_epi8(a, b).as_i8x64();
770        transmute(simd_select_bitmask(k, add, i8x64::ZERO))
771    }
772}
773
774/// Add packed signed 8-bit integers in a and b using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
775///
776/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_adds_epi8&expand=186)
777#[inline]
778#[target_feature(enable = "avx512bw,avx512vl")]
779#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
780#[cfg_attr(test, assert_instr(vpaddsb))]
781#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
782pub const fn _mm256_mask_adds_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
783    unsafe {
784        let add = _mm256_adds_epi8(a, b).as_i8x32();
785        transmute(simd_select_bitmask(k, add, src.as_i8x32()))
786    }
787}
788
789/// Add packed signed 8-bit integers in a and b using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
790///
791/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_adds_epi8&expand=187)
792#[inline]
793#[target_feature(enable = "avx512bw,avx512vl")]
794#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
795#[cfg_attr(test, assert_instr(vpaddsb))]
796#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
797pub const fn _mm256_maskz_adds_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
798    unsafe {
799        let add = _mm256_adds_epi8(a, b).as_i8x32();
800        transmute(simd_select_bitmask(k, add, i8x32::ZERO))
801    }
802}
803
804/// Add packed signed 8-bit integers in a and b using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
805///
806/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_adds_epi8&expand=183)
807#[inline]
808#[target_feature(enable = "avx512bw,avx512vl")]
809#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
810#[cfg_attr(test, assert_instr(vpaddsb))]
811#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
812pub const fn _mm_mask_adds_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
813    unsafe {
814        let add = _mm_adds_epi8(a, b).as_i8x16();
815        transmute(simd_select_bitmask(k, add, src.as_i8x16()))
816    }
817}
818
819/// Add packed signed 8-bit integers in a and b using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
820///
821/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_adds_epi8&expand=184)
822#[inline]
823#[target_feature(enable = "avx512bw,avx512vl")]
824#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
825#[cfg_attr(test, assert_instr(vpaddsb))]
826#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
827pub const fn _mm_maskz_adds_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
828    unsafe {
829        let add = _mm_adds_epi8(a, b).as_i8x16();
830        transmute(simd_select_bitmask(k, add, i8x16::ZERO))
831    }
832}
833
834/// Subtract packed 16-bit integers in b from packed 16-bit integers in a, and store the results in dst.
835///
836/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_sub_epi16&expand=5685)
837#[inline]
838#[target_feature(enable = "avx512bw")]
839#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
840#[cfg_attr(test, assert_instr(vpsubw))]
841#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
842pub const fn _mm512_sub_epi16(a: __m512i, b: __m512i) -> __m512i {
843    unsafe { transmute(simd_sub(a.as_i16x32(), b.as_i16x32())) }
844}
845
846/// Subtract packed 16-bit integers in b from packed 16-bit integers in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
847///
848/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_sub_epi16&expand=5683)
849#[inline]
850#[target_feature(enable = "avx512bw")]
851#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
852#[cfg_attr(test, assert_instr(vpsubw))]
853#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
854pub const fn _mm512_mask_sub_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
855    unsafe {
856        let sub = _mm512_sub_epi16(a, b).as_i16x32();
857        transmute(simd_select_bitmask(k, sub, src.as_i16x32()))
858    }
859}
860
861/// Subtract packed 16-bit integers in b from packed 16-bit integers in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
862///
863/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_sub_epi16&expand=5684)
864#[inline]
865#[target_feature(enable = "avx512bw")]
866#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
867#[cfg_attr(test, assert_instr(vpsubw))]
868#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
869pub const fn _mm512_maskz_sub_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
870    unsafe {
871        let sub = _mm512_sub_epi16(a, b).as_i16x32();
872        transmute(simd_select_bitmask(k, sub, i16x32::ZERO))
873    }
874}
875
876/// Subtract packed 16-bit integers in b from packed 16-bit integers in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
877///
878/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_sub_epi16&expand=5680)
879#[inline]
880#[target_feature(enable = "avx512bw,avx512vl")]
881#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
882#[cfg_attr(test, assert_instr(vpsubw))]
883#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
884pub const fn _mm256_mask_sub_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
885    unsafe {
886        let sub = _mm256_sub_epi16(a, b).as_i16x16();
887        transmute(simd_select_bitmask(k, sub, src.as_i16x16()))
888    }
889}
890
891/// Subtract packed 16-bit integers in b from packed 16-bit integers in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
892///
893/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_sub_epi16&expand=5681)
894#[inline]
895#[target_feature(enable = "avx512bw,avx512vl")]
896#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
897#[cfg_attr(test, assert_instr(vpsubw))]
898#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
899pub const fn _mm256_maskz_sub_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
900    unsafe {
901        let sub = _mm256_sub_epi16(a, b).as_i16x16();
902        transmute(simd_select_bitmask(k, sub, i16x16::ZERO))
903    }
904}
905
906/// Subtract packed 16-bit integers in b from packed 16-bit integers in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
907///
908/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_sub_epi16&expand=5677)
909#[inline]
910#[target_feature(enable = "avx512bw,avx512vl")]
911#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
912#[cfg_attr(test, assert_instr(vpsubw))]
913#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
914pub const fn _mm_mask_sub_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
915    unsafe {
916        let sub = _mm_sub_epi16(a, b).as_i16x8();
917        transmute(simd_select_bitmask(k, sub, src.as_i16x8()))
918    }
919}
920
921/// Subtract packed 16-bit integers in b from packed 16-bit integers in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
922///
923/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_sub_epi16&expand=5678)
924#[inline]
925#[target_feature(enable = "avx512bw,avx512vl")]
926#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
927#[cfg_attr(test, assert_instr(vpsubw))]
928#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
929pub const fn _mm_maskz_sub_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
930    unsafe {
931        let sub = _mm_sub_epi16(a, b).as_i16x8();
932        transmute(simd_select_bitmask(k, sub, i16x8::ZERO))
933    }
934}
935
936/// Subtract packed 8-bit integers in b from packed 8-bit integers in a, and store the results in dst.
937///
938/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_sub_epi8&expand=5712)
939#[inline]
940#[target_feature(enable = "avx512bw")]
941#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
942#[cfg_attr(test, assert_instr(vpsubb))]
943#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
944pub const fn _mm512_sub_epi8(a: __m512i, b: __m512i) -> __m512i {
945    unsafe { transmute(simd_sub(a.as_i8x64(), b.as_i8x64())) }
946}
947
948/// Subtract packed 8-bit integers in b from packed 8-bit integers in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
949///
950/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_sub_epi8&expand=5710)
951#[inline]
952#[target_feature(enable = "avx512bw")]
953#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
954#[cfg_attr(test, assert_instr(vpsubb))]
955#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
956pub const fn _mm512_mask_sub_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
957    unsafe {
958        let sub = _mm512_sub_epi8(a, b).as_i8x64();
959        transmute(simd_select_bitmask(k, sub, src.as_i8x64()))
960    }
961}
962
963/// Subtract packed 8-bit integers in b from packed 8-bit integers in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
964///
965/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_sub_epi8&expand=5711)
966#[inline]
967#[target_feature(enable = "avx512bw")]
968#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
969#[cfg_attr(test, assert_instr(vpsubb))]
970#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
971pub const fn _mm512_maskz_sub_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
972    unsafe {
973        let sub = _mm512_sub_epi8(a, b).as_i8x64();
974        transmute(simd_select_bitmask(k, sub, i8x64::ZERO))
975    }
976}
977
978/// Subtract packed 8-bit integers in b from packed 8-bit integers in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
979///
980/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_sub_epi8&expand=5707)
981#[inline]
982#[target_feature(enable = "avx512bw,avx512vl")]
983#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
984#[cfg_attr(test, assert_instr(vpsubb))]
985#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
986pub const fn _mm256_mask_sub_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
987    unsafe {
988        let sub = _mm256_sub_epi8(a, b).as_i8x32();
989        transmute(simd_select_bitmask(k, sub, src.as_i8x32()))
990    }
991}
992
993/// Subtract packed 8-bit integers in b from packed 8-bit integers in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
994///
995/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_sub_epi8&expand=5708)
996#[inline]
997#[target_feature(enable = "avx512bw,avx512vl")]
998#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
999#[cfg_attr(test, assert_instr(vpsubb))]
1000#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1001pub const fn _mm256_maskz_sub_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
1002    unsafe {
1003        let sub = _mm256_sub_epi8(a, b).as_i8x32();
1004        transmute(simd_select_bitmask(k, sub, i8x32::ZERO))
1005    }
1006}
1007
1008/// Subtract packed 8-bit integers in b from packed 8-bit integers in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
1009///
1010/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_sub_epi8&expand=5704)
1011#[inline]
1012#[target_feature(enable = "avx512bw,avx512vl")]
1013#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1014#[cfg_attr(test, assert_instr(vpsubb))]
1015#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1016pub const fn _mm_mask_sub_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
1017    unsafe {
1018        let sub = _mm_sub_epi8(a, b).as_i8x16();
1019        transmute(simd_select_bitmask(k, sub, src.as_i8x16()))
1020    }
1021}
1022
1023/// Subtract packed 8-bit integers in b from packed 8-bit integers in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
1024///
1025/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_sub_epi8&expand=5705)
1026#[inline]
1027#[target_feature(enable = "avx512bw,avx512vl")]
1028#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1029#[cfg_attr(test, assert_instr(vpsubb))]
1030#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1031pub const fn _mm_maskz_sub_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
1032    unsafe {
1033        let sub = _mm_sub_epi8(a, b).as_i8x16();
1034        transmute(simd_select_bitmask(k, sub, i8x16::ZERO))
1035    }
1036}
1037
1038/// Subtract packed unsigned 16-bit integers in b from packed unsigned 16-bit integers in a using saturation, and store the results in dst.
1039///
1040/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_subs_epu16&expand=5793)
1041#[inline]
1042#[target_feature(enable = "avx512bw")]
1043#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1044#[cfg_attr(test, assert_instr(vpsubusw))]
1045#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1046pub const fn _mm512_subs_epu16(a: __m512i, b: __m512i) -> __m512i {
1047    unsafe { transmute(simd_saturating_sub(a.as_u16x32(), b.as_u16x32())) }
1048}
1049
1050/// Subtract packed unsigned 16-bit integers in b from packed unsigned 16-bit integers in a using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
1051///
1052/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_subs_epu16&expand=5791)
1053#[inline]
1054#[target_feature(enable = "avx512bw")]
1055#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1056#[cfg_attr(test, assert_instr(vpsubusw))]
1057#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1058pub const fn _mm512_mask_subs_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
1059    unsafe {
1060        let sub = _mm512_subs_epu16(a, b).as_u16x32();
1061        transmute(simd_select_bitmask(k, sub, src.as_u16x32()))
1062    }
1063}
1064
1065/// Subtract packed unsigned 16-bit integers in b from packed unsigned 16-bit integers in a using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
1066///
1067/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_subs_epu16&expand=5792)
1068#[inline]
1069#[target_feature(enable = "avx512bw")]
1070#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1071#[cfg_attr(test, assert_instr(vpsubusw))]
1072#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1073pub const fn _mm512_maskz_subs_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
1074    unsafe {
1075        let sub = _mm512_subs_epu16(a, b).as_u16x32();
1076        transmute(simd_select_bitmask(k, sub, u16x32::ZERO))
1077    }
1078}
1079
1080/// Subtract packed unsigned 16-bit integers in b from packed unsigned 16-bit integers in a using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
1081///
1082/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_subs_epu16&expand=5788)
1083#[inline]
1084#[target_feature(enable = "avx512bw,avx512vl")]
1085#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1086#[cfg_attr(test, assert_instr(vpsubusw))]
1087#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1088pub const fn _mm256_mask_subs_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
1089    unsafe {
1090        let sub = _mm256_subs_epu16(a, b).as_u16x16();
1091        transmute(simd_select_bitmask(k, sub, src.as_u16x16()))
1092    }
1093}
1094
1095/// Subtract packed unsigned 16-bit integers in b from packed unsigned 16-bit integers in a using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
1096///
1097/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_subs_epu16&expand=5789)
1098#[inline]
1099#[target_feature(enable = "avx512bw,avx512vl")]
1100#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1101#[cfg_attr(test, assert_instr(vpsubusw))]
1102#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1103pub const fn _mm256_maskz_subs_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
1104    unsafe {
1105        let sub = _mm256_subs_epu16(a, b).as_u16x16();
1106        transmute(simd_select_bitmask(k, sub, u16x16::ZERO))
1107    }
1108}
1109
1110/// Subtract packed unsigned 16-bit integers in b from packed unsigned 16-bit integers in a using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
1111///
1112/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_subs_epu16&expand=5785)
1113#[inline]
1114#[target_feature(enable = "avx512bw,avx512vl")]
1115#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1116#[cfg_attr(test, assert_instr(vpsubusw))]
1117#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1118pub const fn _mm_mask_subs_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
1119    unsafe {
1120        let sub = _mm_subs_epu16(a, b).as_u16x8();
1121        transmute(simd_select_bitmask(k, sub, src.as_u16x8()))
1122    }
1123}
1124
1125/// Subtract packed unsigned 16-bit integers in b from packed unsigned 16-bit integers in a using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
1126///
1127/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_subs_epu16&expand=5786)
1128#[inline]
1129#[target_feature(enable = "avx512bw,avx512vl")]
1130#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1131#[cfg_attr(test, assert_instr(vpsubusw))]
1132#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1133pub const fn _mm_maskz_subs_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
1134    unsafe {
1135        let sub = _mm_subs_epu16(a, b).as_u16x8();
1136        transmute(simd_select_bitmask(k, sub, u16x8::ZERO))
1137    }
1138}
1139
1140/// Subtract packed unsigned 8-bit integers in b from packed unsigned 8-bit integers in a using saturation, and store the results in dst.
1141///
1142/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_subs_epu8&expand=5802)
1143#[inline]
1144#[target_feature(enable = "avx512bw")]
1145#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1146#[cfg_attr(test, assert_instr(vpsubusb))]
1147#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1148pub const fn _mm512_subs_epu8(a: __m512i, b: __m512i) -> __m512i {
1149    unsafe { transmute(simd_saturating_sub(a.as_u8x64(), b.as_u8x64())) }
1150}
1151
1152/// Subtract packed unsigned 8-bit integers in b from packed unsigned 8-bit integers in a using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
1153///
1154/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_subs_epu8&expand=5800)
1155#[inline]
1156#[target_feature(enable = "avx512bw")]
1157#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1158#[cfg_attr(test, assert_instr(vpsubusb))]
1159#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1160pub const fn _mm512_mask_subs_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
1161    unsafe {
1162        let sub = _mm512_subs_epu8(a, b).as_u8x64();
1163        transmute(simd_select_bitmask(k, sub, src.as_u8x64()))
1164    }
1165}
1166
1167/// Subtract packed unsigned 8-bit integers in b from packed unsigned 8-bit integers in a using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
1168///
1169/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_subs_epu8&expand=5801)
1170#[inline]
1171#[target_feature(enable = "avx512bw")]
1172#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1173#[cfg_attr(test, assert_instr(vpsubusb))]
1174#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1175pub const fn _mm512_maskz_subs_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
1176    unsafe {
1177        let sub = _mm512_subs_epu8(a, b).as_u8x64();
1178        transmute(simd_select_bitmask(k, sub, u8x64::ZERO))
1179    }
1180}
1181
1182/// Subtract packed unsigned 8-bit integers in b from packed unsigned 8-bit integers in a using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
1183///
1184/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_subs_epu8&expand=5797)
1185#[inline]
1186#[target_feature(enable = "avx512bw,avx512vl")]
1187#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1188#[cfg_attr(test, assert_instr(vpsubusb))]
1189#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1190pub const fn _mm256_mask_subs_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
1191    unsafe {
1192        let sub = _mm256_subs_epu8(a, b).as_u8x32();
1193        transmute(simd_select_bitmask(k, sub, src.as_u8x32()))
1194    }
1195}
1196
1197/// Subtract packed unsigned 8-bit integers in b from packed unsigned 8-bit integers in a using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
1198///
1199/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_subs_epu8&expand=5798)
1200#[inline]
1201#[target_feature(enable = "avx512bw,avx512vl")]
1202#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1203#[cfg_attr(test, assert_instr(vpsubusb))]
1204#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1205pub const fn _mm256_maskz_subs_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
1206    unsafe {
1207        let sub = _mm256_subs_epu8(a, b).as_u8x32();
1208        transmute(simd_select_bitmask(k, sub, u8x32::ZERO))
1209    }
1210}
1211
1212/// Subtract packed unsigned 8-bit integers in b from packed unsigned 8-bit integers in a using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
1213///
1214/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_subs_epu8&expand=5794)
1215#[inline]
1216#[target_feature(enable = "avx512bw,avx512vl")]
1217#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1218#[cfg_attr(test, assert_instr(vpsubusb))]
1219#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1220pub const fn _mm_mask_subs_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
1221    unsafe {
1222        let sub = _mm_subs_epu8(a, b).as_u8x16();
1223        transmute(simd_select_bitmask(k, sub, src.as_u8x16()))
1224    }
1225}
1226
1227/// Subtract packed unsigned 8-bit integers in b from packed unsigned 8-bit integers in a using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
1228///
1229/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_subs_epu8&expand=5795)
1230#[inline]
1231#[target_feature(enable = "avx512bw,avx512vl")]
1232#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1233#[cfg_attr(test, assert_instr(vpsubusb))]
1234#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1235pub const fn _mm_maskz_subs_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
1236    unsafe {
1237        let sub = _mm_subs_epu8(a, b).as_u8x16();
1238        transmute(simd_select_bitmask(k, sub, u8x16::ZERO))
1239    }
1240}
1241
1242/// Subtract packed signed 16-bit integers in b from packed 16-bit integers in a using saturation, and store the results in dst.
1243///
1244/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_subs_epi16&expand=5775)
1245#[inline]
1246#[target_feature(enable = "avx512bw")]
1247#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1248#[cfg_attr(test, assert_instr(vpsubsw))]
1249#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1250pub const fn _mm512_subs_epi16(a: __m512i, b: __m512i) -> __m512i {
1251    unsafe { transmute(simd_saturating_sub(a.as_i16x32(), b.as_i16x32())) }
1252}
1253
1254/// Subtract packed signed 16-bit integers in b from packed 16-bit integers in a using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
1255///
1256/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_subs_epi16&expand=5773)
1257#[inline]
1258#[target_feature(enable = "avx512bw")]
1259#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1260#[cfg_attr(test, assert_instr(vpsubsw))]
1261#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1262pub const fn _mm512_mask_subs_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
1263    unsafe {
1264        let sub = _mm512_subs_epi16(a, b).as_i16x32();
1265        transmute(simd_select_bitmask(k, sub, src.as_i16x32()))
1266    }
1267}
1268
1269/// Subtract packed signed 16-bit integers in b from packed 16-bit integers in a using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
1270///
1271/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_subs_epi16&expand=5774)
1272#[inline]
1273#[target_feature(enable = "avx512bw")]
1274#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1275#[cfg_attr(test, assert_instr(vpsubsw))]
1276#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1277pub const fn _mm512_maskz_subs_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
1278    unsafe {
1279        let sub = _mm512_subs_epi16(a, b).as_i16x32();
1280        transmute(simd_select_bitmask(k, sub, i16x32::ZERO))
1281    }
1282}
1283
1284/// Subtract packed signed 16-bit integers in b from packed 16-bit integers in a using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
1285///
1286/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_subs_epi16&expand=5770)
1287#[inline]
1288#[target_feature(enable = "avx512bw,avx512vl")]
1289#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1290#[cfg_attr(test, assert_instr(vpsubsw))]
1291#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1292pub const fn _mm256_mask_subs_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
1293    unsafe {
1294        let sub = _mm256_subs_epi16(a, b).as_i16x16();
1295        transmute(simd_select_bitmask(k, sub, src.as_i16x16()))
1296    }
1297}
1298
1299/// Subtract packed signed 16-bit integers in b from packed 16-bit integers in a using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
1300///
1301/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_subs_epi16&expand=5771)
1302#[inline]
1303#[target_feature(enable = "avx512bw,avx512vl")]
1304#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1305#[cfg_attr(test, assert_instr(vpsubsw))]
1306#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1307pub const fn _mm256_maskz_subs_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
1308    unsafe {
1309        let sub = _mm256_subs_epi16(a, b).as_i16x16();
1310        transmute(simd_select_bitmask(k, sub, i16x16::ZERO))
1311    }
1312}
1313
1314/// Subtract packed signed 16-bit integers in b from packed 16-bit integers in a using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
1315///
1316/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_subs_epi16&expand=5767)
1317#[inline]
1318#[target_feature(enable = "avx512bw,avx512vl")]
1319#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1320#[cfg_attr(test, assert_instr(vpsubsw))]
1321#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1322pub const fn _mm_mask_subs_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
1323    unsafe {
1324        let sub = _mm_subs_epi16(a, b).as_i16x8();
1325        transmute(simd_select_bitmask(k, sub, src.as_i16x8()))
1326    }
1327}
1328
1329/// Subtract packed signed 16-bit integers in b from packed 16-bit integers in a using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
1330///
1331/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_subs_epi16&expand=5768)
1332#[inline]
1333#[target_feature(enable = "avx512bw,avx512vl")]
1334#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1335#[cfg_attr(test, assert_instr(vpsubsw))]
1336#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1337pub const fn _mm_maskz_subs_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
1338    unsafe {
1339        let sub = _mm_subs_epi16(a, b).as_i16x8();
1340        transmute(simd_select_bitmask(k, sub, i16x8::ZERO))
1341    }
1342}
1343
1344/// Subtract packed signed 8-bit integers in b from packed 8-bit integers in a using saturation, and store the results in dst.
1345///
1346/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_subs_epi8&expand=5784)
1347#[inline]
1348#[target_feature(enable = "avx512bw")]
1349#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1350#[cfg_attr(test, assert_instr(vpsubsb))]
1351#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1352pub const fn _mm512_subs_epi8(a: __m512i, b: __m512i) -> __m512i {
1353    unsafe { transmute(simd_saturating_sub(a.as_i8x64(), b.as_i8x64())) }
1354}
1355
1356/// Subtract packed signed 8-bit integers in b from packed 8-bit integers in a using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
1357///
1358/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_subs_epi8&expand=5782)
1359#[inline]
1360#[target_feature(enable = "avx512bw")]
1361#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1362#[cfg_attr(test, assert_instr(vpsubsb))]
1363#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1364pub const fn _mm512_mask_subs_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
1365    unsafe {
1366        let sub = _mm512_subs_epi8(a, b).as_i8x64();
1367        transmute(simd_select_bitmask(k, sub, src.as_i8x64()))
1368    }
1369}
1370
1371/// Subtract packed signed 8-bit integers in b from packed 8-bit integers in a using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
1372///
1373/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_subs_epi8&expand=5783)
1374#[inline]
1375#[target_feature(enable = "avx512bw")]
1376#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1377#[cfg_attr(test, assert_instr(vpsubsb))]
1378#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1379pub const fn _mm512_maskz_subs_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
1380    unsafe {
1381        let sub = _mm512_subs_epi8(a, b).as_i8x64();
1382        transmute(simd_select_bitmask(k, sub, i8x64::ZERO))
1383    }
1384}
1385
1386/// Subtract packed signed 8-bit integers in b from packed 8-bit integers in a using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
1387///
1388/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_subs_epi8&expand=5779)
1389#[inline]
1390#[target_feature(enable = "avx512bw,avx512vl")]
1391#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1392#[cfg_attr(test, assert_instr(vpsubsb))]
1393#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1394pub const fn _mm256_mask_subs_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
1395    unsafe {
1396        let sub = _mm256_subs_epi8(a, b).as_i8x32();
1397        transmute(simd_select_bitmask(k, sub, src.as_i8x32()))
1398    }
1399}
1400
1401/// Subtract packed signed 8-bit integers in b from packed 8-bit integers in a using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
1402///
1403/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_subs_epi8&expand=5780)
1404#[inline]
1405#[target_feature(enable = "avx512bw,avx512vl")]
1406#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1407#[cfg_attr(test, assert_instr(vpsubsb))]
1408#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1409pub const fn _mm256_maskz_subs_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
1410    unsafe {
1411        let sub = _mm256_subs_epi8(a, b).as_i8x32();
1412        transmute(simd_select_bitmask(k, sub, i8x32::ZERO))
1413    }
1414}
1415
1416/// Subtract packed signed 8-bit integers in b from packed 8-bit integers in a using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
1417///
1418/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_subs_epi8&expand=5776)
1419#[inline]
1420#[target_feature(enable = "avx512bw,avx512vl")]
1421#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1422#[cfg_attr(test, assert_instr(vpsubsb))]
1423#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1424pub const fn _mm_mask_subs_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
1425    unsafe {
1426        let sub = _mm_subs_epi8(a, b).as_i8x16();
1427        transmute(simd_select_bitmask(k, sub, src.as_i8x16()))
1428    }
1429}
1430
1431/// Subtract packed signed 8-bit integers in b from packed 8-bit integers in a using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
1432///
1433/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_subs_epi8&expand=5777)
1434#[inline]
1435#[target_feature(enable = "avx512bw,avx512vl")]
1436#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1437#[cfg_attr(test, assert_instr(vpsubsb))]
1438#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1439pub const fn _mm_maskz_subs_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
1440    unsafe {
1441        let sub = _mm_subs_epi8(a, b).as_i8x16();
1442        transmute(simd_select_bitmask(k, sub, i8x16::ZERO))
1443    }
1444}
1445
1446/// Multiply the packed unsigned 16-bit integers in a and b, producing intermediate 32-bit integers, and store the high 16 bits of the intermediate integers in dst.
1447///
1448/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mulhi_epu16&expand=3973)
1449#[inline]
1450#[target_feature(enable = "avx512bw")]
1451#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1452#[cfg_attr(test, assert_instr(vpmulhuw))]
1453#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1454pub const fn _mm512_mulhi_epu16(a: __m512i, b: __m512i) -> __m512i {
1455    unsafe {
1456        let a = simd_cast::<_, u32x32>(a.as_u16x32());
1457        let b = simd_cast::<_, u32x32>(b.as_u16x32());
1458        let r = simd_shr(simd_mul(a, b), u32x32::splat(16));
1459        transmute(simd_cast::<u32x32, u16x32>(r))
1460    }
1461}
1462
1463/// Multiply the packed unsigned 16-bit integers in a and b, producing intermediate 32-bit integers, and store the high 16 bits of the intermediate integers in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
1464///
1465/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_mulhi_epu16&expand=3971)
1466#[inline]
1467#[target_feature(enable = "avx512bw")]
1468#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1469#[cfg_attr(test, assert_instr(vpmulhuw))]
1470#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1471pub const fn _mm512_mask_mulhi_epu16(
1472    src: __m512i,
1473    k: __mmask32,
1474    a: __m512i,
1475    b: __m512i,
1476) -> __m512i {
1477    unsafe {
1478        let mul = _mm512_mulhi_epu16(a, b).as_u16x32();
1479        transmute(simd_select_bitmask(k, mul, src.as_u16x32()))
1480    }
1481}
1482
1483/// Multiply the packed unsigned 16-bit integers in a and b, producing intermediate 32-bit integers, and store the high 16 bits of the intermediate integers in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
1484///
1485/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_mulhi_epu16&expand=3972)
1486#[inline]
1487#[target_feature(enable = "avx512bw")]
1488#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1489#[cfg_attr(test, assert_instr(vpmulhuw))]
1490#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1491pub const fn _mm512_maskz_mulhi_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
1492    unsafe {
1493        let mul = _mm512_mulhi_epu16(a, b).as_u16x32();
1494        transmute(simd_select_bitmask(k, mul, u16x32::ZERO))
1495    }
1496}
1497
1498/// Multiply the packed unsigned 16-bit integers in a and b, producing intermediate 32-bit integers, and store the high 16 bits of the intermediate integers in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
1499///
1500/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_mulhi_epu16&expand=3968)
1501#[inline]
1502#[target_feature(enable = "avx512bw,avx512vl")]
1503#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1504#[cfg_attr(test, assert_instr(vpmulhuw))]
1505#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1506pub const fn _mm256_mask_mulhi_epu16(
1507    src: __m256i,
1508    k: __mmask16,
1509    a: __m256i,
1510    b: __m256i,
1511) -> __m256i {
1512    unsafe {
1513        let mul = _mm256_mulhi_epu16(a, b).as_u16x16();
1514        transmute(simd_select_bitmask(k, mul, src.as_u16x16()))
1515    }
1516}
1517
1518/// Multiply the packed unsigned 16-bit integers in a and b, producing intermediate 32-bit integers, and store the high 16 bits of the intermediate integers in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
1519///
1520/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_mulhi_epu16&expand=3969)
1521#[inline]
1522#[target_feature(enable = "avx512bw,avx512vl")]
1523#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1524#[cfg_attr(test, assert_instr(vpmulhuw))]
1525#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1526pub const fn _mm256_maskz_mulhi_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
1527    unsafe {
1528        let mul = _mm256_mulhi_epu16(a, b).as_u16x16();
1529        transmute(simd_select_bitmask(k, mul, u16x16::ZERO))
1530    }
1531}
1532
1533/// Multiply the packed unsigned 16-bit integers in a and b, producing intermediate 32-bit integers, and store the high 16 bits of the intermediate integers in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
1534///
1535/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_mulhi_epu16&expand=3965)
1536#[inline]
1537#[target_feature(enable = "avx512bw,avx512vl")]
1538#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1539#[cfg_attr(test, assert_instr(vpmulhuw))]
1540#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1541pub const fn _mm_mask_mulhi_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
1542    unsafe {
1543        let mul = _mm_mulhi_epu16(a, b).as_u16x8();
1544        transmute(simd_select_bitmask(k, mul, src.as_u16x8()))
1545    }
1546}
1547
1548/// Multiply the packed unsigned 16-bit integers in a and b, producing intermediate 32-bit integers, and store the high 16 bits of the intermediate integers in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
1549///
1550/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_mulhi_epu16&expand=3966)
1551#[inline]
1552#[target_feature(enable = "avx512bw,avx512vl")]
1553#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1554#[cfg_attr(test, assert_instr(vpmulhuw))]
1555#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1556pub const fn _mm_maskz_mulhi_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
1557    unsafe {
1558        let mul = _mm_mulhi_epu16(a, b).as_u16x8();
1559        transmute(simd_select_bitmask(k, mul, u16x8::ZERO))
1560    }
1561}
1562
1563/// Multiply the packed signed 16-bit integers in a and b, producing intermediate 32-bit integers, and store the high 16 bits of the intermediate integers in dst.
1564///
1565/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mulhi_epi16&expand=3962)
1566#[inline]
1567#[target_feature(enable = "avx512bw")]
1568#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1569#[cfg_attr(test, assert_instr(vpmulhw))]
1570#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1571pub const fn _mm512_mulhi_epi16(a: __m512i, b: __m512i) -> __m512i {
1572    unsafe {
1573        let a = simd_cast::<_, i32x32>(a.as_i16x32());
1574        let b = simd_cast::<_, i32x32>(b.as_i16x32());
1575        let r = simd_shr(simd_mul(a, b), i32x32::splat(16));
1576        transmute(simd_cast::<i32x32, i16x32>(r))
1577    }
1578}
1579
1580/// Multiply the packed signed 16-bit integers in a and b, producing intermediate 32-bit integers, and store the high 16 bits of the intermediate integers in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
1581///
1582/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_mulhi_epi16&expand=3960)
1583#[inline]
1584#[target_feature(enable = "avx512bw")]
1585#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1586#[cfg_attr(test, assert_instr(vpmulhw))]
1587#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1588pub const fn _mm512_mask_mulhi_epi16(
1589    src: __m512i,
1590    k: __mmask32,
1591    a: __m512i,
1592    b: __m512i,
1593) -> __m512i {
1594    unsafe {
1595        let mul = _mm512_mulhi_epi16(a, b).as_i16x32();
1596        transmute(simd_select_bitmask(k, mul, src.as_i16x32()))
1597    }
1598}
1599
1600/// Multiply the packed signed 16-bit integers in a and b, producing intermediate 32-bit integers, and store the high 16 bits of the intermediate integers in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
1601///
1602/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_mulhi_epi16&expand=3961)
1603#[inline]
1604#[target_feature(enable = "avx512bw")]
1605#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1606#[cfg_attr(test, assert_instr(vpmulhw))]
1607#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1608pub const fn _mm512_maskz_mulhi_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
1609    unsafe {
1610        let mul = _mm512_mulhi_epi16(a, b).as_i16x32();
1611        transmute(simd_select_bitmask(k, mul, i16x32::ZERO))
1612    }
1613}
1614
1615/// Multiply the packed signed 16-bit integers in a and b, producing intermediate 32-bit integers, and store the high 16 bits of the intermediate integers in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
1616///
1617/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_mulhi_epi16&expand=3957)
1618#[inline]
1619#[target_feature(enable = "avx512bw,avx512vl")]
1620#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1621#[cfg_attr(test, assert_instr(vpmulhw))]
1622#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1623pub const fn _mm256_mask_mulhi_epi16(
1624    src: __m256i,
1625    k: __mmask16,
1626    a: __m256i,
1627    b: __m256i,
1628) -> __m256i {
1629    unsafe {
1630        let mul = _mm256_mulhi_epi16(a, b).as_i16x16();
1631        transmute(simd_select_bitmask(k, mul, src.as_i16x16()))
1632    }
1633}
1634
1635/// Multiply the packed signed 16-bit integers in a and b, producing intermediate 32-bit integers, and store the high 16 bits of the intermediate integers in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
1636///
1637/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_mulhi_epi16&expand=3958)
1638#[inline]
1639#[target_feature(enable = "avx512bw,avx512vl")]
1640#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1641#[cfg_attr(test, assert_instr(vpmulhw))]
1642#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1643pub const fn _mm256_maskz_mulhi_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
1644    unsafe {
1645        let mul = _mm256_mulhi_epi16(a, b).as_i16x16();
1646        transmute(simd_select_bitmask(k, mul, i16x16::ZERO))
1647    }
1648}
1649
1650/// Multiply the packed signed 16-bit integers in a and b, producing intermediate 32-bit integers, and store the high 16 bits of the intermediate integers in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
1651///
1652/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_mulhi_epi16&expand=3954)
1653#[inline]
1654#[target_feature(enable = "avx512bw,avx512vl")]
1655#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1656#[cfg_attr(test, assert_instr(vpmulhw))]
1657#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1658pub const fn _mm_mask_mulhi_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
1659    unsafe {
1660        let mul = _mm_mulhi_epi16(a, b).as_i16x8();
1661        transmute(simd_select_bitmask(k, mul, src.as_i16x8()))
1662    }
1663}
1664
1665/// Multiply the packed signed 16-bit integers in a and b, producing intermediate 32-bit integers, and store the high 16 bits of the intermediate integers in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
1666///
1667/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_mulhi_epi16&expand=3955)
1668#[inline]
1669#[target_feature(enable = "avx512bw,avx512vl")]
1670#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1671#[cfg_attr(test, assert_instr(vpmulhw))]
1672#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1673pub const fn _mm_maskz_mulhi_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
1674    unsafe {
1675        let mul = _mm_mulhi_epi16(a, b).as_i16x8();
1676        transmute(simd_select_bitmask(k, mul, i16x8::ZERO))
1677    }
1678}
1679
1680/// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Truncate each intermediate integer to the 18 most significant bits, round by adding 1, and store bits \[16:1\] to dst.
1681///
1682/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mulhrs_epi16&expand=3986)
1683#[inline]
1684#[target_feature(enable = "avx512bw")]
1685#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1686#[cfg_attr(test, assert_instr(vpmulhrsw))]
1687pub fn _mm512_mulhrs_epi16(a: __m512i, b: __m512i) -> __m512i {
1688    unsafe { transmute(vpmulhrsw(a.as_i16x32(), b.as_i16x32())) }
1689}
1690
1691/// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Truncate each intermediate integer to the 18 most significant bits, round by adding 1, and store bits \[16:1\] to dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
1692///
1693/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_mulhrs_epi16&expand=3984)
1694#[inline]
1695#[target_feature(enable = "avx512bw")]
1696#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1697#[cfg_attr(test, assert_instr(vpmulhrsw))]
1698pub fn _mm512_mask_mulhrs_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
1699    unsafe {
1700        let mul = _mm512_mulhrs_epi16(a, b).as_i16x32();
1701        transmute(simd_select_bitmask(k, mul, src.as_i16x32()))
1702    }
1703}
1704
1705/// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Truncate each intermediate integer to the 18 most significant bits, round by adding 1, and store bits \[16:1\] to dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
1706///
1707/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_mulhrs_epi16&expand=3985)
1708#[inline]
1709#[target_feature(enable = "avx512bw")]
1710#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1711#[cfg_attr(test, assert_instr(vpmulhrsw))]
1712pub fn _mm512_maskz_mulhrs_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
1713    unsafe {
1714        let mul = _mm512_mulhrs_epi16(a, b).as_i16x32();
1715        transmute(simd_select_bitmask(k, mul, i16x32::ZERO))
1716    }
1717}
1718
1719/// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Truncate each intermediate integer to the 18 most significant bits, round by adding 1, and store bits \[16:1\] to dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
1720///
1721/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_mulhrs_epi16&expand=3981)
1722#[inline]
1723#[target_feature(enable = "avx512bw,avx512vl")]
1724#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1725#[cfg_attr(test, assert_instr(vpmulhrsw))]
1726pub fn _mm256_mask_mulhrs_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
1727    unsafe {
1728        let mul = _mm256_mulhrs_epi16(a, b).as_i16x16();
1729        transmute(simd_select_bitmask(k, mul, src.as_i16x16()))
1730    }
1731}
1732
1733/// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Truncate each intermediate integer to the 18 most significant bits, round by adding 1, and store bits \[16:1\] to dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
1734///
1735/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_mulhrs_epi16&expand=3982)
1736#[inline]
1737#[target_feature(enable = "avx512bw,avx512vl")]
1738#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1739#[cfg_attr(test, assert_instr(vpmulhrsw))]
1740pub fn _mm256_maskz_mulhrs_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
1741    unsafe {
1742        let mul = _mm256_mulhrs_epi16(a, b).as_i16x16();
1743        transmute(simd_select_bitmask(k, mul, i16x16::ZERO))
1744    }
1745}
1746
1747/// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Truncate each intermediate integer to the 18 most significant bits, round by adding 1, and store bits \[16:1\] to dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
1748///
1749/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_mulhrs_epi16&expand=3978)
1750#[inline]
1751#[target_feature(enable = "avx512bw,avx512vl")]
1752#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1753#[cfg_attr(test, assert_instr(vpmulhrsw))]
1754pub fn _mm_mask_mulhrs_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
1755    unsafe {
1756        let mul = _mm_mulhrs_epi16(a, b).as_i16x8();
1757        transmute(simd_select_bitmask(k, mul, src.as_i16x8()))
1758    }
1759}
1760
1761/// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Truncate each intermediate integer to the 18 most significant bits, round by adding 1, and store bits \[16:1\] to dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
1762///
1763/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_mulhrs_epi16&expand=3979)
1764#[inline]
1765#[target_feature(enable = "avx512bw,avx512vl")]
1766#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1767#[cfg_attr(test, assert_instr(vpmulhrsw))]
1768pub fn _mm_maskz_mulhrs_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
1769    unsafe {
1770        let mul = _mm_mulhrs_epi16(a, b).as_i16x8();
1771        transmute(simd_select_bitmask(k, mul, i16x8::ZERO))
1772    }
1773}
1774
1775/// Multiply the packed 16-bit integers in a and b, producing intermediate 32-bit integers, and store the low 16 bits of the intermediate integers in dst.
1776///
1777/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mullo_epi16&expand=3996)
1778#[inline]
1779#[target_feature(enable = "avx512bw")]
1780#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1781#[cfg_attr(test, assert_instr(vpmullw))]
1782#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1783pub const fn _mm512_mullo_epi16(a: __m512i, b: __m512i) -> __m512i {
1784    unsafe { transmute(simd_mul(a.as_i16x32(), b.as_i16x32())) }
1785}
1786
1787/// Multiply the packed 16-bit integers in a and b, producing intermediate 32-bit integers, and store the low 16 bits of the intermediate integers in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
1788///
1789/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_mullo_epi16&expand=3994)
1790#[inline]
1791#[target_feature(enable = "avx512bw")]
1792#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1793#[cfg_attr(test, assert_instr(vpmullw))]
1794#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1795pub const fn _mm512_mask_mullo_epi16(
1796    src: __m512i,
1797    k: __mmask32,
1798    a: __m512i,
1799    b: __m512i,
1800) -> __m512i {
1801    unsafe {
1802        let mul = _mm512_mullo_epi16(a, b).as_i16x32();
1803        transmute(simd_select_bitmask(k, mul, src.as_i16x32()))
1804    }
1805}
1806
1807/// Multiply the packed 16-bit integers in a and b, producing intermediate 32-bit integers, and store the low 16 bits of the intermediate integers in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
1808///
1809/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_mullo_epi16&expand=3995)
1810#[inline]
1811#[target_feature(enable = "avx512bw")]
1812#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1813#[cfg_attr(test, assert_instr(vpmullw))]
1814#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1815pub const fn _mm512_maskz_mullo_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
1816    unsafe {
1817        let mul = _mm512_mullo_epi16(a, b).as_i16x32();
1818        transmute(simd_select_bitmask(k, mul, i16x32::ZERO))
1819    }
1820}
1821
1822/// Multiply the packed 16-bit integers in a and b, producing intermediate 32-bit integers, and store the low 16 bits of the intermediate integers in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
1823///
1824/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_mullo_epi16&expand=3991)
1825#[inline]
1826#[target_feature(enable = "avx512bw,avx512vl")]
1827#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1828#[cfg_attr(test, assert_instr(vpmullw))]
1829#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1830pub const fn _mm256_mask_mullo_epi16(
1831    src: __m256i,
1832    k: __mmask16,
1833    a: __m256i,
1834    b: __m256i,
1835) -> __m256i {
1836    unsafe {
1837        let mul = _mm256_mullo_epi16(a, b).as_i16x16();
1838        transmute(simd_select_bitmask(k, mul, src.as_i16x16()))
1839    }
1840}
1841
1842/// Multiply the packed 16-bit integers in a and b, producing intermediate 32-bit integers, and store the low 16 bits of the intermediate integers in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
1843///
1844/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_mullo_epi16&expand=3992)
1845#[inline]
1846#[target_feature(enable = "avx512bw,avx512vl")]
1847#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1848#[cfg_attr(test, assert_instr(vpmullw))]
1849#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1850pub const fn _mm256_maskz_mullo_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
1851    unsafe {
1852        let mul = _mm256_mullo_epi16(a, b).as_i16x16();
1853        transmute(simd_select_bitmask(k, mul, i16x16::ZERO))
1854    }
1855}
1856
1857/// Multiply the packed 16-bit integers in a and b, producing intermediate 32-bit integers, and store the low 16 bits of the intermediate integers in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
1858///
1859/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_mullo_epi16&expand=3988)
1860#[inline]
1861#[target_feature(enable = "avx512bw,avx512vl")]
1862#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1863#[cfg_attr(test, assert_instr(vpmullw))]
1864#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1865pub const fn _mm_mask_mullo_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
1866    unsafe {
1867        let mul = _mm_mullo_epi16(a, b).as_i16x8();
1868        transmute(simd_select_bitmask(k, mul, src.as_i16x8()))
1869    }
1870}
1871
1872/// Multiply the packed 16-bit integers in a and b, producing intermediate 32-bit integers, and store the low 16 bits of the intermediate integers in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
1873///
1874/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_mullo_epi16&expand=3989)
1875#[inline]
1876#[target_feature(enable = "avx512bw,avx512vl")]
1877#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1878#[cfg_attr(test, assert_instr(vpmullw))]
1879#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1880pub const fn _mm_maskz_mullo_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
1881    unsafe {
1882        let mul = _mm_mullo_epi16(a, b).as_i16x8();
1883        transmute(simd_select_bitmask(k, mul, i16x8::ZERO))
1884    }
1885}
1886
1887/// Compare packed unsigned 16-bit integers in a and b, and store packed maximum values in dst.
1888///
1889/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_max_epu16&expand=3609)
1890#[inline]
1891#[target_feature(enable = "avx512bw")]
1892#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1893#[cfg_attr(test, assert_instr(vpmaxuw))]
1894#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1895pub const fn _mm512_max_epu16(a: __m512i, b: __m512i) -> __m512i {
1896    unsafe { simd_imax(a.as_u16x32(), b.as_u16x32()).as_m512i() }
1897}
1898
1899/// Compare packed unsigned 16-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
1900///
1901/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_max_epu16&expand=3607)
1902#[inline]
1903#[target_feature(enable = "avx512bw")]
1904#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1905#[cfg_attr(test, assert_instr(vpmaxuw))]
1906#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1907pub const fn _mm512_mask_max_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
1908    unsafe {
1909        let max = _mm512_max_epu16(a, b).as_u16x32();
1910        transmute(simd_select_bitmask(k, max, src.as_u16x32()))
1911    }
1912}
1913
1914/// Compare packed unsigned 16-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
1915///
1916/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_max_epu16&expand=3608)
1917#[inline]
1918#[target_feature(enable = "avx512bw")]
1919#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1920#[cfg_attr(test, assert_instr(vpmaxuw))]
1921#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1922pub const fn _mm512_maskz_max_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
1923    unsafe {
1924        let max = _mm512_max_epu16(a, b).as_u16x32();
1925        transmute(simd_select_bitmask(k, max, u16x32::ZERO))
1926    }
1927}
1928
1929/// Compare packed unsigned 16-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
1930///
1931/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_max_epu16&expand=3604)
1932#[inline]
1933#[target_feature(enable = "avx512bw,avx512vl")]
1934#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1935#[cfg_attr(test, assert_instr(vpmaxuw))]
1936#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1937pub const fn _mm256_mask_max_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
1938    unsafe {
1939        let max = _mm256_max_epu16(a, b).as_u16x16();
1940        transmute(simd_select_bitmask(k, max, src.as_u16x16()))
1941    }
1942}
1943
1944/// Compare packed unsigned 16-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
1945///
1946/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_max_epu16&expand=3605)
1947#[inline]
1948#[target_feature(enable = "avx512bw,avx512vl")]
1949#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1950#[cfg_attr(test, assert_instr(vpmaxuw))]
1951#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1952pub const fn _mm256_maskz_max_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
1953    unsafe {
1954        let max = _mm256_max_epu16(a, b).as_u16x16();
1955        transmute(simd_select_bitmask(k, max, u16x16::ZERO))
1956    }
1957}
1958
1959/// Compare packed unsigned 16-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
1960///
1961/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_max_epu16&expand=3601)
1962#[inline]
1963#[target_feature(enable = "avx512bw,avx512vl")]
1964#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1965#[cfg_attr(test, assert_instr(vpmaxuw))]
1966#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1967pub const fn _mm_mask_max_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
1968    unsafe {
1969        let max = _mm_max_epu16(a, b).as_u16x8();
1970        transmute(simd_select_bitmask(k, max, src.as_u16x8()))
1971    }
1972}
1973
1974/// Compare packed unsigned 16-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
1975///
1976/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_max_epu16&expand=3602)
1977#[inline]
1978#[target_feature(enable = "avx512bw,avx512vl")]
1979#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1980#[cfg_attr(test, assert_instr(vpmaxuw))]
1981#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1982pub const fn _mm_maskz_max_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
1983    unsafe {
1984        let max = _mm_max_epu16(a, b).as_u16x8();
1985        transmute(simd_select_bitmask(k, max, u16x8::ZERO))
1986    }
1987}
1988
1989/// Compare packed unsigned 8-bit integers in a and b, and store packed maximum values in dst.
1990///
1991/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_max_epu8&expand=3636)
1992#[inline]
1993#[target_feature(enable = "avx512bw")]
1994#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1995#[cfg_attr(test, assert_instr(vpmaxub))]
1996#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1997pub const fn _mm512_max_epu8(a: __m512i, b: __m512i) -> __m512i {
1998    unsafe { simd_imax(a.as_u8x64(), b.as_u8x64()).as_m512i() }
1999}
2000
2001/// Compare packed unsigned 8-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
2002///
2003/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_max_epu8&expand=3634)
2004#[inline]
2005#[target_feature(enable = "avx512bw")]
2006#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2007#[cfg_attr(test, assert_instr(vpmaxub))]
2008#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2009pub const fn _mm512_mask_max_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
2010    unsafe {
2011        let max = _mm512_max_epu8(a, b).as_u8x64();
2012        transmute(simd_select_bitmask(k, max, src.as_u8x64()))
2013    }
2014}
2015
2016/// Compare packed unsigned 8-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
2017///
2018/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_max_epu8&expand=3635)
2019#[inline]
2020#[target_feature(enable = "avx512bw")]
2021#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2022#[cfg_attr(test, assert_instr(vpmaxub))]
2023#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2024pub const fn _mm512_maskz_max_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
2025    unsafe {
2026        let max = _mm512_max_epu8(a, b).as_u8x64();
2027        transmute(simd_select_bitmask(k, max, u8x64::ZERO))
2028    }
2029}
2030
2031/// Compare packed unsigned 8-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
2032///
2033/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_max_epu8&expand=3631)
2034#[inline]
2035#[target_feature(enable = "avx512bw,avx512vl")]
2036#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2037#[cfg_attr(test, assert_instr(vpmaxub))]
2038#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2039pub const fn _mm256_mask_max_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
2040    unsafe {
2041        let max = _mm256_max_epu8(a, b).as_u8x32();
2042        transmute(simd_select_bitmask(k, max, src.as_u8x32()))
2043    }
2044}
2045
2046/// Compare packed unsigned 8-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
2047///
2048/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_max_epu8&expand=3632)
2049#[inline]
2050#[target_feature(enable = "avx512bw,avx512vl")]
2051#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2052#[cfg_attr(test, assert_instr(vpmaxub))]
2053#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2054pub const fn _mm256_maskz_max_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
2055    unsafe {
2056        let max = _mm256_max_epu8(a, b).as_u8x32();
2057        transmute(simd_select_bitmask(k, max, u8x32::ZERO))
2058    }
2059}
2060
2061/// Compare packed unsigned 8-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
2062///
2063/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_max_epu8&expand=3628)
2064#[inline]
2065#[target_feature(enable = "avx512bw,avx512vl")]
2066#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2067#[cfg_attr(test, assert_instr(vpmaxub))]
2068#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2069pub const fn _mm_mask_max_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
2070    unsafe {
2071        let max = _mm_max_epu8(a, b).as_u8x16();
2072        transmute(simd_select_bitmask(k, max, src.as_u8x16()))
2073    }
2074}
2075
2076/// Compare packed unsigned 8-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
2077///
2078/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_max_epu8&expand=3629)
2079#[inline]
2080#[target_feature(enable = "avx512bw,avx512vl")]
2081#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2082#[cfg_attr(test, assert_instr(vpmaxub))]
2083#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2084pub const fn _mm_maskz_max_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
2085    unsafe {
2086        let max = _mm_max_epu8(a, b).as_u8x16();
2087        transmute(simd_select_bitmask(k, max, u8x16::ZERO))
2088    }
2089}
2090
2091/// Compare packed signed 16-bit integers in a and b, and store packed maximum values in dst.
2092///
2093/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_max_epi16&expand=3573)
2094#[inline]
2095#[target_feature(enable = "avx512bw")]
2096#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2097#[cfg_attr(test, assert_instr(vpmaxsw))]
2098#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2099pub const fn _mm512_max_epi16(a: __m512i, b: __m512i) -> __m512i {
2100    unsafe { simd_imax(a.as_i16x32(), b.as_i16x32()).as_m512i() }
2101}
2102
2103/// Compare packed signed 16-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
2104///
2105/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_max_epi16&expand=3571)
2106#[inline]
2107#[target_feature(enable = "avx512bw")]
2108#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2109#[cfg_attr(test, assert_instr(vpmaxsw))]
2110#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2111pub const fn _mm512_mask_max_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
2112    unsafe {
2113        let max = _mm512_max_epi16(a, b).as_i16x32();
2114        transmute(simd_select_bitmask(k, max, src.as_i16x32()))
2115    }
2116}
2117
2118/// Compare packed signed 16-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
2119///
2120/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_max_epi16&expand=3572)
2121#[inline]
2122#[target_feature(enable = "avx512bw")]
2123#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2124#[cfg_attr(test, assert_instr(vpmaxsw))]
2125#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2126pub const fn _mm512_maskz_max_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
2127    unsafe {
2128        let max = _mm512_max_epi16(a, b).as_i16x32();
2129        transmute(simd_select_bitmask(k, max, i16x32::ZERO))
2130    }
2131}
2132
2133/// Compare packed signed 16-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
2134///
2135/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_max_epi16&expand=3568)
2136#[inline]
2137#[target_feature(enable = "avx512bw,avx512vl")]
2138#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2139#[cfg_attr(test, assert_instr(vpmaxsw))]
2140#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2141pub const fn _mm256_mask_max_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
2142    unsafe {
2143        let max = _mm256_max_epi16(a, b).as_i16x16();
2144        transmute(simd_select_bitmask(k, max, src.as_i16x16()))
2145    }
2146}
2147
2148/// Compare packed signed 16-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
2149///
2150/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_max_epi16&expand=3569)
2151#[inline]
2152#[target_feature(enable = "avx512bw,avx512vl")]
2153#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2154#[cfg_attr(test, assert_instr(vpmaxsw))]
2155#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2156pub const fn _mm256_maskz_max_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
2157    unsafe {
2158        let max = _mm256_max_epi16(a, b).as_i16x16();
2159        transmute(simd_select_bitmask(k, max, i16x16::ZERO))
2160    }
2161}
2162
2163/// Compare packed signed 16-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
2164///
2165/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_max_epi16&expand=3565)
2166#[inline]
2167#[target_feature(enable = "avx512bw,avx512vl")]
2168#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2169#[cfg_attr(test, assert_instr(vpmaxsw))]
2170#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2171pub const fn _mm_mask_max_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
2172    unsafe {
2173        let max = _mm_max_epi16(a, b).as_i16x8();
2174        transmute(simd_select_bitmask(k, max, src.as_i16x8()))
2175    }
2176}
2177
2178/// Compare packed signed 16-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
2179///
2180/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_max_epi16&expand=3566)
2181#[inline]
2182#[target_feature(enable = "avx512bw,avx512vl")]
2183#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2184#[cfg_attr(test, assert_instr(vpmaxsw))]
2185#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2186pub const fn _mm_maskz_max_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
2187    unsafe {
2188        let max = _mm_max_epi16(a, b).as_i16x8();
2189        transmute(simd_select_bitmask(k, max, i16x8::ZERO))
2190    }
2191}
2192
2193/// Compare packed signed 8-bit integers in a and b, and store packed maximum values in dst.
2194///
2195/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_max_epi8&expand=3600)
2196#[inline]
2197#[target_feature(enable = "avx512bw")]
2198#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2199#[cfg_attr(test, assert_instr(vpmaxsb))]
2200#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2201pub const fn _mm512_max_epi8(a: __m512i, b: __m512i) -> __m512i {
2202    unsafe { simd_imax(a.as_i8x64(), b.as_i8x64()).as_m512i() }
2203}
2204
2205/// Compare packed signed 8-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
2206///
2207/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_max_epi8&expand=3598)
2208#[inline]
2209#[target_feature(enable = "avx512bw")]
2210#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2211#[cfg_attr(test, assert_instr(vpmaxsb))]
2212#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2213pub const fn _mm512_mask_max_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
2214    unsafe {
2215        let max = _mm512_max_epi8(a, b).as_i8x64();
2216        transmute(simd_select_bitmask(k, max, src.as_i8x64()))
2217    }
2218}
2219
2220/// Compare packed signed 8-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
2221///
2222/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_max_epi8&expand=3599)
2223#[inline]
2224#[target_feature(enable = "avx512bw")]
2225#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2226#[cfg_attr(test, assert_instr(vpmaxsb))]
2227#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2228pub const fn _mm512_maskz_max_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
2229    unsafe {
2230        let max = _mm512_max_epi8(a, b).as_i8x64();
2231        transmute(simd_select_bitmask(k, max, i8x64::ZERO))
2232    }
2233}
2234
2235/// Compare packed signed 8-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
2236///
2237/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_max_epi8&expand=3595)
2238#[inline]
2239#[target_feature(enable = "avx512bw,avx512vl")]
2240#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2241#[cfg_attr(test, assert_instr(vpmaxsb))]
2242#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2243pub const fn _mm256_mask_max_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
2244    unsafe {
2245        let max = _mm256_max_epi8(a, b).as_i8x32();
2246        transmute(simd_select_bitmask(k, max, src.as_i8x32()))
2247    }
2248}
2249
2250/// Compare packed signed 8-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
2251///
2252/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_max_epi8&expand=3596)
2253#[inline]
2254#[target_feature(enable = "avx512bw,avx512vl")]
2255#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2256#[cfg_attr(test, assert_instr(vpmaxsb))]
2257#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2258pub const fn _mm256_maskz_max_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
2259    unsafe {
2260        let max = _mm256_max_epi8(a, b).as_i8x32();
2261        transmute(simd_select_bitmask(k, max, i8x32::ZERO))
2262    }
2263}
2264
2265/// Compare packed signed 8-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
2266///
2267/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_max_epi8&expand=3592)
2268#[inline]
2269#[target_feature(enable = "avx512bw,avx512vl")]
2270#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2271#[cfg_attr(test, assert_instr(vpmaxsb))]
2272#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2273pub const fn _mm_mask_max_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
2274    unsafe {
2275        let max = _mm_max_epi8(a, b).as_i8x16();
2276        transmute(simd_select_bitmask(k, max, src.as_i8x16()))
2277    }
2278}
2279
2280/// Compare packed signed 8-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
2281///
2282/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_max_epi8&expand=3593)
2283#[inline]
2284#[target_feature(enable = "avx512bw,avx512vl")]
2285#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2286#[cfg_attr(test, assert_instr(vpmaxsb))]
2287#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2288pub const fn _mm_maskz_max_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
2289    unsafe {
2290        let max = _mm_max_epi8(a, b).as_i8x16();
2291        transmute(simd_select_bitmask(k, max, i8x16::ZERO))
2292    }
2293}
2294
2295/// Compare packed unsigned 16-bit integers in a and b, and store packed minimum values in dst.
2296///
2297/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_min_epu16&expand=3723)
2298#[inline]
2299#[target_feature(enable = "avx512bw")]
2300#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2301#[cfg_attr(test, assert_instr(vpminuw))]
2302#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2303pub const fn _mm512_min_epu16(a: __m512i, b: __m512i) -> __m512i {
2304    unsafe { simd_imin(a.as_u16x32(), b.as_u16x32()).as_m512i() }
2305}
2306
2307/// Compare packed unsigned 16-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
2308///
2309/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_min_epu16&expand=3721)
2310#[inline]
2311#[target_feature(enable = "avx512bw")]
2312#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2313#[cfg_attr(test, assert_instr(vpminuw))]
2314#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2315pub const fn _mm512_mask_min_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
2316    unsafe {
2317        let min = _mm512_min_epu16(a, b).as_u16x32();
2318        transmute(simd_select_bitmask(k, min, src.as_u16x32()))
2319    }
2320}
2321
2322/// Compare packed unsigned 16-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
2323///
2324/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_min_epu16&expand=3722)
2325#[inline]
2326#[target_feature(enable = "avx512bw")]
2327#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2328#[cfg_attr(test, assert_instr(vpminuw))]
2329#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2330pub const fn _mm512_maskz_min_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
2331    unsafe {
2332        let min = _mm512_min_epu16(a, b).as_u16x32();
2333        transmute(simd_select_bitmask(k, min, u16x32::ZERO))
2334    }
2335}
2336
2337/// Compare packed unsigned 16-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
2338///
2339/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_min_epu16&expand=3718)
2340#[inline]
2341#[target_feature(enable = "avx512bw,avx512vl")]
2342#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2343#[cfg_attr(test, assert_instr(vpminuw))]
2344#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2345pub const fn _mm256_mask_min_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
2346    unsafe {
2347        let min = _mm256_min_epu16(a, b).as_u16x16();
2348        transmute(simd_select_bitmask(k, min, src.as_u16x16()))
2349    }
2350}
2351
2352/// Compare packed unsigned 16-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
2353///
2354/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_min_epu16&expand=3719)
2355#[inline]
2356#[target_feature(enable = "avx512bw,avx512vl")]
2357#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2358#[cfg_attr(test, assert_instr(vpminuw))]
2359#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2360pub const fn _mm256_maskz_min_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
2361    unsafe {
2362        let min = _mm256_min_epu16(a, b).as_u16x16();
2363        transmute(simd_select_bitmask(k, min, u16x16::ZERO))
2364    }
2365}
2366
2367/// Compare packed unsigned 16-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
2368///
2369/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_min_epu16&expand=3715)
2370#[inline]
2371#[target_feature(enable = "avx512bw,avx512vl")]
2372#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2373#[cfg_attr(test, assert_instr(vpminuw))]
2374#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2375pub const fn _mm_mask_min_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
2376    unsafe {
2377        let min = _mm_min_epu16(a, b).as_u16x8();
2378        transmute(simd_select_bitmask(k, min, src.as_u16x8()))
2379    }
2380}
2381
2382/// Compare packed unsigned 16-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
2383///
2384/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_min_epu16&expand=3716)
2385#[inline]
2386#[target_feature(enable = "avx512bw,avx512vl")]
2387#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2388#[cfg_attr(test, assert_instr(vpminuw))]
2389#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2390pub const fn _mm_maskz_min_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
2391    unsafe {
2392        let min = _mm_min_epu16(a, b).as_u16x8();
2393        transmute(simd_select_bitmask(k, min, u16x8::ZERO))
2394    }
2395}
2396
2397/// Compare packed unsigned 8-bit integers in a and b, and store packed minimum values in dst.
2398///
2399/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_min_epu8&expand=3750)
2400#[inline]
2401#[target_feature(enable = "avx512bw")]
2402#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2403#[cfg_attr(test, assert_instr(vpminub))]
2404#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2405pub const fn _mm512_min_epu8(a: __m512i, b: __m512i) -> __m512i {
2406    unsafe { simd_imin(a.as_u8x64(), b.as_u8x64()).as_m512i() }
2407}
2408
2409/// Compare packed unsigned 8-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
2410///
2411/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_min_epu8&expand=3748)
2412#[inline]
2413#[target_feature(enable = "avx512bw")]
2414#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2415#[cfg_attr(test, assert_instr(vpminub))]
2416#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2417pub const fn _mm512_mask_min_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
2418    unsafe {
2419        let min = _mm512_min_epu8(a, b).as_u8x64();
2420        transmute(simd_select_bitmask(k, min, src.as_u8x64()))
2421    }
2422}
2423
2424/// Compare packed unsigned 8-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
2425///
2426/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_min_epu8&expand=3749)
2427#[inline]
2428#[target_feature(enable = "avx512bw")]
2429#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2430#[cfg_attr(test, assert_instr(vpminub))]
2431#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2432pub const fn _mm512_maskz_min_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
2433    unsafe {
2434        let min = _mm512_min_epu8(a, b).as_u8x64();
2435        transmute(simd_select_bitmask(k, min, u8x64::ZERO))
2436    }
2437}
2438
2439/// Compare packed unsigned 8-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
2440///
2441/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_min_epu8&expand=3745)
2442#[inline]
2443#[target_feature(enable = "avx512bw,avx512vl")]
2444#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2445#[cfg_attr(test, assert_instr(vpminub))]
2446#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2447pub const fn _mm256_mask_min_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
2448    unsafe {
2449        let min = _mm256_min_epu8(a, b).as_u8x32();
2450        transmute(simd_select_bitmask(k, min, src.as_u8x32()))
2451    }
2452}
2453
2454/// Compare packed unsigned 8-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
2455///
2456/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_min_epu8&expand=3746)
2457#[inline]
2458#[target_feature(enable = "avx512bw,avx512vl")]
2459#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2460#[cfg_attr(test, assert_instr(vpminub))]
2461#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2462pub const fn _mm256_maskz_min_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
2463    unsafe {
2464        let min = _mm256_min_epu8(a, b).as_u8x32();
2465        transmute(simd_select_bitmask(k, min, u8x32::ZERO))
2466    }
2467}
2468
2469/// Compare packed unsigned 8-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
2470///
2471/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_min_epu8&expand=3742)
2472#[inline]
2473#[target_feature(enable = "avx512bw,avx512vl")]
2474#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2475#[cfg_attr(test, assert_instr(vpminub))]
2476#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2477pub const fn _mm_mask_min_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
2478    unsafe {
2479        let min = _mm_min_epu8(a, b).as_u8x16();
2480        transmute(simd_select_bitmask(k, min, src.as_u8x16()))
2481    }
2482}
2483
2484/// Compare packed unsigned 8-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
2485///
2486/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_min_epu8&expand=3743)
2487#[inline]
2488#[target_feature(enable = "avx512bw,avx512vl")]
2489#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2490#[cfg_attr(test, assert_instr(vpminub))]
2491#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2492pub const fn _mm_maskz_min_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
2493    unsafe {
2494        let min = _mm_min_epu8(a, b).as_u8x16();
2495        transmute(simd_select_bitmask(k, min, u8x16::ZERO))
2496    }
2497}
2498
2499/// Compare packed signed 16-bit integers in a and b, and store packed minimum values in dst.
2500///
2501/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_min_epi16&expand=3687)
2502#[inline]
2503#[target_feature(enable = "avx512bw")]
2504#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2505#[cfg_attr(test, assert_instr(vpminsw))]
2506#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2507pub const fn _mm512_min_epi16(a: __m512i, b: __m512i) -> __m512i {
2508    unsafe { simd_imin(a.as_i16x32(), b.as_i16x32()).as_m512i() }
2509}
2510
2511/// Compare packed signed 16-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
2512///
2513/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_min_epi16&expand=3685)
2514#[inline]
2515#[target_feature(enable = "avx512bw")]
2516#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2517#[cfg_attr(test, assert_instr(vpminsw))]
2518#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2519pub const fn _mm512_mask_min_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
2520    unsafe {
2521        let min = _mm512_min_epi16(a, b).as_i16x32();
2522        transmute(simd_select_bitmask(k, min, src.as_i16x32()))
2523    }
2524}
2525
2526/// Compare packed signed 16-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
2527///
2528/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_min_epi16&expand=3686)
2529#[inline]
2530#[target_feature(enable = "avx512bw")]
2531#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2532#[cfg_attr(test, assert_instr(vpminsw))]
2533#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2534pub const fn _mm512_maskz_min_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
2535    unsafe {
2536        let min = _mm512_min_epi16(a, b).as_i16x32();
2537        transmute(simd_select_bitmask(k, min, i16x32::ZERO))
2538    }
2539}
2540
2541/// Compare packed signed 16-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
2542///
2543/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_min_epi16&expand=3682)
2544#[inline]
2545#[target_feature(enable = "avx512bw,avx512vl")]
2546#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2547#[cfg_attr(test, assert_instr(vpminsw))]
2548#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2549pub const fn _mm256_mask_min_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
2550    unsafe {
2551        let min = _mm256_min_epi16(a, b).as_i16x16();
2552        transmute(simd_select_bitmask(k, min, src.as_i16x16()))
2553    }
2554}
2555
2556/// Compare packed signed 16-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
2557///
2558/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_min_epi16&expand=3683)
2559#[inline]
2560#[target_feature(enable = "avx512bw,avx512vl")]
2561#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2562#[cfg_attr(test, assert_instr(vpminsw))]
2563#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2564pub const fn _mm256_maskz_min_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
2565    unsafe {
2566        let min = _mm256_min_epi16(a, b).as_i16x16();
2567        transmute(simd_select_bitmask(k, min, i16x16::ZERO))
2568    }
2569}
2570
2571/// Compare packed signed 16-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
2572///
2573/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_min_epi16&expand=3679)
2574#[inline]
2575#[target_feature(enable = "avx512bw,avx512vl")]
2576#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2577#[cfg_attr(test, assert_instr(vpminsw))]
2578#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2579pub const fn _mm_mask_min_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
2580    unsafe {
2581        let min = _mm_min_epi16(a, b).as_i16x8();
2582        transmute(simd_select_bitmask(k, min, src.as_i16x8()))
2583    }
2584}
2585
2586/// Compare packed signed 16-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
2587///
2588/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_min_epi16&expand=3680)
2589#[inline]
2590#[target_feature(enable = "avx512bw,avx512vl")]
2591#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2592#[cfg_attr(test, assert_instr(vpminsw))]
2593#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2594pub const fn _mm_maskz_min_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
2595    unsafe {
2596        let min = _mm_min_epi16(a, b).as_i16x8();
2597        transmute(simd_select_bitmask(k, min, i16x8::ZERO))
2598    }
2599}
2600
2601/// Compare packed signed 8-bit integers in a and b, and store packed minimum values in dst.
2602///
2603/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_min_epi8&expand=3714)
2604#[inline]
2605#[target_feature(enable = "avx512bw")]
2606#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2607#[cfg_attr(test, assert_instr(vpminsb))]
2608#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2609pub const fn _mm512_min_epi8(a: __m512i, b: __m512i) -> __m512i {
2610    unsafe { simd_imin(a.as_i8x64(), b.as_i8x64()).as_m512i() }
2611}
2612
2613/// Compare packed signed 8-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
2614///
2615/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_min_epi8&expand=3712)
2616#[inline]
2617#[target_feature(enable = "avx512bw")]
2618#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2619#[cfg_attr(test, assert_instr(vpminsb))]
2620#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2621pub const fn _mm512_mask_min_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
2622    unsafe {
2623        let min = _mm512_min_epi8(a, b).as_i8x64();
2624        transmute(simd_select_bitmask(k, min, src.as_i8x64()))
2625    }
2626}
2627
2628/// Compare packed signed 8-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
2629///
2630/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_min_epi8&expand=3713)
2631#[inline]
2632#[target_feature(enable = "avx512bw")]
2633#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2634#[cfg_attr(test, assert_instr(vpminsb))]
2635#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2636pub const fn _mm512_maskz_min_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
2637    unsafe {
2638        let min = _mm512_min_epi8(a, b).as_i8x64();
2639        transmute(simd_select_bitmask(k, min, i8x64::ZERO))
2640    }
2641}
2642
2643/// Compare packed signed 8-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
2644///
2645/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_min_epi8&expand=3709)
2646#[inline]
2647#[target_feature(enable = "avx512bw,avx512vl")]
2648#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2649#[cfg_attr(test, assert_instr(vpminsb))]
2650#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2651pub const fn _mm256_mask_min_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
2652    unsafe {
2653        let min = _mm256_min_epi8(a, b).as_i8x32();
2654        transmute(simd_select_bitmask(k, min, src.as_i8x32()))
2655    }
2656}
2657
2658/// Compare packed signed 8-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
2659///
2660/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_min_epi8&expand=3710)
2661#[inline]
2662#[target_feature(enable = "avx512bw,avx512vl")]
2663#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2664#[cfg_attr(test, assert_instr(vpminsb))]
2665#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2666pub const fn _mm256_maskz_min_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
2667    unsafe {
2668        let min = _mm256_min_epi8(a, b).as_i8x32();
2669        transmute(simd_select_bitmask(k, min, i8x32::ZERO))
2670    }
2671}
2672
2673/// Compare packed signed 8-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
2674///
2675/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_min_epi8&expand=3706)
2676#[inline]
2677#[target_feature(enable = "avx512bw,avx512vl")]
2678#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2679#[cfg_attr(test, assert_instr(vpminsb))]
2680#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2681pub const fn _mm_mask_min_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
2682    unsafe {
2683        let min = _mm_min_epi8(a, b).as_i8x16();
2684        transmute(simd_select_bitmask(k, min, src.as_i8x16()))
2685    }
2686}
2687
2688/// Compare packed signed 8-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
2689///
2690/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_min_epi8&expand=3707)
2691#[inline]
2692#[target_feature(enable = "avx512bw,avx512vl")]
2693#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2694#[cfg_attr(test, assert_instr(vpminsb))]
2695#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2696pub const fn _mm_maskz_min_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
2697    unsafe {
2698        let min = _mm_min_epi8(a, b).as_i8x16();
2699        transmute(simd_select_bitmask(k, min, i8x16::ZERO))
2700    }
2701}
2702
2703/// Compare packed unsigned 16-bit integers in a and b for less-than, and store the results in mask vector k.
2704///
2705/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmplt_epu16_mask&expand=1050)
2706#[inline]
2707#[target_feature(enable = "avx512bw")]
2708#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2709#[cfg_attr(test, assert_instr(vpcmp))]
2710#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2711pub const fn _mm512_cmplt_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 {
2712    unsafe { simd_bitmask::<u16x32, _>(simd_lt(a.as_u16x32(), b.as_u16x32())) }
2713}
2714
2715/// Compare packed unsigned 16-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
2716///
2717/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmplt_epu16_mask&expand=1051)
2718#[inline]
2719#[target_feature(enable = "avx512bw")]
2720#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2721#[cfg_attr(test, assert_instr(vpcmp))]
2722#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2723pub const fn _mm512_mask_cmplt_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
2724    _mm512_mask_cmp_epu16_mask::<_MM_CMPINT_LT>(k1, a, b)
2725}
2726
2727/// Compare packed unsigned 16-bit integers in a and b for less-than, and store the results in mask vector k.
2728///
2729/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmplt_epu16_mask&expand=1050)
2730#[inline]
2731#[target_feature(enable = "avx512bw,avx512vl")]
2732#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2733#[cfg_attr(test, assert_instr(vpcmp))]
2734#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2735pub const fn _mm256_cmplt_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 {
2736    unsafe { simd_bitmask::<u16x16, _>(simd_lt(a.as_u16x16(), b.as_u16x16())) }
2737}
2738
2739/// Compare packed unsigned 16-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
2740///
2741/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmplt_epu16_mask&expand=1049)
2742#[inline]
2743#[target_feature(enable = "avx512bw,avx512vl")]
2744#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2745#[cfg_attr(test, assert_instr(vpcmp))]
2746#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2747pub const fn _mm256_mask_cmplt_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
2748    _mm256_mask_cmp_epu16_mask::<_MM_CMPINT_LT>(k1, a, b)
2749}
2750
2751/// Compare packed unsigned 16-bit integers in a and b for less-than, and store the results in mask vector k.
2752///
2753/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmplt_epu16_mask&expand=1018)
2754#[inline]
2755#[target_feature(enable = "avx512bw,avx512vl")]
2756#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2757#[cfg_attr(test, assert_instr(vpcmp))]
2758#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2759pub const fn _mm_cmplt_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 {
2760    unsafe { simd_bitmask::<u16x8, _>(simd_lt(a.as_u16x8(), b.as_u16x8())) }
2761}
2762
2763/// Compare packed unsigned 16-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
2764///
2765/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmplt_epu16_mask&expand=1019)
2766#[inline]
2767#[target_feature(enable = "avx512bw,avx512vl")]
2768#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2769#[cfg_attr(test, assert_instr(vpcmp))]
2770#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2771pub const fn _mm_mask_cmplt_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
2772    _mm_mask_cmp_epu16_mask::<_MM_CMPINT_LT>(k1, a, b)
2773}
2774
2775/// Compare packed unsigned 8-bit integers in a and b for less-than, and store the results in mask vector k.
2776///
2777/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=mm512_cmplt_epu8_mask&expand=1068)
2778#[inline]
2779#[target_feature(enable = "avx512bw")]
2780#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2781#[cfg_attr(test, assert_instr(vpcmp))]
2782#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2783pub const fn _mm512_cmplt_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 {
2784    unsafe { simd_bitmask::<u8x64, _>(simd_lt(a.as_u8x64(), b.as_u8x64())) }
2785}
2786
2787/// Compare packed unsigned 8-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
2788///
2789/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmplt_epu8_mask&expand=1069)
2790#[inline]
2791#[target_feature(enable = "avx512bw")]
2792#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2793#[cfg_attr(test, assert_instr(vpcmp))]
2794#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2795pub const fn _mm512_mask_cmplt_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
2796    _mm512_mask_cmp_epu8_mask::<_MM_CMPINT_LT>(k1, a, b)
2797}
2798
2799/// Compare packed unsigned 8-bit integers in a and b for less-than, and store the results in mask vector k.
2800///
2801/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmplt_epu8_mask&expand=1066)
2802#[inline]
2803#[target_feature(enable = "avx512bw,avx512vl")]
2804#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2805#[cfg_attr(test, assert_instr(vpcmp))]
2806#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2807pub const fn _mm256_cmplt_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 {
2808    unsafe { simd_bitmask::<u8x32, _>(simd_lt(a.as_u8x32(), b.as_u8x32())) }
2809}
2810
2811/// Compare packed unsigned 8-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
2812///
2813/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmplt_epu8_mask&expand=1067)
2814#[inline]
2815#[target_feature(enable = "avx512bw,avx512vl")]
2816#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2817#[cfg_attr(test, assert_instr(vpcmp))]
2818#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2819pub const fn _mm256_mask_cmplt_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
2820    _mm256_mask_cmp_epu8_mask::<_MM_CMPINT_LT>(k1, a, b)
2821}
2822
2823/// Compare packed unsigned 8-bit integers in a and b for less-than, and store the results in mask vector k.
2824///
2825/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmplt_epu8_mask&expand=1064)
2826#[inline]
2827#[target_feature(enable = "avx512bw,avx512vl")]
2828#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2829#[cfg_attr(test, assert_instr(vpcmp))]
2830#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2831pub const fn _mm_cmplt_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 {
2832    unsafe { simd_bitmask::<u8x16, _>(simd_lt(a.as_u8x16(), b.as_u8x16())) }
2833}
2834
2835/// Compare packed unsigned 8-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
2836///
2837/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmplt_epu8_mask&expand=1065)
2838#[inline]
2839#[target_feature(enable = "avx512bw,avx512vl")]
2840#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2841#[cfg_attr(test, assert_instr(vpcmp))]
2842#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2843pub const fn _mm_mask_cmplt_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
2844    _mm_mask_cmp_epu8_mask::<_MM_CMPINT_LT>(k1, a, b)
2845}
2846
2847/// Compare packed signed 16-bit integers in a and b for less-than, and store the results in mask vector k.
2848///
2849/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmplt_epi16_mask&expand=1022)
2850#[inline]
2851#[target_feature(enable = "avx512bw")]
2852#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2853#[cfg_attr(test, assert_instr(vpcmp))]
2854#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2855pub const fn _mm512_cmplt_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 {
2856    unsafe { simd_bitmask::<i16x32, _>(simd_lt(a.as_i16x32(), b.as_i16x32())) }
2857}
2858
2859/// Compare packed signed 16-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
2860///
2861/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmplt_epi16_mask&expand=1023)
2862#[inline]
2863#[target_feature(enable = "avx512bw")]
2864#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2865#[cfg_attr(test, assert_instr(vpcmp))]
2866#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2867pub const fn _mm512_mask_cmplt_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
2868    _mm512_mask_cmp_epi16_mask::<_MM_CMPINT_LT>(k1, a, b)
2869}
2870
2871/// Compare packed signed 16-bit integers in a and b for less-than, and store the results in mask vector k.
2872///
2873/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmplt_epi16_mask&expand=1020)
2874#[inline]
2875#[target_feature(enable = "avx512bw,avx512vl")]
2876#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2877#[cfg_attr(test, assert_instr(vpcmp))]
2878#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2879pub const fn _mm256_cmplt_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 {
2880    unsafe { simd_bitmask::<i16x16, _>(simd_lt(a.as_i16x16(), b.as_i16x16())) }
2881}
2882
2883/// Compare packed signed 16-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
2884///
2885/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmplt_epi16_mask&expand=1021)
2886#[inline]
2887#[target_feature(enable = "avx512bw,avx512vl")]
2888#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2889#[cfg_attr(test, assert_instr(vpcmp))]
2890#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2891pub const fn _mm256_mask_cmplt_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
2892    _mm256_mask_cmp_epi16_mask::<_MM_CMPINT_LT>(k1, a, b)
2893}
2894
2895/// Compare packed signed 16-bit integers in a and b for less-than, and store the results in mask vector k.
2896///
2897/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmplt_epi16_mask&expand=1018)
2898#[inline]
2899#[target_feature(enable = "avx512bw,avx512vl")]
2900#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2901#[cfg_attr(test, assert_instr(vpcmp))]
2902#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2903pub const fn _mm_cmplt_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 {
2904    unsafe { simd_bitmask::<i16x8, _>(simd_lt(a.as_i16x8(), b.as_i16x8())) }
2905}
2906
2907/// Compare packed signed 16-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
2908///
2909/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmplt_epi16_mask&expand=1019)
2910#[inline]
2911#[target_feature(enable = "avx512bw,avx512vl")]
2912#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2913#[cfg_attr(test, assert_instr(vpcmp))]
2914#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2915pub const fn _mm_mask_cmplt_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
2916    _mm_mask_cmp_epi16_mask::<_MM_CMPINT_LT>(k1, a, b)
2917}
2918
2919/// Compare packed signed 8-bit integers in a and b for less-than, and store the results in mask vector k.
2920///
2921/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmplt_epi8_mask&expand=1044)
2922#[inline]
2923#[target_feature(enable = "avx512bw")]
2924#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2925#[cfg_attr(test, assert_instr(vpcmp))]
2926#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2927pub const fn _mm512_cmplt_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 {
2928    unsafe { simd_bitmask::<i8x64, _>(simd_lt(a.as_i8x64(), b.as_i8x64())) }
2929}
2930
2931/// Compare packed signed 8-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
2932///
2933/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmplt_epi8_mask&expand=1045)
2934#[inline]
2935#[target_feature(enable = "avx512bw")]
2936#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2937#[cfg_attr(test, assert_instr(vpcmp))]
2938#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2939pub const fn _mm512_mask_cmplt_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
2940    _mm512_mask_cmp_epi8_mask::<_MM_CMPINT_LT>(k1, a, b)
2941}
2942
2943/// Compare packed signed 8-bit integers in a and b for less-than, and store the results in mask vector k.
2944///
2945/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmplt_epi8_mask&expand=1042)
2946#[inline]
2947#[target_feature(enable = "avx512bw,avx512vl")]
2948#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2949#[cfg_attr(test, assert_instr(vpcmp))]
2950#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2951pub const fn _mm256_cmplt_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 {
2952    unsafe { simd_bitmask::<i8x32, _>(simd_lt(a.as_i8x32(), b.as_i8x32())) }
2953}
2954
2955/// Compare packed signed 8-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
2956///
2957/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmplt_epi8_mask&expand=1043)
2958#[inline]
2959#[target_feature(enable = "avx512bw,avx512vl")]
2960#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2961#[cfg_attr(test, assert_instr(vpcmp))]
2962#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2963pub const fn _mm256_mask_cmplt_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
2964    _mm256_mask_cmp_epi8_mask::<_MM_CMPINT_LT>(k1, a, b)
2965}
2966
2967/// Compare packed signed 8-bit integers in a and b for less-than, and store the results in mask vector k.
2968///
2969/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmplt_epi8_mask&expand=1040)
2970#[inline]
2971#[target_feature(enable = "avx512bw,avx512vl")]
2972#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2973#[cfg_attr(test, assert_instr(vpcmp))]
2974#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2975pub const fn _mm_cmplt_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 {
2976    unsafe { simd_bitmask::<i8x16, _>(simd_lt(a.as_i8x16(), b.as_i8x16())) }
2977}
2978
2979/// Compare packed signed 8-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
2980///
2981/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmplt_epi8_mask&expand=1041)
2982#[inline]
2983#[target_feature(enable = "avx512bw,avx512vl")]
2984#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2985#[cfg_attr(test, assert_instr(vpcmp))]
2986#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2987pub const fn _mm_mask_cmplt_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
2988    _mm_mask_cmp_epi8_mask::<_MM_CMPINT_LT>(k1, a, b)
2989}
2990
2991/// Compare packed unsigned 16-bit integers in a and b for greater-than, and store the results in mask vector k.
2992///
2993/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpgt_epu16_mask&expand=927)
2994#[inline]
2995#[target_feature(enable = "avx512bw")]
2996#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2997#[cfg_attr(test, assert_instr(vpcmp))]
2998#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2999pub const fn _mm512_cmpgt_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 {
3000    unsafe { simd_bitmask::<u16x32, _>(simd_gt(a.as_u16x32(), b.as_u16x32())) }
3001}
3002
3003/// Compare packed unsigned 16-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3004///
3005/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpgt_epu16_mask&expand=928)
3006#[inline]
3007#[target_feature(enable = "avx512bw")]
3008#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3009#[cfg_attr(test, assert_instr(vpcmp))]
3010#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3011pub const fn _mm512_mask_cmpgt_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
3012    _mm512_mask_cmp_epu16_mask::<_MM_CMPINT_NLE>(k1, a, b)
3013}
3014
3015/// Compare packed unsigned 16-bit integers in a and b for greater-than, and store the results in mask vector k.
3016///
3017/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpgt_epu16_mask&expand=925)
3018#[inline]
3019#[target_feature(enable = "avx512bw,avx512vl")]
3020#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3021#[cfg_attr(test, assert_instr(vpcmp))]
3022#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3023pub const fn _mm256_cmpgt_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 {
3024    unsafe { simd_bitmask::<u16x16, _>(simd_gt(a.as_u16x16(), b.as_u16x16())) }
3025}
3026
3027/// Compare packed unsigned 16-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3028///
3029/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpgt_epu16_mask&expand=926)
3030#[inline]
3031#[target_feature(enable = "avx512bw,avx512vl")]
3032#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3033#[cfg_attr(test, assert_instr(vpcmp))]
3034#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3035pub const fn _mm256_mask_cmpgt_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
3036    _mm256_mask_cmp_epu16_mask::<_MM_CMPINT_NLE>(k1, a, b)
3037}
3038
3039/// Compare packed unsigned 16-bit integers in a and b for greater-than, and store the results in mask vector k.
3040///
3041/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpgt_epu16_mask&expand=923)
3042#[inline]
3043#[target_feature(enable = "avx512bw,avx512vl")]
3044#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3045#[cfg_attr(test, assert_instr(vpcmp))]
3046#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3047pub const fn _mm_cmpgt_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 {
3048    unsafe { simd_bitmask::<u16x8, _>(simd_gt(a.as_u16x8(), b.as_u16x8())) }
3049}
3050
3051/// Compare packed unsigned 16-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3052///
3053/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpgt_epu16_mask&expand=924)
3054#[inline]
3055#[target_feature(enable = "avx512bw,avx512vl")]
3056#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3057#[cfg_attr(test, assert_instr(vpcmp))]
3058#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3059pub const fn _mm_mask_cmpgt_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
3060    _mm_mask_cmp_epu16_mask::<_MM_CMPINT_NLE>(k1, a, b)
3061}
3062
3063/// Compare packed unsigned 8-bit integers in a and b for greater-than, and store the results in mask vector k.
3064///
3065/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpgt_epu8_mask&expand=945)
3066#[inline]
3067#[target_feature(enable = "avx512bw")]
3068#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3069#[cfg_attr(test, assert_instr(vpcmp))]
3070#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3071pub const fn _mm512_cmpgt_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 {
3072    unsafe { simd_bitmask::<u8x64, _>(simd_gt(a.as_u8x64(), b.as_u8x64())) }
3073}
3074
3075/// Compare packed unsigned 8-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3076///
3077/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpgt_epu8_mask&expand=946)
3078#[inline]
3079#[target_feature(enable = "avx512bw")]
3080#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3081#[cfg_attr(test, assert_instr(vpcmp))]
3082#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3083pub const fn _mm512_mask_cmpgt_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
3084    _mm512_mask_cmp_epu8_mask::<_MM_CMPINT_NLE>(k1, a, b)
3085}
3086
3087/// Compare packed unsigned 8-bit integers in a and b for greater-than, and store the results in mask vector k.
3088///
3089/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpgt_epu8_mask&expand=943)
3090#[inline]
3091#[target_feature(enable = "avx512bw,avx512vl")]
3092#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3093#[cfg_attr(test, assert_instr(vpcmp))]
3094#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3095pub const fn _mm256_cmpgt_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 {
3096    unsafe { simd_bitmask::<u8x32, _>(simd_gt(a.as_u8x32(), b.as_u8x32())) }
3097}
3098
3099/// Compare packed unsigned 8-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3100///
3101/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpgt_epu8_mask&expand=944)
3102#[inline]
3103#[target_feature(enable = "avx512bw,avx512vl")]
3104#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3105#[cfg_attr(test, assert_instr(vpcmp))]
3106#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3107pub const fn _mm256_mask_cmpgt_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
3108    _mm256_mask_cmp_epu8_mask::<_MM_CMPINT_NLE>(k1, a, b)
3109}
3110
3111/// Compare packed unsigned 8-bit integers in a and b for greater-than, and store the results in mask vector k.
3112///
3113/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpgt_epu8_mask&expand=941)
3114#[inline]
3115#[target_feature(enable = "avx512bw,avx512vl")]
3116#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3117#[cfg_attr(test, assert_instr(vpcmp))]
3118#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3119pub const fn _mm_cmpgt_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 {
3120    unsafe { simd_bitmask::<u8x16, _>(simd_gt(a.as_u8x16(), b.as_u8x16())) }
3121}
3122
3123/// Compare packed unsigned 8-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3124///
3125/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpgt_epu8_mask&expand=942)
3126#[inline]
3127#[target_feature(enable = "avx512bw,avx512vl")]
3128#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3129#[cfg_attr(test, assert_instr(vpcmp))]
3130#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3131pub const fn _mm_mask_cmpgt_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
3132    _mm_mask_cmp_epu8_mask::<_MM_CMPINT_NLE>(k1, a, b)
3133}
3134
3135/// Compare packed signed 16-bit integers in a and b for greater-than, and store the results in mask vector k.
3136///
3137/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpgt_epi16_mask&expand=897)
3138#[inline]
3139#[target_feature(enable = "avx512bw")]
3140#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3141#[cfg_attr(test, assert_instr(vpcmp))]
3142#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3143pub const fn _mm512_cmpgt_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 {
3144    unsafe { simd_bitmask::<i16x32, _>(simd_gt(a.as_i16x32(), b.as_i16x32())) }
3145}
3146
3147/// Compare packed signed 16-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3148///
3149/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpgt_epi16_mask&expand=898)
3150#[inline]
3151#[target_feature(enable = "avx512bw")]
3152#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3153#[cfg_attr(test, assert_instr(vpcmp))]
3154#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3155pub const fn _mm512_mask_cmpgt_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
3156    _mm512_mask_cmp_epi16_mask::<_MM_CMPINT_NLE>(k1, a, b)
3157}
3158
3159/// Compare packed signed 16-bit integers in a and b for greater-than, and store the results in mask vector k.
3160///
3161/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpgt_epi16_mask&expand=895)
3162#[inline]
3163#[target_feature(enable = "avx512bw,avx512vl")]
3164#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3165#[cfg_attr(test, assert_instr(vpcmp))]
3166#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3167pub const fn _mm256_cmpgt_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 {
3168    unsafe { simd_bitmask::<i16x16, _>(simd_gt(a.as_i16x16(), b.as_i16x16())) }
3169}
3170
3171/// Compare packed signed 16-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3172///
3173/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpgt_epi16_mask&expand=896)
3174#[inline]
3175#[target_feature(enable = "avx512bw,avx512vl")]
3176#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3177#[cfg_attr(test, assert_instr(vpcmp))]
3178#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3179pub const fn _mm256_mask_cmpgt_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
3180    _mm256_mask_cmp_epi16_mask::<_MM_CMPINT_NLE>(k1, a, b)
3181}
3182
3183/// Compare packed signed 16-bit integers in a and b for greater-than, and store the results in mask vector k.
3184///
3185/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpgt_epi16_mask&expand=893)
3186#[inline]
3187#[target_feature(enable = "avx512bw,avx512vl")]
3188#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3189#[cfg_attr(test, assert_instr(vpcmp))]
3190#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3191pub const fn _mm_cmpgt_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 {
3192    unsafe { simd_bitmask::<i16x8, _>(simd_gt(a.as_i16x8(), b.as_i16x8())) }
3193}
3194
3195/// Compare packed signed 16-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3196///
3197/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpgt_epi16_mask&expand=894)
3198#[inline]
3199#[target_feature(enable = "avx512bw,avx512vl")]
3200#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3201#[cfg_attr(test, assert_instr(vpcmp))]
3202#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3203pub const fn _mm_mask_cmpgt_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
3204    _mm_mask_cmp_epi16_mask::<_MM_CMPINT_NLE>(k1, a, b)
3205}
3206
3207/// Compare packed signed 8-bit integers in a and b for greater-than, and store the results in mask vector k.
3208///
3209/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpgt_epi8_mask&expand=921)
3210#[inline]
3211#[target_feature(enable = "avx512bw")]
3212#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3213#[cfg_attr(test, assert_instr(vpcmp))]
3214#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3215pub const fn _mm512_cmpgt_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 {
3216    unsafe { simd_bitmask::<i8x64, _>(simd_gt(a.as_i8x64(), b.as_i8x64())) }
3217}
3218
3219/// Compare packed signed 8-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3220///
3221/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpgt_epi8_mask&expand=922)
3222#[inline]
3223#[target_feature(enable = "avx512bw")]
3224#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3225#[cfg_attr(test, assert_instr(vpcmp))]
3226#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3227pub const fn _mm512_mask_cmpgt_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
3228    _mm512_mask_cmp_epi8_mask::<_MM_CMPINT_NLE>(k1, a, b)
3229}
3230
3231/// Compare packed signed 8-bit integers in a and b for greater-than, and store the results in mask vector k.
3232///
3233/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpgt_epi8_mask&expand=919)
3234#[inline]
3235#[target_feature(enable = "avx512bw,avx512vl")]
3236#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3237#[cfg_attr(test, assert_instr(vpcmp))]
3238#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3239pub const fn _mm256_cmpgt_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 {
3240    unsafe { simd_bitmask::<i8x32, _>(simd_gt(a.as_i8x32(), b.as_i8x32())) }
3241}
3242
3243/// Compare packed signed 8-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3244///
3245/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpgt_epi8_mask&expand=920)
3246#[inline]
3247#[target_feature(enable = "avx512bw,avx512vl")]
3248#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3249#[cfg_attr(test, assert_instr(vpcmp))]
3250#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3251pub const fn _mm256_mask_cmpgt_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
3252    _mm256_mask_cmp_epi8_mask::<_MM_CMPINT_NLE>(k1, a, b)
3253}
3254
3255/// Compare packed signed 8-bit integers in a and b for greater-than, and store the results in mask vector k.
3256///
3257/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpgt_epi8_mask&expand=917)
3258#[inline]
3259#[target_feature(enable = "avx512bw,avx512vl")]
3260#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3261#[cfg_attr(test, assert_instr(vpcmp))]
3262#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3263pub const fn _mm_cmpgt_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 {
3264    unsafe { simd_bitmask::<i8x16, _>(simd_gt(a.as_i8x16(), b.as_i8x16())) }
3265}
3266
3267/// Compare packed signed 8-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3268///
3269/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpgt_epi8_mask&expand=918)
3270#[inline]
3271#[target_feature(enable = "avx512bw,avx512vl")]
3272#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3273#[cfg_attr(test, assert_instr(vpcmp))]
3274#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3275pub const fn _mm_mask_cmpgt_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
3276    _mm_mask_cmp_epi8_mask::<_MM_CMPINT_NLE>(k1, a, b)
3277}
3278
3279/// Compare packed unsigned 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
3280///
3281/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmple_epu16_mask&expand=989)
3282#[inline]
3283#[target_feature(enable = "avx512bw")]
3284#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3285#[cfg_attr(test, assert_instr(vpcmp))]
3286#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3287pub const fn _mm512_cmple_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 {
3288    unsafe { simd_bitmask::<u16x32, _>(simd_le(a.as_u16x32(), b.as_u16x32())) }
3289}
3290
3291/// Compare packed unsigned 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3292///
3293/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmple_epu16_mask&expand=990)
3294#[inline]
3295#[target_feature(enable = "avx512bw")]
3296#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3297#[cfg_attr(test, assert_instr(vpcmp))]
3298#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3299pub const fn _mm512_mask_cmple_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
3300    _mm512_mask_cmp_epu16_mask::<_MM_CMPINT_LE>(k1, a, b)
3301}
3302
3303/// Compare packed unsigned 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
3304///
3305/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmple_epu16_mask&expand=987)
3306#[inline]
3307#[target_feature(enable = "avx512bw,avx512vl")]
3308#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3309#[cfg_attr(test, assert_instr(vpcmp))]
3310#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3311pub const fn _mm256_cmple_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 {
3312    unsafe { simd_bitmask::<u16x16, _>(simd_le(a.as_u16x16(), b.as_u16x16())) }
3313}
3314
3315/// Compare packed unsigned 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3316///
3317/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmple_epu16_mask&expand=988)
3318#[inline]
3319#[target_feature(enable = "avx512bw,avx512vl")]
3320#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3321#[cfg_attr(test, assert_instr(vpcmp))]
3322#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3323pub const fn _mm256_mask_cmple_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
3324    _mm256_mask_cmp_epu16_mask::<_MM_CMPINT_LE>(k1, a, b)
3325}
3326
3327/// Compare packed unsigned 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
3328///
3329/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmple_epu16_mask&expand=985)
3330#[inline]
3331#[target_feature(enable = "avx512bw,avx512vl")]
3332#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3333#[cfg_attr(test, assert_instr(vpcmp))]
3334#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3335pub const fn _mm_cmple_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 {
3336    unsafe { simd_bitmask::<u16x8, _>(simd_le(a.as_u16x8(), b.as_u16x8())) }
3337}
3338
3339/// Compare packed unsigned 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3340///
3341/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmple_epu16_mask&expand=986)
3342#[inline]
3343#[target_feature(enable = "avx512bw,avx512vl")]
3344#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3345#[cfg_attr(test, assert_instr(vpcmp))]
3346#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3347pub const fn _mm_mask_cmple_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
3348    _mm_mask_cmp_epu16_mask::<_MM_CMPINT_LE>(k1, a, b)
3349}
3350
3351/// Compare packed unsigned 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
3352///
3353/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmple_epu8_mask&expand=1007)
3354#[inline]
3355#[target_feature(enable = "avx512bw")]
3356#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3357#[cfg_attr(test, assert_instr(vpcmp))]
3358#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3359pub const fn _mm512_cmple_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 {
3360    unsafe { simd_bitmask::<u8x64, _>(simd_le(a.as_u8x64(), b.as_u8x64())) }
3361}
3362
3363/// Compare packed unsigned 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3364///
3365/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmple_epu8_mask&expand=1008)
3366#[inline]
3367#[target_feature(enable = "avx512bw")]
3368#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3369#[cfg_attr(test, assert_instr(vpcmp))]
3370#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3371pub const fn _mm512_mask_cmple_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
3372    _mm512_mask_cmp_epu8_mask::<_MM_CMPINT_LE>(k1, a, b)
3373}
3374
3375/// Compare packed unsigned 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
3376///
3377/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmple_epu8_mask&expand=1005)
3378#[inline]
3379#[target_feature(enable = "avx512bw,avx512vl")]
3380#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3381#[cfg_attr(test, assert_instr(vpcmp))]
3382#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3383pub const fn _mm256_cmple_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 {
3384    unsafe { simd_bitmask::<u8x32, _>(simd_le(a.as_u8x32(), b.as_u8x32())) }
3385}
3386
3387/// Compare packed unsigned 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3388///
3389/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmple_epu8_mask&expand=1006)
3390#[inline]
3391#[target_feature(enable = "avx512bw,avx512vl")]
3392#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3393#[cfg_attr(test, assert_instr(vpcmp))]
3394#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3395pub const fn _mm256_mask_cmple_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
3396    _mm256_mask_cmp_epu8_mask::<_MM_CMPINT_LE>(k1, a, b)
3397}
3398
3399/// Compare packed unsigned 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
3400///
3401/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmple_epu8_mask&expand=1003)
3402#[inline]
3403#[target_feature(enable = "avx512bw,avx512vl")]
3404#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3405#[cfg_attr(test, assert_instr(vpcmp))]
3406#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3407pub const fn _mm_cmple_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 {
3408    unsafe { simd_bitmask::<u8x16, _>(simd_le(a.as_u8x16(), b.as_u8x16())) }
3409}
3410
3411/// Compare packed unsigned 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3412///
3413/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmple_epu8_mask&expand=1004)
3414#[inline]
3415#[target_feature(enable = "avx512bw,avx512vl")]
3416#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3417#[cfg_attr(test, assert_instr(vpcmp))]
3418#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3419pub const fn _mm_mask_cmple_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
3420    _mm_mask_cmp_epu8_mask::<_MM_CMPINT_LE>(k1, a, b)
3421}
3422
3423/// Compare packed signed 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
3424///
3425/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmple_epi16_mask&expand=965)
3426#[inline]
3427#[target_feature(enable = "avx512bw")]
3428#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3429#[cfg_attr(test, assert_instr(vpcmp))]
3430#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3431pub const fn _mm512_cmple_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 {
3432    unsafe { simd_bitmask::<i16x32, _>(simd_le(a.as_i16x32(), b.as_i16x32())) }
3433}
3434
3435/// Compare packed signed 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3436///
3437/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmple_epi16_mask&expand=966)
3438#[inline]
3439#[target_feature(enable = "avx512bw")]
3440#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3441#[cfg_attr(test, assert_instr(vpcmp))]
3442#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3443pub const fn _mm512_mask_cmple_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
3444    _mm512_mask_cmp_epi16_mask::<_MM_CMPINT_LE>(k1, a, b)
3445}
3446
3447/// Compare packed signed 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
3448///
3449/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmple_epi16_mask&expand=963)
3450#[inline]
3451#[target_feature(enable = "avx512bw,avx512vl")]
3452#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3453#[cfg_attr(test, assert_instr(vpcmp))]
3454#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3455pub const fn _mm256_cmple_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 {
3456    unsafe { simd_bitmask::<i16x16, _>(simd_le(a.as_i16x16(), b.as_i16x16())) }
3457}
3458
3459/// Compare packed signed 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3460///
3461/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmple_epi16_mask&expand=964)
3462#[inline]
3463#[target_feature(enable = "avx512bw,avx512vl")]
3464#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3465#[cfg_attr(test, assert_instr(vpcmp))]
3466#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3467pub const fn _mm256_mask_cmple_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
3468    _mm256_mask_cmp_epi16_mask::<_MM_CMPINT_LE>(k1, a, b)
3469}
3470
3471/// Compare packed signed 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
3472///
3473/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmple_epi16_mask&expand=961)
3474#[inline]
3475#[target_feature(enable = "avx512bw,avx512vl")]
3476#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3477#[cfg_attr(test, assert_instr(vpcmp))]
3478#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3479pub const fn _mm_cmple_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 {
3480    unsafe { simd_bitmask::<i16x8, _>(simd_le(a.as_i16x8(), b.as_i16x8())) }
3481}
3482
3483/// Compare packed signed 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3484///
3485/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmple_epi16_mask&expand=962)
3486#[inline]
3487#[target_feature(enable = "avx512bw,avx512vl")]
3488#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3489#[cfg_attr(test, assert_instr(vpcmp))]
3490#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3491pub const fn _mm_mask_cmple_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
3492    _mm_mask_cmp_epi16_mask::<_MM_CMPINT_LE>(k1, a, b)
3493}
3494
3495/// Compare packed signed 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
3496///
3497/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmple_epi8_mask&expand=983)
3498#[inline]
3499#[target_feature(enable = "avx512bw")]
3500#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3501#[cfg_attr(test, assert_instr(vpcmp))]
3502#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3503pub const fn _mm512_cmple_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 {
3504    unsafe { simd_bitmask::<i8x64, _>(simd_le(a.as_i8x64(), b.as_i8x64())) }
3505}
3506
3507/// Compare packed signed 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3508///
3509/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmple_epi8_mask&expand=984)
3510#[inline]
3511#[target_feature(enable = "avx512bw")]
3512#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3513#[cfg_attr(test, assert_instr(vpcmp))]
3514#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3515pub const fn _mm512_mask_cmple_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
3516    _mm512_mask_cmp_epi8_mask::<_MM_CMPINT_LE>(k1, a, b)
3517}
3518
3519/// Compare packed signed 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
3520///
3521/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmple_epi8_mask&expand=981)
3522#[inline]
3523#[target_feature(enable = "avx512bw,avx512vl")]
3524#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3525#[cfg_attr(test, assert_instr(vpcmp))]
3526#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3527pub const fn _mm256_cmple_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 {
3528    unsafe { simd_bitmask::<i8x32, _>(simd_le(a.as_i8x32(), b.as_i8x32())) }
3529}
3530
3531/// Compare packed signed 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3532///
3533/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmple_epi8_mask&expand=982)
3534#[inline]
3535#[target_feature(enable = "avx512bw,avx512vl")]
3536#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3537#[cfg_attr(test, assert_instr(vpcmp))]
3538#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3539pub const fn _mm256_mask_cmple_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
3540    _mm256_mask_cmp_epi8_mask::<_MM_CMPINT_LE>(k1, a, b)
3541}
3542
3543/// Compare packed signed 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
3544///
3545/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmple_epi8_mask&expand=979)
3546#[inline]
3547#[target_feature(enable = "avx512bw,avx512vl")]
3548#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3549#[cfg_attr(test, assert_instr(vpcmp))]
3550#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3551pub const fn _mm_cmple_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 {
3552    unsafe { simd_bitmask::<i8x16, _>(simd_le(a.as_i8x16(), b.as_i8x16())) }
3553}
3554
3555/// Compare packed signed 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3556///
3557/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmple_epi8_mask&expand=980)
3558#[inline]
3559#[target_feature(enable = "avx512bw,avx512vl")]
3560#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3561#[cfg_attr(test, assert_instr(vpcmp))]
3562#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3563pub const fn _mm_mask_cmple_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
3564    _mm_mask_cmp_epi8_mask::<_MM_CMPINT_LE>(k1, a, b)
3565}
3566
3567/// Compare packed unsigned 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
3568///
3569/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpge_epu16_mask&expand=867)
3570#[inline]
3571#[target_feature(enable = "avx512bw")]
3572#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3573#[cfg_attr(test, assert_instr(vpcmp))]
3574#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3575pub const fn _mm512_cmpge_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 {
3576    unsafe { simd_bitmask::<u16x32, _>(simd_ge(a.as_u16x32(), b.as_u16x32())) }
3577}
3578
3579/// Compare packed unsigned 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3580///
3581/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpge_epu16_mask&expand=868)
3582#[inline]
3583#[target_feature(enable = "avx512bw")]
3584#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3585#[cfg_attr(test, assert_instr(vpcmp))]
3586#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3587pub const fn _mm512_mask_cmpge_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
3588    _mm512_mask_cmp_epu16_mask::<_MM_CMPINT_NLT>(k1, a, b)
3589}
3590
3591/// Compare packed unsigned 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
3592///
3593/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpge_epu16_mask&expand=865)
3594#[inline]
3595#[target_feature(enable = "avx512bw,avx512vl")]
3596#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3597#[cfg_attr(test, assert_instr(vpcmp))]
3598#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3599pub const fn _mm256_cmpge_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 {
3600    unsafe { simd_bitmask::<u16x16, _>(simd_ge(a.as_u16x16(), b.as_u16x16())) }
3601}
3602
3603/// Compare packed unsigned 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3604///
3605/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpge_epu16_mask&expand=866)
3606#[inline]
3607#[target_feature(enable = "avx512bw,avx512vl")]
3608#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3609#[cfg_attr(test, assert_instr(vpcmp))]
3610#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3611pub const fn _mm256_mask_cmpge_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
3612    _mm256_mask_cmp_epu16_mask::<_MM_CMPINT_NLT>(k1, a, b)
3613}
3614
3615/// Compare packed unsigned 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
3616///
3617/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpge_epu16_mask&expand=863)
3618#[inline]
3619#[target_feature(enable = "avx512bw,avx512vl")]
3620#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3621#[cfg_attr(test, assert_instr(vpcmp))]
3622#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3623pub const fn _mm_cmpge_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 {
3624    unsafe { simd_bitmask::<u16x8, _>(simd_ge(a.as_u16x8(), b.as_u16x8())) }
3625}
3626
3627/// Compare packed unsigned 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3628///
3629/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpge_epu16_mask&expand=864)
3630#[inline]
3631#[target_feature(enable = "avx512bw,avx512vl")]
3632#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3633#[cfg_attr(test, assert_instr(vpcmp))]
3634#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3635pub const fn _mm_mask_cmpge_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
3636    _mm_mask_cmp_epu16_mask::<_MM_CMPINT_NLT>(k1, a, b)
3637}
3638
3639/// Compare packed unsigned 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
3640///
3641/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpge_epu8_mask&expand=885)
3642#[inline]
3643#[target_feature(enable = "avx512bw")]
3644#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3645#[cfg_attr(test, assert_instr(vpcmp))]
3646#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3647pub const fn _mm512_cmpge_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 {
3648    unsafe { simd_bitmask::<u8x64, _>(simd_ge(a.as_u8x64(), b.as_u8x64())) }
3649}
3650
3651/// Compare packed unsigned 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3652///
3653/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpge_epu8_mask&expand=886)
3654#[inline]
3655#[target_feature(enable = "avx512bw")]
3656#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3657#[cfg_attr(test, assert_instr(vpcmp))]
3658#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3659pub const fn _mm512_mask_cmpge_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
3660    _mm512_mask_cmp_epu8_mask::<_MM_CMPINT_NLT>(k1, a, b)
3661}
3662
3663/// Compare packed unsigned 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
3664///
3665/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpge_epu8_mask&expand=883)
3666#[inline]
3667#[target_feature(enable = "avx512bw,avx512vl")]
3668#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3669#[cfg_attr(test, assert_instr(vpcmp))]
3670#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3671pub const fn _mm256_cmpge_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 {
3672    unsafe { simd_bitmask::<u8x32, _>(simd_ge(a.as_u8x32(), b.as_u8x32())) }
3673}
3674
3675/// Compare packed unsigned 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3676///
3677/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpge_epu8_mask&expand=884)
3678#[inline]
3679#[target_feature(enable = "avx512bw,avx512vl")]
3680#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3681#[cfg_attr(test, assert_instr(vpcmp))]
3682#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3683pub const fn _mm256_mask_cmpge_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
3684    _mm256_mask_cmp_epu8_mask::<_MM_CMPINT_NLT>(k1, a, b)
3685}
3686
3687/// Compare packed unsigned 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
3688///
3689/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpge_epu8_mask&expand=881)
3690#[inline]
3691#[target_feature(enable = "avx512bw,avx512vl")]
3692#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3693#[cfg_attr(test, assert_instr(vpcmp))]
3694#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3695pub const fn _mm_cmpge_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 {
3696    unsafe { simd_bitmask::<u8x16, _>(simd_ge(a.as_u8x16(), b.as_u8x16())) }
3697}
3698
3699/// Compare packed unsigned 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3700///
3701/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpge_epu8_mask&expand=882)
3702#[inline]
3703#[target_feature(enable = "avx512bw,avx512vl")]
3704#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3705#[cfg_attr(test, assert_instr(vpcmp))]
3706#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3707pub const fn _mm_mask_cmpge_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
3708    _mm_mask_cmp_epu8_mask::<_MM_CMPINT_NLT>(k1, a, b)
3709}
3710
3711/// Compare packed signed 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
3712///
3713/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpge_epi16_mask&expand=843)
3714#[inline]
3715#[target_feature(enable = "avx512bw")]
3716#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3717#[cfg_attr(test, assert_instr(vpcmp))]
3718#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3719pub const fn _mm512_cmpge_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 {
3720    unsafe { simd_bitmask::<i16x32, _>(simd_ge(a.as_i16x32(), b.as_i16x32())) }
3721}
3722
3723/// Compare packed signed 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3724///
3725/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpge_epi16_mask&expand=844)
3726#[inline]
3727#[target_feature(enable = "avx512bw")]
3728#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3729#[cfg_attr(test, assert_instr(vpcmp))]
3730#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3731pub const fn _mm512_mask_cmpge_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
3732    _mm512_mask_cmp_epi16_mask::<_MM_CMPINT_NLT>(k1, a, b)
3733}
3734
3735/// Compare packed signed 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
3736///
3737/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpge_epi16_mask&expand=841)
3738#[inline]
3739#[target_feature(enable = "avx512bw,avx512vl")]
3740#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3741#[cfg_attr(test, assert_instr(vpcmp))]
3742#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3743pub const fn _mm256_cmpge_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 {
3744    unsafe { simd_bitmask::<i16x16, _>(simd_ge(a.as_i16x16(), b.as_i16x16())) }
3745}
3746
3747/// Compare packed signed 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3748///
3749/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpge_epi16_mask&expand=842)
3750#[inline]
3751#[target_feature(enable = "avx512bw,avx512vl")]
3752#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3753#[cfg_attr(test, assert_instr(vpcmp))]
3754#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3755pub const fn _mm256_mask_cmpge_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
3756    _mm256_mask_cmp_epi16_mask::<_MM_CMPINT_NLT>(k1, a, b)
3757}
3758
3759/// Compare packed signed 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
3760///
3761/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpge_epi16_mask&expand=839)
3762#[inline]
3763#[target_feature(enable = "avx512bw,avx512vl")]
3764#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3765#[cfg_attr(test, assert_instr(vpcmp))]
3766#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3767pub const fn _mm_cmpge_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 {
3768    unsafe { simd_bitmask::<i16x8, _>(simd_ge(a.as_i16x8(), b.as_i16x8())) }
3769}
3770
3771/// Compare packed signed 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3772///
3773/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpge_epi16_mask&expand=840)
3774#[inline]
3775#[target_feature(enable = "avx512bw,avx512vl")]
3776#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3777#[cfg_attr(test, assert_instr(vpcmp))]
3778#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3779pub const fn _mm_mask_cmpge_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
3780    _mm_mask_cmp_epi16_mask::<_MM_CMPINT_NLT>(k1, a, b)
3781}
3782
3783/// Compare packed signed 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
3784///
3785/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpge_epi8_mask&expand=861)
3786#[inline]
3787#[target_feature(enable = "avx512bw")]
3788#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3789#[cfg_attr(test, assert_instr(vpcmp))]
3790#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3791pub const fn _mm512_cmpge_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 {
3792    unsafe { simd_bitmask::<i8x64, _>(simd_ge(a.as_i8x64(), b.as_i8x64())) }
3793}
3794
3795/// Compare packed signed 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3796///
3797/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpge_epi8_mask&expand=862)
3798#[inline]
3799#[target_feature(enable = "avx512bw")]
3800#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3801#[cfg_attr(test, assert_instr(vpcmp))]
3802#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3803pub const fn _mm512_mask_cmpge_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
3804    _mm512_mask_cmp_epi8_mask::<_MM_CMPINT_NLT>(k1, a, b)
3805}
3806
3807/// Compare packed signed 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
3808///
3809/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpge_epi8_mask&expand=859)
3810#[inline]
3811#[target_feature(enable = "avx512bw,avx512vl")]
3812#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3813#[cfg_attr(test, assert_instr(vpcmp))]
3814#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3815pub const fn _mm256_cmpge_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 {
3816    unsafe { simd_bitmask::<i8x32, _>(simd_ge(a.as_i8x32(), b.as_i8x32())) }
3817}
3818
3819/// Compare packed signed 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3820///
3821/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpge_epi8_mask&expand=860)
3822#[inline]
3823#[target_feature(enable = "avx512bw,avx512vl")]
3824#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3825#[cfg_attr(test, assert_instr(vpcmp))]
3826#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3827pub const fn _mm256_mask_cmpge_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
3828    _mm256_mask_cmp_epi8_mask::<_MM_CMPINT_NLT>(k1, a, b)
3829}
3830
3831/// Compare packed signed 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
3832///
3833/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpge_epi8_mask&expand=857)
3834#[inline]
3835#[target_feature(enable = "avx512bw,avx512vl")]
3836#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3837#[cfg_attr(test, assert_instr(vpcmp))]
3838#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3839pub const fn _mm_cmpge_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 {
3840    unsafe { simd_bitmask::<i8x16, _>(simd_ge(a.as_i8x16(), b.as_i8x16())) }
3841}
3842
3843/// Compare packed signed 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3844///
3845/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpge_epi8_mask&expand=858)
3846#[inline]
3847#[target_feature(enable = "avx512bw,avx512vl")]
3848#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3849#[cfg_attr(test, assert_instr(vpcmp))]
3850#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3851pub const fn _mm_mask_cmpge_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
3852    _mm_mask_cmp_epi8_mask::<_MM_CMPINT_NLT>(k1, a, b)
3853}
3854
3855/// Compare packed unsigned 16-bit integers in a and b for equality, and store the results in mask vector k.
3856///
3857/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpeq_epu16_mask&expand=801)
3858#[inline]
3859#[target_feature(enable = "avx512bw")]
3860#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3861#[cfg_attr(test, assert_instr(vpcmp))]
3862#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3863pub const fn _mm512_cmpeq_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 {
3864    unsafe { simd_bitmask::<u16x32, _>(simd_eq(a.as_u16x32(), b.as_u16x32())) }
3865}
3866
3867/// Compare packed unsigned 16-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3868///
3869/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpeq_epu16_mask&expand=802)
3870#[inline]
3871#[target_feature(enable = "avx512bw")]
3872#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3873#[cfg_attr(test, assert_instr(vpcmp))]
3874#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3875pub const fn _mm512_mask_cmpeq_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
3876    _mm512_mask_cmp_epu16_mask::<_MM_CMPINT_EQ>(k1, a, b)
3877}
3878
3879/// Compare packed unsigned 16-bit integers in a and b for equality, and store the results in mask vector k.
3880///
3881/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpeq_epu16_mask&expand=799)
3882#[inline]
3883#[target_feature(enable = "avx512bw,avx512vl")]
3884#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3885#[cfg_attr(test, assert_instr(vpcmp))]
3886#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3887pub const fn _mm256_cmpeq_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 {
3888    unsafe { simd_bitmask::<u16x16, _>(simd_eq(a.as_u16x16(), b.as_u16x16())) }
3889}
3890
3891/// Compare packed unsigned 16-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3892///
3893/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpeq_epu16_mask&expand=800)
3894#[inline]
3895#[target_feature(enable = "avx512bw,avx512vl")]
3896#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3897#[cfg_attr(test, assert_instr(vpcmp))]
3898#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3899pub const fn _mm256_mask_cmpeq_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
3900    _mm256_mask_cmp_epu16_mask::<_MM_CMPINT_EQ>(k1, a, b)
3901}
3902
3903/// Compare packed unsigned 16-bit integers in a and b for equality, and store the results in mask vector k.
3904///
3905/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpeq_epu16_mask&expand=797)
3906#[inline]
3907#[target_feature(enable = "avx512bw,avx512vl")]
3908#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3909#[cfg_attr(test, assert_instr(vpcmp))]
3910#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3911pub const fn _mm_cmpeq_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 {
3912    unsafe { simd_bitmask::<u16x8, _>(simd_eq(a.as_u16x8(), b.as_u16x8())) }
3913}
3914
3915/// Compare packed unsigned 16-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3916///
3917/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpeq_epu16_mask&expand=798)
3918#[inline]
3919#[target_feature(enable = "avx512bw,avx512vl")]
3920#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3921#[cfg_attr(test, assert_instr(vpcmp))]
3922#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3923pub const fn _mm_mask_cmpeq_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
3924    _mm_mask_cmp_epu16_mask::<_MM_CMPINT_EQ>(k1, a, b)
3925}
3926
3927/// Compare packed unsigned 8-bit integers in a and b for equality, and store the results in mask vector k.
3928///
3929/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpeq_epu8_mask&expand=819)
3930#[inline]
3931#[target_feature(enable = "avx512bw")]
3932#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3933#[cfg_attr(test, assert_instr(vpcmp))]
3934#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3935pub const fn _mm512_cmpeq_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 {
3936    unsafe { simd_bitmask::<u8x64, _>(simd_eq(a.as_u8x64(), b.as_u8x64())) }
3937}
3938
3939/// Compare packed unsigned 8-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3940///
3941/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpeq_epu8_mask&expand=820)
3942#[inline]
3943#[target_feature(enable = "avx512bw")]
3944#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3945#[cfg_attr(test, assert_instr(vpcmp))]
3946#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3947pub const fn _mm512_mask_cmpeq_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
3948    _mm512_mask_cmp_epu8_mask::<_MM_CMPINT_EQ>(k1, a, b)
3949}
3950
3951/// Compare packed unsigned 8-bit integers in a and b for equality, and store the results in mask vector k.
3952///
3953/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpeq_epu8_mask&expand=817)
3954#[inline]
3955#[target_feature(enable = "avx512bw,avx512vl")]
3956#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3957#[cfg_attr(test, assert_instr(vpcmp))]
3958#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3959pub const fn _mm256_cmpeq_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 {
3960    unsafe { simd_bitmask::<u8x32, _>(simd_eq(a.as_u8x32(), b.as_u8x32())) }
3961}
3962
3963/// Compare packed unsigned 8-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3964///
3965/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpeq_epu8_mask&expand=818)
3966#[inline]
3967#[target_feature(enable = "avx512bw,avx512vl")]
3968#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3969#[cfg_attr(test, assert_instr(vpcmp))]
3970#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3971pub const fn _mm256_mask_cmpeq_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
3972    _mm256_mask_cmp_epu8_mask::<_MM_CMPINT_EQ>(k1, a, b)
3973}
3974
3975/// Compare packed unsigned 8-bit integers in a and b for equality, and store the results in mask vector k.
3976///
3977/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpeq_epu8_mask&expand=815)
3978#[inline]
3979#[target_feature(enable = "avx512bw,avx512vl")]
3980#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3981#[cfg_attr(test, assert_instr(vpcmp))]
3982#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3983pub const fn _mm_cmpeq_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 {
3984    unsafe { simd_bitmask::<u8x16, _>(simd_eq(a.as_u8x16(), b.as_u8x16())) }
3985}
3986
3987/// Compare packed unsigned 8-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
3988///
3989/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpeq_epu8_mask&expand=816)
3990#[inline]
3991#[target_feature(enable = "avx512bw,avx512vl")]
3992#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3993#[cfg_attr(test, assert_instr(vpcmp))]
3994#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3995pub const fn _mm_mask_cmpeq_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
3996    _mm_mask_cmp_epu8_mask::<_MM_CMPINT_EQ>(k1, a, b)
3997}
3998
3999/// Compare packed signed 16-bit integers in a and b for equality, and store the results in mask vector k.
4000///
4001/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpeq_epi16_mask&expand=771)
4002#[inline]
4003#[target_feature(enable = "avx512bw")]
4004#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4005#[cfg_attr(test, assert_instr(vpcmp))]
4006#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4007pub const fn _mm512_cmpeq_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 {
4008    unsafe { simd_bitmask::<i16x32, _>(simd_eq(a.as_i16x32(), b.as_i16x32())) }
4009}
4010
4011/// Compare packed signed 16-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
4012///
4013/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpeq_epi16_mask&expand=772)
4014#[inline]
4015#[target_feature(enable = "avx512bw")]
4016#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4017#[cfg_attr(test, assert_instr(vpcmp))]
4018#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4019pub const fn _mm512_mask_cmpeq_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
4020    _mm512_mask_cmp_epi16_mask::<_MM_CMPINT_EQ>(k1, a, b)
4021}
4022
4023/// Compare packed signed 16-bit integers in a and b for equality, and store the results in mask vector k.
4024///
4025/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpeq_epi16_mask&expand=769)
4026#[inline]
4027#[target_feature(enable = "avx512bw,avx512vl")]
4028#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4029#[cfg_attr(test, assert_instr(vpcmp))]
4030#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4031pub const fn _mm256_cmpeq_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 {
4032    unsafe { simd_bitmask::<i16x16, _>(simd_eq(a.as_i16x16(), b.as_i16x16())) }
4033}
4034
4035/// Compare packed signed 16-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
4036///
4037/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpeq_epi16_mask&expand=770)
4038#[inline]
4039#[target_feature(enable = "avx512bw,avx512vl")]
4040#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4041#[cfg_attr(test, assert_instr(vpcmp))]
4042#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4043pub const fn _mm256_mask_cmpeq_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
4044    _mm256_mask_cmp_epi16_mask::<_MM_CMPINT_EQ>(k1, a, b)
4045}
4046
4047/// Compare packed signed 16-bit integers in a and b for equality, and store the results in mask vector k.
4048///
4049/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpeq_epi16_mask&expand=767)
4050#[inline]
4051#[target_feature(enable = "avx512bw,avx512vl")]
4052#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4053#[cfg_attr(test, assert_instr(vpcmp))]
4054#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4055pub const fn _mm_cmpeq_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 {
4056    unsafe { simd_bitmask::<i16x8, _>(simd_eq(a.as_i16x8(), b.as_i16x8())) }
4057}
4058
4059/// Compare packed signed 16-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
4060///
4061/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpeq_epi16_mask&expand=768)
4062#[inline]
4063#[target_feature(enable = "avx512bw,avx512vl")]
4064#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4065#[cfg_attr(test, assert_instr(vpcmp))]
4066#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4067pub const fn _mm_mask_cmpeq_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
4068    _mm_mask_cmp_epi16_mask::<_MM_CMPINT_EQ>(k1, a, b)
4069}
4070
4071/// Compare packed signed 8-bit integers in a and b for equality, and store the results in mask vector k.
4072///
4073/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpeq_epi8_mask&expand=795)
4074#[inline]
4075#[target_feature(enable = "avx512bw")]
4076#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4077#[cfg_attr(test, assert_instr(vpcmp))]
4078#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4079pub const fn _mm512_cmpeq_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 {
4080    unsafe { simd_bitmask::<i8x64, _>(simd_eq(a.as_i8x64(), b.as_i8x64())) }
4081}
4082
4083/// Compare packed signed 8-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
4084///
4085/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpeq_epi8_mask&expand=796)
4086#[inline]
4087#[target_feature(enable = "avx512bw")]
4088#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4089#[cfg_attr(test, assert_instr(vpcmp))]
4090#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4091pub const fn _mm512_mask_cmpeq_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
4092    _mm512_mask_cmp_epi8_mask::<_MM_CMPINT_EQ>(k1, a, b)
4093}
4094
4095/// Compare packed signed 8-bit integers in a and b for equality, and store the results in mask vector k.
4096///
4097/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpeq_epi8_mask&expand=793)
4098#[inline]
4099#[target_feature(enable = "avx512bw,avx512vl")]
4100#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4101#[cfg_attr(test, assert_instr(vpcmp))]
4102#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4103pub const fn _mm256_cmpeq_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 {
4104    unsafe { simd_bitmask::<i8x32, _>(simd_eq(a.as_i8x32(), b.as_i8x32())) }
4105}
4106
4107/// Compare packed signed 8-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
4108///
4109/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpeq_epi8_mask&expand=794)
4110#[inline]
4111#[target_feature(enable = "avx512bw,avx512vl")]
4112#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4113#[cfg_attr(test, assert_instr(vpcmp))]
4114#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4115pub const fn _mm256_mask_cmpeq_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
4116    _mm256_mask_cmp_epi8_mask::<_MM_CMPINT_EQ>(k1, a, b)
4117}
4118
4119/// Compare packed signed 8-bit integers in a and b for equality, and store the results in mask vector k.
4120///
4121/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpeq_epi8_mask&expand=791)
4122#[inline]
4123#[target_feature(enable = "avx512bw,avx512vl")]
4124#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4125#[cfg_attr(test, assert_instr(vpcmp))]
4126#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4127pub const fn _mm_cmpeq_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 {
4128    unsafe { simd_bitmask::<i8x16, _>(simd_eq(a.as_i8x16(), b.as_i8x16())) }
4129}
4130
4131/// Compare packed signed 8-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
4132///
4133/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpeq_epi8_mask&expand=792)
4134#[inline]
4135#[target_feature(enable = "avx512bw,avx512vl")]
4136#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4137#[cfg_attr(test, assert_instr(vpcmp))]
4138#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4139pub const fn _mm_mask_cmpeq_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
4140    _mm_mask_cmp_epi8_mask::<_MM_CMPINT_EQ>(k1, a, b)
4141}
4142
4143/// Compare packed unsigned 16-bit integers in a and b for not-equal, and store the results in mask vector k.
4144///
4145/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpneq_epu16_mask&expand=1106)
4146#[inline]
4147#[target_feature(enable = "avx512bw")]
4148#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4149#[cfg_attr(test, assert_instr(vpcmp))]
4150#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4151pub const fn _mm512_cmpneq_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 {
4152    unsafe { simd_bitmask::<u16x32, _>(simd_ne(a.as_u16x32(), b.as_u16x32())) }
4153}
4154
4155/// Compare packed unsigned 16-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
4156///
4157/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpneq_epu16_mask&expand=1107)
4158#[inline]
4159#[target_feature(enable = "avx512bw")]
4160#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4161#[cfg_attr(test, assert_instr(vpcmp))]
4162#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4163pub const fn _mm512_mask_cmpneq_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
4164    _mm512_mask_cmp_epu16_mask::<_MM_CMPINT_NE>(k1, a, b)
4165}
4166
4167/// Compare packed unsigned 16-bit integers in a and b for not-equal, and store the results in mask vector k.
4168///
4169/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpneq_epu16_mask&expand=1104)
4170#[inline]
4171#[target_feature(enable = "avx512bw,avx512vl")]
4172#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4173#[cfg_attr(test, assert_instr(vpcmp))]
4174#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4175pub const fn _mm256_cmpneq_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 {
4176    unsafe { simd_bitmask::<u16x16, _>(simd_ne(a.as_u16x16(), b.as_u16x16())) }
4177}
4178
4179/// Compare packed unsigned 16-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
4180///
4181/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpneq_epu16_mask&expand=1105)
4182#[inline]
4183#[target_feature(enable = "avx512bw,avx512vl")]
4184#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4185#[cfg_attr(test, assert_instr(vpcmp))]
4186#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4187pub const fn _mm256_mask_cmpneq_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
4188    _mm256_mask_cmp_epu16_mask::<_MM_CMPINT_NE>(k1, a, b)
4189}
4190
4191/// Compare packed unsigned 16-bit integers in a and b for not-equal, and store the results in mask vector k.
4192///
4193/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpneq_epu16_mask&expand=1102)
4194#[inline]
4195#[target_feature(enable = "avx512bw,avx512vl")]
4196#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4197#[cfg_attr(test, assert_instr(vpcmp))]
4198#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4199pub const fn _mm_cmpneq_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 {
4200    unsafe { simd_bitmask::<u16x8, _>(simd_ne(a.as_u16x8(), b.as_u16x8())) }
4201}
4202
4203/// Compare packed unsigned 16-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
4204///
4205/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpneq_epu16_mask&expand=1103)
4206#[inline]
4207#[target_feature(enable = "avx512bw,avx512vl")]
4208#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4209#[cfg_attr(test, assert_instr(vpcmp))]
4210#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4211pub const fn _mm_mask_cmpneq_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
4212    _mm_mask_cmp_epu16_mask::<_MM_CMPINT_NE>(k1, a, b)
4213}
4214
4215/// Compare packed unsigned 8-bit integers in a and b for not-equal, and store the results in mask vector k.
4216///
4217/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpneq_epu8_mask&expand=1124)
4218#[inline]
4219#[target_feature(enable = "avx512bw")]
4220#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4221#[cfg_attr(test, assert_instr(vpcmp))]
4222#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4223pub const fn _mm512_cmpneq_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 {
4224    unsafe { simd_bitmask::<u8x64, _>(simd_ne(a.as_u8x64(), b.as_u8x64())) }
4225}
4226
4227/// Compare packed unsigned 8-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
4228///
4229/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpneq_epu8_mask&expand=1125)
4230#[inline]
4231#[target_feature(enable = "avx512bw")]
4232#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4233#[cfg_attr(test, assert_instr(vpcmp))]
4234#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4235pub const fn _mm512_mask_cmpneq_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
4236    _mm512_mask_cmp_epu8_mask::<_MM_CMPINT_NE>(k1, a, b)
4237}
4238
4239/// Compare packed unsigned 8-bit integers in a and b for not-equal, and store the results in mask vector k.
4240///
4241/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpneq_epu8_mask&expand=1122)
4242#[inline]
4243#[target_feature(enable = "avx512bw,avx512vl")]
4244#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4245#[cfg_attr(test, assert_instr(vpcmp))]
4246#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4247pub const fn _mm256_cmpneq_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 {
4248    unsafe { simd_bitmask::<u8x32, _>(simd_ne(a.as_u8x32(), b.as_u8x32())) }
4249}
4250
4251/// Compare packed unsigned 8-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
4252///
4253/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpneq_epu8_mask&expand=1123)
4254#[inline]
4255#[target_feature(enable = "avx512bw,avx512vl")]
4256#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4257#[cfg_attr(test, assert_instr(vpcmp))]
4258#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4259pub const fn _mm256_mask_cmpneq_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
4260    _mm256_mask_cmp_epu8_mask::<_MM_CMPINT_NE>(k1, a, b)
4261}
4262
4263/// Compare packed unsigned 8-bit integers in a and b for not-equal, and store the results in mask vector k.
4264///
4265/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpneq_epu8_mask&expand=1120)
4266#[inline]
4267#[target_feature(enable = "avx512bw,avx512vl")]
4268#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4269#[cfg_attr(test, assert_instr(vpcmp))]
4270#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4271pub const fn _mm_cmpneq_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 {
4272    unsafe { simd_bitmask::<u8x16, _>(simd_ne(a.as_u8x16(), b.as_u8x16())) }
4273}
4274
4275/// Compare packed unsigned 8-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
4276///
4277/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpneq_epu8_mask&expand=1121)
4278#[inline]
4279#[target_feature(enable = "avx512bw,avx512vl")]
4280#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4281#[cfg_attr(test, assert_instr(vpcmp))]
4282#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4283pub const fn _mm_mask_cmpneq_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
4284    _mm_mask_cmp_epu8_mask::<_MM_CMPINT_NE>(k1, a, b)
4285}
4286
4287/// Compare packed signed 16-bit integers in a and b for not-equal, and store the results in mask vector k.
4288///
4289/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpneq_epi16_mask&expand=1082)
4290#[inline]
4291#[target_feature(enable = "avx512bw")]
4292#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4293#[cfg_attr(test, assert_instr(vpcmp))]
4294#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4295pub const fn _mm512_cmpneq_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 {
4296    unsafe { simd_bitmask::<i16x32, _>(simd_ne(a.as_i16x32(), b.as_i16x32())) }
4297}
4298
4299/// Compare packed signed 16-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
4300///
4301/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpneq_epi16_mask&expand=1083)
4302#[inline]
4303#[target_feature(enable = "avx512bw")]
4304#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4305#[cfg_attr(test, assert_instr(vpcmp))]
4306#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4307pub const fn _mm512_mask_cmpneq_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
4308    _mm512_mask_cmp_epi16_mask::<_MM_CMPINT_NE>(k1, a, b)
4309}
4310
4311/// Compare packed signed 16-bit integers in a and b for not-equal, and store the results in mask vector k.
4312///
4313/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpneq_epi16_mask&expand=1080)
4314#[inline]
4315#[target_feature(enable = "avx512bw,avx512vl")]
4316#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4317#[cfg_attr(test, assert_instr(vpcmp))]
4318#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4319pub const fn _mm256_cmpneq_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 {
4320    unsafe { simd_bitmask::<i16x16, _>(simd_ne(a.as_i16x16(), b.as_i16x16())) }
4321}
4322
4323/// Compare packed signed 16-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
4324///
4325/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpneq_epi16_mask&expand=1081)
4326#[inline]
4327#[target_feature(enable = "avx512bw,avx512vl")]
4328#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4329#[cfg_attr(test, assert_instr(vpcmp))]
4330#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4331pub const fn _mm256_mask_cmpneq_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
4332    _mm256_mask_cmp_epi16_mask::<_MM_CMPINT_NE>(k1, a, b)
4333}
4334
4335/// Compare packed signed 16-bit integers in a and b for not-equal, and store the results in mask vector k.
4336///
4337/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpneq_epi16_mask&expand=1078)
4338#[inline]
4339#[target_feature(enable = "avx512bw,avx512vl")]
4340#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4341#[cfg_attr(test, assert_instr(vpcmp))]
4342#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4343pub const fn _mm_cmpneq_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 {
4344    unsafe { simd_bitmask::<i16x8, _>(simd_ne(a.as_i16x8(), b.as_i16x8())) }
4345}
4346
4347/// Compare packed signed 16-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
4348///
4349/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpneq_epi16_mask&expand=1079)
4350#[inline]
4351#[target_feature(enable = "avx512bw,avx512vl")]
4352#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4353#[cfg_attr(test, assert_instr(vpcmp))]
4354#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4355pub const fn _mm_mask_cmpneq_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
4356    _mm_mask_cmp_epi16_mask::<_MM_CMPINT_NE>(k1, a, b)
4357}
4358
4359/// Compare packed signed 8-bit integers in a and b for not-equal, and store the results in mask vector k.
4360///
4361/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpneq_epi8_mask&expand=1100)
4362#[inline]
4363#[target_feature(enable = "avx512bw")]
4364#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4365#[cfg_attr(test, assert_instr(vpcmp))]
4366#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4367pub const fn _mm512_cmpneq_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 {
4368    unsafe { simd_bitmask::<i8x64, _>(simd_ne(a.as_i8x64(), b.as_i8x64())) }
4369}
4370
4371/// Compare packed signed 8-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
4372///
4373/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpneq_epi8_mask&expand=1101)
4374#[inline]
4375#[target_feature(enable = "avx512bw")]
4376#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4377#[cfg_attr(test, assert_instr(vpcmp))]
4378#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4379pub const fn _mm512_mask_cmpneq_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
4380    _mm512_mask_cmp_epi8_mask::<_MM_CMPINT_NE>(k1, a, b)
4381}
4382
4383/// Compare packed signed 8-bit integers in a and b for not-equal, and store the results in mask vector k.
4384///
4385/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpneq_epi8_mask&expand=1098)
4386#[inline]
4387#[target_feature(enable = "avx512bw,avx512vl")]
4388#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4389#[cfg_attr(test, assert_instr(vpcmp))]
4390#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4391pub const fn _mm256_cmpneq_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 {
4392    unsafe { simd_bitmask::<i8x32, _>(simd_ne(a.as_i8x32(), b.as_i8x32())) }
4393}
4394
4395/// Compare packed signed 8-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
4396///
4397/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpneq_epi8_mask&expand=1099)
4398#[inline]
4399#[target_feature(enable = "avx512bw,avx512vl")]
4400#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4401#[cfg_attr(test, assert_instr(vpcmp))]
4402#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4403pub const fn _mm256_mask_cmpneq_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
4404    _mm256_mask_cmp_epi8_mask::<_MM_CMPINT_NE>(k1, a, b)
4405}
4406
4407/// Compare packed signed 8-bit integers in a and b for not-equal, and store the results in mask vector k.
4408///
4409/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpneq_epi8_mask&expand=1096)
4410#[inline]
4411#[target_feature(enable = "avx512bw,avx512vl")]
4412#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4413#[cfg_attr(test, assert_instr(vpcmp))]
4414#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4415pub const fn _mm_cmpneq_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 {
4416    unsafe { simd_bitmask::<i8x16, _>(simd_ne(a.as_i8x16(), b.as_i8x16())) }
4417}
4418
4419/// Compare packed signed 8-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
4420///
4421/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpneq_epi8_mask&expand=1097)
4422#[inline]
4423#[target_feature(enable = "avx512bw,avx512vl")]
4424#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4425#[cfg_attr(test, assert_instr(vpcmp))]
4426#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4427pub const fn _mm_mask_cmpneq_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
4428    _mm_mask_cmp_epi8_mask::<_MM_CMPINT_NE>(k1, a, b)
4429}
4430
4431/// Compare packed unsigned 16-bit integers in a and b based on the comparison operand specified by `IMM8`, and store the results in mask vector k.
4432///
4433/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmp_epu16_mask&expand=715)
4434#[inline]
4435#[target_feature(enable = "avx512bw")]
4436#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4437#[rustc_legacy_const_generics(2)]
4438#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4439#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4440pub const fn _mm512_cmp_epu16_mask<const IMM8: i32>(a: __m512i, b: __m512i) -> __mmask32 {
4441    unsafe {
4442        static_assert_uimm_bits!(IMM8, 3);
4443        let a = a.as_u16x32();
4444        let b = b.as_u16x32();
4445        let r = match IMM8 {
4446            0 => simd_eq(a, b),
4447            1 => simd_lt(a, b),
4448            2 => simd_le(a, b),
4449            3 => i16x32::ZERO,
4450            4 => simd_ne(a, b),
4451            5 => simd_ge(a, b),
4452            6 => simd_gt(a, b),
4453            _ => i16x32::splat(-1),
4454        };
4455        simd_bitmask(r)
4456    }
4457}
4458
4459/// Compare packed unsigned 16-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
4460///
4461/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmp_epu16_mask&expand=716)
4462#[inline]
4463#[target_feature(enable = "avx512bw")]
4464#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4465#[rustc_legacy_const_generics(3)]
4466#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4467#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4468pub const fn _mm512_mask_cmp_epu16_mask<const IMM8: i32>(
4469    k1: __mmask32,
4470    a: __m512i,
4471    b: __m512i,
4472) -> __mmask32 {
4473    unsafe {
4474        static_assert_uimm_bits!(IMM8, 3);
4475        let a = a.as_u16x32();
4476        let b = b.as_u16x32();
4477        let k1 = simd_select_bitmask(k1, i16x32::splat(-1), i16x32::ZERO);
4478        let r = match IMM8 {
4479            0 => simd_and(k1, simd_eq(a, b)),
4480            1 => simd_and(k1, simd_lt(a, b)),
4481            2 => simd_and(k1, simd_le(a, b)),
4482            3 => i16x32::ZERO,
4483            4 => simd_and(k1, simd_ne(a, b)),
4484            5 => simd_and(k1, simd_ge(a, b)),
4485            6 => simd_and(k1, simd_gt(a, b)),
4486            _ => k1,
4487        };
4488        simd_bitmask(r)
4489    }
4490}
4491
4492/// Compare packed unsigned 16-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
4493///
4494/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmp_epu16_mask&expand=713)
4495#[inline]
4496#[target_feature(enable = "avx512bw,avx512vl")]
4497#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4498#[rustc_legacy_const_generics(2)]
4499#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4500#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4501pub const fn _mm256_cmp_epu16_mask<const IMM8: i32>(a: __m256i, b: __m256i) -> __mmask16 {
4502    unsafe {
4503        static_assert_uimm_bits!(IMM8, 3);
4504        let a = a.as_u16x16();
4505        let b = b.as_u16x16();
4506        let r = match IMM8 {
4507            0 => simd_eq(a, b),
4508            1 => simd_lt(a, b),
4509            2 => simd_le(a, b),
4510            3 => i16x16::ZERO,
4511            4 => simd_ne(a, b),
4512            5 => simd_ge(a, b),
4513            6 => simd_gt(a, b),
4514            _ => i16x16::splat(-1),
4515        };
4516        simd_bitmask(r)
4517    }
4518}
4519
4520/// Compare packed unsigned 16-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
4521///
4522/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmp_epu16_mask&expand=714)
4523#[inline]
4524#[target_feature(enable = "avx512bw,avx512vl")]
4525#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4526#[rustc_legacy_const_generics(3)]
4527#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4528#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4529pub const fn _mm256_mask_cmp_epu16_mask<const IMM8: i32>(
4530    k1: __mmask16,
4531    a: __m256i,
4532    b: __m256i,
4533) -> __mmask16 {
4534    unsafe {
4535        static_assert_uimm_bits!(IMM8, 3);
4536        let a = a.as_u16x16();
4537        let b = b.as_u16x16();
4538        let k1 = simd_select_bitmask(k1, i16x16::splat(-1), i16x16::ZERO);
4539        let r = match IMM8 {
4540            0 => simd_and(k1, simd_eq(a, b)),
4541            1 => simd_and(k1, simd_lt(a, b)),
4542            2 => simd_and(k1, simd_le(a, b)),
4543            3 => i16x16::ZERO,
4544            4 => simd_and(k1, simd_ne(a, b)),
4545            5 => simd_and(k1, simd_ge(a, b)),
4546            6 => simd_and(k1, simd_gt(a, b)),
4547            _ => k1,
4548        };
4549        simd_bitmask(r)
4550    }
4551}
4552
4553/// Compare packed unsigned 16-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
4554///
4555/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmp_epu16_mask&expand=711)
4556#[inline]
4557#[target_feature(enable = "avx512bw,avx512vl")]
4558#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4559#[rustc_legacy_const_generics(2)]
4560#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4561#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4562pub const fn _mm_cmp_epu16_mask<const IMM8: i32>(a: __m128i, b: __m128i) -> __mmask8 {
4563    unsafe {
4564        static_assert_uimm_bits!(IMM8, 3);
4565        let a = a.as_u16x8();
4566        let b = b.as_u16x8();
4567        let r = match IMM8 {
4568            0 => simd_eq(a, b),
4569            1 => simd_lt(a, b),
4570            2 => simd_le(a, b),
4571            3 => i16x8::ZERO,
4572            4 => simd_ne(a, b),
4573            5 => simd_ge(a, b),
4574            6 => simd_gt(a, b),
4575            _ => i16x8::splat(-1),
4576        };
4577        simd_bitmask(r)
4578    }
4579}
4580
4581/// Compare packed unsigned 16-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
4582///
4583/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmp_epu16_mask&expand=712)
4584#[inline]
4585#[target_feature(enable = "avx512bw,avx512vl")]
4586#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4587#[rustc_legacy_const_generics(3)]
4588#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4589#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4590pub const fn _mm_mask_cmp_epu16_mask<const IMM8: i32>(
4591    k1: __mmask8,
4592    a: __m128i,
4593    b: __m128i,
4594) -> __mmask8 {
4595    unsafe {
4596        static_assert_uimm_bits!(IMM8, 3);
4597        let a = a.as_u16x8();
4598        let b = b.as_u16x8();
4599        let k1 = simd_select_bitmask(k1, i16x8::splat(-1), i16x8::ZERO);
4600        let r = match IMM8 {
4601            0 => simd_and(k1, simd_eq(a, b)),
4602            1 => simd_and(k1, simd_lt(a, b)),
4603            2 => simd_and(k1, simd_le(a, b)),
4604            3 => i16x8::ZERO,
4605            4 => simd_and(k1, simd_ne(a, b)),
4606            5 => simd_and(k1, simd_ge(a, b)),
4607            6 => simd_and(k1, simd_gt(a, b)),
4608            _ => k1,
4609        };
4610        simd_bitmask(r)
4611    }
4612}
4613
4614/// Compare packed unsigned 8-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
4615///
4616/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmp_epu8_mask&expand=733)
4617#[inline]
4618#[target_feature(enable = "avx512bw")]
4619#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4620#[rustc_legacy_const_generics(2)]
4621#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4622#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4623pub const fn _mm512_cmp_epu8_mask<const IMM8: i32>(a: __m512i, b: __m512i) -> __mmask64 {
4624    unsafe {
4625        static_assert_uimm_bits!(IMM8, 3);
4626        let a = a.as_u8x64();
4627        let b = b.as_u8x64();
4628        let r = match IMM8 {
4629            0 => simd_eq(a, b),
4630            1 => simd_lt(a, b),
4631            2 => simd_le(a, b),
4632            3 => i8x64::ZERO,
4633            4 => simd_ne(a, b),
4634            5 => simd_ge(a, b),
4635            6 => simd_gt(a, b),
4636            _ => i8x64::splat(-1),
4637        };
4638        simd_bitmask(r)
4639    }
4640}
4641
4642/// Compare packed unsigned 8-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
4643///
4644/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmp_epu8_mask&expand=734)
4645#[inline]
4646#[target_feature(enable = "avx512bw")]
4647#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4648#[rustc_legacy_const_generics(3)]
4649#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4650#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4651pub const fn _mm512_mask_cmp_epu8_mask<const IMM8: i32>(
4652    k1: __mmask64,
4653    a: __m512i,
4654    b: __m512i,
4655) -> __mmask64 {
4656    unsafe {
4657        static_assert_uimm_bits!(IMM8, 3);
4658        let a = a.as_u8x64();
4659        let b = b.as_u8x64();
4660        let k1 = simd_select_bitmask(k1, i8x64::splat(-1), i8x64::ZERO);
4661        let r = match IMM8 {
4662            0 => simd_and(k1, simd_eq(a, b)),
4663            1 => simd_and(k1, simd_lt(a, b)),
4664            2 => simd_and(k1, simd_le(a, b)),
4665            3 => i8x64::ZERO,
4666            4 => simd_and(k1, simd_ne(a, b)),
4667            5 => simd_and(k1, simd_ge(a, b)),
4668            6 => simd_and(k1, simd_gt(a, b)),
4669            _ => k1,
4670        };
4671        simd_bitmask(r)
4672    }
4673}
4674
4675/// Compare packed unsigned 8-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
4676///
4677/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmp_epu8_mask&expand=731)
4678#[inline]
4679#[target_feature(enable = "avx512bw,avx512vl")]
4680#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4681#[rustc_legacy_const_generics(2)]
4682#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4683#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4684pub const fn _mm256_cmp_epu8_mask<const IMM8: i32>(a: __m256i, b: __m256i) -> __mmask32 {
4685    unsafe {
4686        static_assert_uimm_bits!(IMM8, 3);
4687        let a = a.as_u8x32();
4688        let b = b.as_u8x32();
4689        let r = match IMM8 {
4690            0 => simd_eq(a, b),
4691            1 => simd_lt(a, b),
4692            2 => simd_le(a, b),
4693            3 => i8x32::ZERO,
4694            4 => simd_ne(a, b),
4695            5 => simd_ge(a, b),
4696            6 => simd_gt(a, b),
4697            _ => i8x32::splat(-1),
4698        };
4699        simd_bitmask(r)
4700    }
4701}
4702
4703/// Compare packed unsigned 8-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
4704///
4705/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmp_epu8_mask&expand=732)
4706#[inline]
4707#[target_feature(enable = "avx512bw,avx512vl")]
4708#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4709#[rustc_legacy_const_generics(3)]
4710#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4711#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4712pub const fn _mm256_mask_cmp_epu8_mask<const IMM8: i32>(
4713    k1: __mmask32,
4714    a: __m256i,
4715    b: __m256i,
4716) -> __mmask32 {
4717    unsafe {
4718        static_assert_uimm_bits!(IMM8, 3);
4719        let a = a.as_u8x32();
4720        let b = b.as_u8x32();
4721        let k1 = simd_select_bitmask(k1, i8x32::splat(-1), i8x32::ZERO);
4722        let r = match IMM8 {
4723            0 => simd_and(k1, simd_eq(a, b)),
4724            1 => simd_and(k1, simd_lt(a, b)),
4725            2 => simd_and(k1, simd_le(a, b)),
4726            3 => i8x32::ZERO,
4727            4 => simd_and(k1, simd_ne(a, b)),
4728            5 => simd_and(k1, simd_ge(a, b)),
4729            6 => simd_and(k1, simd_gt(a, b)),
4730            _ => k1,
4731        };
4732        simd_bitmask(r)
4733    }
4734}
4735
4736/// Compare packed unsigned 8-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
4737///
4738/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmp_epu8_mask&expand=729)
4739#[inline]
4740#[target_feature(enable = "avx512bw,avx512vl")]
4741#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4742#[rustc_legacy_const_generics(2)]
4743#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4744#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4745pub const fn _mm_cmp_epu8_mask<const IMM8: i32>(a: __m128i, b: __m128i) -> __mmask16 {
4746    unsafe {
4747        static_assert_uimm_bits!(IMM8, 3);
4748        let a = a.as_u8x16();
4749        let b = b.as_u8x16();
4750        let r = match IMM8 {
4751            0 => simd_eq(a, b),
4752            1 => simd_lt(a, b),
4753            2 => simd_le(a, b),
4754            3 => i8x16::ZERO,
4755            4 => simd_ne(a, b),
4756            5 => simd_ge(a, b),
4757            6 => simd_gt(a, b),
4758            _ => i8x16::splat(-1),
4759        };
4760        simd_bitmask(r)
4761    }
4762}
4763
4764/// Compare packed unsigned 8-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
4765///
4766/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmp_epu8_mask&expand=730)
4767#[inline]
4768#[target_feature(enable = "avx512bw,avx512vl")]
4769#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4770#[rustc_legacy_const_generics(3)]
4771#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4772#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4773pub const fn _mm_mask_cmp_epu8_mask<const IMM8: i32>(
4774    k1: __mmask16,
4775    a: __m128i,
4776    b: __m128i,
4777) -> __mmask16 {
4778    unsafe {
4779        static_assert_uimm_bits!(IMM8, 3);
4780        let a = a.as_u8x16();
4781        let b = b.as_u8x16();
4782        let k1 = simd_select_bitmask(k1, i8x16::splat(-1), i8x16::ZERO);
4783        let r = match IMM8 {
4784            0 => simd_and(k1, simd_eq(a, b)),
4785            1 => simd_and(k1, simd_lt(a, b)),
4786            2 => simd_and(k1, simd_le(a, b)),
4787            3 => i8x16::ZERO,
4788            4 => simd_and(k1, simd_ne(a, b)),
4789            5 => simd_and(k1, simd_ge(a, b)),
4790            6 => simd_and(k1, simd_gt(a, b)),
4791            _ => k1,
4792        };
4793        simd_bitmask(r)
4794    }
4795}
4796
4797/// Compare packed signed 16-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
4798///
4799/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmp_epi16_mask&expand=691)
4800#[inline]
4801#[target_feature(enable = "avx512bw")]
4802#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4803#[rustc_legacy_const_generics(2)]
4804#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4805#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4806pub const fn _mm512_cmp_epi16_mask<const IMM8: i32>(a: __m512i, b: __m512i) -> __mmask32 {
4807    unsafe {
4808        static_assert_uimm_bits!(IMM8, 3);
4809        let a = a.as_i16x32();
4810        let b = b.as_i16x32();
4811        let r = match IMM8 {
4812            0 => simd_eq(a, b),
4813            1 => simd_lt(a, b),
4814            2 => simd_le(a, b),
4815            3 => i16x32::ZERO,
4816            4 => simd_ne(a, b),
4817            5 => simd_ge(a, b),
4818            6 => simd_gt(a, b),
4819            _ => i16x32::splat(-1),
4820        };
4821        simd_bitmask(r)
4822    }
4823}
4824
4825/// Compare packed signed 16-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
4826///
4827/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmp_epi16_mask&expand=692)
4828#[inline]
4829#[target_feature(enable = "avx512bw")]
4830#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4831#[rustc_legacy_const_generics(3)]
4832#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4833#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4834pub const fn _mm512_mask_cmp_epi16_mask<const IMM8: i32>(
4835    k1: __mmask32,
4836    a: __m512i,
4837    b: __m512i,
4838) -> __mmask32 {
4839    unsafe {
4840        static_assert_uimm_bits!(IMM8, 3);
4841        let a = a.as_i16x32();
4842        let b = b.as_i16x32();
4843        let k1 = simd_select_bitmask(k1, i16x32::splat(-1), i16x32::ZERO);
4844        let r = match IMM8 {
4845            0 => simd_and(k1, simd_eq(a, b)),
4846            1 => simd_and(k1, simd_lt(a, b)),
4847            2 => simd_and(k1, simd_le(a, b)),
4848            3 => i16x32::ZERO,
4849            4 => simd_and(k1, simd_ne(a, b)),
4850            5 => simd_and(k1, simd_ge(a, b)),
4851            6 => simd_and(k1, simd_gt(a, b)),
4852            _ => k1,
4853        };
4854        simd_bitmask(r)
4855    }
4856}
4857
4858/// Compare packed signed 16-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
4859///
4860/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmp_epi16_mask&expand=689)
4861#[inline]
4862#[target_feature(enable = "avx512bw,avx512vl")]
4863#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4864#[rustc_legacy_const_generics(2)]
4865#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4866#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4867pub const fn _mm256_cmp_epi16_mask<const IMM8: i32>(a: __m256i, b: __m256i) -> __mmask16 {
4868    unsafe {
4869        static_assert_uimm_bits!(IMM8, 3);
4870        let a = a.as_i16x16();
4871        let b = b.as_i16x16();
4872        let r = match IMM8 {
4873            0 => simd_eq(a, b),
4874            1 => simd_lt(a, b),
4875            2 => simd_le(a, b),
4876            3 => i16x16::ZERO,
4877            4 => simd_ne(a, b),
4878            5 => simd_ge(a, b),
4879            6 => simd_gt(a, b),
4880            _ => i16x16::splat(-1),
4881        };
4882        simd_bitmask(r)
4883    }
4884}
4885
4886/// Compare packed signed 16-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
4887///
4888/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmp_epi16_mask&expand=690)
4889#[inline]
4890#[target_feature(enable = "avx512bw,avx512vl")]
4891#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4892#[rustc_legacy_const_generics(3)]
4893#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4894#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4895pub const fn _mm256_mask_cmp_epi16_mask<const IMM8: i32>(
4896    k1: __mmask16,
4897    a: __m256i,
4898    b: __m256i,
4899) -> __mmask16 {
4900    unsafe {
4901        static_assert_uimm_bits!(IMM8, 3);
4902        let a = a.as_i16x16();
4903        let b = b.as_i16x16();
4904        let k1 = simd_select_bitmask(k1, i16x16::splat(-1), i16x16::ZERO);
4905        let r = match IMM8 {
4906            0 => simd_and(k1, simd_eq(a, b)),
4907            1 => simd_and(k1, simd_lt(a, b)),
4908            2 => simd_and(k1, simd_le(a, b)),
4909            3 => i16x16::ZERO,
4910            4 => simd_and(k1, simd_ne(a, b)),
4911            5 => simd_and(k1, simd_ge(a, b)),
4912            6 => simd_and(k1, simd_gt(a, b)),
4913            _ => k1,
4914        };
4915        simd_bitmask(r)
4916    }
4917}
4918
4919/// Compare packed signed 16-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
4920///
4921/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmp_epi16_mask&expand=687)
4922#[inline]
4923#[target_feature(enable = "avx512bw,avx512vl")]
4924#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4925#[rustc_legacy_const_generics(2)]
4926#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4927#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4928pub const fn _mm_cmp_epi16_mask<const IMM8: i32>(a: __m128i, b: __m128i) -> __mmask8 {
4929    unsafe {
4930        static_assert_uimm_bits!(IMM8, 3);
4931        let a = a.as_i16x8();
4932        let b = b.as_i16x8();
4933        let r = match IMM8 {
4934            0 => simd_eq(a, b),
4935            1 => simd_lt(a, b),
4936            2 => simd_le(a, b),
4937            3 => i16x8::ZERO,
4938            4 => simd_ne(a, b),
4939            5 => simd_ge(a, b),
4940            6 => simd_gt(a, b),
4941            _ => i16x8::splat(-1),
4942        };
4943        simd_bitmask(r)
4944    }
4945}
4946
4947/// Compare packed signed 16-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
4948///
4949/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmp_epi16_mask&expand=688)
4950#[inline]
4951#[target_feature(enable = "avx512bw,avx512vl")]
4952#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4953#[rustc_legacy_const_generics(3)]
4954#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4955#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4956pub const fn _mm_mask_cmp_epi16_mask<const IMM8: i32>(
4957    k1: __mmask8,
4958    a: __m128i,
4959    b: __m128i,
4960) -> __mmask8 {
4961    unsafe {
4962        static_assert_uimm_bits!(IMM8, 3);
4963        let a = a.as_i16x8();
4964        let b = b.as_i16x8();
4965        let k1 = simd_select_bitmask(k1, i16x8::splat(-1), i16x8::ZERO);
4966        let r = match IMM8 {
4967            0 => simd_and(k1, simd_eq(a, b)),
4968            1 => simd_and(k1, simd_lt(a, b)),
4969            2 => simd_and(k1, simd_le(a, b)),
4970            3 => i16x8::ZERO,
4971            4 => simd_and(k1, simd_ne(a, b)),
4972            5 => simd_and(k1, simd_ge(a, b)),
4973            6 => simd_and(k1, simd_gt(a, b)),
4974            _ => k1,
4975        };
4976        simd_bitmask(r)
4977    }
4978}
4979
4980/// Compare packed signed 8-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
4981///
4982/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmp_epi8_mask&expand=709)
4983#[inline]
4984#[target_feature(enable = "avx512bw")]
4985#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4986#[rustc_legacy_const_generics(2)]
4987#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4988#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4989pub const fn _mm512_cmp_epi8_mask<const IMM8: i32>(a: __m512i, b: __m512i) -> __mmask64 {
4990    unsafe {
4991        static_assert_uimm_bits!(IMM8, 3);
4992        let a = a.as_i8x64();
4993        let b = b.as_i8x64();
4994        let r = match IMM8 {
4995            0 => simd_eq(a, b),
4996            1 => simd_lt(a, b),
4997            2 => simd_le(a, b),
4998            3 => i8x64::ZERO,
4999            4 => simd_ne(a, b),
5000            5 => simd_ge(a, b),
5001            6 => simd_gt(a, b),
5002            _ => i8x64::splat(-1),
5003        };
5004        simd_bitmask(r)
5005    }
5006}
5007
5008/// Compare packed signed 8-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
5009///
5010/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmp_epi8_mask&expand=710)
5011#[inline]
5012#[target_feature(enable = "avx512bw")]
5013#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5014#[rustc_legacy_const_generics(3)]
5015#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
5016#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5017pub const fn _mm512_mask_cmp_epi8_mask<const IMM8: i32>(
5018    k1: __mmask64,
5019    a: __m512i,
5020    b: __m512i,
5021) -> __mmask64 {
5022    unsafe {
5023        static_assert_uimm_bits!(IMM8, 3);
5024        let a = a.as_i8x64();
5025        let b = b.as_i8x64();
5026        let k1 = simd_select_bitmask(k1, i8x64::splat(-1), i8x64::ZERO);
5027        let r = match IMM8 {
5028            0 => simd_and(k1, simd_eq(a, b)),
5029            1 => simd_and(k1, simd_lt(a, b)),
5030            2 => simd_and(k1, simd_le(a, b)),
5031            3 => i8x64::ZERO,
5032            4 => simd_and(k1, simd_ne(a, b)),
5033            5 => simd_and(k1, simd_ge(a, b)),
5034            6 => simd_and(k1, simd_gt(a, b)),
5035            _ => k1,
5036        };
5037        simd_bitmask(r)
5038    }
5039}
5040
5041/// Compare packed signed 8-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
5042///
5043/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmp_epi8_mask&expand=707)
5044#[inline]
5045#[target_feature(enable = "avx512bw,avx512vl")]
5046#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5047#[rustc_legacy_const_generics(2)]
5048#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
5049#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5050pub const fn _mm256_cmp_epi8_mask<const IMM8: i32>(a: __m256i, b: __m256i) -> __mmask32 {
5051    unsafe {
5052        static_assert_uimm_bits!(IMM8, 3);
5053        let a = a.as_i8x32();
5054        let b = b.as_i8x32();
5055        let r = match IMM8 {
5056            0 => simd_eq(a, b),
5057            1 => simd_lt(a, b),
5058            2 => simd_le(a, b),
5059            3 => i8x32::ZERO,
5060            4 => simd_ne(a, b),
5061            5 => simd_ge(a, b),
5062            6 => simd_gt(a, b),
5063            _ => i8x32::splat(-1),
5064        };
5065        simd_bitmask(r)
5066    }
5067}
5068
5069/// Compare packed signed 8-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
5070///
5071/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmp_epi8_mask&expand=708)
5072#[inline]
5073#[target_feature(enable = "avx512bw,avx512vl")]
5074#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5075#[rustc_legacy_const_generics(3)]
5076#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
5077#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5078pub const fn _mm256_mask_cmp_epi8_mask<const IMM8: i32>(
5079    k1: __mmask32,
5080    a: __m256i,
5081    b: __m256i,
5082) -> __mmask32 {
5083    unsafe {
5084        static_assert_uimm_bits!(IMM8, 3);
5085        let a = a.as_i8x32();
5086        let b = b.as_i8x32();
5087        let k1 = simd_select_bitmask(k1, i8x32::splat(-1), i8x32::ZERO);
5088        let r = match IMM8 {
5089            0 => simd_and(k1, simd_eq(a, b)),
5090            1 => simd_and(k1, simd_lt(a, b)),
5091            2 => simd_and(k1, simd_le(a, b)),
5092            3 => i8x32::ZERO,
5093            4 => simd_and(k1, simd_ne(a, b)),
5094            5 => simd_and(k1, simd_ge(a, b)),
5095            6 => simd_and(k1, simd_gt(a, b)),
5096            _ => k1,
5097        };
5098        simd_bitmask(r)
5099    }
5100}
5101
5102/// Compare packed signed 8-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
5103///
5104/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmp_epi8_mask&expand=705)
5105#[inline]
5106#[target_feature(enable = "avx512bw,avx512vl")]
5107#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5108#[rustc_legacy_const_generics(2)]
5109#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
5110#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5111pub const fn _mm_cmp_epi8_mask<const IMM8: i32>(a: __m128i, b: __m128i) -> __mmask16 {
5112    unsafe {
5113        static_assert_uimm_bits!(IMM8, 3);
5114        let a = a.as_i8x16();
5115        let b = b.as_i8x16();
5116        let r = match IMM8 {
5117            0 => simd_eq(a, b),
5118            1 => simd_lt(a, b),
5119            2 => simd_le(a, b),
5120            3 => i8x16::ZERO,
5121            4 => simd_ne(a, b),
5122            5 => simd_ge(a, b),
5123            6 => simd_gt(a, b),
5124            _ => i8x16::splat(-1),
5125        };
5126        simd_bitmask(r)
5127    }
5128}
5129
5130/// Compare packed signed 8-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
5131///
5132/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmp_epi8_mask&expand=706)
5133#[inline]
5134#[target_feature(enable = "avx512bw,avx512vl")]
5135#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5136#[rustc_legacy_const_generics(3)]
5137#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
5138#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5139pub const fn _mm_mask_cmp_epi8_mask<const IMM8: i32>(
5140    k1: __mmask16,
5141    a: __m128i,
5142    b: __m128i,
5143) -> __mmask16 {
5144    unsafe {
5145        static_assert_uimm_bits!(IMM8, 3);
5146        let a = a.as_i8x16();
5147        let b = b.as_i8x16();
5148        let k1 = simd_select_bitmask(k1, i8x16::splat(-1), i8x16::ZERO);
5149        let r = match IMM8 {
5150            0 => simd_and(k1, simd_eq(a, b)),
5151            1 => simd_and(k1, simd_lt(a, b)),
5152            2 => simd_and(k1, simd_le(a, b)),
5153            3 => i8x16::ZERO,
5154            4 => simd_and(k1, simd_ne(a, b)),
5155            5 => simd_and(k1, simd_ge(a, b)),
5156            6 => simd_and(k1, simd_gt(a, b)),
5157            _ => k1,
5158        };
5159        simd_bitmask(r)
5160    }
5161}
5162
5163/// Reduce the packed 16-bit integers in a by addition. Returns the sum of all elements in a.
5164///
5165/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_reduce_add_epi16)
5166#[inline]
5167#[target_feature(enable = "avx512bw,avx512vl")]
5168#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5169#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5170pub const fn _mm256_reduce_add_epi16(a: __m256i) -> i16 {
5171    unsafe { simd_reduce_add_ordered(a.as_i16x16(), 0) }
5172}
5173
5174/// Reduce the packed 16-bit integers in a by addition using mask k. Returns the sum of all active elements in a.
5175///
5176/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_reduce_add_epi16)
5177#[inline]
5178#[target_feature(enable = "avx512bw,avx512vl")]
5179#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5180#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5181pub const fn _mm256_mask_reduce_add_epi16(k: __mmask16, a: __m256i) -> i16 {
5182    unsafe { simd_reduce_add_ordered(simd_select_bitmask(k, a.as_i16x16(), i16x16::ZERO), 0) }
5183}
5184
5185/// Reduce the packed 16-bit integers in a by addition. Returns the sum of all elements in a.
5186///
5187/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_reduce_add_epi16)
5188#[inline]
5189#[target_feature(enable = "avx512bw,avx512vl")]
5190#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5191#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5192pub const fn _mm_reduce_add_epi16(a: __m128i) -> i16 {
5193    unsafe { simd_reduce_add_ordered(a.as_i16x8(), 0) }
5194}
5195
5196/// Reduce the packed 16-bit integers in a by addition using mask k. Returns the sum of all active elements in a.
5197///
5198/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_reduce_add_epi16)
5199#[inline]
5200#[target_feature(enable = "avx512bw,avx512vl")]
5201#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5202#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5203pub const fn _mm_mask_reduce_add_epi16(k: __mmask8, a: __m128i) -> i16 {
5204    unsafe { simd_reduce_add_ordered(simd_select_bitmask(k, a.as_i16x8(), i16x8::ZERO), 0) }
5205}
5206
5207/// Reduce the packed 8-bit integers in a by addition. Returns the sum of all elements in a.
5208///
5209/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_reduce_add_epi8)
5210#[inline]
5211#[target_feature(enable = "avx512bw,avx512vl")]
5212#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5213#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5214pub const fn _mm256_reduce_add_epi8(a: __m256i) -> i8 {
5215    unsafe { simd_reduce_add_ordered(a.as_i8x32(), 0) }
5216}
5217
5218/// Reduce the packed 8-bit integers in a by addition using mask k. Returns the sum of all active elements in a.
5219///
5220/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_reduce_add_epi8)
5221#[inline]
5222#[target_feature(enable = "avx512bw,avx512vl")]
5223#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5224#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5225pub const fn _mm256_mask_reduce_add_epi8(k: __mmask32, a: __m256i) -> i8 {
5226    unsafe { simd_reduce_add_ordered(simd_select_bitmask(k, a.as_i8x32(), i8x32::ZERO), 0) }
5227}
5228
5229/// Reduce the packed 8-bit integers in a by addition. Returns the sum of all elements in a.
5230///
5231/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_reduce_add_epi8)
5232#[inline]
5233#[target_feature(enable = "avx512bw,avx512vl")]
5234#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5235#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5236pub const fn _mm_reduce_add_epi8(a: __m128i) -> i8 {
5237    unsafe { simd_reduce_add_ordered(a.as_i8x16(), 0) }
5238}
5239
5240/// Reduce the packed 8-bit integers in a by addition using mask k. Returns the sum of all active elements in a.
5241///
5242/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_reduce_add_epi8)
5243#[inline]
5244#[target_feature(enable = "avx512bw,avx512vl")]
5245#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5246#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5247pub const fn _mm_mask_reduce_add_epi8(k: __mmask16, a: __m128i) -> i8 {
5248    unsafe { simd_reduce_add_ordered(simd_select_bitmask(k, a.as_i8x16(), i8x16::ZERO), 0) }
5249}
5250
5251/// Reduce the packed 16-bit integers in a by bitwise AND. Returns the bitwise AND of all elements in a.
5252///
5253/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_reduce_and_epi16)
5254#[inline]
5255#[target_feature(enable = "avx512bw,avx512vl")]
5256#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5257#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5258pub const fn _mm256_reduce_and_epi16(a: __m256i) -> i16 {
5259    unsafe { simd_reduce_and(a.as_i16x16()) }
5260}
5261
5262/// Reduce the packed 16-bit integers in a by bitwise AND using mask k. Returns the bitwise AND of all active elements in a.
5263///
5264/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_reduce_and_epi16)
5265#[inline]
5266#[target_feature(enable = "avx512bw,avx512vl")]
5267#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5268#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5269pub const fn _mm256_mask_reduce_and_epi16(k: __mmask16, a: __m256i) -> i16 {
5270    unsafe {
5271        simd_reduce_and(simd_select_bitmask(
5272            k,
5273            a.as_i16x16(),
5274            _mm256_set1_epi64x(-1).as_i16x16(),
5275        ))
5276    }
5277}
5278
5279/// Reduce the packed 16-bit integers in a by bitwise AND. Returns the bitwise AND of all elements in a.
5280///
5281/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_reduce_and_epi16)
5282#[inline]
5283#[target_feature(enable = "avx512bw,avx512vl")]
5284#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5285#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5286pub const fn _mm_reduce_and_epi16(a: __m128i) -> i16 {
5287    unsafe { simd_reduce_and(a.as_i16x8()) }
5288}
5289
5290/// Reduce the packed 16-bit integers in a by bitwise AND using mask k. Returns the bitwise AND of all active elements in a.
5291///
5292/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_reduce_and_epi16)
5293#[inline]
5294#[target_feature(enable = "avx512bw,avx512vl")]
5295#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5296#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5297pub const fn _mm_mask_reduce_and_epi16(k: __mmask8, a: __m128i) -> i16 {
5298    unsafe {
5299        simd_reduce_and(simd_select_bitmask(
5300            k,
5301            a.as_i16x8(),
5302            _mm_set1_epi64x(-1).as_i16x8(),
5303        ))
5304    }
5305}
5306
5307/// Reduce the packed 8-bit integers in a by bitwise AND. Returns the bitwise AND of all elements in a.
5308///
5309/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_reduce_and_epi8)
5310#[inline]
5311#[target_feature(enable = "avx512bw,avx512vl")]
5312#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5313#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5314pub const fn _mm256_reduce_and_epi8(a: __m256i) -> i8 {
5315    unsafe { simd_reduce_and(a.as_i8x32()) }
5316}
5317
5318/// Reduce the packed 8-bit integers in a by bitwise AND using mask k. Returns the bitwise AND of all active elements in a.
5319///
5320/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_reduce_and_epi8)
5321#[inline]
5322#[target_feature(enable = "avx512bw,avx512vl")]
5323#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5324#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5325pub const fn _mm256_mask_reduce_and_epi8(k: __mmask32, a: __m256i) -> i8 {
5326    unsafe {
5327        simd_reduce_and(simd_select_bitmask(
5328            k,
5329            a.as_i8x32(),
5330            _mm256_set1_epi64x(-1).as_i8x32(),
5331        ))
5332    }
5333}
5334
5335/// Reduce the packed 8-bit integers in a by bitwise AND. Returns the bitwise AND of all elements in a.
5336///
5337/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_reduce_and_epi8)
5338#[inline]
5339#[target_feature(enable = "avx512bw,avx512vl")]
5340#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5341#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5342pub const fn _mm_reduce_and_epi8(a: __m128i) -> i8 {
5343    unsafe { simd_reduce_and(a.as_i8x16()) }
5344}
5345
5346/// Reduce the packed 8-bit integers in a by bitwise AND using mask k. Returns the bitwise AND of all active elements in a.
5347///
5348/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_reduce_and_epi8)
5349#[inline]
5350#[target_feature(enable = "avx512bw,avx512vl")]
5351#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5352#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5353pub const fn _mm_mask_reduce_and_epi8(k: __mmask16, a: __m128i) -> i8 {
5354    unsafe {
5355        simd_reduce_and(simd_select_bitmask(
5356            k,
5357            a.as_i8x16(),
5358            _mm_set1_epi64x(-1).as_i8x16(),
5359        ))
5360    }
5361}
5362
5363/// Reduce the packed 16-bit integers in a by maximum. Returns the maximum of all elements in a.
5364///
5365/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_reduce_max_epi16)
5366#[inline]
5367#[target_feature(enable = "avx512bw,avx512vl")]
5368#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5369#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5370pub const fn _mm256_reduce_max_epi16(a: __m256i) -> i16 {
5371    unsafe { simd_reduce_max(a.as_i16x16()) }
5372}
5373
5374/// Reduce the packed 16-bit integers in a by maximum using mask k. Returns the maximum of all active elements in a.
5375///
5376/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_reduce_max_epi16)
5377#[inline]
5378#[target_feature(enable = "avx512bw,avx512vl")]
5379#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5380#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5381pub const fn _mm256_mask_reduce_max_epi16(k: __mmask16, a: __m256i) -> i16 {
5382    unsafe { simd_reduce_max(simd_select_bitmask(k, a.as_i16x16(), i16x16::splat(-32768))) }
5383}
5384
5385/// Reduce the packed 16-bit integers in a by maximum. Returns the maximum of all elements in a.
5386///
5387/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_reduce_max_epi16)
5388#[inline]
5389#[target_feature(enable = "avx512bw,avx512vl")]
5390#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5391#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5392pub const fn _mm_reduce_max_epi16(a: __m128i) -> i16 {
5393    unsafe { simd_reduce_max(a.as_i16x8()) }
5394}
5395
5396/// Reduce the packed 16-bit integers in a by maximum using mask k. Returns the maximum of all active elements in a.
5397///
5398/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_reduce_max_epi16)
5399#[inline]
5400#[target_feature(enable = "avx512bw,avx512vl")]
5401#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5402#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5403pub const fn _mm_mask_reduce_max_epi16(k: __mmask8, a: __m128i) -> i16 {
5404    unsafe { simd_reduce_max(simd_select_bitmask(k, a.as_i16x8(), i16x8::splat(-32768))) }
5405}
5406
5407/// Reduce the packed 8-bit integers in a by maximum. Returns the maximum of all elements in a.
5408///
5409/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_reduce_max_epi8)
5410#[inline]
5411#[target_feature(enable = "avx512bw,avx512vl")]
5412#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5413#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5414pub const fn _mm256_reduce_max_epi8(a: __m256i) -> i8 {
5415    unsafe { simd_reduce_max(a.as_i8x32()) }
5416}
5417
5418/// Reduce the packed 8-bit integers in a by maximum using mask k. Returns the maximum of all active elements in a.
5419///
5420/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_reduce_max_epi8)
5421#[inline]
5422#[target_feature(enable = "avx512bw,avx512vl")]
5423#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5424#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5425pub const fn _mm256_mask_reduce_max_epi8(k: __mmask32, a: __m256i) -> i8 {
5426    unsafe { simd_reduce_max(simd_select_bitmask(k, a.as_i8x32(), i8x32::splat(-128))) }
5427}
5428
5429/// Reduce the packed 8-bit integers in a by maximum. Returns the maximum of all elements in a.
5430///
5431/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_reduce_max_epi8)
5432#[inline]
5433#[target_feature(enable = "avx512bw,avx512vl")]
5434#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5435#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5436pub const fn _mm_reduce_max_epi8(a: __m128i) -> i8 {
5437    unsafe { simd_reduce_max(a.as_i8x16()) }
5438}
5439
5440/// Reduce the packed 8-bit integers in a by maximum using mask k. Returns the maximum of all active elements in a.
5441///
5442/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_reduce_max_epi8)
5443#[inline]
5444#[target_feature(enable = "avx512bw,avx512vl")]
5445#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5446#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5447pub const fn _mm_mask_reduce_max_epi8(k: __mmask16, a: __m128i) -> i8 {
5448    unsafe { simd_reduce_max(simd_select_bitmask(k, a.as_i8x16(), i8x16::splat(-128))) }
5449}
5450
5451/// Reduce the packed unsigned 16-bit integers in a by maximum. Returns the maximum of all elements in a.
5452///
5453/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_reduce_max_epu16)
5454#[inline]
5455#[target_feature(enable = "avx512bw,avx512vl")]
5456#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5457#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5458pub const fn _mm256_reduce_max_epu16(a: __m256i) -> u16 {
5459    unsafe { simd_reduce_max(a.as_u16x16()) }
5460}
5461
5462/// Reduce the packed unsigned 16-bit integers in a by maximum using mask k. Returns the maximum of all active elements in a.
5463///
5464/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_reduce_max_epu16)
5465#[inline]
5466#[target_feature(enable = "avx512bw,avx512vl")]
5467#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5468#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5469pub const fn _mm256_mask_reduce_max_epu16(k: __mmask16, a: __m256i) -> u16 {
5470    unsafe { simd_reduce_max(simd_select_bitmask(k, a.as_u16x16(), u16x16::ZERO)) }
5471}
5472
5473/// Reduce the packed unsigned 16-bit integers in a by maximum. Returns the maximum of all elements in a.
5474///
5475/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_reduce_max_epu16)
5476#[inline]
5477#[target_feature(enable = "avx512bw,avx512vl")]
5478#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5479#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5480pub const fn _mm_reduce_max_epu16(a: __m128i) -> u16 {
5481    unsafe { simd_reduce_max(a.as_u16x8()) }
5482}
5483
5484/// Reduce the packed unsigned 16-bit integers in a by maximum using mask k. Returns the maximum of all active elements in a.
5485///
5486/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_reduce_max_epu16)
5487#[inline]
5488#[target_feature(enable = "avx512bw,avx512vl")]
5489#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5490#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5491pub const fn _mm_mask_reduce_max_epu16(k: __mmask8, a: __m128i) -> u16 {
5492    unsafe { simd_reduce_max(simd_select_bitmask(k, a.as_u16x8(), u16x8::ZERO)) }
5493}
5494
5495/// Reduce the packed unsigned 8-bit integers in a by maximum. Returns the maximum of all elements in a.
5496///
5497/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_reduce_max_epu8)
5498#[inline]
5499#[target_feature(enable = "avx512bw,avx512vl")]
5500#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5501#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5502pub const fn _mm256_reduce_max_epu8(a: __m256i) -> u8 {
5503    unsafe { simd_reduce_max(a.as_u8x32()) }
5504}
5505
5506/// Reduce the packed unsigned 8-bit integers in a by maximum using mask k. Returns the maximum of all active elements in a.
5507///
5508/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_reduce_max_epu8)
5509#[inline]
5510#[target_feature(enable = "avx512bw,avx512vl")]
5511#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5512#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5513pub const fn _mm256_mask_reduce_max_epu8(k: __mmask32, a: __m256i) -> u8 {
5514    unsafe { simd_reduce_max(simd_select_bitmask(k, a.as_u8x32(), u8x32::ZERO)) }
5515}
5516
5517/// Reduce the packed unsigned 8-bit integers in a by maximum. Returns the maximum of all elements in a.
5518///
5519/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_reduce_max_epu8)
5520#[inline]
5521#[target_feature(enable = "avx512bw,avx512vl")]
5522#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5523#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5524pub const fn _mm_reduce_max_epu8(a: __m128i) -> u8 {
5525    unsafe { simd_reduce_max(a.as_u8x16()) }
5526}
5527
5528/// Reduce the packed unsigned 8-bit integers in a by maximum using mask k. Returns the maximum of all active elements in a.
5529///
5530/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_reduce_max_epu8)
5531#[inline]
5532#[target_feature(enable = "avx512bw,avx512vl")]
5533#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5534#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5535pub const fn _mm_mask_reduce_max_epu8(k: __mmask16, a: __m128i) -> u8 {
5536    unsafe { simd_reduce_max(simd_select_bitmask(k, a.as_u8x16(), u8x16::ZERO)) }
5537}
5538
5539/// Reduce the packed 16-bit integers in a by minimum. Returns the minimum of all elements in a.
5540///
5541/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_reduce_min_epi16)
5542#[inline]
5543#[target_feature(enable = "avx512bw,avx512vl")]
5544#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5545#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5546pub const fn _mm256_reduce_min_epi16(a: __m256i) -> i16 {
5547    unsafe { simd_reduce_min(a.as_i16x16()) }
5548}
5549
5550/// Reduce the packed 16-bit integers in a by minimum using mask k. Returns the minimum of all active elements in a.
5551///
5552/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_reduce_min_epi16)
5553#[inline]
5554#[target_feature(enable = "avx512bw,avx512vl")]
5555#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5556#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5557pub const fn _mm256_mask_reduce_min_epi16(k: __mmask16, a: __m256i) -> i16 {
5558    unsafe { simd_reduce_min(simd_select_bitmask(k, a.as_i16x16(), i16x16::splat(0x7fff))) }
5559}
5560
5561/// Reduce the packed 16-bit integers in a by minimum. Returns the minimum of all elements in a.
5562///
5563/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_reduce_min_epi16)
5564#[inline]
5565#[target_feature(enable = "avx512bw,avx512vl")]
5566#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5567#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5568pub const fn _mm_reduce_min_epi16(a: __m128i) -> i16 {
5569    unsafe { simd_reduce_min(a.as_i16x8()) }
5570}
5571
5572/// Reduce the packed 16-bit integers in a by minimum using mask k. Returns the minimum of all active elements in a.
5573///
5574/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_reduce_min_epi16)
5575#[inline]
5576#[target_feature(enable = "avx512bw,avx512vl")]
5577#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5578#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5579pub const fn _mm_mask_reduce_min_epi16(k: __mmask8, a: __m128i) -> i16 {
5580    unsafe { simd_reduce_min(simd_select_bitmask(k, a.as_i16x8(), i16x8::splat(0x7fff))) }
5581}
5582
5583/// Reduce the packed 8-bit integers in a by minimum. Returns the minimum of all elements in a.
5584///
5585/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_reduce_min_epi8)
5586#[inline]
5587#[target_feature(enable = "avx512bw,avx512vl")]
5588#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5589#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5590pub const fn _mm256_reduce_min_epi8(a: __m256i) -> i8 {
5591    unsafe { simd_reduce_min(a.as_i8x32()) }
5592}
5593
5594/// Reduce the packed 8-bit integers in a by minimum using mask k. Returns the minimum of all active elements in a.
5595///
5596/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_reduce_min_epi8)
5597#[inline]
5598#[target_feature(enable = "avx512bw,avx512vl")]
5599#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5600#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5601pub const fn _mm256_mask_reduce_min_epi8(k: __mmask32, a: __m256i) -> i8 {
5602    unsafe { simd_reduce_min(simd_select_bitmask(k, a.as_i8x32(), i8x32::splat(0x7f))) }
5603}
5604
5605/// Reduce the packed 8-bit integers in a by minimum. Returns the minimum of all elements in a.
5606///
5607/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_reduce_min_epi8)
5608#[inline]
5609#[target_feature(enable = "avx512bw,avx512vl")]
5610#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5611#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5612pub const fn _mm_reduce_min_epi8(a: __m128i) -> i8 {
5613    unsafe { simd_reduce_min(a.as_i8x16()) }
5614}
5615
5616/// Reduce the packed 8-bit integers in a by minimum using mask k. Returns the minimum of all active elements in a.
5617///
5618/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_reduce_min_epi8)
5619#[inline]
5620#[target_feature(enable = "avx512bw,avx512vl")]
5621#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5622#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5623pub const fn _mm_mask_reduce_min_epi8(k: __mmask16, a: __m128i) -> i8 {
5624    unsafe { simd_reduce_min(simd_select_bitmask(k, a.as_i8x16(), i8x16::splat(0x7f))) }
5625}
5626
5627/// Reduce the packed unsigned 16-bit integers in a by minimum. Returns the minimum of all elements in a.
5628///
5629/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_reduce_min_epu16)
5630#[inline]
5631#[target_feature(enable = "avx512bw,avx512vl")]
5632#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5633#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5634pub const fn _mm256_reduce_min_epu16(a: __m256i) -> u16 {
5635    unsafe { simd_reduce_min(a.as_u16x16()) }
5636}
5637
5638/// Reduce the packed unsigned 16-bit integers in a by minimum using mask k. Returns the minimum of all active elements in a.
5639///
5640/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_reduce_min_epu16)
5641#[inline]
5642#[target_feature(enable = "avx512bw,avx512vl")]
5643#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5644#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5645pub const fn _mm256_mask_reduce_min_epu16(k: __mmask16, a: __m256i) -> u16 {
5646    unsafe { simd_reduce_min(simd_select_bitmask(k, a.as_u16x16(), u16x16::splat(0xffff))) }
5647}
5648
5649/// Reduce the packed unsigned 16-bit integers in a by minimum. Returns the minimum of all elements in a.
5650///
5651/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_reduce_min_epu16)
5652#[inline]
5653#[target_feature(enable = "avx512bw,avx512vl")]
5654#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5655#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5656pub const fn _mm_reduce_min_epu16(a: __m128i) -> u16 {
5657    unsafe { simd_reduce_min(a.as_u16x8()) }
5658}
5659
5660/// Reduce the packed unsigned 16-bit integers in a by minimum using mask k. Returns the minimum of all active elements in a.
5661///
5662/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_reduce_min_epu16)
5663#[inline]
5664#[target_feature(enable = "avx512bw,avx512vl")]
5665#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5666#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5667pub const fn _mm_mask_reduce_min_epu16(k: __mmask8, a: __m128i) -> u16 {
5668    unsafe { simd_reduce_min(simd_select_bitmask(k, a.as_u16x8(), u16x8::splat(0xffff))) }
5669}
5670
5671/// Reduce the packed unsigned 8-bit integers in a by minimum. Returns the minimum of all elements in a.
5672///
5673/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_reduce_min_epu8)
5674#[inline]
5675#[target_feature(enable = "avx512bw,avx512vl")]
5676#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5677#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5678pub const fn _mm256_reduce_min_epu8(a: __m256i) -> u8 {
5679    unsafe { simd_reduce_min(a.as_u8x32()) }
5680}
5681
5682/// Reduce the packed unsigned 8-bit integers in a by minimum using mask k. Returns the minimum of all active elements in a.
5683///
5684/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_reduce_min_epu8)
5685#[inline]
5686#[target_feature(enable = "avx512bw,avx512vl")]
5687#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5688#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5689pub const fn _mm256_mask_reduce_min_epu8(k: __mmask32, a: __m256i) -> u8 {
5690    unsafe { simd_reduce_min(simd_select_bitmask(k, a.as_u8x32(), u8x32::splat(0xff))) }
5691}
5692
5693/// Reduce the packed unsigned 8-bit integers in a by minimum. Returns the minimum of all elements in a.
5694///
5695/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_reduce_min_epu8)
5696#[inline]
5697#[target_feature(enable = "avx512bw,avx512vl")]
5698#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5699#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5700pub const fn _mm_reduce_min_epu8(a: __m128i) -> u8 {
5701    unsafe { simd_reduce_min(a.as_u8x16()) }
5702}
5703
5704/// Reduce the packed unsigned 8-bit integers in a by minimum using mask k. Returns the minimum of all active elements in a.
5705///
5706/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_reduce_min_epu8)
5707#[inline]
5708#[target_feature(enable = "avx512bw,avx512vl")]
5709#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5710#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5711pub const fn _mm_mask_reduce_min_epu8(k: __mmask16, a: __m128i) -> u8 {
5712    unsafe { simd_reduce_min(simd_select_bitmask(k, a.as_u8x16(), u8x16::splat(0xff))) }
5713}
5714
5715/// Reduce the packed 16-bit integers in a by multiplication. Returns the product of all elements in a.
5716///
5717/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_reduce_mul_epi16)
5718#[inline]
5719#[target_feature(enable = "avx512bw,avx512vl")]
5720#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5721#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5722pub const fn _mm256_reduce_mul_epi16(a: __m256i) -> i16 {
5723    unsafe { simd_reduce_mul_ordered(a.as_i16x16(), 1) }
5724}
5725
5726/// Reduce the packed 16-bit integers in a by multiplication using mask k. Returns the product of all active elements in a.
5727///
5728/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_reduce_mul_epi16)
5729#[inline]
5730#[target_feature(enable = "avx512bw,avx512vl")]
5731#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5732#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5733pub const fn _mm256_mask_reduce_mul_epi16(k: __mmask16, a: __m256i) -> i16 {
5734    unsafe { simd_reduce_mul_ordered(simd_select_bitmask(k, a.as_i16x16(), i16x16::splat(1)), 1) }
5735}
5736
5737/// Reduce the packed 16-bit integers in a by multiplication. Returns the product of all elements in a.
5738///
5739/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_reduce_mul_epi16)
5740#[inline]
5741#[target_feature(enable = "avx512bw,avx512vl")]
5742#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5743#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5744pub const fn _mm_reduce_mul_epi16(a: __m128i) -> i16 {
5745    unsafe { simd_reduce_mul_ordered(a.as_i16x8(), 1) }
5746}
5747
5748/// Reduce the packed 16-bit integers in a by multiplication using mask k. Returns the product of all active elements in a.
5749///
5750/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_reduce_mul_epi16)
5751#[inline]
5752#[target_feature(enable = "avx512bw,avx512vl")]
5753#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5754#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5755pub const fn _mm_mask_reduce_mul_epi16(k: __mmask8, a: __m128i) -> i16 {
5756    unsafe { simd_reduce_mul_ordered(simd_select_bitmask(k, a.as_i16x8(), i16x8::splat(1)), 1) }
5757}
5758
5759/// Reduce the packed 8-bit integers in a by multiplication. Returns the product of all elements in a.
5760///
5761/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_reduce_mul_epi8)
5762#[inline]
5763#[target_feature(enable = "avx512bw,avx512vl")]
5764#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5765#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5766pub const fn _mm256_reduce_mul_epi8(a: __m256i) -> i8 {
5767    unsafe { simd_reduce_mul_ordered(a.as_i8x32(), 1) }
5768}
5769
5770/// Reduce the packed 8-bit integers in a by multiplication using mask k. Returns the product of all active elements in a.
5771///
5772/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_reduce_mul_epi8)
5773#[inline]
5774#[target_feature(enable = "avx512bw,avx512vl")]
5775#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5776#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5777pub const fn _mm256_mask_reduce_mul_epi8(k: __mmask32, a: __m256i) -> i8 {
5778    unsafe { simd_reduce_mul_ordered(simd_select_bitmask(k, a.as_i8x32(), i8x32::splat(1)), 1) }
5779}
5780
5781/// Reduce the packed 8-bit integers in a by multiplication. Returns the product of all elements in a.
5782///
5783/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_reduce_mul_epi8)
5784#[inline]
5785#[target_feature(enable = "avx512bw,avx512vl")]
5786#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5787#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5788pub const fn _mm_reduce_mul_epi8(a: __m128i) -> i8 {
5789    unsafe { simd_reduce_mul_ordered(a.as_i8x16(), 1) }
5790}
5791
5792/// Reduce the packed 8-bit integers in a by multiplication using mask k. Returns the product of all active elements in a.
5793///
5794/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_reduce_mul_epi8)
5795#[inline]
5796#[target_feature(enable = "avx512bw,avx512vl")]
5797#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5798#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5799pub const fn _mm_mask_reduce_mul_epi8(k: __mmask16, a: __m128i) -> i8 {
5800    unsafe { simd_reduce_mul_ordered(simd_select_bitmask(k, a.as_i8x16(), i8x16::splat(1)), 1) }
5801}
5802
5803/// Reduce the packed 16-bit integers in a by bitwise OR. Returns the bitwise OR of all elements in a.
5804///
5805/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_reduce_or_epi16)
5806#[inline]
5807#[target_feature(enable = "avx512bw,avx512vl")]
5808#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5809#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5810pub const fn _mm256_reduce_or_epi16(a: __m256i) -> i16 {
5811    unsafe { simd_reduce_or(a.as_i16x16()) }
5812}
5813
5814/// Reduce the packed 16-bit integers in a by bitwise OR using mask k. Returns the bitwise OR of all active elements in a.
5815///
5816/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_reduce_or_epi16)
5817#[inline]
5818#[target_feature(enable = "avx512bw,avx512vl")]
5819#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5820#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5821pub const fn _mm256_mask_reduce_or_epi16(k: __mmask16, a: __m256i) -> i16 {
5822    unsafe { simd_reduce_or(simd_select_bitmask(k, a.as_i16x16(), i16x16::ZERO)) }
5823}
5824
5825/// Reduce the packed 16-bit integers in a by bitwise OR. Returns the bitwise OR of all elements in a.
5826///
5827/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_reduce_or_epi16)
5828#[inline]
5829#[target_feature(enable = "avx512bw,avx512vl")]
5830#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5831#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5832pub const fn _mm_reduce_or_epi16(a: __m128i) -> i16 {
5833    unsafe { simd_reduce_or(a.as_i16x8()) }
5834}
5835
5836/// Reduce the packed 16-bit integers in a by bitwise OR using mask k. Returns the bitwise OR of all active elements in a.
5837///
5838/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_reduce_or_epi16)
5839#[inline]
5840#[target_feature(enable = "avx512bw,avx512vl")]
5841#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5842#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5843pub const fn _mm_mask_reduce_or_epi16(k: __mmask8, a: __m128i) -> i16 {
5844    unsafe { simd_reduce_or(simd_select_bitmask(k, a.as_i16x8(), i16x8::ZERO)) }
5845}
5846
5847/// Reduce the packed 8-bit integers in a by bitwise OR. Returns the bitwise OR of all elements in a.
5848///
5849/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_reduce_or_epi8)
5850#[inline]
5851#[target_feature(enable = "avx512bw,avx512vl")]
5852#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5853#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5854pub const fn _mm256_reduce_or_epi8(a: __m256i) -> i8 {
5855    unsafe { simd_reduce_or(a.as_i8x32()) }
5856}
5857
5858/// Reduce the packed 8-bit integers in a by bitwise OR using mask k. Returns the bitwise OR of all active elements in a.
5859///
5860/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_reduce_or_epi8)
5861#[inline]
5862#[target_feature(enable = "avx512bw,avx512vl")]
5863#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5864#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5865pub const fn _mm256_mask_reduce_or_epi8(k: __mmask32, a: __m256i) -> i8 {
5866    unsafe { simd_reduce_or(simd_select_bitmask(k, a.as_i8x32(), i8x32::ZERO)) }
5867}
5868
5869/// Reduce the packed 8-bit integers in a by bitwise OR. Returns the bitwise OR of all elements in a.
5870///
5871/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_reduce_or_epi8)
5872#[inline]
5873#[target_feature(enable = "avx512bw,avx512vl")]
5874#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5875#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5876pub const fn _mm_reduce_or_epi8(a: __m128i) -> i8 {
5877    unsafe { simd_reduce_or(a.as_i8x16()) }
5878}
5879
5880/// Reduce the packed 8-bit integers in a by bitwise OR using mask k. Returns the bitwise OR of all active elements in a.
5881///
5882/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_reduce_or_epi8)
5883#[inline]
5884#[target_feature(enable = "avx512bw,avx512vl")]
5885#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5886#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5887pub const fn _mm_mask_reduce_or_epi8(k: __mmask16, a: __m128i) -> i8 {
5888    unsafe { simd_reduce_or(simd_select_bitmask(k, a.as_i8x16(), i8x16::ZERO)) }
5889}
5890
5891/// Load 512-bits (composed of 32 packed 16-bit integers) from memory into dst. mem_addr does not need to be aligned on any particular boundary.
5892///
5893/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_loadu_epi16&expand=3368)
5894#[inline]
5895#[target_feature(enable = "avx512bw")]
5896#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5897#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu16
5898#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5899pub const unsafe fn _mm512_loadu_epi16(mem_addr: *const i16) -> __m512i {
5900    ptr::read_unaligned(mem_addr as *const __m512i)
5901}
5902
5903/// Load 256-bits (composed of 16 packed 16-bit integers) from memory into dst. mem_addr does not need to be aligned on any particular boundary.
5904///
5905/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_loadu_epi16&expand=3365)
5906#[inline]
5907#[target_feature(enable = "avx512bw,avx512vl")]
5908#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5909#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu16
5910#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5911pub const unsafe fn _mm256_loadu_epi16(mem_addr: *const i16) -> __m256i {
5912    ptr::read_unaligned(mem_addr as *const __m256i)
5913}
5914
5915/// Load 128-bits (composed of 8 packed 16-bit integers) from memory into dst. mem_addr does not need to be aligned on any particular boundary.
5916///
5917/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_loadu_epi16&expand=3362)
5918#[inline]
5919#[target_feature(enable = "avx512bw,avx512vl")]
5920#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5921#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu16
5922#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5923pub const unsafe fn _mm_loadu_epi16(mem_addr: *const i16) -> __m128i {
5924    ptr::read_unaligned(mem_addr as *const __m128i)
5925}
5926
5927/// Load 512-bits (composed of 64 packed 8-bit integers) from memory into dst. mem_addr does not need to be aligned on any particular boundary.
5928///
5929/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_loadu_epi8&expand=3395)
5930#[inline]
5931#[target_feature(enable = "avx512bw")]
5932#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5933#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu8
5934#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5935pub const unsafe fn _mm512_loadu_epi8(mem_addr: *const i8) -> __m512i {
5936    ptr::read_unaligned(mem_addr as *const __m512i)
5937}
5938
5939/// Load 256-bits (composed of 32 packed 8-bit integers) from memory into dst. mem_addr does not need to be aligned on any particular boundary.
5940///
5941/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_loadu_epi8&expand=3392)
5942#[inline]
5943#[target_feature(enable = "avx512bw,avx512vl")]
5944#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5945#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu8
5946#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5947pub const unsafe fn _mm256_loadu_epi8(mem_addr: *const i8) -> __m256i {
5948    ptr::read_unaligned(mem_addr as *const __m256i)
5949}
5950
5951/// Load 128-bits (composed of 16 packed 8-bit integers) from memory into dst. mem_addr does not need to be aligned on any particular boundary.
5952///
5953/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_loadu_epi8&expand=3389)
5954#[inline]
5955#[target_feature(enable = "avx512bw,avx512vl")]
5956#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5957#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu8
5958#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5959pub const unsafe fn _mm_loadu_epi8(mem_addr: *const i8) -> __m128i {
5960    ptr::read_unaligned(mem_addr as *const __m128i)
5961}
5962
5963/// Store 512-bits (composed of 32 packed 16-bit integers) from a into memory. mem_addr does not need to be aligned on any particular boundary.
5964///
5965/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_storeu_epi16&expand=5622)
5966#[inline]
5967#[target_feature(enable = "avx512bw")]
5968#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5969#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu16
5970#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5971pub const unsafe fn _mm512_storeu_epi16(mem_addr: *mut i16, a: __m512i) {
5972    ptr::write_unaligned(mem_addr as *mut __m512i, a);
5973}
5974
5975/// Store 256-bits (composed of 16 packed 16-bit integers) from a into memory. mem_addr does not need to be aligned on any particular boundary.
5976///
5977/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_storeu_epi16&expand=5620)
5978#[inline]
5979#[target_feature(enable = "avx512bw,avx512vl")]
5980#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5981#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu16
5982#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5983pub const unsafe fn _mm256_storeu_epi16(mem_addr: *mut i16, a: __m256i) {
5984    ptr::write_unaligned(mem_addr as *mut __m256i, a);
5985}
5986
5987/// Store 128-bits (composed of 8 packed 16-bit integers) from a into memory. mem_addr does not need to be aligned on any particular boundary.
5988///
5989/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_storeu_epi16&expand=5618)
5990#[inline]
5991#[target_feature(enable = "avx512bw,avx512vl")]
5992#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5993#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu16
5994#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5995pub const unsafe fn _mm_storeu_epi16(mem_addr: *mut i16, a: __m128i) {
5996    ptr::write_unaligned(mem_addr as *mut __m128i, a);
5997}
5998
5999/// Store 512-bits (composed of 64 packed 8-bit integers) from a into memory. mem_addr does not need to be aligned on any particular boundary.
6000///
6001/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_storeu_epi8&expand=5640)
6002#[inline]
6003#[target_feature(enable = "avx512bw")]
6004#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6005#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu8
6006#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6007pub const unsafe fn _mm512_storeu_epi8(mem_addr: *mut i8, a: __m512i) {
6008    ptr::write_unaligned(mem_addr as *mut __m512i, a);
6009}
6010
6011/// Store 256-bits (composed of 32 packed 8-bit integers) from a into memory. mem_addr does not need to be aligned on any particular boundary.
6012///
6013/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_storeu_epi8&expand=5638)
6014#[inline]
6015#[target_feature(enable = "avx512bw,avx512vl")]
6016#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6017#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu8
6018#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6019pub const unsafe fn _mm256_storeu_epi8(mem_addr: *mut i8, a: __m256i) {
6020    ptr::write_unaligned(mem_addr as *mut __m256i, a);
6021}
6022
6023/// Store 128-bits (composed of 16 packed 8-bit integers) from a into memory. mem_addr does not need to be aligned on any particular boundary.
6024///
6025/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_storeu_epi8&expand=5636)
6026#[inline]
6027#[target_feature(enable = "avx512bw,avx512vl")]
6028#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6029#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu8
6030#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6031pub const unsafe fn _mm_storeu_epi8(mem_addr: *mut i8, a: __m128i) {
6032    ptr::write_unaligned(mem_addr as *mut __m128i, a);
6033}
6034
6035/// Load packed 16-bit integers from memory into dst using writemask k
6036/// (elements are copied from src when the corresponding mask bit is not set).
6037/// mem_addr does not need to be aligned on any particular boundary.
6038///
6039/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_loadu_epi16)
6040#[inline]
6041#[target_feature(enable = "avx512bw")]
6042#[cfg_attr(test, assert_instr(vmovdqu16))]
6043#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6044#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6045pub const unsafe fn _mm512_mask_loadu_epi16(
6046    src: __m512i,
6047    k: __mmask32,
6048    mem_addr: *const i16,
6049) -> __m512i {
6050    let mask = simd_select_bitmask(k, i16x32::splat(!0), i16x32::ZERO);
6051    simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_i16x32()).as_m512i()
6052}
6053
6054/// Load packed 16-bit integers from memory into dst using zeromask k
6055/// (elements are zeroed out when the corresponding mask bit is not set).
6056/// mem_addr does not need to be aligned on any particular boundary.
6057///
6058/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_loadu_epi16)
6059#[inline]
6060#[target_feature(enable = "avx512bw")]
6061#[cfg_attr(test, assert_instr(vmovdqu16))]
6062#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6063#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6064pub const unsafe fn _mm512_maskz_loadu_epi16(k: __mmask32, mem_addr: *const i16) -> __m512i {
6065    _mm512_mask_loadu_epi16(_mm512_setzero_si512(), k, mem_addr)
6066}
6067
6068/// Load packed 8-bit integers from memory into dst using writemask k
6069/// (elements are copied from src when the corresponding mask bit is not set).
6070/// mem_addr does not need to be aligned on any particular boundary.
6071///
6072/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_loadu_epi8)
6073#[inline]
6074#[target_feature(enable = "avx512bw")]
6075#[cfg_attr(test, assert_instr(vmovdqu8))]
6076#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6077#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6078pub const unsafe fn _mm512_mask_loadu_epi8(
6079    src: __m512i,
6080    k: __mmask64,
6081    mem_addr: *const i8,
6082) -> __m512i {
6083    let mask = simd_select_bitmask(k, i8x64::splat(!0), i8x64::ZERO);
6084    simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_i8x64()).as_m512i()
6085}
6086
6087/// Load packed 8-bit integers from memory into dst using zeromask k
6088/// (elements are zeroed out when the corresponding mask bit is not set).
6089/// mem_addr does not need to be aligned on any particular boundary.
6090///
6091/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_loadu_epi8)
6092#[inline]
6093#[target_feature(enable = "avx512bw")]
6094#[cfg_attr(test, assert_instr(vmovdqu8))]
6095#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6096#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6097pub const unsafe fn _mm512_maskz_loadu_epi8(k: __mmask64, mem_addr: *const i8) -> __m512i {
6098    _mm512_mask_loadu_epi8(_mm512_setzero_si512(), k, mem_addr)
6099}
6100
6101/// Load packed 16-bit integers from memory into dst using writemask k
6102/// (elements are copied from src when the corresponding mask bit is not set).
6103/// mem_addr does not need to be aligned on any particular boundary.
6104///
6105/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_loadu_epi16)
6106#[inline]
6107#[target_feature(enable = "avx512bw,avx512vl")]
6108#[cfg_attr(test, assert_instr(vmovdqu16))]
6109#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6110#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6111pub const unsafe fn _mm256_mask_loadu_epi16(
6112    src: __m256i,
6113    k: __mmask16,
6114    mem_addr: *const i16,
6115) -> __m256i {
6116    let mask = simd_select_bitmask(k, i16x16::splat(!0), i16x16::ZERO);
6117    simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_i16x16()).as_m256i()
6118}
6119
6120/// Load packed 16-bit integers from memory into dst using zeromask k
6121/// (elements are zeroed out when the corresponding mask bit is not set).
6122/// mem_addr does not need to be aligned on any particular boundary.
6123///
6124/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_loadu_epi16)
6125#[inline]
6126#[target_feature(enable = "avx512bw,avx512vl")]
6127#[cfg_attr(test, assert_instr(vmovdqu16))]
6128#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6129#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6130pub const unsafe fn _mm256_maskz_loadu_epi16(k: __mmask16, mem_addr: *const i16) -> __m256i {
6131    _mm256_mask_loadu_epi16(_mm256_setzero_si256(), k, mem_addr)
6132}
6133
6134/// Load packed 8-bit integers from memory into dst using writemask k
6135/// (elements are copied from src when the corresponding mask bit is not set).
6136/// mem_addr does not need to be aligned on any particular boundary.
6137///
6138/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_loadu_epi8)
6139#[inline]
6140#[target_feature(enable = "avx512bw,avx512vl")]
6141#[cfg_attr(test, assert_instr(vmovdqu8))]
6142#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6143#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6144pub const unsafe fn _mm256_mask_loadu_epi8(
6145    src: __m256i,
6146    k: __mmask32,
6147    mem_addr: *const i8,
6148) -> __m256i {
6149    let mask = simd_select_bitmask(k, i8x32::splat(!0), i8x32::ZERO);
6150    simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_i8x32()).as_m256i()
6151}
6152
6153/// Load packed 8-bit integers from memory into dst using zeromask k
6154/// (elements are zeroed out when the corresponding mask bit is not set).
6155/// mem_addr does not need to be aligned on any particular boundary.
6156///
6157/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_loadu_epi8)
6158#[inline]
6159#[target_feature(enable = "avx512bw,avx512vl")]
6160#[cfg_attr(test, assert_instr(vmovdqu8))]
6161#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6162#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6163pub const unsafe fn _mm256_maskz_loadu_epi8(k: __mmask32, mem_addr: *const i8) -> __m256i {
6164    _mm256_mask_loadu_epi8(_mm256_setzero_si256(), k, mem_addr)
6165}
6166
6167/// Load packed 16-bit integers from memory into dst using writemask k
6168/// (elements are copied from src when the corresponding mask bit is not set).
6169/// mem_addr does not need to be aligned on any particular boundary.
6170///
6171/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_loadu_epi16)
6172#[inline]
6173#[target_feature(enable = "avx512bw,avx512vl")]
6174#[cfg_attr(test, assert_instr(vmovdqu16))]
6175#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6176#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6177pub const unsafe fn _mm_mask_loadu_epi16(
6178    src: __m128i,
6179    k: __mmask8,
6180    mem_addr: *const i16,
6181) -> __m128i {
6182    let mask = simd_select_bitmask(k, i16x8::splat(!0), i16x8::ZERO);
6183    simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_i16x8()).as_m128i()
6184}
6185
6186/// Load packed 16-bit integers from memory into dst using zeromask k
6187/// (elements are zeroed out when the corresponding mask bit is not set).
6188/// mem_addr does not need to be aligned on any particular boundary.
6189///
6190/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_loadu_epi16)
6191#[inline]
6192#[target_feature(enable = "avx512bw,avx512vl")]
6193#[cfg_attr(test, assert_instr(vmovdqu16))]
6194#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6195#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6196pub const unsafe fn _mm_maskz_loadu_epi16(k: __mmask8, mem_addr: *const i16) -> __m128i {
6197    _mm_mask_loadu_epi16(_mm_setzero_si128(), k, mem_addr)
6198}
6199
6200/// Load packed 8-bit integers from memory into dst using writemask k
6201/// (elements are copied from src when the corresponding mask bit is not set).
6202/// mem_addr does not need to be aligned on any particular boundary.
6203///
6204/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_loadu_epi8)
6205#[inline]
6206#[target_feature(enable = "avx512bw,avx512vl")]
6207#[cfg_attr(test, assert_instr(vmovdqu8))]
6208#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6209#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6210pub const unsafe fn _mm_mask_loadu_epi8(
6211    src: __m128i,
6212    k: __mmask16,
6213    mem_addr: *const i8,
6214) -> __m128i {
6215    let mask = simd_select_bitmask(k, i8x16::splat(!0), i8x16::ZERO);
6216    simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_i8x16()).as_m128i()
6217}
6218
6219/// Load packed 8-bit integers from memory into dst using zeromask k
6220/// (elements are zeroed out when the corresponding mask bit is not set).
6221/// mem_addr does not need to be aligned on any particular boundary.
6222///
6223/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_loadu_epi8)
6224#[inline]
6225#[target_feature(enable = "avx512bw,avx512vl")]
6226#[cfg_attr(test, assert_instr(vmovdqu8))]
6227#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6228#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6229pub const unsafe fn _mm_maskz_loadu_epi8(k: __mmask16, mem_addr: *const i8) -> __m128i {
6230    _mm_mask_loadu_epi8(_mm_setzero_si128(), k, mem_addr)
6231}
6232
6233/// Store packed 16-bit integers from a into memory using writemask k.
6234/// mem_addr does not need to be aligned on any particular boundary.
6235///
6236/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_storeu_epi16)
6237#[inline]
6238#[target_feature(enable = "avx512bw")]
6239#[cfg_attr(test, assert_instr(vmovdqu16))]
6240#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6241#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6242pub const unsafe fn _mm512_mask_storeu_epi16(mem_addr: *mut i16, mask: __mmask32, a: __m512i) {
6243    let mask = simd_select_bitmask(mask, i16x32::splat(!0), i16x32::ZERO);
6244    simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_i16x32());
6245}
6246
6247/// Store packed 8-bit integers from a into memory using writemask k.
6248/// mem_addr does not need to be aligned on any particular boundary.
6249///
6250/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_storeu_epi8)
6251#[inline]
6252#[target_feature(enable = "avx512bw")]
6253#[cfg_attr(test, assert_instr(vmovdqu8))]
6254#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6255#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6256pub const unsafe fn _mm512_mask_storeu_epi8(mem_addr: *mut i8, mask: __mmask64, a: __m512i) {
6257    let mask = simd_select_bitmask(mask, i8x64::splat(!0), i8x64::ZERO);
6258    simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_i8x64());
6259}
6260
6261/// Store packed 16-bit integers from a into memory using writemask k.
6262/// mem_addr does not need to be aligned on any particular boundary.
6263///
6264/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_storeu_epi16)
6265#[inline]
6266#[target_feature(enable = "avx512bw,avx512vl")]
6267#[cfg_attr(test, assert_instr(vmovdqu16))]
6268#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6269#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6270pub const unsafe fn _mm256_mask_storeu_epi16(mem_addr: *mut i16, mask: __mmask16, a: __m256i) {
6271    let mask = simd_select_bitmask(mask, i16x16::splat(!0), i16x16::ZERO);
6272    simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_i16x16());
6273}
6274
6275/// Store packed 8-bit integers from a into memory using writemask k.
6276/// mem_addr does not need to be aligned on any particular boundary.
6277///
6278/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_storeu_epi8)
6279#[inline]
6280#[target_feature(enable = "avx512bw,avx512vl")]
6281#[cfg_attr(test, assert_instr(vmovdqu8))]
6282#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6283#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6284pub const unsafe fn _mm256_mask_storeu_epi8(mem_addr: *mut i8, mask: __mmask32, a: __m256i) {
6285    let mask = simd_select_bitmask(mask, i8x32::splat(!0), i8x32::ZERO);
6286    simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_i8x32());
6287}
6288
6289/// Store packed 16-bit integers from a into memory using writemask k.
6290/// mem_addr does not need to be aligned on any particular boundary.
6291///
6292/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_storeu_epi16)
6293#[inline]
6294#[target_feature(enable = "avx512bw,avx512vl")]
6295#[cfg_attr(test, assert_instr(vmovdqu16))]
6296#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6297#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6298pub const unsafe fn _mm_mask_storeu_epi16(mem_addr: *mut i16, mask: __mmask8, a: __m128i) {
6299    let mask = simd_select_bitmask(mask, i16x8::splat(!0), i16x8::ZERO);
6300    simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_i16x8());
6301}
6302
6303/// Store packed 8-bit integers from a into memory using writemask k.
6304/// mem_addr does not need to be aligned on any particular boundary.
6305///
6306/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_storeu_epi8)
6307#[inline]
6308#[target_feature(enable = "avx512bw,avx512vl")]
6309#[cfg_attr(test, assert_instr(vmovdqu8))]
6310#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6311#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6312pub const unsafe fn _mm_mask_storeu_epi8(mem_addr: *mut i8, mask: __mmask16, a: __m128i) {
6313    let mask = simd_select_bitmask(mask, i8x16::splat(!0), i8x16::ZERO);
6314    simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_i8x16());
6315}
6316
6317/// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Horizontally add adjacent pairs of intermediate 32-bit integers, and pack the results in dst.
6318///
6319/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_madd_epi16&expand=3511)
6320#[inline]
6321#[target_feature(enable = "avx512bw")]
6322#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6323#[cfg_attr(test, assert_instr(vpmaddwd))]
6324pub fn _mm512_madd_epi16(a: __m512i, b: __m512i) -> __m512i {
6325    // It's a trick used in the Adler-32 algorithm to perform a widening addition.
6326    //
6327    // ```rust
6328    // #[target_feature(enable = "avx512bw")]
6329    // unsafe fn widening_add(mad: __m512i) -> __m512i {
6330    //     _mm512_madd_epi16(mad, _mm512_set1_epi16(1))
6331    // }
6332    // ```
6333    //
6334    // If we implement this using generic vector intrinsics, the optimizer
6335    // will eliminate this pattern, and `vpmaddwd` will no longer be emitted.
6336    // For this reason, we use x86 intrinsics.
6337    unsafe { transmute(vpmaddwd(a.as_i16x32(), b.as_i16x32())) }
6338}
6339
6340/// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Horizontally add adjacent pairs of intermediate 32-bit integers, and pack the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
6341///
6342/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_madd_epi16&expand=3512)
6343#[inline]
6344#[target_feature(enable = "avx512bw")]
6345#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6346#[cfg_attr(test, assert_instr(vpmaddwd))]
6347pub fn _mm512_mask_madd_epi16(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
6348    unsafe {
6349        let madd = _mm512_madd_epi16(a, b).as_i32x16();
6350        transmute(simd_select_bitmask(k, madd, src.as_i32x16()))
6351    }
6352}
6353
6354/// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Horizontally add adjacent pairs of intermediate 32-bit integers, and pack the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
6355///
6356/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_madd_epi16&expand=3513)
6357#[inline]
6358#[target_feature(enable = "avx512bw")]
6359#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6360#[cfg_attr(test, assert_instr(vpmaddwd))]
6361pub fn _mm512_maskz_madd_epi16(k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
6362    unsafe {
6363        let madd = _mm512_madd_epi16(a, b).as_i32x16();
6364        transmute(simd_select_bitmask(k, madd, i32x16::ZERO))
6365    }
6366}
6367
6368/// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Horizontally add adjacent pairs of intermediate 32-bit integers, and pack the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
6369///
6370/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_madd_epi16&expand=3509)
6371#[inline]
6372#[target_feature(enable = "avx512bw,avx512vl")]
6373#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6374#[cfg_attr(test, assert_instr(vpmaddwd))]
6375pub fn _mm256_mask_madd_epi16(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
6376    unsafe {
6377        let madd = _mm256_madd_epi16(a, b).as_i32x8();
6378        transmute(simd_select_bitmask(k, madd, src.as_i32x8()))
6379    }
6380}
6381
6382/// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Horizontally add adjacent pairs of intermediate 32-bit integers, and pack the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
6383///
6384/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_madd_epi16&expand=3510)
6385#[inline]
6386#[target_feature(enable = "avx512bw,avx512vl")]
6387#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6388#[cfg_attr(test, assert_instr(vpmaddwd))]
6389pub fn _mm256_maskz_madd_epi16(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
6390    unsafe {
6391        let madd = _mm256_madd_epi16(a, b).as_i32x8();
6392        transmute(simd_select_bitmask(k, madd, i32x8::ZERO))
6393    }
6394}
6395
6396/// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Horizontally add adjacent pairs of intermediate 32-bit integers, and pack the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
6397///
6398/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_madd_epi16&expand=3506)
6399#[inline]
6400#[target_feature(enable = "avx512bw,avx512vl")]
6401#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6402#[cfg_attr(test, assert_instr(vpmaddwd))]
6403pub fn _mm_mask_madd_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
6404    unsafe {
6405        let madd = _mm_madd_epi16(a, b).as_i32x4();
6406        transmute(simd_select_bitmask(k, madd, src.as_i32x4()))
6407    }
6408}
6409
6410/// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Horizontally add adjacent pairs of intermediate 32-bit integers, and pack the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
6411///
6412/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_madd_epi16&expand=3507)
6413#[inline]
6414#[target_feature(enable = "avx512bw,avx512vl")]
6415#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6416#[cfg_attr(test, assert_instr(vpmaddwd))]
6417pub fn _mm_maskz_madd_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
6418    unsafe {
6419        let madd = _mm_madd_epi16(a, b).as_i32x4();
6420        transmute(simd_select_bitmask(k, madd, i32x4::ZERO))
6421    }
6422}
6423
6424/// Vertically multiply each unsigned 8-bit integer from a with the corresponding signed 8-bit integer from b, producing intermediate signed 16-bit integers. Horizontally add adjacent pairs of intermediate signed 16-bit integers, and pack the saturated results in dst.
6425///
6426/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maddubs_epi16&expand=3539)
6427#[inline]
6428#[target_feature(enable = "avx512bw")]
6429#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6430#[cfg_attr(test, assert_instr(vpmaddubsw))]
6431pub fn _mm512_maddubs_epi16(a: __m512i, b: __m512i) -> __m512i {
6432    unsafe { transmute(vpmaddubsw(a.as_u8x64(), b.as_i8x64())) }
6433}
6434
6435/// Multiply packed unsigned 8-bit integers in a by packed signed 8-bit integers in b, producing intermediate signed 16-bit integers. Horizontally add adjacent pairs of intermediate signed 16-bit integers, and pack the saturated results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
6436///
6437/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_maddubs_epi16&expand=3540)
6438#[inline]
6439#[target_feature(enable = "avx512bw")]
6440#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6441#[cfg_attr(test, assert_instr(vpmaddubsw))]
6442pub fn _mm512_mask_maddubs_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
6443    unsafe {
6444        let madd = _mm512_maddubs_epi16(a, b).as_i16x32();
6445        transmute(simd_select_bitmask(k, madd, src.as_i16x32()))
6446    }
6447}
6448
6449/// Multiply packed unsigned 8-bit integers in a by packed signed 8-bit integers in b, producing intermediate signed 16-bit integers. Horizontally add adjacent pairs of intermediate signed 16-bit integers, and pack the saturated results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
6450///
6451/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_maddubs_epi16&expand=3541)
6452#[inline]
6453#[target_feature(enable = "avx512bw")]
6454#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6455#[cfg_attr(test, assert_instr(vpmaddubsw))]
6456pub fn _mm512_maskz_maddubs_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
6457    unsafe {
6458        let madd = _mm512_maddubs_epi16(a, b).as_i16x32();
6459        transmute(simd_select_bitmask(k, madd, i16x32::ZERO))
6460    }
6461}
6462
6463/// Multiply packed unsigned 8-bit integers in a by packed signed 8-bit integers in b, producing intermediate signed 16-bit integers. Horizontally add adjacent pairs of intermediate signed 16-bit integers, and pack the saturated results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
6464///
6465/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_maddubs_epi16&expand=3537)
6466#[inline]
6467#[target_feature(enable = "avx512bw,avx512vl")]
6468#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6469#[cfg_attr(test, assert_instr(vpmaddubsw))]
6470pub fn _mm256_mask_maddubs_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
6471    unsafe {
6472        let madd = _mm256_maddubs_epi16(a, b).as_i16x16();
6473        transmute(simd_select_bitmask(k, madd, src.as_i16x16()))
6474    }
6475}
6476
6477/// Multiply packed unsigned 8-bit integers in a by packed signed 8-bit integers in b, producing intermediate signed 16-bit integers. Horizontally add adjacent pairs of intermediate signed 16-bit integers, and pack the saturated results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
6478///
6479/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_maddubs_epi16&expand=3538)
6480#[inline]
6481#[target_feature(enable = "avx512bw,avx512vl")]
6482#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6483#[cfg_attr(test, assert_instr(vpmaddubsw))]
6484pub fn _mm256_maskz_maddubs_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
6485    unsafe {
6486        let madd = _mm256_maddubs_epi16(a, b).as_i16x16();
6487        transmute(simd_select_bitmask(k, madd, i16x16::ZERO))
6488    }
6489}
6490
6491/// Multiply packed unsigned 8-bit integers in a by packed signed 8-bit integers in b, producing intermediate signed 16-bit integers. Horizontally add adjacent pairs of intermediate signed 16-bit integers, and pack the saturated results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
6492///
6493/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_maddubs_epi16&expand=3534)
6494#[inline]
6495#[target_feature(enable = "avx512bw,avx512vl")]
6496#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6497#[cfg_attr(test, assert_instr(vpmaddubsw))]
6498pub fn _mm_mask_maddubs_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
6499    unsafe {
6500        let madd = _mm_maddubs_epi16(a, b).as_i16x8();
6501        transmute(simd_select_bitmask(k, madd, src.as_i16x8()))
6502    }
6503}
6504
6505/// Multiply packed unsigned 8-bit integers in a by packed signed 8-bit integers in b, producing intermediate signed 16-bit integers. Horizontally add adjacent pairs of intermediate signed 16-bit integers, and pack the saturated results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
6506///
6507/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_maddubs_epi16&expand=3535)
6508#[inline]
6509#[target_feature(enable = "avx512bw,avx512vl")]
6510#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6511#[cfg_attr(test, assert_instr(vpmaddubsw))]
6512pub fn _mm_maskz_maddubs_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
6513    unsafe {
6514        let madd = _mm_maddubs_epi16(a, b).as_i16x8();
6515        transmute(simd_select_bitmask(k, madd, i16x8::ZERO))
6516    }
6517}
6518
6519/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using signed saturation, and store the results in dst.
6520///
6521/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_packs_epi32&expand=4091)
6522#[inline]
6523#[target_feature(enable = "avx512bw")]
6524#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6525#[cfg_attr(test, assert_instr(vpackssdw))]
6526pub fn _mm512_packs_epi32(a: __m512i, b: __m512i) -> __m512i {
6527    unsafe { transmute(vpackssdw(a.as_i32x16(), b.as_i32x16())) }
6528}
6529
6530/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
6531///
6532/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_packs_epi32&expand=4089)
6533#[inline]
6534#[target_feature(enable = "avx512bw")]
6535#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6536#[cfg_attr(test, assert_instr(vpackssdw))]
6537pub fn _mm512_mask_packs_epi32(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
6538    unsafe {
6539        let pack = _mm512_packs_epi32(a, b).as_i16x32();
6540        transmute(simd_select_bitmask(k, pack, src.as_i16x32()))
6541    }
6542}
6543
6544/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
6545///
6546/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_packs_epi32&expand=4090)
6547#[inline]
6548#[target_feature(enable = "avx512bw")]
6549#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6550#[cfg_attr(test, assert_instr(vpackssdw))]
6551pub fn _mm512_maskz_packs_epi32(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
6552    unsafe {
6553        let pack = _mm512_packs_epi32(a, b).as_i16x32();
6554        transmute(simd_select_bitmask(k, pack, i16x32::ZERO))
6555    }
6556}
6557
6558/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
6559///
6560/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_packs_epi32&expand=4086)
6561#[inline]
6562#[target_feature(enable = "avx512bw,avx512vl")]
6563#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6564#[cfg_attr(test, assert_instr(vpackssdw))]
6565pub fn _mm256_mask_packs_epi32(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
6566    unsafe {
6567        let pack = _mm256_packs_epi32(a, b).as_i16x16();
6568        transmute(simd_select_bitmask(k, pack, src.as_i16x16()))
6569    }
6570}
6571
6572/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
6573///
6574/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_packs_epi32&expand=4087)
6575#[inline]
6576#[target_feature(enable = "avx512bw,avx512vl")]
6577#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6578#[cfg_attr(test, assert_instr(vpackssdw))]
6579pub fn _mm256_maskz_packs_epi32(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
6580    unsafe {
6581        let pack = _mm256_packs_epi32(a, b).as_i16x16();
6582        transmute(simd_select_bitmask(k, pack, i16x16::ZERO))
6583    }
6584}
6585
6586/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
6587///
6588/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_packs_epi32&expand=4083)
6589#[inline]
6590#[target_feature(enable = "avx512bw,avx512vl")]
6591#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6592#[cfg_attr(test, assert_instr(vpackssdw))]
6593pub fn _mm_mask_packs_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
6594    unsafe {
6595        let pack = _mm_packs_epi32(a, b).as_i16x8();
6596        transmute(simd_select_bitmask(k, pack, src.as_i16x8()))
6597    }
6598}
6599
6600/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
6601///
6602/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_packs_epi32&expand=4084)
6603#[inline]
6604#[target_feature(enable = "avx512bw,avx512vl")]
6605#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6606#[cfg_attr(test, assert_instr(vpackssdw))]
6607pub fn _mm_maskz_packs_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
6608    unsafe {
6609        let pack = _mm_packs_epi32(a, b).as_i16x8();
6610        transmute(simd_select_bitmask(k, pack, i16x8::ZERO))
6611    }
6612}
6613
6614/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using signed saturation, and store the results in dst.
6615///
6616/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_packs_epi16&expand=4082)
6617#[inline]
6618#[target_feature(enable = "avx512bw")]
6619#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6620#[cfg_attr(test, assert_instr(vpacksswb))]
6621pub fn _mm512_packs_epi16(a: __m512i, b: __m512i) -> __m512i {
6622    unsafe { transmute(vpacksswb(a.as_i16x32(), b.as_i16x32())) }
6623}
6624
6625/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
6626///
6627/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_packs_epi16&expand=4080)
6628#[inline]
6629#[target_feature(enable = "avx512bw")]
6630#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6631#[cfg_attr(test, assert_instr(vpacksswb))]
6632pub fn _mm512_mask_packs_epi16(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
6633    unsafe {
6634        let pack = _mm512_packs_epi16(a, b).as_i8x64();
6635        transmute(simd_select_bitmask(k, pack, src.as_i8x64()))
6636    }
6637}
6638
6639/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
6640///
6641/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_packs_epi16&expand=4081)
6642#[inline]
6643#[target_feature(enable = "avx512bw")]
6644#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6645#[cfg_attr(test, assert_instr(vpacksswb))]
6646pub fn _mm512_maskz_packs_epi16(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
6647    unsafe {
6648        let pack = _mm512_packs_epi16(a, b).as_i8x64();
6649        transmute(simd_select_bitmask(k, pack, i8x64::ZERO))
6650    }
6651}
6652
6653/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
6654///
6655/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_packs_epi16&expand=4077)
6656#[inline]
6657#[target_feature(enable = "avx512bw,avx512vl")]
6658#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6659#[cfg_attr(test, assert_instr(vpacksswb))]
6660pub fn _mm256_mask_packs_epi16(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
6661    unsafe {
6662        let pack = _mm256_packs_epi16(a, b).as_i8x32();
6663        transmute(simd_select_bitmask(k, pack, src.as_i8x32()))
6664    }
6665}
6666
6667/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
6668///
6669/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=#text=_mm256_maskz_packs_epi16&expand=4078)
6670#[inline]
6671#[target_feature(enable = "avx512bw,avx512vl")]
6672#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6673#[cfg_attr(test, assert_instr(vpacksswb))]
6674pub fn _mm256_maskz_packs_epi16(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
6675    unsafe {
6676        let pack = _mm256_packs_epi16(a, b).as_i8x32();
6677        transmute(simd_select_bitmask(k, pack, i8x32::ZERO))
6678    }
6679}
6680
6681/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
6682///
6683/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_packs_epi16&expand=4074)
6684#[inline]
6685#[target_feature(enable = "avx512bw,avx512vl")]
6686#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6687#[cfg_attr(test, assert_instr(vpacksswb))]
6688pub fn _mm_mask_packs_epi16(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
6689    unsafe {
6690        let pack = _mm_packs_epi16(a, b).as_i8x16();
6691        transmute(simd_select_bitmask(k, pack, src.as_i8x16()))
6692    }
6693}
6694
6695/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
6696///
6697/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_packs_epi16&expand=4075)
6698#[inline]
6699#[target_feature(enable = "avx512bw,avx512vl")]
6700#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6701#[cfg_attr(test, assert_instr(vpacksswb))]
6702pub fn _mm_maskz_packs_epi16(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
6703    unsafe {
6704        let pack = _mm_packs_epi16(a, b).as_i8x16();
6705        transmute(simd_select_bitmask(k, pack, i8x16::ZERO))
6706    }
6707}
6708
6709/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using unsigned saturation, and store the results in dst.
6710///
6711/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_packus_epi32&expand=4130)
6712#[inline]
6713#[target_feature(enable = "avx512bw")]
6714#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6715#[cfg_attr(test, assert_instr(vpackusdw))]
6716pub fn _mm512_packus_epi32(a: __m512i, b: __m512i) -> __m512i {
6717    unsafe { transmute(vpackusdw(a.as_i32x16(), b.as_i32x16())) }
6718}
6719
6720/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
6721///
6722/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_packus_epi32&expand=4128)
6723#[inline]
6724#[target_feature(enable = "avx512bw")]
6725#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6726#[cfg_attr(test, assert_instr(vpackusdw))]
6727pub fn _mm512_mask_packus_epi32(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
6728    unsafe {
6729        let pack = _mm512_packus_epi32(a, b).as_i16x32();
6730        transmute(simd_select_bitmask(k, pack, src.as_i16x32()))
6731    }
6732}
6733
6734/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
6735///
6736/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_packus_epi32&expand=4129)
6737#[inline]
6738#[target_feature(enable = "avx512bw")]
6739#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6740#[cfg_attr(test, assert_instr(vpackusdw))]
6741pub fn _mm512_maskz_packus_epi32(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
6742    unsafe {
6743        let pack = _mm512_packus_epi32(a, b).as_i16x32();
6744        transmute(simd_select_bitmask(k, pack, i16x32::ZERO))
6745    }
6746}
6747
6748/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
6749///
6750/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_packus_epi32&expand=4125)
6751#[inline]
6752#[target_feature(enable = "avx512bw,avx512vl")]
6753#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6754#[cfg_attr(test, assert_instr(vpackusdw))]
6755pub fn _mm256_mask_packus_epi32(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
6756    unsafe {
6757        let pack = _mm256_packus_epi32(a, b).as_i16x16();
6758        transmute(simd_select_bitmask(k, pack, src.as_i16x16()))
6759    }
6760}
6761
6762/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
6763///
6764/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_packus_epi32&expand=4126)
6765#[inline]
6766#[target_feature(enable = "avx512bw,avx512vl")]
6767#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6768#[cfg_attr(test, assert_instr(vpackusdw))]
6769pub fn _mm256_maskz_packus_epi32(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
6770    unsafe {
6771        let pack = _mm256_packus_epi32(a, b).as_i16x16();
6772        transmute(simd_select_bitmask(k, pack, i16x16::ZERO))
6773    }
6774}
6775
6776/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
6777///
6778/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_packus_epi32&expand=4122)
6779#[inline]
6780#[target_feature(enable = "avx512bw,avx512vl")]
6781#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6782#[cfg_attr(test, assert_instr(vpackusdw))]
6783pub fn _mm_mask_packus_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
6784    unsafe {
6785        let pack = _mm_packus_epi32(a, b).as_i16x8();
6786        transmute(simd_select_bitmask(k, pack, src.as_i16x8()))
6787    }
6788}
6789
6790/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
6791///
6792/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_packus_epi32&expand=4123)
6793#[inline]
6794#[target_feature(enable = "avx512bw,avx512vl")]
6795#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6796#[cfg_attr(test, assert_instr(vpackusdw))]
6797pub fn _mm_maskz_packus_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
6798    unsafe {
6799        let pack = _mm_packus_epi32(a, b).as_i16x8();
6800        transmute(simd_select_bitmask(k, pack, i16x8::ZERO))
6801    }
6802}
6803
6804/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using unsigned saturation, and store the results in dst.
6805///
6806/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_packus_epi16&expand=4121)
6807#[inline]
6808#[target_feature(enable = "avx512bw")]
6809#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6810#[cfg_attr(test, assert_instr(vpackuswb))]
6811pub fn _mm512_packus_epi16(a: __m512i, b: __m512i) -> __m512i {
6812    unsafe { transmute(vpackuswb(a.as_i16x32(), b.as_i16x32())) }
6813}
6814
6815/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
6816///
6817/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_packus_epi16&expand=4119)
6818#[inline]
6819#[target_feature(enable = "avx512bw")]
6820#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6821#[cfg_attr(test, assert_instr(vpackuswb))]
6822pub fn _mm512_mask_packus_epi16(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
6823    unsafe {
6824        let pack = _mm512_packus_epi16(a, b).as_i8x64();
6825        transmute(simd_select_bitmask(k, pack, src.as_i8x64()))
6826    }
6827}
6828
6829/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
6830///
6831/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_packus_epi16&expand=4120)
6832#[inline]
6833#[target_feature(enable = "avx512bw")]
6834#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6835#[cfg_attr(test, assert_instr(vpackuswb))]
6836pub fn _mm512_maskz_packus_epi16(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
6837    unsafe {
6838        let pack = _mm512_packus_epi16(a, b).as_i8x64();
6839        transmute(simd_select_bitmask(k, pack, i8x64::ZERO))
6840    }
6841}
6842
6843/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
6844///
6845/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_packus_epi16&expand=4116)
6846#[inline]
6847#[target_feature(enable = "avx512bw,avx512vl")]
6848#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6849#[cfg_attr(test, assert_instr(vpackuswb))]
6850pub fn _mm256_mask_packus_epi16(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
6851    unsafe {
6852        let pack = _mm256_packus_epi16(a, b).as_i8x32();
6853        transmute(simd_select_bitmask(k, pack, src.as_i8x32()))
6854    }
6855}
6856
6857/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
6858///
6859/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_packus_epi16&expand=4117)
6860#[inline]
6861#[target_feature(enable = "avx512bw,avx512vl")]
6862#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6863#[cfg_attr(test, assert_instr(vpackuswb))]
6864pub fn _mm256_maskz_packus_epi16(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
6865    unsafe {
6866        let pack = _mm256_packus_epi16(a, b).as_i8x32();
6867        transmute(simd_select_bitmask(k, pack, i8x32::ZERO))
6868    }
6869}
6870
6871/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
6872///
6873/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_packus_epi16&expand=4113)
6874#[inline]
6875#[target_feature(enable = "avx512bw,avx512vl")]
6876#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6877#[cfg_attr(test, assert_instr(vpackuswb))]
6878pub fn _mm_mask_packus_epi16(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
6879    unsafe {
6880        let pack = _mm_packus_epi16(a, b).as_i8x16();
6881        transmute(simd_select_bitmask(k, pack, src.as_i8x16()))
6882    }
6883}
6884
6885/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
6886///
6887/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_packus_epi16&expand=4114)
6888#[inline]
6889#[target_feature(enable = "avx512bw,avx512vl")]
6890#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6891#[cfg_attr(test, assert_instr(vpackuswb))]
6892pub fn _mm_maskz_packus_epi16(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
6893    unsafe {
6894        let pack = _mm_packus_epi16(a, b).as_i8x16();
6895        transmute(simd_select_bitmask(k, pack, i8x16::ZERO))
6896    }
6897}
6898
6899/// Average packed unsigned 16-bit integers in a and b, and store the results in dst.
6900///
6901/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_avg_epu16&expand=388)
6902#[inline]
6903#[target_feature(enable = "avx512bw")]
6904#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6905#[cfg_attr(test, assert_instr(vpavgw))]
6906#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6907pub const fn _mm512_avg_epu16(a: __m512i, b: __m512i) -> __m512i {
6908    unsafe {
6909        let a = simd_cast::<_, u32x32>(a.as_u16x32());
6910        let b = simd_cast::<_, u32x32>(b.as_u16x32());
6911        let r = simd_shr(simd_add(simd_add(a, b), u32x32::splat(1)), u32x32::splat(1));
6912        transmute(simd_cast::<_, u16x32>(r))
6913    }
6914}
6915
6916/// Average packed unsigned 16-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
6917///
6918/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_avg_epu16&expand=389)
6919#[inline]
6920#[target_feature(enable = "avx512bw")]
6921#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6922#[cfg_attr(test, assert_instr(vpavgw))]
6923#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6924pub const fn _mm512_mask_avg_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
6925    unsafe {
6926        let avg = _mm512_avg_epu16(a, b).as_u16x32();
6927        transmute(simd_select_bitmask(k, avg, src.as_u16x32()))
6928    }
6929}
6930
6931/// Average packed unsigned 16-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
6932///
6933/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_avg_epu16&expand=390)
6934#[inline]
6935#[target_feature(enable = "avx512bw")]
6936#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6937#[cfg_attr(test, assert_instr(vpavgw))]
6938#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6939pub const fn _mm512_maskz_avg_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
6940    unsafe {
6941        let avg = _mm512_avg_epu16(a, b).as_u16x32();
6942        transmute(simd_select_bitmask(k, avg, u16x32::ZERO))
6943    }
6944}
6945
6946/// Average packed unsigned 16-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
6947///
6948/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_avg_epu16&expand=386)
6949#[inline]
6950#[target_feature(enable = "avx512bw,avx512vl")]
6951#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6952#[cfg_attr(test, assert_instr(vpavgw))]
6953#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6954pub const fn _mm256_mask_avg_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
6955    unsafe {
6956        let avg = _mm256_avg_epu16(a, b).as_u16x16();
6957        transmute(simd_select_bitmask(k, avg, src.as_u16x16()))
6958    }
6959}
6960
6961/// Average packed unsigned 16-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
6962///
6963/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_avg_epu16&expand=387)
6964#[inline]
6965#[target_feature(enable = "avx512bw,avx512vl")]
6966#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6967#[cfg_attr(test, assert_instr(vpavgw))]
6968#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6969pub const fn _mm256_maskz_avg_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
6970    unsafe {
6971        let avg = _mm256_avg_epu16(a, b).as_u16x16();
6972        transmute(simd_select_bitmask(k, avg, u16x16::ZERO))
6973    }
6974}
6975
6976/// Average packed unsigned 16-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
6977///
6978/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_avg_epu16&expand=383)
6979#[inline]
6980#[target_feature(enable = "avx512bw,avx512vl")]
6981#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6982#[cfg_attr(test, assert_instr(vpavgw))]
6983#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6984pub const fn _mm_mask_avg_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
6985    unsafe {
6986        let avg = _mm_avg_epu16(a, b).as_u16x8();
6987        transmute(simd_select_bitmask(k, avg, src.as_u16x8()))
6988    }
6989}
6990
6991/// Average packed unsigned 16-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
6992///
6993/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_avg_epu16&expand=384)
6994#[inline]
6995#[target_feature(enable = "avx512bw,avx512vl")]
6996#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6997#[cfg_attr(test, assert_instr(vpavgw))]
6998#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6999pub const fn _mm_maskz_avg_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
7000    unsafe {
7001        let avg = _mm_avg_epu16(a, b).as_u16x8();
7002        transmute(simd_select_bitmask(k, avg, u16x8::ZERO))
7003    }
7004}
7005
7006/// Average packed unsigned 8-bit integers in a and b, and store the results in dst.
7007///
7008/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_avg_epu8&expand=397)
7009#[inline]
7010#[target_feature(enable = "avx512bw")]
7011#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7012#[cfg_attr(test, assert_instr(vpavgb))]
7013#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7014pub const fn _mm512_avg_epu8(a: __m512i, b: __m512i) -> __m512i {
7015    unsafe {
7016        let a = simd_cast::<_, u16x64>(a.as_u8x64());
7017        let b = simd_cast::<_, u16x64>(b.as_u8x64());
7018        let r = simd_shr(simd_add(simd_add(a, b), u16x64::splat(1)), u16x64::splat(1));
7019        transmute(simd_cast::<_, u8x64>(r))
7020    }
7021}
7022
7023/// Average packed unsigned 8-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
7024///
7025/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_avg_epu8&expand=398)
7026#[inline]
7027#[target_feature(enable = "avx512bw")]
7028#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7029#[cfg_attr(test, assert_instr(vpavgb))]
7030#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7031pub const fn _mm512_mask_avg_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
7032    unsafe {
7033        let avg = _mm512_avg_epu8(a, b).as_u8x64();
7034        transmute(simd_select_bitmask(k, avg, src.as_u8x64()))
7035    }
7036}
7037
7038/// Average packed unsigned 8-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
7039///
7040/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_avg_epu8&expand=399)
7041#[inline]
7042#[target_feature(enable = "avx512bw")]
7043#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7044#[cfg_attr(test, assert_instr(vpavgb))]
7045#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7046pub const fn _mm512_maskz_avg_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
7047    unsafe {
7048        let avg = _mm512_avg_epu8(a, b).as_u8x64();
7049        transmute(simd_select_bitmask(k, avg, u8x64::ZERO))
7050    }
7051}
7052
7053/// Average packed unsigned 8-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
7054///
7055/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_avg_epu8&expand=395)
7056#[inline]
7057#[target_feature(enable = "avx512bw,avx512vl")]
7058#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7059#[cfg_attr(test, assert_instr(vpavgb))]
7060#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7061pub const fn _mm256_mask_avg_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
7062    unsafe {
7063        let avg = _mm256_avg_epu8(a, b).as_u8x32();
7064        transmute(simd_select_bitmask(k, avg, src.as_u8x32()))
7065    }
7066}
7067
7068/// Average packed unsigned 8-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
7069///
7070/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_avg_epu8&expand=396)
7071#[inline]
7072#[target_feature(enable = "avx512bw,avx512vl")]
7073#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7074#[cfg_attr(test, assert_instr(vpavgb))]
7075#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7076pub const fn _mm256_maskz_avg_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
7077    unsafe {
7078        let avg = _mm256_avg_epu8(a, b).as_u8x32();
7079        transmute(simd_select_bitmask(k, avg, u8x32::ZERO))
7080    }
7081}
7082
7083/// Average packed unsigned 8-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
7084///
7085/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_avg_epu8&expand=392)
7086#[inline]
7087#[target_feature(enable = "avx512bw,avx512vl")]
7088#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7089#[cfg_attr(test, assert_instr(vpavgb))]
7090#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7091pub const fn _mm_mask_avg_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
7092    unsafe {
7093        let avg = _mm_avg_epu8(a, b).as_u8x16();
7094        transmute(simd_select_bitmask(k, avg, src.as_u8x16()))
7095    }
7096}
7097
7098/// Average packed unsigned 8-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
7099///
7100/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_avg_epu8&expand=393)
7101#[inline]
7102#[target_feature(enable = "avx512bw,avx512vl")]
7103#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7104#[cfg_attr(test, assert_instr(vpavgb))]
7105#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7106pub const fn _mm_maskz_avg_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
7107    unsafe {
7108        let avg = _mm_avg_epu8(a, b).as_u8x16();
7109        transmute(simd_select_bitmask(k, avg, u8x16::ZERO))
7110    }
7111}
7112
7113/// Shift packed 16-bit integers in a left by count while shifting in zeros, and store the results in dst.
7114///
7115/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_sll_epi16&expand=5271)
7116#[inline]
7117#[target_feature(enable = "avx512bw")]
7118#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7119#[cfg_attr(test, assert_instr(vpsllw))]
7120pub fn _mm512_sll_epi16(a: __m512i, count: __m128i) -> __m512i {
7121    unsafe { transmute(vpsllw(a.as_i16x32(), count.as_i16x8())) }
7122}
7123
7124/// Shift packed 16-bit integers in a left by count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
7125///
7126/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_sll_epi16&expand=5269)
7127#[inline]
7128#[target_feature(enable = "avx512bw")]
7129#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7130#[cfg_attr(test, assert_instr(vpsllw))]
7131pub fn _mm512_mask_sll_epi16(src: __m512i, k: __mmask32, a: __m512i, count: __m128i) -> __m512i {
7132    unsafe {
7133        let shf = _mm512_sll_epi16(a, count).as_i16x32();
7134        transmute(simd_select_bitmask(k, shf, src.as_i16x32()))
7135    }
7136}
7137
7138/// Shift packed 16-bit integers in a left by count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
7139///
7140/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_sll_epi16&expand=5270)
7141#[inline]
7142#[target_feature(enable = "avx512bw")]
7143#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7144#[cfg_attr(test, assert_instr(vpsllw))]
7145pub fn _mm512_maskz_sll_epi16(k: __mmask32, a: __m512i, count: __m128i) -> __m512i {
7146    unsafe {
7147        let shf = _mm512_sll_epi16(a, count).as_i16x32();
7148        transmute(simd_select_bitmask(k, shf, i16x32::ZERO))
7149    }
7150}
7151
7152/// Shift packed 16-bit integers in a left by count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
7153///
7154/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_sll_epi16&expand=5266)
7155#[inline]
7156#[target_feature(enable = "avx512bw,avx512vl")]
7157#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7158#[cfg_attr(test, assert_instr(vpsllw))]
7159pub fn _mm256_mask_sll_epi16(src: __m256i, k: __mmask16, a: __m256i, count: __m128i) -> __m256i {
7160    unsafe {
7161        let shf = _mm256_sll_epi16(a, count).as_i16x16();
7162        transmute(simd_select_bitmask(k, shf, src.as_i16x16()))
7163    }
7164}
7165
7166/// Shift packed 16-bit integers in a left by count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
7167///
7168/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_sll_epi16&expand=5267)
7169#[inline]
7170#[target_feature(enable = "avx512bw,avx512vl")]
7171#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7172#[cfg_attr(test, assert_instr(vpsllw))]
7173pub fn _mm256_maskz_sll_epi16(k: __mmask16, a: __m256i, count: __m128i) -> __m256i {
7174    unsafe {
7175        let shf = _mm256_sll_epi16(a, count).as_i16x16();
7176        transmute(simd_select_bitmask(k, shf, i16x16::ZERO))
7177    }
7178}
7179
7180/// Shift packed 16-bit integers in a left by count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
7181///
7182/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_sll_epi16&expand=5263)
7183#[inline]
7184#[target_feature(enable = "avx512bw,avx512vl")]
7185#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7186#[cfg_attr(test, assert_instr(vpsllw))]
7187pub fn _mm_mask_sll_epi16(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
7188    unsafe {
7189        let shf = _mm_sll_epi16(a, count).as_i16x8();
7190        transmute(simd_select_bitmask(k, shf, src.as_i16x8()))
7191    }
7192}
7193
7194/// Shift packed 16-bit integers in a left by count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
7195///
7196/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_sll_epi16&expand=5264)
7197#[inline]
7198#[target_feature(enable = "avx512bw,avx512vl")]
7199#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7200#[cfg_attr(test, assert_instr(vpsllw))]
7201pub fn _mm_maskz_sll_epi16(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
7202    unsafe {
7203        let shf = _mm_sll_epi16(a, count).as_i16x8();
7204        transmute(simd_select_bitmask(k, shf, i16x8::ZERO))
7205    }
7206}
7207
7208/// Shift packed 16-bit integers in a left by imm8 while shifting in zeros, and store the results in dst.
7209///
7210/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_slli_epi16&expand=5301)
7211#[inline]
7212#[target_feature(enable = "avx512bw")]
7213#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7214#[cfg_attr(test, assert_instr(vpsllw, IMM8 = 5))]
7215#[rustc_legacy_const_generics(1)]
7216#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7217pub const fn _mm512_slli_epi16<const IMM8: u32>(a: __m512i) -> __m512i {
7218    unsafe {
7219        static_assert_uimm_bits!(IMM8, 8);
7220        if IMM8 >= 16 {
7221            _mm512_setzero_si512()
7222        } else {
7223            transmute(simd_shl(a.as_u16x32(), u16x32::splat(IMM8 as u16)))
7224        }
7225    }
7226}
7227
7228/// Shift packed 16-bit integers in a left by imm8 while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
7229///
7230/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_slli_epi16&expand=5299)
7231#[inline]
7232#[target_feature(enable = "avx512bw")]
7233#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7234#[cfg_attr(test, assert_instr(vpsllw, IMM8 = 5))]
7235#[rustc_legacy_const_generics(3)]
7236#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7237pub const fn _mm512_mask_slli_epi16<const IMM8: u32>(
7238    src: __m512i,
7239    k: __mmask32,
7240    a: __m512i,
7241) -> __m512i {
7242    unsafe {
7243        static_assert_uimm_bits!(IMM8, 8);
7244        let shf = if IMM8 >= 16 {
7245            u16x32::ZERO
7246        } else {
7247            simd_shl(a.as_u16x32(), u16x32::splat(IMM8 as u16))
7248        };
7249        transmute(simd_select_bitmask(k, shf, src.as_u16x32()))
7250    }
7251}
7252
7253/// Shift packed 16-bit integers in a left by imm8 while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
7254///
7255/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_slli_epi16&expand=5300)
7256#[inline]
7257#[target_feature(enable = "avx512bw")]
7258#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7259#[cfg_attr(test, assert_instr(vpsllw, IMM8 = 5))]
7260#[rustc_legacy_const_generics(2)]
7261#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7262pub const fn _mm512_maskz_slli_epi16<const IMM8: u32>(k: __mmask32, a: __m512i) -> __m512i {
7263    unsafe {
7264        static_assert_uimm_bits!(IMM8, 8);
7265        if IMM8 >= 16 {
7266            _mm512_setzero_si512()
7267        } else {
7268            let shf = simd_shl(a.as_u16x32(), u16x32::splat(IMM8 as u16));
7269            transmute(simd_select_bitmask(k, shf, u16x32::ZERO))
7270        }
7271    }
7272}
7273
7274/// Shift packed 16-bit integers in a left by imm8 while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
7275///
7276/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_slli_epi16&expand=5296)
7277#[inline]
7278#[target_feature(enable = "avx512bw,avx512vl")]
7279#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7280#[cfg_attr(test, assert_instr(vpsllw, IMM8 = 5))]
7281#[rustc_legacy_const_generics(3)]
7282#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7283pub const fn _mm256_mask_slli_epi16<const IMM8: u32>(
7284    src: __m256i,
7285    k: __mmask16,
7286    a: __m256i,
7287) -> __m256i {
7288    unsafe {
7289        static_assert_uimm_bits!(IMM8, 8);
7290        let shf = if IMM8 >= 16 {
7291            u16x16::ZERO
7292        } else {
7293            simd_shl(a.as_u16x16(), u16x16::splat(IMM8 as u16))
7294        };
7295        transmute(simd_select_bitmask(k, shf, src.as_u16x16()))
7296    }
7297}
7298
7299/// Shift packed 16-bit integers in a left by imm8 while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
7300///
7301/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_slli_epi16&expand=5297)
7302#[inline]
7303#[target_feature(enable = "avx512bw,avx512vl")]
7304#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7305#[cfg_attr(test, assert_instr(vpsllw, IMM8 = 5))]
7306#[rustc_legacy_const_generics(2)]
7307#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7308pub const fn _mm256_maskz_slli_epi16<const IMM8: u32>(k: __mmask16, a: __m256i) -> __m256i {
7309    unsafe {
7310        static_assert_uimm_bits!(IMM8, 8);
7311        if IMM8 >= 16 {
7312            _mm256_setzero_si256()
7313        } else {
7314            let shf = simd_shl(a.as_u16x16(), u16x16::splat(IMM8 as u16));
7315            transmute(simd_select_bitmask(k, shf, u16x16::ZERO))
7316        }
7317    }
7318}
7319
7320/// Shift packed 16-bit integers in a left by imm8 while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
7321///
7322/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_slli_epi16&expand=5293)
7323#[inline]
7324#[target_feature(enable = "avx512bw,avx512vl")]
7325#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7326#[cfg_attr(test, assert_instr(vpsllw, IMM8 = 5))]
7327#[rustc_legacy_const_generics(3)]
7328#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7329pub const fn _mm_mask_slli_epi16<const IMM8: u32>(
7330    src: __m128i,
7331    k: __mmask8,
7332    a: __m128i,
7333) -> __m128i {
7334    unsafe {
7335        static_assert_uimm_bits!(IMM8, 8);
7336        let shf = if IMM8 >= 16 {
7337            u16x8::ZERO
7338        } else {
7339            simd_shl(a.as_u16x8(), u16x8::splat(IMM8 as u16))
7340        };
7341        transmute(simd_select_bitmask(k, shf, src.as_u16x8()))
7342    }
7343}
7344
7345/// Shift packed 16-bit integers in a left by imm8 while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
7346///
7347/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_slli_epi16&expand=5294)
7348#[inline]
7349#[target_feature(enable = "avx512bw,avx512vl")]
7350#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7351#[cfg_attr(test, assert_instr(vpsllw, IMM8 = 5))]
7352#[rustc_legacy_const_generics(2)]
7353#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7354pub const fn _mm_maskz_slli_epi16<const IMM8: u32>(k: __mmask8, a: __m128i) -> __m128i {
7355    unsafe {
7356        static_assert_uimm_bits!(IMM8, 8);
7357        if IMM8 >= 16 {
7358            _mm_setzero_si128()
7359        } else {
7360            let shf = simd_shl(a.as_u16x8(), u16x8::splat(IMM8 as u16));
7361            transmute(simd_select_bitmask(k, shf, u16x8::ZERO))
7362        }
7363    }
7364}
7365
7366/// Shift packed 16-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst.
7367///
7368/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_sllv_epi16&expand=5333)
7369#[inline]
7370#[target_feature(enable = "avx512bw")]
7371#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7372#[cfg_attr(test, assert_instr(vpsllvw))]
7373pub fn _mm512_sllv_epi16(a: __m512i, count: __m512i) -> __m512i {
7374    unsafe { transmute(vpsllvw(a.as_i16x32(), count.as_i16x32())) }
7375}
7376
7377/// Shift packed 16-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
7378///
7379/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_sllv_epi16&expand=5331)
7380#[inline]
7381#[target_feature(enable = "avx512bw")]
7382#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7383#[cfg_attr(test, assert_instr(vpsllvw))]
7384pub fn _mm512_mask_sllv_epi16(src: __m512i, k: __mmask32, a: __m512i, count: __m512i) -> __m512i {
7385    unsafe {
7386        let shf = _mm512_sllv_epi16(a, count).as_i16x32();
7387        transmute(simd_select_bitmask(k, shf, src.as_i16x32()))
7388    }
7389}
7390
7391/// Shift packed 16-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
7392///
7393/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_sllv_epi16&expand=5332)
7394#[inline]
7395#[target_feature(enable = "avx512bw")]
7396#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7397#[cfg_attr(test, assert_instr(vpsllvw))]
7398pub fn _mm512_maskz_sllv_epi16(k: __mmask32, a: __m512i, count: __m512i) -> __m512i {
7399    unsafe {
7400        let shf = _mm512_sllv_epi16(a, count).as_i16x32();
7401        transmute(simd_select_bitmask(k, shf, i16x32::ZERO))
7402    }
7403}
7404
7405/// Shift packed 16-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst.
7406///
7407/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_sllv_epi16&expand=5330)
7408#[inline]
7409#[target_feature(enable = "avx512bw,avx512vl")]
7410#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7411#[cfg_attr(test, assert_instr(vpsllvw))]
7412pub fn _mm256_sllv_epi16(a: __m256i, count: __m256i) -> __m256i {
7413    unsafe { transmute(vpsllvw256(a.as_i16x16(), count.as_i16x16())) }
7414}
7415
7416/// Shift packed 16-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
7417///
7418/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_sllv_epi16&expand=5328)
7419#[inline]
7420#[target_feature(enable = "avx512bw,avx512vl")]
7421#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7422#[cfg_attr(test, assert_instr(vpsllvw))]
7423pub fn _mm256_mask_sllv_epi16(src: __m256i, k: __mmask16, a: __m256i, count: __m256i) -> __m256i {
7424    unsafe {
7425        let shf = _mm256_sllv_epi16(a, count).as_i16x16();
7426        transmute(simd_select_bitmask(k, shf, src.as_i16x16()))
7427    }
7428}
7429
7430/// Shift packed 16-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
7431///
7432/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_sllv_epi16&expand=5329)
7433#[inline]
7434#[target_feature(enable = "avx512bw,avx512vl")]
7435#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7436#[cfg_attr(test, assert_instr(vpsllvw))]
7437pub fn _mm256_maskz_sllv_epi16(k: __mmask16, a: __m256i, count: __m256i) -> __m256i {
7438    unsafe {
7439        let shf = _mm256_sllv_epi16(a, count).as_i16x16();
7440        transmute(simd_select_bitmask(k, shf, i16x16::ZERO))
7441    }
7442}
7443
7444/// Shift packed 16-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst.
7445///
7446/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_sllv_epi16&expand=5327)
7447#[inline]
7448#[target_feature(enable = "avx512bw,avx512vl")]
7449#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7450#[cfg_attr(test, assert_instr(vpsllvw))]
7451pub fn _mm_sllv_epi16(a: __m128i, count: __m128i) -> __m128i {
7452    unsafe { transmute(vpsllvw128(a.as_i16x8(), count.as_i16x8())) }
7453}
7454
7455/// Shift packed 16-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
7456///
7457/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_sllv_epi16&expand=5325)
7458#[inline]
7459#[target_feature(enable = "avx512bw,avx512vl")]
7460#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7461#[cfg_attr(test, assert_instr(vpsllvw))]
7462pub fn _mm_mask_sllv_epi16(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
7463    unsafe {
7464        let shf = _mm_sllv_epi16(a, count).as_i16x8();
7465        transmute(simd_select_bitmask(k, shf, src.as_i16x8()))
7466    }
7467}
7468
7469/// Shift packed 16-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
7470///
7471/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_sllv_epi16&expand=5326)
7472#[inline]
7473#[target_feature(enable = "avx512bw,avx512vl")]
7474#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7475#[cfg_attr(test, assert_instr(vpsllvw))]
7476pub fn _mm_maskz_sllv_epi16(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
7477    unsafe {
7478        let shf = _mm_sllv_epi16(a, count).as_i16x8();
7479        transmute(simd_select_bitmask(k, shf, i16x8::ZERO))
7480    }
7481}
7482
7483/// Shift packed 16-bit integers in a right by count while shifting in zeros, and store the results in dst.
7484///
7485/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_srl_epi16&expand=5483)
7486#[inline]
7487#[target_feature(enable = "avx512bw")]
7488#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7489#[cfg_attr(test, assert_instr(vpsrlw))]
7490pub fn _mm512_srl_epi16(a: __m512i, count: __m128i) -> __m512i {
7491    unsafe { transmute(vpsrlw(a.as_i16x32(), count.as_i16x8())) }
7492}
7493
7494/// Shift packed 16-bit integers in a right by count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
7495///
7496/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_srl_epi16&expand=5481)
7497#[inline]
7498#[target_feature(enable = "avx512bw")]
7499#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7500#[cfg_attr(test, assert_instr(vpsrlw))]
7501pub fn _mm512_mask_srl_epi16(src: __m512i, k: __mmask32, a: __m512i, count: __m128i) -> __m512i {
7502    unsafe {
7503        let shf = _mm512_srl_epi16(a, count).as_i16x32();
7504        transmute(simd_select_bitmask(k, shf, src.as_i16x32()))
7505    }
7506}
7507
7508/// Shift packed 16-bit integers in a right by count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
7509///
7510/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_srl_epi16&expand=5482)
7511#[inline]
7512#[target_feature(enable = "avx512bw")]
7513#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7514#[cfg_attr(test, assert_instr(vpsrlw))]
7515pub fn _mm512_maskz_srl_epi16(k: __mmask32, a: __m512i, count: __m128i) -> __m512i {
7516    unsafe {
7517        let shf = _mm512_srl_epi16(a, count).as_i16x32();
7518        transmute(simd_select_bitmask(k, shf, i16x32::ZERO))
7519    }
7520}
7521
7522/// Shift packed 16-bit integers in a right by count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
7523///
7524/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_srl_epi16&expand=5478)
7525#[inline]
7526#[target_feature(enable = "avx512bw,avx512vl")]
7527#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7528#[cfg_attr(test, assert_instr(vpsrlw))]
7529pub fn _mm256_mask_srl_epi16(src: __m256i, k: __mmask16, a: __m256i, count: __m128i) -> __m256i {
7530    unsafe {
7531        let shf = _mm256_srl_epi16(a, count).as_i16x16();
7532        transmute(simd_select_bitmask(k, shf, src.as_i16x16()))
7533    }
7534}
7535
7536/// Shift packed 16-bit integers in a right by count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
7537///
7538/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_srl_epi16&expand=5479)
7539#[inline]
7540#[target_feature(enable = "avx512bw,avx512vl")]
7541#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7542#[cfg_attr(test, assert_instr(vpsrlw))]
7543pub fn _mm256_maskz_srl_epi16(k: __mmask16, a: __m256i, count: __m128i) -> __m256i {
7544    unsafe {
7545        let shf = _mm256_srl_epi16(a, count).as_i16x16();
7546        transmute(simd_select_bitmask(k, shf, i16x16::ZERO))
7547    }
7548}
7549
7550/// Shift packed 16-bit integers in a right by count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
7551///
7552/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_srl_epi16&expand=5475)
7553#[inline]
7554#[target_feature(enable = "avx512bw,avx512vl")]
7555#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7556#[cfg_attr(test, assert_instr(vpsrlw))]
7557pub fn _mm_mask_srl_epi16(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
7558    unsafe {
7559        let shf = _mm_srl_epi16(a, count).as_i16x8();
7560        transmute(simd_select_bitmask(k, shf, src.as_i16x8()))
7561    }
7562}
7563
7564/// Shift packed 16-bit integers in a right by count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
7565///
7566/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_srl_epi16&expand=5476)
7567#[inline]
7568#[target_feature(enable = "avx512bw,avx512vl")]
7569#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7570#[cfg_attr(test, assert_instr(vpsrlw))]
7571pub fn _mm_maskz_srl_epi16(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
7572    unsafe {
7573        let shf = _mm_srl_epi16(a, count).as_i16x8();
7574        transmute(simd_select_bitmask(k, shf, i16x8::ZERO))
7575    }
7576}
7577
7578/// Shift packed 16-bit integers in a right by imm8 while shifting in zeros, and store the results in dst.
7579///
7580/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_srli_epi16&expand=5513)
7581#[inline]
7582#[target_feature(enable = "avx512bw")]
7583#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7584#[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 5))]
7585#[rustc_legacy_const_generics(1)]
7586#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7587pub const fn _mm512_srli_epi16<const IMM8: u32>(a: __m512i) -> __m512i {
7588    unsafe {
7589        static_assert_uimm_bits!(IMM8, 8);
7590        if IMM8 >= 16 {
7591            _mm512_setzero_si512()
7592        } else {
7593            transmute(simd_shr(a.as_u16x32(), u16x32::splat(IMM8 as u16)))
7594        }
7595    }
7596}
7597
7598/// Shift packed 16-bit integers in a right by imm8 while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
7599///
7600/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_srli_epi16&expand=5511)
7601#[inline]
7602#[target_feature(enable = "avx512bw")]
7603#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7604#[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 5))]
7605#[rustc_legacy_const_generics(3)]
7606#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7607pub const fn _mm512_mask_srli_epi16<const IMM8: u32>(
7608    src: __m512i,
7609    k: __mmask32,
7610    a: __m512i,
7611) -> __m512i {
7612    unsafe {
7613        static_assert_uimm_bits!(IMM8, 8);
7614        let shf = if IMM8 >= 16 {
7615            u16x32::ZERO
7616        } else {
7617            simd_shr(a.as_u16x32(), u16x32::splat(IMM8 as u16))
7618        };
7619        transmute(simd_select_bitmask(k, shf, src.as_u16x32()))
7620    }
7621}
7622
7623/// Shift packed 16-bit integers in a right by imm8 while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
7624///
7625/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_srli_epi16&expand=5512)
7626#[inline]
7627#[target_feature(enable = "avx512bw")]
7628#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7629#[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 5))]
7630#[rustc_legacy_const_generics(2)]
7631#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7632pub const fn _mm512_maskz_srli_epi16<const IMM8: i32>(k: __mmask32, a: __m512i) -> __m512i {
7633    unsafe {
7634        static_assert_uimm_bits!(IMM8, 8);
7635        //imm8 should be u32, it seems the document to verify is incorrect
7636        if IMM8 >= 16 {
7637            _mm512_setzero_si512()
7638        } else {
7639            let shf = simd_shr(a.as_u16x32(), u16x32::splat(IMM8 as u16));
7640            transmute(simd_select_bitmask(k, shf, u16x32::ZERO))
7641        }
7642    }
7643}
7644
7645/// Shift packed 16-bit integers in a right by imm8 while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
7646///
7647/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_srli_epi16&expand=5508)
7648#[inline]
7649#[target_feature(enable = "avx512bw,avx512vl")]
7650#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7651#[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 5))]
7652#[rustc_legacy_const_generics(3)]
7653#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7654pub const fn _mm256_mask_srli_epi16<const IMM8: i32>(
7655    src: __m256i,
7656    k: __mmask16,
7657    a: __m256i,
7658) -> __m256i {
7659    unsafe {
7660        static_assert_uimm_bits!(IMM8, 8);
7661        let shf = _mm256_srli_epi16::<IMM8>(a);
7662        transmute(simd_select_bitmask(k, shf.as_i16x16(), src.as_i16x16()))
7663    }
7664}
7665
7666/// Shift packed 16-bit integers in a right by imm8 while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
7667///
7668/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_srli_epi16&expand=5509)
7669#[inline]
7670#[target_feature(enable = "avx512bw,avx512vl")]
7671#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7672#[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 5))]
7673#[rustc_legacy_const_generics(2)]
7674#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7675pub const fn _mm256_maskz_srli_epi16<const IMM8: i32>(k: __mmask16, a: __m256i) -> __m256i {
7676    unsafe {
7677        static_assert_uimm_bits!(IMM8, 8);
7678        let shf = _mm256_srli_epi16::<IMM8>(a);
7679        transmute(simd_select_bitmask(k, shf.as_i16x16(), i16x16::ZERO))
7680    }
7681}
7682
7683/// Shift packed 16-bit integers in a right by imm8 while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
7684///
7685/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_srli_epi16&expand=5505)
7686#[inline]
7687#[target_feature(enable = "avx512bw,avx512vl")]
7688#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7689#[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 5))]
7690#[rustc_legacy_const_generics(3)]
7691#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7692pub const fn _mm_mask_srli_epi16<const IMM8: i32>(
7693    src: __m128i,
7694    k: __mmask8,
7695    a: __m128i,
7696) -> __m128i {
7697    unsafe {
7698        static_assert_uimm_bits!(IMM8, 8);
7699        let shf = _mm_srli_epi16::<IMM8>(a);
7700        transmute(simd_select_bitmask(k, shf.as_i16x8(), src.as_i16x8()))
7701    }
7702}
7703
7704/// Shift packed 16-bit integers in a right by imm8 while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
7705///
7706/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_srli_epi16&expand=5506)
7707#[inline]
7708#[target_feature(enable = "avx512bw,avx512vl")]
7709#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7710#[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 5))]
7711#[rustc_legacy_const_generics(2)]
7712#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7713pub const fn _mm_maskz_srli_epi16<const IMM8: i32>(k: __mmask8, a: __m128i) -> __m128i {
7714    unsafe {
7715        static_assert_uimm_bits!(IMM8, 8);
7716        let shf = _mm_srli_epi16::<IMM8>(a);
7717        transmute(simd_select_bitmask(k, shf.as_i16x8(), i16x8::ZERO))
7718    }
7719}
7720
7721/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst.
7722///
7723/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_srlv_epi16&expand=5545)
7724#[inline]
7725#[target_feature(enable = "avx512bw")]
7726#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7727#[cfg_attr(test, assert_instr(vpsrlvw))]
7728pub fn _mm512_srlv_epi16(a: __m512i, count: __m512i) -> __m512i {
7729    unsafe { transmute(vpsrlvw(a.as_i16x32(), count.as_i16x32())) }
7730}
7731
7732/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
7733///
7734/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_srlv_epi16&expand=5543)
7735#[inline]
7736#[target_feature(enable = "avx512bw")]
7737#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7738#[cfg_attr(test, assert_instr(vpsrlvw))]
7739pub fn _mm512_mask_srlv_epi16(src: __m512i, k: __mmask32, a: __m512i, count: __m512i) -> __m512i {
7740    unsafe {
7741        let shf = _mm512_srlv_epi16(a, count).as_i16x32();
7742        transmute(simd_select_bitmask(k, shf, src.as_i16x32()))
7743    }
7744}
7745
7746/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
7747///
7748/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_srlv_epi16&expand=5544)
7749#[inline]
7750#[target_feature(enable = "avx512bw")]
7751#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7752#[cfg_attr(test, assert_instr(vpsrlvw))]
7753pub fn _mm512_maskz_srlv_epi16(k: __mmask32, a: __m512i, count: __m512i) -> __m512i {
7754    unsafe {
7755        let shf = _mm512_srlv_epi16(a, count).as_i16x32();
7756        transmute(simd_select_bitmask(k, shf, i16x32::ZERO))
7757    }
7758}
7759
7760/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst.
7761///
7762/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_srlv_epi16&expand=5542)
7763#[inline]
7764#[target_feature(enable = "avx512bw,avx512vl")]
7765#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7766#[cfg_attr(test, assert_instr(vpsrlvw))]
7767pub fn _mm256_srlv_epi16(a: __m256i, count: __m256i) -> __m256i {
7768    unsafe { transmute(vpsrlvw256(a.as_i16x16(), count.as_i16x16())) }
7769}
7770
7771/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
7772///
7773/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_srlv_epi16&expand=5540)
7774#[inline]
7775#[target_feature(enable = "avx512bw,avx512vl")]
7776#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7777#[cfg_attr(test, assert_instr(vpsrlvw))]
7778pub fn _mm256_mask_srlv_epi16(src: __m256i, k: __mmask16, a: __m256i, count: __m256i) -> __m256i {
7779    unsafe {
7780        let shf = _mm256_srlv_epi16(a, count).as_i16x16();
7781        transmute(simd_select_bitmask(k, shf, src.as_i16x16()))
7782    }
7783}
7784
7785/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
7786///
7787/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_srlv_epi16&expand=5541)
7788#[inline]
7789#[target_feature(enable = "avx512bw,avx512vl")]
7790#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7791#[cfg_attr(test, assert_instr(vpsrlvw))]
7792pub fn _mm256_maskz_srlv_epi16(k: __mmask16, a: __m256i, count: __m256i) -> __m256i {
7793    unsafe {
7794        let shf = _mm256_srlv_epi16(a, count).as_i16x16();
7795        transmute(simd_select_bitmask(k, shf, i16x16::ZERO))
7796    }
7797}
7798
7799/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst.
7800///
7801/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_srlv_epi16&expand=5539)
7802#[inline]
7803#[target_feature(enable = "avx512bw,avx512vl")]
7804#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7805#[cfg_attr(test, assert_instr(vpsrlvw))]
7806pub fn _mm_srlv_epi16(a: __m128i, count: __m128i) -> __m128i {
7807    unsafe { transmute(vpsrlvw128(a.as_i16x8(), count.as_i16x8())) }
7808}
7809
7810/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
7811///
7812/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_srlv_epi16&expand=5537)
7813#[inline]
7814#[target_feature(enable = "avx512bw,avx512vl")]
7815#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7816#[cfg_attr(test, assert_instr(vpsrlvw))]
7817pub fn _mm_mask_srlv_epi16(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
7818    unsafe {
7819        let shf = _mm_srlv_epi16(a, count).as_i16x8();
7820        transmute(simd_select_bitmask(k, shf, src.as_i16x8()))
7821    }
7822}
7823
7824/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
7825///
7826/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_srlv_epi16&expand=5538)
7827#[inline]
7828#[target_feature(enable = "avx512bw,avx512vl")]
7829#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7830#[cfg_attr(test, assert_instr(vpsrlvw))]
7831pub fn _mm_maskz_srlv_epi16(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
7832    unsafe {
7833        let shf = _mm_srlv_epi16(a, count).as_i16x8();
7834        transmute(simd_select_bitmask(k, shf, i16x8::ZERO))
7835    }
7836}
7837
7838/// Shift packed 16-bit integers in a right by count while shifting in sign bits, and store the results in dst.
7839///
7840/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_sra_epi16&expand=5398)
7841#[inline]
7842#[target_feature(enable = "avx512bw")]
7843#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7844#[cfg_attr(test, assert_instr(vpsraw))]
7845pub fn _mm512_sra_epi16(a: __m512i, count: __m128i) -> __m512i {
7846    unsafe { transmute(vpsraw(a.as_i16x32(), count.as_i16x8())) }
7847}
7848
7849/// Shift packed 16-bit integers in a right by count while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
7850///
7851/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_sra_epi16&expand=5396)
7852#[inline]
7853#[target_feature(enable = "avx512bw")]
7854#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7855#[cfg_attr(test, assert_instr(vpsraw))]
7856pub fn _mm512_mask_sra_epi16(src: __m512i, k: __mmask32, a: __m512i, count: __m128i) -> __m512i {
7857    unsafe {
7858        let shf = _mm512_sra_epi16(a, count).as_i16x32();
7859        transmute(simd_select_bitmask(k, shf, src.as_i16x32()))
7860    }
7861}
7862
7863/// Shift packed 16-bit integers in a right by count while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
7864///
7865/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_sra_epi16&expand=5397)
7866#[inline]
7867#[target_feature(enable = "avx512bw")]
7868#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7869#[cfg_attr(test, assert_instr(vpsraw))]
7870pub fn _mm512_maskz_sra_epi16(k: __mmask32, a: __m512i, count: __m128i) -> __m512i {
7871    unsafe {
7872        let shf = _mm512_sra_epi16(a, count).as_i16x32();
7873        transmute(simd_select_bitmask(k, shf, i16x32::ZERO))
7874    }
7875}
7876
7877/// Shift packed 16-bit integers in a right by count while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
7878///
7879/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_sra_epi16&expand=5393)
7880#[inline]
7881#[target_feature(enable = "avx512bw,avx512vl")]
7882#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7883#[cfg_attr(test, assert_instr(vpsraw))]
7884pub fn _mm256_mask_sra_epi16(src: __m256i, k: __mmask16, a: __m256i, count: __m128i) -> __m256i {
7885    unsafe {
7886        let shf = _mm256_sra_epi16(a, count).as_i16x16();
7887        transmute(simd_select_bitmask(k, shf, src.as_i16x16()))
7888    }
7889}
7890
7891/// Shift packed 16-bit integers in a right by count while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
7892///
7893/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_sra_epi16&expand=5394)
7894#[inline]
7895#[target_feature(enable = "avx512bw,avx512vl")]
7896#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7897#[cfg_attr(test, assert_instr(vpsraw))]
7898pub fn _mm256_maskz_sra_epi16(k: __mmask16, a: __m256i, count: __m128i) -> __m256i {
7899    unsafe {
7900        let shf = _mm256_sra_epi16(a, count).as_i16x16();
7901        transmute(simd_select_bitmask(k, shf, i16x16::ZERO))
7902    }
7903}
7904
7905/// Shift packed 16-bit integers in a right by count while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
7906///
7907/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_sra_epi16&expand=5390)
7908#[inline]
7909#[target_feature(enable = "avx512bw,avx512vl")]
7910#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7911#[cfg_attr(test, assert_instr(vpsraw))]
7912pub fn _mm_mask_sra_epi16(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
7913    unsafe {
7914        let shf = _mm_sra_epi16(a, count).as_i16x8();
7915        transmute(simd_select_bitmask(k, shf, src.as_i16x8()))
7916    }
7917}
7918
7919/// Shift packed 16-bit integers in a right by count while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
7920///
7921/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_sra_epi16&expand=5391)
7922#[inline]
7923#[target_feature(enable = "avx512bw,avx512vl")]
7924#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7925#[cfg_attr(test, assert_instr(vpsraw))]
7926pub fn _mm_maskz_sra_epi16(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
7927    unsafe {
7928        let shf = _mm_sra_epi16(a, count).as_i16x8();
7929        transmute(simd_select_bitmask(k, shf, i16x8::ZERO))
7930    }
7931}
7932
7933/// Shift packed 16-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst.
7934///
7935/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_srai_epi16&expand=5427)
7936#[inline]
7937#[target_feature(enable = "avx512bw")]
7938#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7939#[cfg_attr(test, assert_instr(vpsraw, IMM8 = 1))]
7940#[rustc_legacy_const_generics(1)]
7941#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7942pub const fn _mm512_srai_epi16<const IMM8: u32>(a: __m512i) -> __m512i {
7943    unsafe {
7944        static_assert_uimm_bits!(IMM8, 8);
7945        transmute(simd_shr(a.as_i16x32(), i16x32::splat(IMM8.min(15) as i16)))
7946    }
7947}
7948
7949/// Shift packed 16-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
7950///
7951/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_srai_epi16&expand=5425)
7952#[inline]
7953#[target_feature(enable = "avx512bw")]
7954#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7955#[cfg_attr(test, assert_instr(vpsraw, IMM8 = 1))]
7956#[rustc_legacy_const_generics(3)]
7957#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7958pub const fn _mm512_mask_srai_epi16<const IMM8: u32>(
7959    src: __m512i,
7960    k: __mmask32,
7961    a: __m512i,
7962) -> __m512i {
7963    unsafe {
7964        static_assert_uimm_bits!(IMM8, 8);
7965        let shf = simd_shr(a.as_i16x32(), i16x32::splat(IMM8.min(15) as i16));
7966        transmute(simd_select_bitmask(k, shf, src.as_i16x32()))
7967    }
7968}
7969
7970/// Shift packed 16-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
7971///
7972/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_srai_epi16&expand=5426)
7973#[inline]
7974#[target_feature(enable = "avx512bw")]
7975#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7976#[cfg_attr(test, assert_instr(vpsraw, IMM8 = 1))]
7977#[rustc_legacy_const_generics(2)]
7978#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7979pub const fn _mm512_maskz_srai_epi16<const IMM8: u32>(k: __mmask32, a: __m512i) -> __m512i {
7980    unsafe {
7981        static_assert_uimm_bits!(IMM8, 8);
7982        let shf = simd_shr(a.as_i16x32(), i16x32::splat(IMM8.min(15) as i16));
7983        transmute(simd_select_bitmask(k, shf, i16x32::ZERO))
7984    }
7985}
7986
7987/// Shift packed 16-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
7988///
7989/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_srai_epi16&expand=5422)
7990#[inline]
7991#[target_feature(enable = "avx512bw,avx512vl")]
7992#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7993#[cfg_attr(test, assert_instr(vpsraw, IMM8 = 1))]
7994#[rustc_legacy_const_generics(3)]
7995#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7996pub const fn _mm256_mask_srai_epi16<const IMM8: u32>(
7997    src: __m256i,
7998    k: __mmask16,
7999    a: __m256i,
8000) -> __m256i {
8001    unsafe {
8002        static_assert_uimm_bits!(IMM8, 8);
8003        let r = simd_shr(a.as_i16x16(), i16x16::splat(IMM8.min(15) as i16));
8004        transmute(simd_select_bitmask(k, r, src.as_i16x16()))
8005    }
8006}
8007
8008/// Shift packed 16-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
8009///
8010/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_srai_epi16&expand=5423)
8011#[inline]
8012#[target_feature(enable = "avx512bw,avx512vl")]
8013#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8014#[cfg_attr(test, assert_instr(vpsraw, IMM8 = 1))]
8015#[rustc_legacy_const_generics(2)]
8016#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8017pub const fn _mm256_maskz_srai_epi16<const IMM8: u32>(k: __mmask16, a: __m256i) -> __m256i {
8018    unsafe {
8019        static_assert_uimm_bits!(IMM8, 8);
8020        let r = simd_shr(a.as_i16x16(), i16x16::splat(IMM8.min(15) as i16));
8021        transmute(simd_select_bitmask(k, r, i16x16::ZERO))
8022    }
8023}
8024
8025/// Shift packed 16-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
8026///
8027/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_srai_epi16&expand=5419)
8028#[inline]
8029#[target_feature(enable = "avx512bw,avx512vl")]
8030#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8031#[cfg_attr(test, assert_instr(vpsraw, IMM8 = 1))]
8032#[rustc_legacy_const_generics(3)]
8033#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8034pub const fn _mm_mask_srai_epi16<const IMM8: u32>(
8035    src: __m128i,
8036    k: __mmask8,
8037    a: __m128i,
8038) -> __m128i {
8039    unsafe {
8040        static_assert_uimm_bits!(IMM8, 8);
8041        let r = simd_shr(a.as_i16x8(), i16x8::splat(IMM8.min(15) as i16));
8042        transmute(simd_select_bitmask(k, r, src.as_i16x8()))
8043    }
8044}
8045
8046/// Shift packed 16-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
8047///
8048/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_srai_epi16&expand=5420)
8049#[inline]
8050#[target_feature(enable = "avx512bw,avx512vl")]
8051#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8052#[cfg_attr(test, assert_instr(vpsraw, IMM8 = 1))]
8053#[rustc_legacy_const_generics(2)]
8054#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8055pub const fn _mm_maskz_srai_epi16<const IMM8: u32>(k: __mmask8, a: __m128i) -> __m128i {
8056    unsafe {
8057        static_assert_uimm_bits!(IMM8, 8);
8058        let r = simd_shr(a.as_i16x8(), i16x8::splat(IMM8.min(15) as i16));
8059        transmute(simd_select_bitmask(k, r, i16x8::ZERO))
8060    }
8061}
8062
8063/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst.
8064///
8065/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_srav_epi16&expand=5456)
8066#[inline]
8067#[target_feature(enable = "avx512bw")]
8068#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8069#[cfg_attr(test, assert_instr(vpsravw))]
8070pub fn _mm512_srav_epi16(a: __m512i, count: __m512i) -> __m512i {
8071    unsafe { transmute(vpsravw(a.as_i16x32(), count.as_i16x32())) }
8072}
8073
8074/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
8075///
8076/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_srav_epi16&expand=5454)
8077#[inline]
8078#[target_feature(enable = "avx512bw")]
8079#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8080#[cfg_attr(test, assert_instr(vpsravw))]
8081pub fn _mm512_mask_srav_epi16(src: __m512i, k: __mmask32, a: __m512i, count: __m512i) -> __m512i {
8082    unsafe {
8083        let shf = _mm512_srav_epi16(a, count).as_i16x32();
8084        transmute(simd_select_bitmask(k, shf, src.as_i16x32()))
8085    }
8086}
8087
8088/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
8089///
8090/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_srav_epi16&expand=5455)
8091#[inline]
8092#[target_feature(enable = "avx512bw")]
8093#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8094#[cfg_attr(test, assert_instr(vpsravw))]
8095pub fn _mm512_maskz_srav_epi16(k: __mmask32, a: __m512i, count: __m512i) -> __m512i {
8096    unsafe {
8097        let shf = _mm512_srav_epi16(a, count).as_i16x32();
8098        transmute(simd_select_bitmask(k, shf, i16x32::ZERO))
8099    }
8100}
8101
8102/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst.
8103///
8104/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_srav_epi16&expand=5453)
8105#[inline]
8106#[target_feature(enable = "avx512bw,avx512vl")]
8107#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8108#[cfg_attr(test, assert_instr(vpsravw))]
8109pub fn _mm256_srav_epi16(a: __m256i, count: __m256i) -> __m256i {
8110    unsafe { transmute(vpsravw256(a.as_i16x16(), count.as_i16x16())) }
8111}
8112
8113/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
8114///
8115/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_srav_epi16&expand=5451)
8116#[inline]
8117#[target_feature(enable = "avx512bw,avx512vl")]
8118#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8119#[cfg_attr(test, assert_instr(vpsravw))]
8120pub fn _mm256_mask_srav_epi16(src: __m256i, k: __mmask16, a: __m256i, count: __m256i) -> __m256i {
8121    unsafe {
8122        let shf = _mm256_srav_epi16(a, count).as_i16x16();
8123        transmute(simd_select_bitmask(k, shf, src.as_i16x16()))
8124    }
8125}
8126
8127/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
8128///
8129/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_srav_epi16&expand=5452)
8130#[inline]
8131#[target_feature(enable = "avx512bw,avx512vl")]
8132#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8133#[cfg_attr(test, assert_instr(vpsravw))]
8134pub fn _mm256_maskz_srav_epi16(k: __mmask16, a: __m256i, count: __m256i) -> __m256i {
8135    unsafe {
8136        let shf = _mm256_srav_epi16(a, count).as_i16x16();
8137        transmute(simd_select_bitmask(k, shf, i16x16::ZERO))
8138    }
8139}
8140
8141/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst.
8142///
8143/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_srav_epi16&expand=5450)
8144#[inline]
8145#[target_feature(enable = "avx512bw,avx512vl")]
8146#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8147#[cfg_attr(test, assert_instr(vpsravw))]
8148pub fn _mm_srav_epi16(a: __m128i, count: __m128i) -> __m128i {
8149    unsafe { transmute(vpsravw128(a.as_i16x8(), count.as_i16x8())) }
8150}
8151
8152/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
8153///
8154/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_srav_epi16&expand=5448)
8155#[inline]
8156#[target_feature(enable = "avx512bw,avx512vl")]
8157#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8158#[cfg_attr(test, assert_instr(vpsravw))]
8159pub fn _mm_mask_srav_epi16(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
8160    unsafe {
8161        let shf = _mm_srav_epi16(a, count).as_i16x8();
8162        transmute(simd_select_bitmask(k, shf, src.as_i16x8()))
8163    }
8164}
8165
8166/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
8167///
8168/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_srav_epi16&expand=5449)
8169#[inline]
8170#[target_feature(enable = "avx512bw,avx512vl")]
8171#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8172#[cfg_attr(test, assert_instr(vpsravw))]
8173pub fn _mm_maskz_srav_epi16(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
8174    unsafe {
8175        let shf = _mm_srav_epi16(a, count).as_i16x8();
8176        transmute(simd_select_bitmask(k, shf, i16x8::ZERO))
8177    }
8178}
8179
8180/// Shuffle 16-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst.
8181///
8182/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_permutex2var_epi16&expand=4226)
8183#[inline]
8184#[target_feature(enable = "avx512bw")]
8185#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8186#[cfg_attr(test, assert_instr(vperm))] //vpermi2w or vpermt2w
8187pub fn _mm512_permutex2var_epi16(a: __m512i, idx: __m512i, b: __m512i) -> __m512i {
8188    unsafe { transmute(vpermi2w(a.as_i16x32(), idx.as_i16x32(), b.as_i16x32())) }
8189}
8190
8191/// Shuffle 16-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
8192///
8193/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_permutex2var_epi16&expand=4223)
8194#[inline]
8195#[target_feature(enable = "avx512bw")]
8196#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8197#[cfg_attr(test, assert_instr(vpermt2w))]
8198pub fn _mm512_mask_permutex2var_epi16(
8199    a: __m512i,
8200    k: __mmask32,
8201    idx: __m512i,
8202    b: __m512i,
8203) -> __m512i {
8204    unsafe {
8205        let permute = _mm512_permutex2var_epi16(a, idx, b).as_i16x32();
8206        transmute(simd_select_bitmask(k, permute, a.as_i16x32()))
8207    }
8208}
8209
8210/// Shuffle 16-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
8211///
8212/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_permutex2var_epi16&expand=4225)
8213#[inline]
8214#[target_feature(enable = "avx512bw")]
8215#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8216#[cfg_attr(test, assert_instr(vperm))] //vpermi2w or vpermt2w
8217pub fn _mm512_maskz_permutex2var_epi16(
8218    k: __mmask32,
8219    a: __m512i,
8220    idx: __m512i,
8221    b: __m512i,
8222) -> __m512i {
8223    unsafe {
8224        let permute = _mm512_permutex2var_epi16(a, idx, b).as_i16x32();
8225        transmute(simd_select_bitmask(k, permute, i16x32::ZERO))
8226    }
8227}
8228
8229/// Shuffle 16-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from idx when the corresponding mask bit is not set).
8230///
8231/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask2_permutex2var_epi16&expand=4224)
8232#[inline]
8233#[target_feature(enable = "avx512bw")]
8234#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8235#[cfg_attr(test, assert_instr(vpermi2w))]
8236pub fn _mm512_mask2_permutex2var_epi16(
8237    a: __m512i,
8238    idx: __m512i,
8239    k: __mmask32,
8240    b: __m512i,
8241) -> __m512i {
8242    unsafe {
8243        let permute = _mm512_permutex2var_epi16(a, idx, b).as_i16x32();
8244        transmute(simd_select_bitmask(k, permute, idx.as_i16x32()))
8245    }
8246}
8247
8248/// Shuffle 16-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst.
8249///
8250/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_permutex2var_epi16&expand=4222)
8251#[inline]
8252#[target_feature(enable = "avx512bw,avx512vl")]
8253#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8254#[cfg_attr(test, assert_instr(vperm))] //vpermi2w or vpermt2w
8255pub fn _mm256_permutex2var_epi16(a: __m256i, idx: __m256i, b: __m256i) -> __m256i {
8256    unsafe { transmute(vpermi2w256(a.as_i16x16(), idx.as_i16x16(), b.as_i16x16())) }
8257}
8258
8259/// Shuffle 16-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
8260///
8261/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_permutex2var_epi16&expand=4219)
8262#[inline]
8263#[target_feature(enable = "avx512bw,avx512vl")]
8264#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8265#[cfg_attr(test, assert_instr(vpermt2w))]
8266pub fn _mm256_mask_permutex2var_epi16(
8267    a: __m256i,
8268    k: __mmask16,
8269    idx: __m256i,
8270    b: __m256i,
8271) -> __m256i {
8272    unsafe {
8273        let permute = _mm256_permutex2var_epi16(a, idx, b).as_i16x16();
8274        transmute(simd_select_bitmask(k, permute, a.as_i16x16()))
8275    }
8276}
8277
8278/// Shuffle 16-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
8279///
8280/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_permutex2var_epi16&expand=4221)
8281#[inline]
8282#[target_feature(enable = "avx512bw,avx512vl")]
8283#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8284#[cfg_attr(test, assert_instr(vperm))] //vpermi2w or vpermt2w
8285pub fn _mm256_maskz_permutex2var_epi16(
8286    k: __mmask16,
8287    a: __m256i,
8288    idx: __m256i,
8289    b: __m256i,
8290) -> __m256i {
8291    unsafe {
8292        let permute = _mm256_permutex2var_epi16(a, idx, b).as_i16x16();
8293        transmute(simd_select_bitmask(k, permute, i16x16::ZERO))
8294    }
8295}
8296
8297/// Shuffle 16-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from idx when the corresponding mask bit is not set).
8298///
8299/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask2_permutex2var_epi16&expand=4220)
8300#[inline]
8301#[target_feature(enable = "avx512bw,avx512vl")]
8302#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8303#[cfg_attr(test, assert_instr(vpermi2w))]
8304pub fn _mm256_mask2_permutex2var_epi16(
8305    a: __m256i,
8306    idx: __m256i,
8307    k: __mmask16,
8308    b: __m256i,
8309) -> __m256i {
8310    unsafe {
8311        let permute = _mm256_permutex2var_epi16(a, idx, b).as_i16x16();
8312        transmute(simd_select_bitmask(k, permute, idx.as_i16x16()))
8313    }
8314}
8315
8316/// Shuffle 16-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst.
8317///
8318/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_permutex2var_epi16&expand=4218)
8319#[inline]
8320#[target_feature(enable = "avx512bw,avx512vl")]
8321#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8322#[cfg_attr(test, assert_instr(vperm))] //vpermi2w or vpermt2w
8323pub fn _mm_permutex2var_epi16(a: __m128i, idx: __m128i, b: __m128i) -> __m128i {
8324    unsafe { transmute(vpermi2w128(a.as_i16x8(), idx.as_i16x8(), b.as_i16x8())) }
8325}
8326
8327/// Shuffle 16-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
8328///
8329/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_permutex2var_epi16&expand=4215)
8330#[inline]
8331#[target_feature(enable = "avx512bw,avx512vl")]
8332#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8333#[cfg_attr(test, assert_instr(vpermt2w))]
8334pub fn _mm_mask_permutex2var_epi16(a: __m128i, k: __mmask8, idx: __m128i, b: __m128i) -> __m128i {
8335    unsafe {
8336        let permute = _mm_permutex2var_epi16(a, idx, b).as_i16x8();
8337        transmute(simd_select_bitmask(k, permute, a.as_i16x8()))
8338    }
8339}
8340
8341/// Shuffle 16-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
8342///
8343/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_permutex2var_epi16&expand=4217)
8344#[inline]
8345#[target_feature(enable = "avx512bw,avx512vl")]
8346#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8347#[cfg_attr(test, assert_instr(vperm))] //vpermi2w or vpermt2w
8348pub fn _mm_maskz_permutex2var_epi16(k: __mmask8, a: __m128i, idx: __m128i, b: __m128i) -> __m128i {
8349    unsafe {
8350        let permute = _mm_permutex2var_epi16(a, idx, b).as_i16x8();
8351        transmute(simd_select_bitmask(k, permute, i16x8::ZERO))
8352    }
8353}
8354
8355/// Shuffle 16-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from idx when the corresponding mask bit is not set).
8356///
8357/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask2_permutex2var_epi16&expand=4216)
8358#[inline]
8359#[target_feature(enable = "avx512bw,avx512vl")]
8360#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8361#[cfg_attr(test, assert_instr(vpermi2w))]
8362pub fn _mm_mask2_permutex2var_epi16(a: __m128i, idx: __m128i, k: __mmask8, b: __m128i) -> __m128i {
8363    unsafe {
8364        let permute = _mm_permutex2var_epi16(a, idx, b).as_i16x8();
8365        transmute(simd_select_bitmask(k, permute, idx.as_i16x8()))
8366    }
8367}
8368
8369/// Shuffle 16-bit integers in a across lanes using the corresponding index in idx, and store the results in dst.
8370///
8371/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_permutexvar_epi16&expand=4295)
8372#[inline]
8373#[target_feature(enable = "avx512bw")]
8374#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8375#[cfg_attr(test, assert_instr(vpermw))]
8376pub fn _mm512_permutexvar_epi16(idx: __m512i, a: __m512i) -> __m512i {
8377    unsafe { transmute(vpermw(a.as_i16x32(), idx.as_i16x32())) }
8378}
8379
8380/// Shuffle 16-bit integers in a across lanes using the corresponding index in idx, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
8381///
8382/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_permutexvar_epi16&expand=4293)
8383#[inline]
8384#[target_feature(enable = "avx512bw")]
8385#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8386#[cfg_attr(test, assert_instr(vpermw))]
8387pub fn _mm512_mask_permutexvar_epi16(
8388    src: __m512i,
8389    k: __mmask32,
8390    idx: __m512i,
8391    a: __m512i,
8392) -> __m512i {
8393    unsafe {
8394        let permute = _mm512_permutexvar_epi16(idx, a).as_i16x32();
8395        transmute(simd_select_bitmask(k, permute, src.as_i16x32()))
8396    }
8397}
8398
8399/// Shuffle 16-bit integers in a across lanes using the corresponding index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
8400///
8401/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_permutexvar_epi16&expand=4294)
8402#[inline]
8403#[target_feature(enable = "avx512bw")]
8404#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8405#[cfg_attr(test, assert_instr(vpermw))]
8406pub fn _mm512_maskz_permutexvar_epi16(k: __mmask32, idx: __m512i, a: __m512i) -> __m512i {
8407    unsafe {
8408        let permute = _mm512_permutexvar_epi16(idx, a).as_i16x32();
8409        transmute(simd_select_bitmask(k, permute, i16x32::ZERO))
8410    }
8411}
8412
8413/// Shuffle 16-bit integers in a across lanes using the corresponding index in idx, and store the results in dst.
8414///
8415/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_permutexvar_epi16&expand=4292)
8416#[inline]
8417#[target_feature(enable = "avx512bw,avx512vl")]
8418#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8419#[cfg_attr(test, assert_instr(vpermw))]
8420pub fn _mm256_permutexvar_epi16(idx: __m256i, a: __m256i) -> __m256i {
8421    unsafe { transmute(vpermw256(a.as_i16x16(), idx.as_i16x16())) }
8422}
8423
8424/// Shuffle 16-bit integers in a across lanes using the corresponding index in idx, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
8425///
8426/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_permutexvar_epi16&expand=4290)
8427#[inline]
8428#[target_feature(enable = "avx512bw,avx512vl")]
8429#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8430#[cfg_attr(test, assert_instr(vpermw))]
8431pub fn _mm256_mask_permutexvar_epi16(
8432    src: __m256i,
8433    k: __mmask16,
8434    idx: __m256i,
8435    a: __m256i,
8436) -> __m256i {
8437    unsafe {
8438        let permute = _mm256_permutexvar_epi16(idx, a).as_i16x16();
8439        transmute(simd_select_bitmask(k, permute, src.as_i16x16()))
8440    }
8441}
8442
8443/// Shuffle 16-bit integers in a across lanes using the corresponding index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
8444///
8445/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_permutexvar_epi16&expand=4291)
8446#[inline]
8447#[target_feature(enable = "avx512bw,avx512vl")]
8448#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8449#[cfg_attr(test, assert_instr(vpermw))]
8450pub fn _mm256_maskz_permutexvar_epi16(k: __mmask16, idx: __m256i, a: __m256i) -> __m256i {
8451    unsafe {
8452        let permute = _mm256_permutexvar_epi16(idx, a).as_i16x16();
8453        transmute(simd_select_bitmask(k, permute, i16x16::ZERO))
8454    }
8455}
8456
8457/// Shuffle 16-bit integers in a across lanes using the corresponding index in idx, and store the results in dst.
8458///
8459/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_permutexvar_epi16&expand=4289)
8460#[inline]
8461#[target_feature(enable = "avx512bw,avx512vl")]
8462#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8463#[cfg_attr(test, assert_instr(vpermw))]
8464pub fn _mm_permutexvar_epi16(idx: __m128i, a: __m128i) -> __m128i {
8465    unsafe { transmute(vpermw128(a.as_i16x8(), idx.as_i16x8())) }
8466}
8467
8468/// Shuffle 16-bit integers in a across lanes using the corresponding index in idx, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
8469///
8470/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_permutexvar_epi16&expand=4287)
8471#[inline]
8472#[target_feature(enable = "avx512bw,avx512vl")]
8473#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8474#[cfg_attr(test, assert_instr(vpermw))]
8475pub fn _mm_mask_permutexvar_epi16(src: __m128i, k: __mmask8, idx: __m128i, a: __m128i) -> __m128i {
8476    unsafe {
8477        let permute = _mm_permutexvar_epi16(idx, a).as_i16x8();
8478        transmute(simd_select_bitmask(k, permute, src.as_i16x8()))
8479    }
8480}
8481
8482/// Shuffle 16-bit integers in a across lanes using the corresponding index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
8483///
8484/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_permutexvar_epi16&expand=4288)
8485#[inline]
8486#[target_feature(enable = "avx512bw,avx512vl")]
8487#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8488#[cfg_attr(test, assert_instr(vpermw))]
8489pub fn _mm_maskz_permutexvar_epi16(k: __mmask8, idx: __m128i, a: __m128i) -> __m128i {
8490    unsafe {
8491        let permute = _mm_permutexvar_epi16(idx, a).as_i16x8();
8492        transmute(simd_select_bitmask(k, permute, i16x8::ZERO))
8493    }
8494}
8495
8496/// Blend packed 16-bit integers from a and b using control mask k, and store the results in dst.
8497///
8498/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_blend_epi16&expand=430)
8499#[inline]
8500#[target_feature(enable = "avx512bw")]
8501#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8502#[cfg_attr(test, assert_instr(vmovdqu16))] //should be vpblendmw
8503#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8504pub const fn _mm512_mask_blend_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
8505    unsafe { transmute(simd_select_bitmask(k, b.as_i16x32(), a.as_i16x32())) }
8506}
8507
8508/// Blend packed 16-bit integers from a and b using control mask k, and store the results in dst.
8509///
8510/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_blend_epi16&expand=429)
8511#[inline]
8512#[target_feature(enable = "avx512bw,avx512vl")]
8513#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8514#[cfg_attr(test, assert_instr(vmovdqu16))] //should be vpblendmw
8515#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8516pub const fn _mm256_mask_blend_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
8517    unsafe { transmute(simd_select_bitmask(k, b.as_i16x16(), a.as_i16x16())) }
8518}
8519
8520/// Blend packed 16-bit integers from a and b using control mask k, and store the results in dst.
8521///
8522/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_blend_epi16&expand=427)
8523#[inline]
8524#[target_feature(enable = "avx512bw,avx512vl")]
8525#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8526#[cfg_attr(test, assert_instr(vmovdqu16))] //should be vpblendmw
8527#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8528pub const fn _mm_mask_blend_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
8529    unsafe { transmute(simd_select_bitmask(k, b.as_i16x8(), a.as_i16x8())) }
8530}
8531
8532/// Blend packed 8-bit integers from a and b using control mask k, and store the results in dst.
8533///
8534/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_blend_epi8&expand=441)
8535#[inline]
8536#[target_feature(enable = "avx512bw")]
8537#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8538#[cfg_attr(test, assert_instr(vmovdqu8))] //should be vpblendmb
8539#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8540pub const fn _mm512_mask_blend_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
8541    unsafe { transmute(simd_select_bitmask(k, b.as_i8x64(), a.as_i8x64())) }
8542}
8543
8544/// Blend packed 8-bit integers from a and b using control mask k, and store the results in dst.
8545///
8546/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_blend_epi8&expand=440)
8547#[inline]
8548#[target_feature(enable = "avx512bw,avx512vl")]
8549#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8550#[cfg_attr(test, assert_instr(vmovdqu8))] //should be vpblendmb
8551#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8552pub const fn _mm256_mask_blend_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
8553    unsafe { transmute(simd_select_bitmask(k, b.as_i8x32(), a.as_i8x32())) }
8554}
8555
8556/// Blend packed 8-bit integers from a and b using control mask k, and store the results in dst.
8557///
8558/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_blend_epi8&expand=439)
8559#[inline]
8560#[target_feature(enable = "avx512bw,avx512vl")]
8561#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8562#[cfg_attr(test, assert_instr(vmovdqu8))] //should be vpblendmb
8563#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8564pub const fn _mm_mask_blend_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
8565    unsafe { transmute(simd_select_bitmask(k, b.as_i8x16(), a.as_i8x16())) }
8566}
8567
8568/// Broadcast the low packed 16-bit integer from a to all elements of dst.
8569///
8570/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_broadcastw_epi16&expand=587)
8571#[inline]
8572#[target_feature(enable = "avx512bw")]
8573#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8574#[cfg_attr(test, assert_instr(vpbroadcastw))]
8575#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8576pub const fn _mm512_broadcastw_epi16(a: __m128i) -> __m512i {
8577    unsafe {
8578        let a = _mm512_castsi128_si512(a).as_i16x32();
8579        let ret: i16x32 = simd_shuffle!(
8580            a,
8581            a,
8582            [
8583                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
8584                0, 0, 0, 0,
8585            ],
8586        );
8587        transmute(ret)
8588    }
8589}
8590
8591/// Broadcast the low packed 16-bit integer from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
8592///
8593/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_broadcastw_epi16&expand=588)
8594#[inline]
8595#[target_feature(enable = "avx512bw")]
8596#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8597#[cfg_attr(test, assert_instr(vpbroadcastw))]
8598#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8599pub const fn _mm512_mask_broadcastw_epi16(src: __m512i, k: __mmask32, a: __m128i) -> __m512i {
8600    unsafe {
8601        let broadcast = _mm512_broadcastw_epi16(a).as_i16x32();
8602        transmute(simd_select_bitmask(k, broadcast, src.as_i16x32()))
8603    }
8604}
8605
8606/// Broadcast the low packed 16-bit integer from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
8607///
8608/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_broadcastw_epi16&expand=589)
8609#[inline]
8610#[target_feature(enable = "avx512bw")]
8611#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8612#[cfg_attr(test, assert_instr(vpbroadcastw))]
8613#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8614pub const fn _mm512_maskz_broadcastw_epi16(k: __mmask32, a: __m128i) -> __m512i {
8615    unsafe {
8616        let broadcast = _mm512_broadcastw_epi16(a).as_i16x32();
8617        transmute(simd_select_bitmask(k, broadcast, i16x32::ZERO))
8618    }
8619}
8620
8621/// Broadcast the low packed 16-bit integer from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
8622///
8623/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_broadcastw_epi16&expand=585)
8624#[inline]
8625#[target_feature(enable = "avx512bw,avx512vl")]
8626#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8627#[cfg_attr(test, assert_instr(vpbroadcastw))]
8628#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8629pub const fn _mm256_mask_broadcastw_epi16(src: __m256i, k: __mmask16, a: __m128i) -> __m256i {
8630    unsafe {
8631        let broadcast = _mm256_broadcastw_epi16(a).as_i16x16();
8632        transmute(simd_select_bitmask(k, broadcast, src.as_i16x16()))
8633    }
8634}
8635
8636/// Broadcast the low packed 16-bit integer from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
8637///
8638/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_broadcastw_epi16&expand=586)
8639#[inline]
8640#[target_feature(enable = "avx512bw,avx512vl")]
8641#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8642#[cfg_attr(test, assert_instr(vpbroadcastw))]
8643#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8644pub const fn _mm256_maskz_broadcastw_epi16(k: __mmask16, a: __m128i) -> __m256i {
8645    unsafe {
8646        let broadcast = _mm256_broadcastw_epi16(a).as_i16x16();
8647        transmute(simd_select_bitmask(k, broadcast, i16x16::ZERO))
8648    }
8649}
8650
8651/// Broadcast the low packed 16-bit integer from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
8652///
8653/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_broadcastw_epi16&expand=582)
8654#[inline]
8655#[target_feature(enable = "avx512bw,avx512vl")]
8656#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8657#[cfg_attr(test, assert_instr(vpbroadcastw))]
8658#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8659pub const fn _mm_mask_broadcastw_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
8660    unsafe {
8661        let broadcast = _mm_broadcastw_epi16(a).as_i16x8();
8662        transmute(simd_select_bitmask(k, broadcast, src.as_i16x8()))
8663    }
8664}
8665
8666/// Broadcast the low packed 16-bit integer from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
8667///
8668/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_broadcastw_epi16&expand=583)
8669#[inline]
8670#[target_feature(enable = "avx512bw,avx512vl")]
8671#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8672#[cfg_attr(test, assert_instr(vpbroadcastw))]
8673#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8674pub const fn _mm_maskz_broadcastw_epi16(k: __mmask8, a: __m128i) -> __m128i {
8675    unsafe {
8676        let broadcast = _mm_broadcastw_epi16(a).as_i16x8();
8677        transmute(simd_select_bitmask(k, broadcast, i16x8::ZERO))
8678    }
8679}
8680
8681/// Broadcast the low packed 8-bit integer from a to all elements of dst.
8682///
8683/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_broadcastb_epi8&expand=536)
8684#[inline]
8685#[target_feature(enable = "avx512bw")]
8686#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8687#[cfg_attr(test, assert_instr(vpbroadcastb))]
8688#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8689pub const fn _mm512_broadcastb_epi8(a: __m128i) -> __m512i {
8690    unsafe {
8691        let a = _mm512_castsi128_si512(a).as_i8x64();
8692        let ret: i8x64 = simd_shuffle!(
8693            a,
8694            a,
8695            [
8696                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
8697                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
8698                0, 0, 0, 0, 0, 0, 0, 0,
8699            ],
8700        );
8701        transmute(ret)
8702    }
8703}
8704
8705/// Broadcast the low packed 8-bit integer from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
8706///
8707/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_broadcastb_epi8&expand=537)
8708#[inline]
8709#[target_feature(enable = "avx512bw")]
8710#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8711#[cfg_attr(test, assert_instr(vpbroadcastb))]
8712#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8713pub const fn _mm512_mask_broadcastb_epi8(src: __m512i, k: __mmask64, a: __m128i) -> __m512i {
8714    unsafe {
8715        let broadcast = _mm512_broadcastb_epi8(a).as_i8x64();
8716        transmute(simd_select_bitmask(k, broadcast, src.as_i8x64()))
8717    }
8718}
8719
8720/// Broadcast the low packed 8-bit integer from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
8721///
8722/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_broadcastb_epi8&expand=538)
8723#[inline]
8724#[target_feature(enable = "avx512bw")]
8725#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8726#[cfg_attr(test, assert_instr(vpbroadcastb))]
8727#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8728pub const fn _mm512_maskz_broadcastb_epi8(k: __mmask64, a: __m128i) -> __m512i {
8729    unsafe {
8730        let broadcast = _mm512_broadcastb_epi8(a).as_i8x64();
8731        transmute(simd_select_bitmask(k, broadcast, i8x64::ZERO))
8732    }
8733}
8734
8735/// Broadcast the low packed 8-bit integer from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
8736///
8737/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_broadcastb_epi8&expand=534)
8738#[inline]
8739#[target_feature(enable = "avx512bw,avx512vl")]
8740#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8741#[cfg_attr(test, assert_instr(vpbroadcastb))]
8742#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8743pub const fn _mm256_mask_broadcastb_epi8(src: __m256i, k: __mmask32, a: __m128i) -> __m256i {
8744    unsafe {
8745        let broadcast = _mm256_broadcastb_epi8(a).as_i8x32();
8746        transmute(simd_select_bitmask(k, broadcast, src.as_i8x32()))
8747    }
8748}
8749
8750/// Broadcast the low packed 8-bit integer from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
8751///
8752/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_broadcastb_epi8&expand=535)
8753#[inline]
8754#[target_feature(enable = "avx512bw,avx512vl")]
8755#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8756#[cfg_attr(test, assert_instr(vpbroadcastb))]
8757#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8758pub const fn _mm256_maskz_broadcastb_epi8(k: __mmask32, a: __m128i) -> __m256i {
8759    unsafe {
8760        let broadcast = _mm256_broadcastb_epi8(a).as_i8x32();
8761        transmute(simd_select_bitmask(k, broadcast, i8x32::ZERO))
8762    }
8763}
8764
8765/// Broadcast the low packed 8-bit integer from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
8766///
8767/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_broadcastb_epi8&expand=531)
8768#[inline]
8769#[target_feature(enable = "avx512bw,avx512vl")]
8770#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8771#[cfg_attr(test, assert_instr(vpbroadcastb))]
8772#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8773pub const fn _mm_mask_broadcastb_epi8(src: __m128i, k: __mmask16, a: __m128i) -> __m128i {
8774    unsafe {
8775        let broadcast = _mm_broadcastb_epi8(a).as_i8x16();
8776        transmute(simd_select_bitmask(k, broadcast, src.as_i8x16()))
8777    }
8778}
8779
8780/// Broadcast the low packed 8-bit integer from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
8781///
8782/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_broadcastb_epi8&expand=532)
8783#[inline]
8784#[target_feature(enable = "avx512bw,avx512vl")]
8785#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8786#[cfg_attr(test, assert_instr(vpbroadcastb))]
8787#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8788pub const fn _mm_maskz_broadcastb_epi8(k: __mmask16, a: __m128i) -> __m128i {
8789    unsafe {
8790        let broadcast = _mm_broadcastb_epi8(a).as_i8x16();
8791        transmute(simd_select_bitmask(k, broadcast, i8x16::ZERO))
8792    }
8793}
8794
8795/// Unpack and interleave 16-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst.
8796///
8797/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_unpackhi_epi16&expand=6012)
8798#[inline]
8799#[target_feature(enable = "avx512bw")]
8800#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8801#[cfg_attr(test, assert_instr(vpunpckhwd))]
8802#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8803pub const fn _mm512_unpackhi_epi16(a: __m512i, b: __m512i) -> __m512i {
8804    unsafe {
8805        let a = a.as_i16x32();
8806        let b = b.as_i16x32();
8807        #[rustfmt::skip]
8808        let r: i16x32 = simd_shuffle!(
8809            a,
8810            b,
8811            [
8812                4, 32 + 4, 5, 32 + 5,
8813                6, 32 + 6, 7, 32 + 7,
8814                12, 32 + 12, 13, 32 + 13,
8815                14, 32 + 14, 15, 32 + 15,
8816                20, 32 + 20, 21, 32 + 21,
8817                22, 32 + 22, 23, 32 + 23,
8818                28, 32 + 28, 29, 32 + 29,
8819                30, 32 + 30, 31, 32 + 31,
8820            ],
8821        );
8822        transmute(r)
8823    }
8824}
8825
8826/// Unpack and interleave 16-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
8827///
8828/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_unpackhi_epi16&expand=6010)
8829#[inline]
8830#[target_feature(enable = "avx512bw")]
8831#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8832#[cfg_attr(test, assert_instr(vpunpckhwd))]
8833#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8834pub const fn _mm512_mask_unpackhi_epi16(
8835    src: __m512i,
8836    k: __mmask32,
8837    a: __m512i,
8838    b: __m512i,
8839) -> __m512i {
8840    unsafe {
8841        let unpackhi = _mm512_unpackhi_epi16(a, b).as_i16x32();
8842        transmute(simd_select_bitmask(k, unpackhi, src.as_i16x32()))
8843    }
8844}
8845
8846/// Unpack and interleave 16-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
8847///
8848/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_unpackhi_epi16&expand=6011)
8849#[inline]
8850#[target_feature(enable = "avx512bw")]
8851#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8852#[cfg_attr(test, assert_instr(vpunpckhwd))]
8853#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8854pub const fn _mm512_maskz_unpackhi_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
8855    unsafe {
8856        let unpackhi = _mm512_unpackhi_epi16(a, b).as_i16x32();
8857        transmute(simd_select_bitmask(k, unpackhi, i16x32::ZERO))
8858    }
8859}
8860
8861/// Unpack and interleave 16-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
8862///
8863/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_unpackhi_epi16&expand=6007)
8864#[inline]
8865#[target_feature(enable = "avx512bw,avx512vl")]
8866#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8867#[cfg_attr(test, assert_instr(vpunpckhwd))]
8868#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8869pub const fn _mm256_mask_unpackhi_epi16(
8870    src: __m256i,
8871    k: __mmask16,
8872    a: __m256i,
8873    b: __m256i,
8874) -> __m256i {
8875    unsafe {
8876        let unpackhi = _mm256_unpackhi_epi16(a, b).as_i16x16();
8877        transmute(simd_select_bitmask(k, unpackhi, src.as_i16x16()))
8878    }
8879}
8880
8881/// Unpack and interleave 16-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
8882///
8883/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_unpackhi_epi16&expand=6008)
8884#[inline]
8885#[target_feature(enable = "avx512bw,avx512vl")]
8886#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8887#[cfg_attr(test, assert_instr(vpunpckhwd))]
8888#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8889pub const fn _mm256_maskz_unpackhi_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
8890    unsafe {
8891        let unpackhi = _mm256_unpackhi_epi16(a, b).as_i16x16();
8892        transmute(simd_select_bitmask(k, unpackhi, i16x16::ZERO))
8893    }
8894}
8895
8896/// Unpack and interleave 16-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
8897///
8898/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_unpackhi_epi16&expand=6004)
8899#[inline]
8900#[target_feature(enable = "avx512bw,avx512vl")]
8901#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8902#[cfg_attr(test, assert_instr(vpunpckhwd))]
8903#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8904pub const fn _mm_mask_unpackhi_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
8905    unsafe {
8906        let unpackhi = _mm_unpackhi_epi16(a, b).as_i16x8();
8907        transmute(simd_select_bitmask(k, unpackhi, src.as_i16x8()))
8908    }
8909}
8910
8911/// Unpack and interleave 16-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
8912///
8913/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_unpackhi_epi16&expand=6005)
8914#[inline]
8915#[target_feature(enable = "avx512bw,avx512vl")]
8916#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8917#[cfg_attr(test, assert_instr(vpunpckhwd))]
8918#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8919pub const fn _mm_maskz_unpackhi_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
8920    unsafe {
8921        let unpackhi = _mm_unpackhi_epi16(a, b).as_i16x8();
8922        transmute(simd_select_bitmask(k, unpackhi, i16x8::ZERO))
8923    }
8924}
8925
8926/// Unpack and interleave 8-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst.
8927///
8928/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_unpackhi_epi8&expand=6039)
8929#[inline]
8930#[target_feature(enable = "avx512bw")]
8931#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8932#[cfg_attr(test, assert_instr(vpunpckhbw))]
8933#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8934pub const fn _mm512_unpackhi_epi8(a: __m512i, b: __m512i) -> __m512i {
8935    unsafe {
8936        let a = a.as_i8x64();
8937        let b = b.as_i8x64();
8938        #[rustfmt::skip]
8939        let r: i8x64 = simd_shuffle!(
8940            a,
8941            b,
8942            [
8943                8, 64 + 8, 9, 64 + 9,
8944                10, 64 + 10, 11, 64 + 11,
8945                12, 64 + 12, 13, 64 + 13,
8946                14, 64 + 14, 15, 64 + 15,
8947                24, 64 + 24, 25, 64 + 25,
8948                26, 64 + 26, 27, 64 + 27,
8949                28, 64 + 28, 29, 64 + 29,
8950                30, 64 + 30, 31, 64 + 31,
8951                40, 64 + 40, 41, 64 + 41,
8952                42, 64 + 42, 43, 64 + 43,
8953                44, 64 + 44, 45, 64 + 45,
8954                46, 64 + 46, 47, 64 + 47,
8955                56, 64 + 56, 57, 64 + 57,
8956                58, 64 + 58, 59, 64 + 59,
8957                60, 64 + 60, 61, 64 + 61,
8958                62, 64 + 62, 63, 64 + 63,
8959            ],
8960        );
8961        transmute(r)
8962    }
8963}
8964
8965/// Unpack and interleave 8-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
8966///
8967/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_unpackhi_epi8&expand=6037)
8968#[inline]
8969#[target_feature(enable = "avx512bw")]
8970#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8971#[cfg_attr(test, assert_instr(vpunpckhbw))]
8972#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8973pub const fn _mm512_mask_unpackhi_epi8(
8974    src: __m512i,
8975    k: __mmask64,
8976    a: __m512i,
8977    b: __m512i,
8978) -> __m512i {
8979    unsafe {
8980        let unpackhi = _mm512_unpackhi_epi8(a, b).as_i8x64();
8981        transmute(simd_select_bitmask(k, unpackhi, src.as_i8x64()))
8982    }
8983}
8984
8985/// Unpack and interleave 8-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
8986///
8987/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_unpackhi_epi8&expand=6038)
8988#[inline]
8989#[target_feature(enable = "avx512bw")]
8990#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8991#[cfg_attr(test, assert_instr(vpunpckhbw))]
8992#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8993pub const fn _mm512_maskz_unpackhi_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
8994    unsafe {
8995        let unpackhi = _mm512_unpackhi_epi8(a, b).as_i8x64();
8996        transmute(simd_select_bitmask(k, unpackhi, i8x64::ZERO))
8997    }
8998}
8999
9000/// Unpack and interleave 8-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
9001///
9002/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_unpackhi_epi8&expand=6034)
9003#[inline]
9004#[target_feature(enable = "avx512bw,avx512vl")]
9005#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9006#[cfg_attr(test, assert_instr(vpunpckhbw))]
9007#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9008pub const fn _mm256_mask_unpackhi_epi8(
9009    src: __m256i,
9010    k: __mmask32,
9011    a: __m256i,
9012    b: __m256i,
9013) -> __m256i {
9014    unsafe {
9015        let unpackhi = _mm256_unpackhi_epi8(a, b).as_i8x32();
9016        transmute(simd_select_bitmask(k, unpackhi, src.as_i8x32()))
9017    }
9018}
9019
9020/// Unpack and interleave 8-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9021///
9022/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_unpackhi_epi8&expand=6035)
9023#[inline]
9024#[target_feature(enable = "avx512bw,avx512vl")]
9025#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9026#[cfg_attr(test, assert_instr(vpunpckhbw))]
9027#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9028pub const fn _mm256_maskz_unpackhi_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
9029    unsafe {
9030        let unpackhi = _mm256_unpackhi_epi8(a, b).as_i8x32();
9031        transmute(simd_select_bitmask(k, unpackhi, i8x32::ZERO))
9032    }
9033}
9034
9035/// Unpack and interleave 8-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
9036///
9037/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_unpackhi_epi8&expand=6031)
9038#[inline]
9039#[target_feature(enable = "avx512bw,avx512vl")]
9040#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9041#[cfg_attr(test, assert_instr(vpunpckhbw))]
9042#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9043pub const fn _mm_mask_unpackhi_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
9044    unsafe {
9045        let unpackhi = _mm_unpackhi_epi8(a, b).as_i8x16();
9046        transmute(simd_select_bitmask(k, unpackhi, src.as_i8x16()))
9047    }
9048}
9049
9050/// Unpack and interleave 8-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9051///
9052/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_unpackhi_epi8&expand=6032)
9053#[inline]
9054#[target_feature(enable = "avx512bw,avx512vl")]
9055#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9056#[cfg_attr(test, assert_instr(vpunpckhbw))]
9057#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9058pub const fn _mm_maskz_unpackhi_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
9059    unsafe {
9060        let unpackhi = _mm_unpackhi_epi8(a, b).as_i8x16();
9061        transmute(simd_select_bitmask(k, unpackhi, i8x16::ZERO))
9062    }
9063}
9064
9065/// Unpack and interleave 16-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst.
9066///
9067/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_unpacklo_epi16&expand=6069)
9068#[inline]
9069#[target_feature(enable = "avx512bw")]
9070#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9071#[cfg_attr(test, assert_instr(vpunpcklwd))]
9072#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9073pub const fn _mm512_unpacklo_epi16(a: __m512i, b: __m512i) -> __m512i {
9074    unsafe {
9075        let a = a.as_i16x32();
9076        let b = b.as_i16x32();
9077        #[rustfmt::skip]
9078        let r: i16x32 = simd_shuffle!(
9079            a,
9080            b,
9081            [
9082               0,  32+0,   1, 32+1,
9083               2,  32+2,   3, 32+3,
9084               8,  32+8,   9, 32+9,
9085               10, 32+10, 11, 32+11,
9086               16, 32+16, 17, 32+17,
9087               18, 32+18, 19, 32+19,
9088               24, 32+24, 25, 32+25,
9089               26, 32+26, 27, 32+27
9090            ],
9091        );
9092        transmute(r)
9093    }
9094}
9095
9096/// Unpack and interleave 16-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
9097///
9098/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_unpacklo_epi16&expand=6067)
9099#[inline]
9100#[target_feature(enable = "avx512bw")]
9101#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9102#[cfg_attr(test, assert_instr(vpunpcklwd))]
9103#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9104pub const fn _mm512_mask_unpacklo_epi16(
9105    src: __m512i,
9106    k: __mmask32,
9107    a: __m512i,
9108    b: __m512i,
9109) -> __m512i {
9110    unsafe {
9111        let unpacklo = _mm512_unpacklo_epi16(a, b).as_i16x32();
9112        transmute(simd_select_bitmask(k, unpacklo, src.as_i16x32()))
9113    }
9114}
9115
9116/// Unpack and interleave 16-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9117///
9118/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_unpacklo_epi16&expand=6068)
9119#[inline]
9120#[target_feature(enable = "avx512bw")]
9121#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9122#[cfg_attr(test, assert_instr(vpunpcklwd))]
9123#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9124pub const fn _mm512_maskz_unpacklo_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
9125    unsafe {
9126        let unpacklo = _mm512_unpacklo_epi16(a, b).as_i16x32();
9127        transmute(simd_select_bitmask(k, unpacklo, i16x32::ZERO))
9128    }
9129}
9130
9131/// Unpack and interleave 16-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
9132///
9133/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_unpacklo_epi16&expand=6064)
9134#[inline]
9135#[target_feature(enable = "avx512bw,avx512vl")]
9136#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9137#[cfg_attr(test, assert_instr(vpunpcklwd))]
9138#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9139pub const fn _mm256_mask_unpacklo_epi16(
9140    src: __m256i,
9141    k: __mmask16,
9142    a: __m256i,
9143    b: __m256i,
9144) -> __m256i {
9145    unsafe {
9146        let unpacklo = _mm256_unpacklo_epi16(a, b).as_i16x16();
9147        transmute(simd_select_bitmask(k, unpacklo, src.as_i16x16()))
9148    }
9149}
9150
9151/// Unpack and interleave 16-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9152///
9153/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_unpacklo_epi16&expand=6065)
9154#[inline]
9155#[target_feature(enable = "avx512bw,avx512vl")]
9156#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9157#[cfg_attr(test, assert_instr(vpunpcklwd))]
9158#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9159pub const fn _mm256_maskz_unpacklo_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
9160    unsafe {
9161        let unpacklo = _mm256_unpacklo_epi16(a, b).as_i16x16();
9162        transmute(simd_select_bitmask(k, unpacklo, i16x16::ZERO))
9163    }
9164}
9165
9166/// Unpack and interleave 16-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
9167///
9168/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_unpacklo_epi16&expand=6061)
9169#[inline]
9170#[target_feature(enable = "avx512bw,avx512vl")]
9171#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9172#[cfg_attr(test, assert_instr(vpunpcklwd))]
9173#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9174pub const fn _mm_mask_unpacklo_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
9175    unsafe {
9176        let unpacklo = _mm_unpacklo_epi16(a, b).as_i16x8();
9177        transmute(simd_select_bitmask(k, unpacklo, src.as_i16x8()))
9178    }
9179}
9180
9181/// Unpack and interleave 16-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9182///
9183/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_unpacklo_epi16&expand=6062)
9184#[inline]
9185#[target_feature(enable = "avx512bw,avx512vl")]
9186#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9187#[cfg_attr(test, assert_instr(vpunpcklwd))]
9188#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9189pub const fn _mm_maskz_unpacklo_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
9190    unsafe {
9191        let unpacklo = _mm_unpacklo_epi16(a, b).as_i16x8();
9192        transmute(simd_select_bitmask(k, unpacklo, i16x8::ZERO))
9193    }
9194}
9195
9196/// Unpack and interleave 8-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst.
9197///
9198/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_unpacklo_epi8&expand=6096)
9199#[inline]
9200#[target_feature(enable = "avx512bw")]
9201#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9202#[cfg_attr(test, assert_instr(vpunpcklbw))]
9203#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9204pub const fn _mm512_unpacklo_epi8(a: __m512i, b: __m512i) -> __m512i {
9205    unsafe {
9206        let a = a.as_i8x64();
9207        let b = b.as_i8x64();
9208        #[rustfmt::skip]
9209        let r: i8x64 = simd_shuffle!(
9210            a,
9211            b,
9212            [
9213                0,  64+0,   1, 64+1,
9214                2,  64+2,   3, 64+3,
9215                4,  64+4,   5, 64+5,
9216                6,  64+6,   7, 64+7,
9217                16, 64+16, 17, 64+17,
9218                18, 64+18, 19, 64+19,
9219                20, 64+20, 21, 64+21,
9220                22, 64+22, 23, 64+23,
9221                32, 64+32, 33, 64+33,
9222                34, 64+34, 35, 64+35,
9223                36, 64+36, 37, 64+37,
9224                38, 64+38, 39, 64+39,
9225                48, 64+48, 49, 64+49,
9226                50, 64+50, 51, 64+51,
9227                52, 64+52, 53, 64+53,
9228                54, 64+54, 55, 64+55,
9229            ],
9230        );
9231        transmute(r)
9232    }
9233}
9234
9235/// Unpack and interleave 8-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
9236///
9237/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_unpacklo_epi8&expand=6094)
9238#[inline]
9239#[target_feature(enable = "avx512bw")]
9240#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9241#[cfg_attr(test, assert_instr(vpunpcklbw))]
9242#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9243pub const fn _mm512_mask_unpacklo_epi8(
9244    src: __m512i,
9245    k: __mmask64,
9246    a: __m512i,
9247    b: __m512i,
9248) -> __m512i {
9249    unsafe {
9250        let unpacklo = _mm512_unpacklo_epi8(a, b).as_i8x64();
9251        transmute(simd_select_bitmask(k, unpacklo, src.as_i8x64()))
9252    }
9253}
9254
9255/// Unpack and interleave 8-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9256///
9257/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_unpacklo_epi8&expand=6095)
9258#[inline]
9259#[target_feature(enable = "avx512bw")]
9260#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9261#[cfg_attr(test, assert_instr(vpunpcklbw))]
9262#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9263pub const fn _mm512_maskz_unpacklo_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
9264    unsafe {
9265        let unpacklo = _mm512_unpacklo_epi8(a, b).as_i8x64();
9266        transmute(simd_select_bitmask(k, unpacklo, i8x64::ZERO))
9267    }
9268}
9269
9270/// Unpack and interleave 8-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
9271///
9272/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_unpacklo_epi8&expand=6091)
9273#[inline]
9274#[target_feature(enable = "avx512bw,avx512vl")]
9275#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9276#[cfg_attr(test, assert_instr(vpunpcklbw))]
9277#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9278pub const fn _mm256_mask_unpacklo_epi8(
9279    src: __m256i,
9280    k: __mmask32,
9281    a: __m256i,
9282    b: __m256i,
9283) -> __m256i {
9284    unsafe {
9285        let unpacklo = _mm256_unpacklo_epi8(a, b).as_i8x32();
9286        transmute(simd_select_bitmask(k, unpacklo, src.as_i8x32()))
9287    }
9288}
9289
9290/// Unpack and interleave 8-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9291///
9292/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_unpacklo_epi8&expand=6092)
9293#[inline]
9294#[target_feature(enable = "avx512bw,avx512vl")]
9295#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9296#[cfg_attr(test, assert_instr(vpunpcklbw))]
9297#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9298pub const fn _mm256_maskz_unpacklo_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
9299    unsafe {
9300        let unpacklo = _mm256_unpacklo_epi8(a, b).as_i8x32();
9301        transmute(simd_select_bitmask(k, unpacklo, i8x32::ZERO))
9302    }
9303}
9304
9305/// Unpack and interleave 8-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
9306///
9307/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_unpacklo_epi8&expand=6088)
9308#[inline]
9309#[target_feature(enable = "avx512bw,avx512vl")]
9310#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9311#[cfg_attr(test, assert_instr(vpunpcklbw))]
9312#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9313pub const fn _mm_mask_unpacklo_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
9314    unsafe {
9315        let unpacklo = _mm_unpacklo_epi8(a, b).as_i8x16();
9316        transmute(simd_select_bitmask(k, unpacklo, src.as_i8x16()))
9317    }
9318}
9319
9320/// Unpack and interleave 8-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9321///
9322/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_unpacklo_epi8&expand=6089)
9323#[inline]
9324#[target_feature(enable = "avx512bw,avx512vl")]
9325#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9326#[cfg_attr(test, assert_instr(vpunpcklbw))]
9327#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9328pub const fn _mm_maskz_unpacklo_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
9329    unsafe {
9330        let unpacklo = _mm_unpacklo_epi8(a, b).as_i8x16();
9331        transmute(simd_select_bitmask(k, unpacklo, i8x16::ZERO))
9332    }
9333}
9334
9335/// Move packed 16-bit integers from a into dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
9336///
9337/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_mov_epi16&expand=3795)
9338#[inline]
9339#[target_feature(enable = "avx512bw")]
9340#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9341#[cfg_attr(test, assert_instr(vmovdqu16))]
9342#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9343pub const fn _mm512_mask_mov_epi16(src: __m512i, k: __mmask32, a: __m512i) -> __m512i {
9344    unsafe {
9345        let mov = a.as_i16x32();
9346        transmute(simd_select_bitmask(k, mov, src.as_i16x32()))
9347    }
9348}
9349
9350/// Move packed 16-bit integers from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9351///
9352/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_mov_epi16&expand=3796)
9353#[inline]
9354#[target_feature(enable = "avx512bw")]
9355#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9356#[cfg_attr(test, assert_instr(vmovdqu16))]
9357#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9358pub const fn _mm512_maskz_mov_epi16(k: __mmask32, a: __m512i) -> __m512i {
9359    unsafe {
9360        let mov = a.as_i16x32();
9361        transmute(simd_select_bitmask(k, mov, i16x32::ZERO))
9362    }
9363}
9364
9365/// Move packed 16-bit integers from a into dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
9366///
9367/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_mov_epi16&expand=3793)
9368#[inline]
9369#[target_feature(enable = "avx512bw,avx512vl")]
9370#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9371#[cfg_attr(test, assert_instr(vmovdqu16))]
9372#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9373pub const fn _mm256_mask_mov_epi16(src: __m256i, k: __mmask16, a: __m256i) -> __m256i {
9374    unsafe {
9375        let mov = a.as_i16x16();
9376        transmute(simd_select_bitmask(k, mov, src.as_i16x16()))
9377    }
9378}
9379
9380/// Move packed 16-bit integers from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9381///
9382/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_mov_epi16&expand=3794)
9383#[inline]
9384#[target_feature(enable = "avx512bw,avx512vl")]
9385#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9386#[cfg_attr(test, assert_instr(vmovdqu16))]
9387#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9388pub const fn _mm256_maskz_mov_epi16(k: __mmask16, a: __m256i) -> __m256i {
9389    unsafe {
9390        let mov = a.as_i16x16();
9391        transmute(simd_select_bitmask(k, mov, i16x16::ZERO))
9392    }
9393}
9394
9395/// Move packed 16-bit integers from a into dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
9396///
9397/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_mov_epi16&expand=3791)
9398#[inline]
9399#[target_feature(enable = "avx512bw,avx512vl")]
9400#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9401#[cfg_attr(test, assert_instr(vmovdqu16))]
9402#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9403pub const fn _mm_mask_mov_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
9404    unsafe {
9405        let mov = a.as_i16x8();
9406        transmute(simd_select_bitmask(k, mov, src.as_i16x8()))
9407    }
9408}
9409
9410/// Move packed 16-bit integers from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9411///
9412/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_mov_epi16&expand=3792)
9413#[inline]
9414#[target_feature(enable = "avx512bw,avx512vl")]
9415#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9416#[cfg_attr(test, assert_instr(vmovdqu16))]
9417#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9418pub const fn _mm_maskz_mov_epi16(k: __mmask8, a: __m128i) -> __m128i {
9419    unsafe {
9420        let mov = a.as_i16x8();
9421        transmute(simd_select_bitmask(k, mov, i16x8::ZERO))
9422    }
9423}
9424
9425/// Move packed 8-bit integers from a into dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
9426///
9427/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_mov_epi8&expand=3813)
9428#[inline]
9429#[target_feature(enable = "avx512bw")]
9430#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9431#[cfg_attr(test, assert_instr(vmovdqu8))]
9432#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9433pub const fn _mm512_mask_mov_epi8(src: __m512i, k: __mmask64, a: __m512i) -> __m512i {
9434    unsafe {
9435        let mov = a.as_i8x64();
9436        transmute(simd_select_bitmask(k, mov, src.as_i8x64()))
9437    }
9438}
9439
9440/// Move packed 8-bit integers from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9441///
9442/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_mov_epi8&expand=3814)
9443#[inline]
9444#[target_feature(enable = "avx512bw")]
9445#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9446#[cfg_attr(test, assert_instr(vmovdqu8))]
9447#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9448pub const fn _mm512_maskz_mov_epi8(k: __mmask64, a: __m512i) -> __m512i {
9449    unsafe {
9450        let mov = a.as_i8x64();
9451        transmute(simd_select_bitmask(k, mov, i8x64::ZERO))
9452    }
9453}
9454
9455/// Move packed 8-bit integers from a into dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
9456///
9457/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_mov_epi8&expand=3811)
9458#[inline]
9459#[target_feature(enable = "avx512bw,avx512vl")]
9460#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9461#[cfg_attr(test, assert_instr(vmovdqu8))]
9462#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9463pub const fn _mm256_mask_mov_epi8(src: __m256i, k: __mmask32, a: __m256i) -> __m256i {
9464    unsafe {
9465        let mov = a.as_i8x32();
9466        transmute(simd_select_bitmask(k, mov, src.as_i8x32()))
9467    }
9468}
9469
9470/// Move packed 8-bit integers from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9471///
9472/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_mov_epi8&expand=3812)
9473#[inline]
9474#[target_feature(enable = "avx512bw,avx512vl")]
9475#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9476#[cfg_attr(test, assert_instr(vmovdqu8))]
9477#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9478pub const fn _mm256_maskz_mov_epi8(k: __mmask32, a: __m256i) -> __m256i {
9479    unsafe {
9480        let mov = a.as_i8x32();
9481        transmute(simd_select_bitmask(k, mov, i8x32::ZERO))
9482    }
9483}
9484
9485/// Move packed 8-bit integers from a into dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
9486///
9487/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_mov_epi8&expand=3809)
9488#[inline]
9489#[target_feature(enable = "avx512bw,avx512vl")]
9490#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9491#[cfg_attr(test, assert_instr(vmovdqu8))]
9492#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9493pub const fn _mm_mask_mov_epi8(src: __m128i, k: __mmask16, a: __m128i) -> __m128i {
9494    unsafe {
9495        let mov = a.as_i8x16();
9496        transmute(simd_select_bitmask(k, mov, src.as_i8x16()))
9497    }
9498}
9499
9500/// Move packed 8-bit integers from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9501///
9502/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_mov_epi8&expand=3810)
9503#[inline]
9504#[target_feature(enable = "avx512bw,avx512vl")]
9505#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9506#[cfg_attr(test, assert_instr(vmovdqu8))]
9507#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9508pub const fn _mm_maskz_mov_epi8(k: __mmask16, a: __m128i) -> __m128i {
9509    unsafe {
9510        let mov = a.as_i8x16();
9511        transmute(simd_select_bitmask(k, mov, i8x16::ZERO))
9512    }
9513}
9514
9515/// Broadcast 16-bit integer a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
9516///
9517/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_set1_epi16&expand=4942)
9518#[inline]
9519#[target_feature(enable = "avx512bw")]
9520#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9521#[cfg_attr(test, assert_instr(vpbroadcastw))]
9522#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9523pub const fn _mm512_mask_set1_epi16(src: __m512i, k: __mmask32, a: i16) -> __m512i {
9524    unsafe {
9525        let r = _mm512_set1_epi16(a).as_i16x32();
9526        transmute(simd_select_bitmask(k, r, src.as_i16x32()))
9527    }
9528}
9529
9530/// Broadcast the low packed 16-bit integer from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9531///
9532/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_set1_epi16&expand=4943)
9533#[inline]
9534#[target_feature(enable = "avx512bw")]
9535#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9536#[cfg_attr(test, assert_instr(vpbroadcastw))]
9537#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9538pub const fn _mm512_maskz_set1_epi16(k: __mmask32, a: i16) -> __m512i {
9539    unsafe {
9540        let r = _mm512_set1_epi16(a).as_i16x32();
9541        transmute(simd_select_bitmask(k, r, i16x32::ZERO))
9542    }
9543}
9544
9545/// Broadcast 16-bit integer a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
9546///
9547/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_set1_epi16&expand=4939)
9548#[inline]
9549#[target_feature(enable = "avx512bw,avx512vl")]
9550#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9551#[cfg_attr(test, assert_instr(vpbroadcastw))]
9552#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9553pub const fn _mm256_mask_set1_epi16(src: __m256i, k: __mmask16, a: i16) -> __m256i {
9554    unsafe {
9555        let r = _mm256_set1_epi16(a).as_i16x16();
9556        transmute(simd_select_bitmask(k, r, src.as_i16x16()))
9557    }
9558}
9559
9560/// Broadcast the low packed 16-bit integer from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9561///
9562/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_set1_epi16&expand=4940)
9563#[inline]
9564#[target_feature(enable = "avx512bw,avx512vl")]
9565#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9566#[cfg_attr(test, assert_instr(vpbroadcastw))]
9567#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9568pub const fn _mm256_maskz_set1_epi16(k: __mmask16, a: i16) -> __m256i {
9569    unsafe {
9570        let r = _mm256_set1_epi16(a).as_i16x16();
9571        transmute(simd_select_bitmask(k, r, i16x16::ZERO))
9572    }
9573}
9574
9575/// Broadcast 16-bit integer a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
9576///
9577/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_set1_epi16&expand=4936)
9578#[inline]
9579#[target_feature(enable = "avx512bw,avx512vl")]
9580#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9581#[cfg_attr(test, assert_instr(vpbroadcastw))]
9582#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9583pub const fn _mm_mask_set1_epi16(src: __m128i, k: __mmask8, a: i16) -> __m128i {
9584    unsafe {
9585        let r = _mm_set1_epi16(a).as_i16x8();
9586        transmute(simd_select_bitmask(k, r, src.as_i16x8()))
9587    }
9588}
9589
9590/// Broadcast the low packed 16-bit integer from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9591///
9592/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_set1_epi16&expand=4937)
9593#[inline]
9594#[target_feature(enable = "avx512bw,avx512vl")]
9595#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9596#[cfg_attr(test, assert_instr(vpbroadcastw))]
9597#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9598pub const fn _mm_maskz_set1_epi16(k: __mmask8, a: i16) -> __m128i {
9599    unsafe {
9600        let r = _mm_set1_epi16(a).as_i16x8();
9601        transmute(simd_select_bitmask(k, r, i16x8::ZERO))
9602    }
9603}
9604
9605/// Broadcast 8-bit integer a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
9606///
9607/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_set1_epi8&expand=4970)
9608#[inline]
9609#[target_feature(enable = "avx512bw")]
9610#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9611#[cfg_attr(test, assert_instr(vpbroadcast))]
9612#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9613pub const fn _mm512_mask_set1_epi8(src: __m512i, k: __mmask64, a: i8) -> __m512i {
9614    unsafe {
9615        let r = _mm512_set1_epi8(a).as_i8x64();
9616        transmute(simd_select_bitmask(k, r, src.as_i8x64()))
9617    }
9618}
9619
9620/// Broadcast 8-bit integer a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9621///
9622/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_set1_epi8&expand=4971)
9623#[inline]
9624#[target_feature(enable = "avx512bw")]
9625#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9626#[cfg_attr(test, assert_instr(vpbroadcast))]
9627#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9628pub const fn _mm512_maskz_set1_epi8(k: __mmask64, a: i8) -> __m512i {
9629    unsafe {
9630        let r = _mm512_set1_epi8(a).as_i8x64();
9631        transmute(simd_select_bitmask(k, r, i8x64::ZERO))
9632    }
9633}
9634
9635/// Broadcast 8-bit integer a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
9636///
9637/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_set1_epi8&expand=4967)
9638#[inline]
9639#[target_feature(enable = "avx512bw,avx512vl")]
9640#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9641#[cfg_attr(test, assert_instr(vpbroadcast))]
9642#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9643pub const fn _mm256_mask_set1_epi8(src: __m256i, k: __mmask32, a: i8) -> __m256i {
9644    unsafe {
9645        let r = _mm256_set1_epi8(a).as_i8x32();
9646        transmute(simd_select_bitmask(k, r, src.as_i8x32()))
9647    }
9648}
9649
9650/// Broadcast 8-bit integer a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9651///
9652/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_set1_epi8&expand=4968)
9653#[inline]
9654#[target_feature(enable = "avx512bw,avx512vl")]
9655#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9656#[cfg_attr(test, assert_instr(vpbroadcast))]
9657#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9658pub const fn _mm256_maskz_set1_epi8(k: __mmask32, a: i8) -> __m256i {
9659    unsafe {
9660        let r = _mm256_set1_epi8(a).as_i8x32();
9661        transmute(simd_select_bitmask(k, r, i8x32::ZERO))
9662    }
9663}
9664
9665/// Broadcast 8-bit integer a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
9666///
9667/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_set1_epi8&expand=4964)
9668#[inline]
9669#[target_feature(enable = "avx512bw,avx512vl")]
9670#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9671#[cfg_attr(test, assert_instr(vpbroadcast))]
9672#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9673pub const fn _mm_mask_set1_epi8(src: __m128i, k: __mmask16, a: i8) -> __m128i {
9674    unsafe {
9675        let r = _mm_set1_epi8(a).as_i8x16();
9676        transmute(simd_select_bitmask(k, r, src.as_i8x16()))
9677    }
9678}
9679
9680/// Broadcast 8-bit integer a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9681///
9682/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_set1_epi8&expand=4965)
9683#[inline]
9684#[target_feature(enable = "avx512bw,avx512vl")]
9685#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9686#[cfg_attr(test, assert_instr(vpbroadcast))]
9687#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9688pub const fn _mm_maskz_set1_epi8(k: __mmask16, a: i8) -> __m128i {
9689    unsafe {
9690        let r = _mm_set1_epi8(a).as_i8x16();
9691        transmute(simd_select_bitmask(k, r, i8x16::ZERO))
9692    }
9693}
9694
9695/// Shuffle 16-bit integers in the low 64 bits of 128-bit lanes of a using the control in imm8. Store the results in the low 64 bits of 128-bit lanes of dst, with the high 64 bits of 128-bit lanes being copied from a to dst.
9696///
9697/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_shufflelo_epi16&expand=5221)
9698#[inline]
9699#[target_feature(enable = "avx512bw")]
9700#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9701#[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 0))]
9702#[rustc_legacy_const_generics(1)]
9703#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9704pub const fn _mm512_shufflelo_epi16<const IMM8: i32>(a: __m512i) -> __m512i {
9705    unsafe {
9706        static_assert_uimm_bits!(IMM8, 8);
9707        let a = a.as_i16x32();
9708        let r: i16x32 = simd_shuffle!(
9709            a,
9710            a,
9711            [
9712                IMM8 as u32 & 0b11,
9713                (IMM8 as u32 >> 2) & 0b11,
9714                (IMM8 as u32 >> 4) & 0b11,
9715                (IMM8 as u32 >> 6) & 0b11,
9716                4,
9717                5,
9718                6,
9719                7,
9720                (IMM8 as u32 & 0b11) + 8,
9721                ((IMM8 as u32 >> 2) & 0b11) + 8,
9722                ((IMM8 as u32 >> 4) & 0b11) + 8,
9723                ((IMM8 as u32 >> 6) & 0b11) + 8,
9724                12,
9725                13,
9726                14,
9727                15,
9728                (IMM8 as u32 & 0b11) + 16,
9729                ((IMM8 as u32 >> 2) & 0b11) + 16,
9730                ((IMM8 as u32 >> 4) & 0b11) + 16,
9731                ((IMM8 as u32 >> 6) & 0b11) + 16,
9732                20,
9733                21,
9734                22,
9735                23,
9736                (IMM8 as u32 & 0b11) + 24,
9737                ((IMM8 as u32 >> 2) & 0b11) + 24,
9738                ((IMM8 as u32 >> 4) & 0b11) + 24,
9739                ((IMM8 as u32 >> 6) & 0b11) + 24,
9740                28,
9741                29,
9742                30,
9743                31,
9744            ],
9745        );
9746        transmute(r)
9747    }
9748}
9749
9750/// Shuffle 16-bit integers in the low 64 bits of 128-bit lanes of a using the control in imm8. Store the results in the low 64 bits of 128-bit lanes of dst, with the high 64 bits of 128-bit lanes being copied from a to dst, using writemask k (elements are copied from src when the corresponding mask bit is not set).
9751///
9752/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_shufflelo_epi16&expand=5219)
9753#[inline]
9754#[target_feature(enable = "avx512bw")]
9755#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9756#[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 0))]
9757#[rustc_legacy_const_generics(3)]
9758#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9759pub const fn _mm512_mask_shufflelo_epi16<const IMM8: i32>(
9760    src: __m512i,
9761    k: __mmask32,
9762    a: __m512i,
9763) -> __m512i {
9764    unsafe {
9765        static_assert_uimm_bits!(IMM8, 8);
9766        let r = _mm512_shufflelo_epi16::<IMM8>(a);
9767        transmute(simd_select_bitmask(k, r.as_i16x32(), src.as_i16x32()))
9768    }
9769}
9770
9771/// Shuffle 16-bit integers in the low 64 bits of 128-bit lanes of a using the control in imm8. Store the results in the low 64 bits of 128-bit lanes of dst, with the high 64 bits of 128-bit lanes being copied from a to dst, using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9772///
9773/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_shufflelo_epi16&expand=5220)
9774#[inline]
9775#[target_feature(enable = "avx512bw")]
9776#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9777#[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 0))]
9778#[rustc_legacy_const_generics(2)]
9779#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9780pub const fn _mm512_maskz_shufflelo_epi16<const IMM8: i32>(k: __mmask32, a: __m512i) -> __m512i {
9781    unsafe {
9782        static_assert_uimm_bits!(IMM8, 8);
9783        let r = _mm512_shufflelo_epi16::<IMM8>(a);
9784        transmute(simd_select_bitmask(k, r.as_i16x32(), i16x32::ZERO))
9785    }
9786}
9787
9788/// Shuffle 16-bit integers in the low 64 bits of 128-bit lanes of a using the control in imm8. Store the results in the low 64 bits of 128-bit lanes of dst, with the high 64 bits of 128-bit lanes being copied from a to dst, using writemask k (elements are copied from src when the corresponding mask bit is not set).
9789///
9790/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_shufflelo_epi16&expand=5216)
9791#[inline]
9792#[target_feature(enable = "avx512bw,avx512vl")]
9793#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9794#[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 5))]
9795#[rustc_legacy_const_generics(3)]
9796#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9797pub const fn _mm256_mask_shufflelo_epi16<const IMM8: i32>(
9798    src: __m256i,
9799    k: __mmask16,
9800    a: __m256i,
9801) -> __m256i {
9802    unsafe {
9803        static_assert_uimm_bits!(IMM8, 8);
9804        let shuffle = _mm256_shufflelo_epi16::<IMM8>(a);
9805        transmute(simd_select_bitmask(k, shuffle.as_i16x16(), src.as_i16x16()))
9806    }
9807}
9808
9809/// Shuffle 16-bit integers in the low 64 bits of 128-bit lanes of a using the control in imm8. Store the results in the low 64 bits of 128-bit lanes of dst, with the high 64 bits of 128-bit lanes being copied from a to dst, using writemask k (elements are copied from src when the corresponding mask bit is not set).
9810///
9811/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_shufflelo_epi16&expand=5217)
9812#[inline]
9813#[target_feature(enable = "avx512bw,avx512vl")]
9814#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9815#[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 5))]
9816#[rustc_legacy_const_generics(2)]
9817#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9818pub const fn _mm256_maskz_shufflelo_epi16<const IMM8: i32>(k: __mmask16, a: __m256i) -> __m256i {
9819    unsafe {
9820        static_assert_uimm_bits!(IMM8, 8);
9821        let shuffle = _mm256_shufflelo_epi16::<IMM8>(a);
9822        transmute(simd_select_bitmask(k, shuffle.as_i16x16(), i16x16::ZERO))
9823    }
9824}
9825
9826/// Shuffle 16-bit integers in the low 64 bits of 128-bit lanes of a using the control in imm8. Store the results in the low 64 bits of 128-bit lanes of dst, with the high 64 bits of 128-bit lanes being copied from a to dst, using writemask k (elements are copied from src when the corresponding mask bit is not set).
9827///
9828/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_shufflelo_epi16&expand=5213)
9829#[inline]
9830#[target_feature(enable = "avx512bw,avx512vl")]
9831#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9832#[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 5))]
9833#[rustc_legacy_const_generics(3)]
9834#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9835pub const fn _mm_mask_shufflelo_epi16<const IMM8: i32>(
9836    src: __m128i,
9837    k: __mmask8,
9838    a: __m128i,
9839) -> __m128i {
9840    unsafe {
9841        static_assert_uimm_bits!(IMM8, 8);
9842        let shuffle = _mm_shufflelo_epi16::<IMM8>(a);
9843        transmute(simd_select_bitmask(k, shuffle.as_i16x8(), src.as_i16x8()))
9844    }
9845}
9846
9847/// Shuffle 16-bit integers in the low 64 bits of 128-bit lanes of a using the control in imm8. Store the results in the low 64 bits of 128-bit lanes of dst, with the high 64 bits of 128-bit lanes being copied from a to dst, using writemask k (elements are copied from src when the corresponding mask bit is not set).
9848///
9849/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_shufflelo_epi16&expand=5214)
9850#[inline]
9851#[target_feature(enable = "avx512bw,avx512vl")]
9852#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9853#[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 5))]
9854#[rustc_legacy_const_generics(2)]
9855#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9856pub const fn _mm_maskz_shufflelo_epi16<const IMM8: i32>(k: __mmask8, a: __m128i) -> __m128i {
9857    unsafe {
9858        static_assert_uimm_bits!(IMM8, 8);
9859        let shuffle = _mm_shufflelo_epi16::<IMM8>(a);
9860        transmute(simd_select_bitmask(k, shuffle.as_i16x8(), i16x8::ZERO))
9861    }
9862}
9863
9864/// Shuffle 16-bit integers in the high 64 bits of 128-bit lanes of a using the control in imm8. Store the results in the high 64 bits of 128-bit lanes of dst, with the low 64 bits of 128-bit lanes being copied from a to dst.
9865///
9866/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_shufflehi_epi16&expand=5212)
9867#[inline]
9868#[target_feature(enable = "avx512bw")]
9869#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9870#[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 0))]
9871#[rustc_legacy_const_generics(1)]
9872#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9873pub const fn _mm512_shufflehi_epi16<const IMM8: i32>(a: __m512i) -> __m512i {
9874    unsafe {
9875        static_assert_uimm_bits!(IMM8, 8);
9876        let a = a.as_i16x32();
9877        let r: i16x32 = simd_shuffle!(
9878            a,
9879            a,
9880            [
9881                0,
9882                1,
9883                2,
9884                3,
9885                (IMM8 as u32 & 0b11) + 4,
9886                ((IMM8 as u32 >> 2) & 0b11) + 4,
9887                ((IMM8 as u32 >> 4) & 0b11) + 4,
9888                ((IMM8 as u32 >> 6) & 0b11) + 4,
9889                8,
9890                9,
9891                10,
9892                11,
9893                (IMM8 as u32 & 0b11) + 12,
9894                ((IMM8 as u32 >> 2) & 0b11) + 12,
9895                ((IMM8 as u32 >> 4) & 0b11) + 12,
9896                ((IMM8 as u32 >> 6) & 0b11) + 12,
9897                16,
9898                17,
9899                18,
9900                19,
9901                (IMM8 as u32 & 0b11) + 20,
9902                ((IMM8 as u32 >> 2) & 0b11) + 20,
9903                ((IMM8 as u32 >> 4) & 0b11) + 20,
9904                ((IMM8 as u32 >> 6) & 0b11) + 20,
9905                24,
9906                25,
9907                26,
9908                27,
9909                (IMM8 as u32 & 0b11) + 28,
9910                ((IMM8 as u32 >> 2) & 0b11) + 28,
9911                ((IMM8 as u32 >> 4) & 0b11) + 28,
9912                ((IMM8 as u32 >> 6) & 0b11) + 28,
9913            ],
9914        );
9915        transmute(r)
9916    }
9917}
9918
9919/// Shuffle 16-bit integers in the high 64 bits of 128-bit lanes of a using the control in imm8. Store the results in the high 64 bits of 128-bit lanes of dst, with the low 64 bits of 128-bit lanes being copied from a to dst, using writemask k (elements are copied from src when the corresponding mask bit is not set).
9920///
9921/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_shufflehi_epi16&expand=5210)
9922#[inline]
9923#[target_feature(enable = "avx512bw")]
9924#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9925#[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 0))]
9926#[rustc_legacy_const_generics(3)]
9927#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9928pub const fn _mm512_mask_shufflehi_epi16<const IMM8: i32>(
9929    src: __m512i,
9930    k: __mmask32,
9931    a: __m512i,
9932) -> __m512i {
9933    unsafe {
9934        static_assert_uimm_bits!(IMM8, 8);
9935        let r = _mm512_shufflehi_epi16::<IMM8>(a);
9936        transmute(simd_select_bitmask(k, r.as_i16x32(), src.as_i16x32()))
9937    }
9938}
9939
9940/// Shuffle 16-bit integers in the high 64 bits of 128-bit lanes of a using the control in imm8. Store the results in the high 64 bits of 128-bit lanes of dst, with the low 64 bits of 128-bit lanes being copied from a to dst, using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9941///
9942/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_shufflehi_epi16&expand=5211)
9943#[inline]
9944#[target_feature(enable = "avx512bw")]
9945#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9946#[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 0))]
9947#[rustc_legacy_const_generics(2)]
9948#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9949pub const fn _mm512_maskz_shufflehi_epi16<const IMM8: i32>(k: __mmask32, a: __m512i) -> __m512i {
9950    unsafe {
9951        static_assert_uimm_bits!(IMM8, 8);
9952        let r = _mm512_shufflehi_epi16::<IMM8>(a);
9953        transmute(simd_select_bitmask(k, r.as_i16x32(), i16x32::ZERO))
9954    }
9955}
9956
9957/// Shuffle 16-bit integers in the high 64 bits of 128-bit lanes of a using the control in imm8. Store the results in the high 64 bits of 128-bit lanes of dst, with the low 64 bits of 128-bit lanes being copied from a to dst, using writemask k (elements are copied from src when the corresponding mask bit is not set).
9958///
9959/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_shufflehi_epi16&expand=5207)
9960#[inline]
9961#[target_feature(enable = "avx512bw,avx512vl")]
9962#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9963#[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 5))]
9964#[rustc_legacy_const_generics(3)]
9965#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9966pub const fn _mm256_mask_shufflehi_epi16<const IMM8: i32>(
9967    src: __m256i,
9968    k: __mmask16,
9969    a: __m256i,
9970) -> __m256i {
9971    unsafe {
9972        static_assert_uimm_bits!(IMM8, 8);
9973        let shuffle = _mm256_shufflehi_epi16::<IMM8>(a);
9974        transmute(simd_select_bitmask(k, shuffle.as_i16x16(), src.as_i16x16()))
9975    }
9976}
9977
9978/// Shuffle 16-bit integers in the high 64 bits of 128-bit lanes of a using the control in imm8. Store the results in the high 64 bits of 128-bit lanes of dst, with the low 64 bits of 128-bit lanes being copied from a to dst, using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9979///
9980/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_shufflehi_epi16&expand=5208)
9981#[inline]
9982#[target_feature(enable = "avx512bw,avx512vl")]
9983#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9984#[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 5))]
9985#[rustc_legacy_const_generics(2)]
9986#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9987pub const fn _mm256_maskz_shufflehi_epi16<const IMM8: i32>(k: __mmask16, a: __m256i) -> __m256i {
9988    unsafe {
9989        static_assert_uimm_bits!(IMM8, 8);
9990        let shuffle = _mm256_shufflehi_epi16::<IMM8>(a);
9991        transmute(simd_select_bitmask(k, shuffle.as_i16x16(), i16x16::ZERO))
9992    }
9993}
9994
9995/// Shuffle 16-bit integers in the high 64 bits of 128-bit lanes of a using the control in imm8. Store the results in the high 64 bits of 128-bit lanes of dst, with the low 64 bits of 128-bit lanes being copied from a to dst, using writemask k (elements are copied from src when the corresponding mask bit is not set).
9996///
9997/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_shufflehi_epi16&expand=5204)
9998#[inline]
9999#[target_feature(enable = "avx512bw,avx512vl")]
10000#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10001#[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 5))]
10002#[rustc_legacy_const_generics(3)]
10003#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10004pub const fn _mm_mask_shufflehi_epi16<const IMM8: i32>(
10005    src: __m128i,
10006    k: __mmask8,
10007    a: __m128i,
10008) -> __m128i {
10009    unsafe {
10010        static_assert_uimm_bits!(IMM8, 8);
10011        let shuffle = _mm_shufflehi_epi16::<IMM8>(a);
10012        transmute(simd_select_bitmask(k, shuffle.as_i16x8(), src.as_i16x8()))
10013    }
10014}
10015
10016/// Shuffle 16-bit integers in the high 64 bits of 128-bit lanes of a using the control in imm8. Store the results in the high 64 bits of 128-bit lanes of dst, with the low 64 bits of 128-bit lanes being copied from a to dst, using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
10017///
10018/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_shufflehi_epi16&expand=5205)
10019#[inline]
10020#[target_feature(enable = "avx512bw,avx512vl")]
10021#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10022#[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 5))]
10023#[rustc_legacy_const_generics(2)]
10024#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10025pub const fn _mm_maskz_shufflehi_epi16<const IMM8: i32>(k: __mmask8, a: __m128i) -> __m128i {
10026    unsafe {
10027        static_assert_uimm_bits!(IMM8, 8);
10028        let shuffle = _mm_shufflehi_epi16::<IMM8>(a);
10029        transmute(simd_select_bitmask(k, shuffle.as_i16x8(), i16x8::ZERO))
10030    }
10031}
10032
10033/// Shuffle packed 8-bit integers in a according to shuffle control mask in the corresponding 8-bit element of b, and store the results in dst.
10034///
10035/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_shuffle_epi8&expand=5159)
10036#[inline]
10037#[target_feature(enable = "avx512bw")]
10038#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10039#[cfg_attr(test, assert_instr(vpshufb))]
10040pub fn _mm512_shuffle_epi8(a: __m512i, b: __m512i) -> __m512i {
10041    unsafe { transmute(vpshufb(a.as_i8x64(), b.as_i8x64())) }
10042}
10043
10044/// Shuffle 8-bit integers in a within 128-bit lanes using the control in the corresponding 8-bit element of b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
10045///
10046/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_shuffle_epi8&expand=5157)
10047#[inline]
10048#[target_feature(enable = "avx512bw")]
10049#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10050#[cfg_attr(test, assert_instr(vpshufb))]
10051pub fn _mm512_mask_shuffle_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
10052    unsafe {
10053        let shuffle = _mm512_shuffle_epi8(a, b).as_i8x64();
10054        transmute(simd_select_bitmask(k, shuffle, src.as_i8x64()))
10055    }
10056}
10057
10058/// Shuffle packed 8-bit integers in a according to shuffle control mask in the corresponding 8-bit element of b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
10059///
10060/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_shuffle_epi8&expand=5158)
10061#[inline]
10062#[target_feature(enable = "avx512bw")]
10063#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10064#[cfg_attr(test, assert_instr(vpshufb))]
10065pub fn _mm512_maskz_shuffle_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
10066    unsafe {
10067        let shuffle = _mm512_shuffle_epi8(a, b).as_i8x64();
10068        transmute(simd_select_bitmask(k, shuffle, i8x64::ZERO))
10069    }
10070}
10071
10072/// Shuffle 8-bit integers in a within 128-bit lanes using the control in the corresponding 8-bit element of b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
10073///
10074/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_shuffle_epi8&expand=5154)
10075#[inline]
10076#[target_feature(enable = "avx512bw,avx512vl")]
10077#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10078#[cfg_attr(test, assert_instr(vpshufb))]
10079pub fn _mm256_mask_shuffle_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
10080    unsafe {
10081        let shuffle = _mm256_shuffle_epi8(a, b).as_i8x32();
10082        transmute(simd_select_bitmask(k, shuffle, src.as_i8x32()))
10083    }
10084}
10085
10086/// Shuffle packed 8-bit integers in a according to shuffle control mask in the corresponding 8-bit element of b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
10087///
10088/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_shuffle_epi8&expand=5155)
10089#[inline]
10090#[target_feature(enable = "avx512bw,avx512vl")]
10091#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10092#[cfg_attr(test, assert_instr(vpshufb))]
10093pub fn _mm256_maskz_shuffle_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
10094    unsafe {
10095        let shuffle = _mm256_shuffle_epi8(a, b).as_i8x32();
10096        transmute(simd_select_bitmask(k, shuffle, i8x32::ZERO))
10097    }
10098}
10099
10100/// Shuffle 8-bit integers in a within 128-bit lanes using the control in the corresponding 8-bit element of b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
10101///
10102/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_shuffle_epi8&expand=5151)
10103#[inline]
10104#[target_feature(enable = "avx512bw,avx512vl")]
10105#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10106#[cfg_attr(test, assert_instr(vpshufb))]
10107pub fn _mm_mask_shuffle_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
10108    unsafe {
10109        let shuffle = _mm_shuffle_epi8(a, b).as_i8x16();
10110        transmute(simd_select_bitmask(k, shuffle, src.as_i8x16()))
10111    }
10112}
10113
10114/// Shuffle packed 8-bit integers in a according to shuffle control mask in the corresponding 8-bit element of b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
10115///
10116/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_shuffle_epi8&expand=5152)
10117#[inline]
10118#[target_feature(enable = "avx512bw,avx512vl")]
10119#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10120#[cfg_attr(test, assert_instr(vpshufb))]
10121pub fn _mm_maskz_shuffle_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
10122    unsafe {
10123        let shuffle = _mm_shuffle_epi8(a, b).as_i8x16();
10124        transmute(simd_select_bitmask(k, shuffle, i8x16::ZERO))
10125    }
10126}
10127
10128/// Compute the bitwise AND of packed 16-bit integers in a and b, producing intermediate 16-bit values, and set the corresponding bit in result mask k if the intermediate value is non-zero.
10129///
10130/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_test_epi16_mask&expand=5884)
10131#[inline]
10132#[target_feature(enable = "avx512bw")]
10133#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10134#[cfg_attr(test, assert_instr(vptestmw))]
10135#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10136pub const fn _mm512_test_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 {
10137    let and = _mm512_and_si512(a, b);
10138    let zero = _mm512_setzero_si512();
10139    _mm512_cmpneq_epi16_mask(and, zero)
10140}
10141
10142/// Compute the bitwise AND of packed 16-bit integers in a and b, producing intermediate 16-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is non-zero.
10143///
10144/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_test_epi16_mask&expand=5883)
10145#[inline]
10146#[target_feature(enable = "avx512bw")]
10147#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10148#[cfg_attr(test, assert_instr(vptestmw))]
10149#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10150pub const fn _mm512_mask_test_epi16_mask(k: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
10151    let and = _mm512_and_si512(a, b);
10152    let zero = _mm512_setzero_si512();
10153    _mm512_mask_cmpneq_epi16_mask(k, and, zero)
10154}
10155
10156/// Compute the bitwise AND of packed 16-bit integers in a and b, producing intermediate 16-bit values, and set the corresponding bit in result mask k if the intermediate value is non-zero.
10157///
10158/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_test_epi16_mask&expand=5882)
10159#[inline]
10160#[target_feature(enable = "avx512bw,avx512vl")]
10161#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10162#[cfg_attr(test, assert_instr(vptestmw))]
10163#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10164pub const fn _mm256_test_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 {
10165    let and = _mm256_and_si256(a, b);
10166    let zero = _mm256_setzero_si256();
10167    _mm256_cmpneq_epi16_mask(and, zero)
10168}
10169
10170/// Compute the bitwise AND of packed 16-bit integers in a and b, producing intermediate 16-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is non-zero.
10171///
10172/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_test_epi16_mask&expand=5881)
10173#[inline]
10174#[target_feature(enable = "avx512bw,avx512vl")]
10175#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10176#[cfg_attr(test, assert_instr(vptestmw))]
10177#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10178pub const fn _mm256_mask_test_epi16_mask(k: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
10179    let and = _mm256_and_si256(a, b);
10180    let zero = _mm256_setzero_si256();
10181    _mm256_mask_cmpneq_epi16_mask(k, and, zero)
10182}
10183
10184/// Compute the bitwise AND of packed 16-bit integers in a and b, producing intermediate 16-bit values, and set the corresponding bit in result mask k if the intermediate value is non-zero.
10185///
10186/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_test_epi16_mask&expand=5880)
10187#[inline]
10188#[target_feature(enable = "avx512bw,avx512vl")]
10189#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10190#[cfg_attr(test, assert_instr(vptestmw))]
10191#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10192pub const fn _mm_test_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 {
10193    let and = _mm_and_si128(a, b);
10194    let zero = _mm_setzero_si128();
10195    _mm_cmpneq_epi16_mask(and, zero)
10196}
10197
10198/// Compute the bitwise AND of packed 16-bit integers in a and b, producing intermediate 16-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is non-zero.
10199///
10200/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_test_epi16_mask&expand=5879)
10201#[inline]
10202#[target_feature(enable = "avx512bw,avx512vl")]
10203#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10204#[cfg_attr(test, assert_instr(vptestmw))]
10205#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10206pub const fn _mm_mask_test_epi16_mask(k: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
10207    let and = _mm_and_si128(a, b);
10208    let zero = _mm_setzero_si128();
10209    _mm_mask_cmpneq_epi16_mask(k, and, zero)
10210}
10211
10212/// Compute the bitwise AND of packed 8-bit integers in a and b, producing intermediate 8-bit values, and set the corresponding bit in result mask k if the intermediate value is non-zero.
10213///
10214/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_test_epi8_mask&expand=5902)
10215#[inline]
10216#[target_feature(enable = "avx512bw")]
10217#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10218#[cfg_attr(test, assert_instr(vptestmb))]
10219#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10220pub const fn _mm512_test_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 {
10221    let and = _mm512_and_si512(a, b);
10222    let zero = _mm512_setzero_si512();
10223    _mm512_cmpneq_epi8_mask(and, zero)
10224}
10225
10226/// Compute the bitwise AND of packed 8-bit integers in a and b, producing intermediate 8-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is non-zero.
10227///
10228/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_test_epi8_mask&expand=5901)
10229#[inline]
10230#[target_feature(enable = "avx512bw")]
10231#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10232#[cfg_attr(test, assert_instr(vptestmb))]
10233#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10234pub const fn _mm512_mask_test_epi8_mask(k: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
10235    let and = _mm512_and_si512(a, b);
10236    let zero = _mm512_setzero_si512();
10237    _mm512_mask_cmpneq_epi8_mask(k, and, zero)
10238}
10239
10240/// Compute the bitwise AND of packed 8-bit integers in a and b, producing intermediate 8-bit values, and set the corresponding bit in result mask k if the intermediate value is non-zero.
10241///
10242/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_test_epi8_mask&expand=5900)
10243#[inline]
10244#[target_feature(enable = "avx512bw,avx512vl")]
10245#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10246#[cfg_attr(test, assert_instr(vptestmb))]
10247#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10248pub const fn _mm256_test_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 {
10249    let and = _mm256_and_si256(a, b);
10250    let zero = _mm256_setzero_si256();
10251    _mm256_cmpneq_epi8_mask(and, zero)
10252}
10253
10254/// Compute the bitwise AND of packed 8-bit integers in a and b, producing intermediate 8-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is non-zero.
10255///
10256/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_test_epi8_mask&expand=5899)
10257#[inline]
10258#[target_feature(enable = "avx512bw,avx512vl")]
10259#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10260#[cfg_attr(test, assert_instr(vptestmb))]
10261#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10262pub const fn _mm256_mask_test_epi8_mask(k: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
10263    let and = _mm256_and_si256(a, b);
10264    let zero = _mm256_setzero_si256();
10265    _mm256_mask_cmpneq_epi8_mask(k, and, zero)
10266}
10267
10268/// Compute the bitwise AND of packed 8-bit integers in a and b, producing intermediate 8-bit values, and set the corresponding bit in result mask k if the intermediate value is non-zero.
10269///
10270/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_test_epi8_mask&expand=5898)
10271#[inline]
10272#[target_feature(enable = "avx512bw,avx512vl")]
10273#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10274#[cfg_attr(test, assert_instr(vptestmb))]
10275#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10276pub const fn _mm_test_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 {
10277    let and = _mm_and_si128(a, b);
10278    let zero = _mm_setzero_si128();
10279    _mm_cmpneq_epi8_mask(and, zero)
10280}
10281
10282/// Compute the bitwise AND of packed 8-bit integers in a and b, producing intermediate 8-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is non-zero.
10283///
10284/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_test_epi8_mask&expand=5897)
10285#[inline]
10286#[target_feature(enable = "avx512bw,avx512vl")]
10287#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10288#[cfg_attr(test, assert_instr(vptestmb))]
10289#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10290pub const fn _mm_mask_test_epi8_mask(k: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
10291    let and = _mm_and_si128(a, b);
10292    let zero = _mm_setzero_si128();
10293    _mm_mask_cmpneq_epi8_mask(k, and, zero)
10294}
10295
10296/// Compute the bitwise NAND of packed 16-bit integers in a and b, producing intermediate 16-bit values, and set the corresponding bit in result mask k if the intermediate value is zero.
10297///
10298/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_testn_epi16_mask&expand=5915)
10299#[inline]
10300#[target_feature(enable = "avx512bw")]
10301#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10302#[cfg_attr(test, assert_instr(vptestnmw))]
10303#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10304pub const fn _mm512_testn_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 {
10305    let and = _mm512_and_si512(a, b);
10306    let zero = _mm512_setzero_si512();
10307    _mm512_cmpeq_epi16_mask(and, zero)
10308}
10309
10310/// Compute the bitwise NAND of packed 16-bit integers in a and b, producing intermediate 16-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is zero.
10311///
10312/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_testn_epi16_mask&expand=5914)
10313#[inline]
10314#[target_feature(enable = "avx512bw")]
10315#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10316#[cfg_attr(test, assert_instr(vptestnmw))]
10317#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10318pub const fn _mm512_mask_testn_epi16_mask(k: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
10319    let and = _mm512_and_si512(a, b);
10320    let zero = _mm512_setzero_si512();
10321    _mm512_mask_cmpeq_epi16_mask(k, and, zero)
10322}
10323
10324/// Compute the bitwise NAND of packed 16-bit integers in a and b, producing intermediate 16-bit values, and set the corresponding bit in result mask k if the intermediate value is zero.
10325///
10326/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_testn_epi16_mask&expand=5913)
10327#[inline]
10328#[target_feature(enable = "avx512bw,avx512vl")]
10329#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10330#[cfg_attr(test, assert_instr(vptestnmw))]
10331#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10332pub const fn _mm256_testn_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 {
10333    let and = _mm256_and_si256(a, b);
10334    let zero = _mm256_setzero_si256();
10335    _mm256_cmpeq_epi16_mask(and, zero)
10336}
10337
10338/// Compute the bitwise NAND of packed 16-bit integers in a and b, producing intermediate 16-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is zero.
10339///
10340/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_testn_epi16_mask&expand=5912)
10341#[inline]
10342#[target_feature(enable = "avx512bw,avx512vl")]
10343#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10344#[cfg_attr(test, assert_instr(vptestnmw))]
10345#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10346pub const fn _mm256_mask_testn_epi16_mask(k: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
10347    let and = _mm256_and_si256(a, b);
10348    let zero = _mm256_setzero_si256();
10349    _mm256_mask_cmpeq_epi16_mask(k, and, zero)
10350}
10351
10352/// Compute the bitwise NAND of packed 16-bit integers in a and b, producing intermediate 16-bit values, and set the corresponding bit in result mask k if the intermediate value is zero.
10353///
10354/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_testn_epi16_mask&expand=5911)
10355#[inline]
10356#[target_feature(enable = "avx512bw,avx512vl")]
10357#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10358#[cfg_attr(test, assert_instr(vptestnmw))]
10359#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10360pub const fn _mm_testn_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 {
10361    let and = _mm_and_si128(a, b);
10362    let zero = _mm_setzero_si128();
10363    _mm_cmpeq_epi16_mask(and, zero)
10364}
10365
10366/// Compute the bitwise NAND of packed 16-bit integers in a and b, producing intermediate 16-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is zero.
10367///
10368/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_testn_epi16_mask&expand=5910)
10369#[inline]
10370#[target_feature(enable = "avx512bw,avx512vl")]
10371#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10372#[cfg_attr(test, assert_instr(vptestnmw))]
10373#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10374pub const fn _mm_mask_testn_epi16_mask(k: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
10375    let and = _mm_and_si128(a, b);
10376    let zero = _mm_setzero_si128();
10377    _mm_mask_cmpeq_epi16_mask(k, and, zero)
10378}
10379
10380/// Compute the bitwise NAND of packed 8-bit integers in a and b, producing intermediate 8-bit values, and set the corresponding bit in result mask k if the intermediate value is zero.
10381///
10382/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_testn_epi8_mask&expand=5933)
10383#[inline]
10384#[target_feature(enable = "avx512bw")]
10385#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10386#[cfg_attr(test, assert_instr(vptestnmb))]
10387#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10388pub const fn _mm512_testn_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 {
10389    let and = _mm512_and_si512(a, b);
10390    let zero = _mm512_setzero_si512();
10391    _mm512_cmpeq_epi8_mask(and, zero)
10392}
10393
10394/// Compute the bitwise NAND of packed 8-bit integers in a and b, producing intermediate 8-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is zero.
10395///
10396/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_testn_epi8_mask&expand=5932)
10397#[inline]
10398#[target_feature(enable = "avx512bw")]
10399#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10400#[cfg_attr(test, assert_instr(vptestnmb))]
10401#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10402pub const fn _mm512_mask_testn_epi8_mask(k: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
10403    let and = _mm512_and_si512(a, b);
10404    let zero = _mm512_setzero_si512();
10405    _mm512_mask_cmpeq_epi8_mask(k, and, zero)
10406}
10407
10408/// Compute the bitwise NAND of packed 8-bit integers in a and b, producing intermediate 8-bit values, and set the corresponding bit in result mask k if the intermediate value is zero.
10409///
10410/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_testn_epi8_mask&expand=5931)
10411#[inline]
10412#[target_feature(enable = "avx512bw,avx512vl")]
10413#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10414#[cfg_attr(test, assert_instr(vptestnmb))]
10415#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10416pub const fn _mm256_testn_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 {
10417    let and = _mm256_and_si256(a, b);
10418    let zero = _mm256_setzero_si256();
10419    _mm256_cmpeq_epi8_mask(and, zero)
10420}
10421
10422/// Compute the bitwise NAND of packed 8-bit integers in a and b, producing intermediate 8-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is zero.
10423///
10424/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_testn_epi8_mask&expand=5930)
10425#[inline]
10426#[target_feature(enable = "avx512bw,avx512vl")]
10427#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10428#[cfg_attr(test, assert_instr(vptestnmb))]
10429#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10430pub const fn _mm256_mask_testn_epi8_mask(k: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
10431    let and = _mm256_and_si256(a, b);
10432    let zero = _mm256_setzero_si256();
10433    _mm256_mask_cmpeq_epi8_mask(k, and, zero)
10434}
10435
10436/// Compute the bitwise NAND of packed 8-bit integers in a and b, producing intermediate 8-bit values, and set the corresponding bit in result mask k if the intermediate value is zero.
10437///
10438/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_testn_epi8_mask&expand=5929)
10439#[inline]
10440#[target_feature(enable = "avx512bw,avx512vl")]
10441#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10442#[cfg_attr(test, assert_instr(vptestnmb))]
10443#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10444pub const fn _mm_testn_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 {
10445    let and = _mm_and_si128(a, b);
10446    let zero = _mm_setzero_si128();
10447    _mm_cmpeq_epi8_mask(and, zero)
10448}
10449
10450/// Compute the bitwise NAND of packed 8-bit integers in a and b, producing intermediate 8-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is zero.
10451///
10452/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_testn_epi8_mask&expand=5928)
10453#[inline]
10454#[target_feature(enable = "avx512bw,avx512vl")]
10455#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10456#[cfg_attr(test, assert_instr(vptestnmb))]
10457#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10458pub const fn _mm_mask_testn_epi8_mask(k: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
10459    let and = _mm_and_si128(a, b);
10460    let zero = _mm_setzero_si128();
10461    _mm_mask_cmpeq_epi8_mask(k, and, zero)
10462}
10463
10464/// Store 64-bit mask from a into memory.
10465///
10466/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_store_mask64&expand=5578)
10467#[inline]
10468#[target_feature(enable = "avx512bw")]
10469#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10470#[cfg_attr(test, assert_instr(mov))] //should be kmovq
10471#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10472pub const unsafe fn _store_mask64(mem_addr: *mut __mmask64, a: __mmask64) {
10473    ptr::write(mem_addr as *mut __mmask64, a);
10474}
10475
10476/// Store 32-bit mask from a into memory.
10477///
10478/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_store_mask32&expand=5577)
10479#[inline]
10480#[target_feature(enable = "avx512bw")]
10481#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10482#[cfg_attr(test, assert_instr(mov))] //should be kmovd
10483#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10484pub const unsafe fn _store_mask32(mem_addr: *mut __mmask32, a: __mmask32) {
10485    ptr::write(mem_addr as *mut __mmask32, a);
10486}
10487
10488/// Load 64-bit mask from memory into k.
10489///
10490/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_load_mask64&expand=3318)
10491#[inline]
10492#[target_feature(enable = "avx512bw")]
10493#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10494#[cfg_attr(test, assert_instr(mov))] //should be kmovq
10495#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10496pub const unsafe fn _load_mask64(mem_addr: *const __mmask64) -> __mmask64 {
10497    ptr::read(mem_addr as *const __mmask64)
10498}
10499
10500/// Load 32-bit mask from memory into k.
10501///
10502/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_load_mask32&expand=3317)
10503#[inline]
10504#[target_feature(enable = "avx512bw")]
10505#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10506#[cfg_attr(test, assert_instr(mov))] //should be kmovd
10507#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10508pub const unsafe fn _load_mask32(mem_addr: *const __mmask32) -> __mmask32 {
10509    ptr::read(mem_addr as *const __mmask32)
10510}
10511
10512/// Compute the absolute differences of packed unsigned 8-bit integers in a and b, then horizontally sum each consecutive 8 differences to produce eight unsigned 16-bit integers, and pack these unsigned 16-bit integers in the low 16 bits of 64-bit elements in dst.
10513///
10514/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_sad_epu8&expand=4855)
10515#[inline]
10516#[target_feature(enable = "avx512bw")]
10517#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10518#[cfg_attr(test, assert_instr(vpsadbw))]
10519pub fn _mm512_sad_epu8(a: __m512i, b: __m512i) -> __m512i {
10520    unsafe { transmute(vpsadbw(a.as_u8x64(), b.as_u8x64())) }
10521}
10522
10523/// Compute the sum of absolute differences (SADs) of quadruplets of unsigned 8-bit integers in a compared to those in b, and store the 16-bit results in dst. Four SADs are performed on four 8-bit quadruplets for each 64-bit lane. The first two SADs use the lower 8-bit quadruplet of the lane from a, and the last two SADs use the uppper 8-bit quadruplet of the lane from a. Quadruplets from b are selected from within 128-bit lanes according to the control in imm8, and each SAD in each 64-bit lane uses the selected quadruplet at 8-bit offsets.
10524///
10525/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_dbsad_epu8&expand=2114)
10526#[inline]
10527#[target_feature(enable = "avx512bw")]
10528#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10529#[rustc_legacy_const_generics(2)]
10530#[cfg_attr(test, assert_instr(vdbpsadbw, IMM8 = 0))]
10531pub fn _mm512_dbsad_epu8<const IMM8: i32>(a: __m512i, b: __m512i) -> __m512i {
10532    unsafe {
10533        static_assert_uimm_bits!(IMM8, 8);
10534        let a = a.as_u8x64();
10535        let b = b.as_u8x64();
10536        let r = vdbpsadbw(a, b, IMM8);
10537        transmute(r)
10538    }
10539}
10540
10541/// Compute the sum of absolute differences (SADs) of quadruplets of unsigned 8-bit integers in a compared to those in b, and store the 16-bit results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). Four SADs are performed on four 8-bit quadruplets for each 64-bit lane. The first two SADs use the lower 8-bit quadruplet of the lane from a, and the last two SADs use the uppper 8-bit quadruplet of the lane from a. Quadruplets from b are selected from within 128-bit lanes according to the control in imm8, and each SAD in each 64-bit lane uses the selected quadruplet at 8-bit offsets.
10542///
10543/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_dbsad_epu8&expand=2115)
10544#[inline]
10545#[target_feature(enable = "avx512bw")]
10546#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10547#[rustc_legacy_const_generics(4)]
10548#[cfg_attr(test, assert_instr(vdbpsadbw, IMM8 = 0))]
10549pub fn _mm512_mask_dbsad_epu8<const IMM8: i32>(
10550    src: __m512i,
10551    k: __mmask32,
10552    a: __m512i,
10553    b: __m512i,
10554) -> __m512i {
10555    unsafe {
10556        static_assert_uimm_bits!(IMM8, 8);
10557        let a = a.as_u8x64();
10558        let b = b.as_u8x64();
10559        let r = vdbpsadbw(a, b, IMM8);
10560        transmute(simd_select_bitmask(k, r, src.as_u16x32()))
10561    }
10562}
10563
10564/// Compute the sum of absolute differences (SADs) of quadruplets of unsigned 8-bit integers in a compared to those in b, and store the 16-bit results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). Four SADs are performed on four 8-bit quadruplets for each 64-bit lane. The first two SADs use the lower 8-bit quadruplet of the lane from a, and the last two SADs use the uppper 8-bit quadruplet of the lane from a. Quadruplets from b are selected from within 128-bit lanes according to the control in imm8, and each SAD in each 64-bit lane uses the selected quadruplet at 8-bit offsets.
10565///
10566/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_dbsad_epu8&expand=2116)
10567#[inline]
10568#[target_feature(enable = "avx512bw")]
10569#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10570#[rustc_legacy_const_generics(3)]
10571#[cfg_attr(test, assert_instr(vdbpsadbw, IMM8 = 0))]
10572pub fn _mm512_maskz_dbsad_epu8<const IMM8: i32>(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
10573    unsafe {
10574        static_assert_uimm_bits!(IMM8, 8);
10575        let a = a.as_u8x64();
10576        let b = b.as_u8x64();
10577        let r = vdbpsadbw(a, b, IMM8);
10578        transmute(simd_select_bitmask(k, r, u16x32::ZERO))
10579    }
10580}
10581
10582/// Compute the sum of absolute differences (SADs) of quadruplets of unsigned 8-bit integers in a compared to those in b, and store the 16-bit results in dst. Four SADs are performed on four 8-bit quadruplets for each 64-bit lane. The first two SADs use the lower 8-bit quadruplet of the lane from a, and the last two SADs use the uppper 8-bit quadruplet of the lane from a. Quadruplets from b are selected from within 128-bit lanes according to the control in imm8, and each SAD in each 64-bit lane uses the selected quadruplet at 8-bit offsets.
10583///
10584/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_dbsad_epu8&expand=2111)
10585#[inline]
10586#[target_feature(enable = "avx512bw,avx512vl")]
10587#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10588#[rustc_legacy_const_generics(2)]
10589#[cfg_attr(test, assert_instr(vdbpsadbw, IMM8 = 0))]
10590pub fn _mm256_dbsad_epu8<const IMM8: i32>(a: __m256i, b: __m256i) -> __m256i {
10591    unsafe {
10592        static_assert_uimm_bits!(IMM8, 8);
10593        let a = a.as_u8x32();
10594        let b = b.as_u8x32();
10595        let r = vdbpsadbw256(a, b, IMM8);
10596        transmute(r)
10597    }
10598}
10599
10600/// Compute the sum of absolute differences (SADs) of quadruplets of unsigned 8-bit integers in a compared to those in b, and store the 16-bit results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). Four SADs are performed on four 8-bit quadruplets for each 64-bit lane. The first two SADs use the lower 8-bit quadruplet of the lane from a, and the last two SADs use the uppper 8-bit quadruplet of the lane from a. Quadruplets from b are selected from within 128-bit lanes according to the control in imm8, and each SAD in each 64-bit lane uses the selected quadruplet at 8-bit offsets.
10601///
10602/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_dbsad_epu8&expand=2112)
10603#[inline]
10604#[target_feature(enable = "avx512bw,avx512vl")]
10605#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10606#[rustc_legacy_const_generics(4)]
10607#[cfg_attr(test, assert_instr(vdbpsadbw, IMM8 = 0))]
10608pub fn _mm256_mask_dbsad_epu8<const IMM8: i32>(
10609    src: __m256i,
10610    k: __mmask16,
10611    a: __m256i,
10612    b: __m256i,
10613) -> __m256i {
10614    unsafe {
10615        static_assert_uimm_bits!(IMM8, 8);
10616        let a = a.as_u8x32();
10617        let b = b.as_u8x32();
10618        let r = vdbpsadbw256(a, b, IMM8);
10619        transmute(simd_select_bitmask(k, r, src.as_u16x16()))
10620    }
10621}
10622
10623/// Compute the sum of absolute differences (SADs) of quadruplets of unsigned 8-bit integers in a compared to those in b, and store the 16-bit results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). Four SADs are performed on four 8-bit quadruplets for each 64-bit lane. The first two SADs use the lower 8-bit quadruplet of the lane from a, and the last two SADs use the uppper 8-bit quadruplet of the lane from a. Quadruplets from b are selected from within 128-bit lanes according to the control in imm8, and each SAD in each 64-bit lane uses the selected quadruplet at 8-bit offsets.
10624///
10625/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_dbsad_epu8&expand=2113)
10626#[inline]
10627#[target_feature(enable = "avx512bw,avx512vl")]
10628#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10629#[rustc_legacy_const_generics(3)]
10630#[cfg_attr(test, assert_instr(vdbpsadbw, IMM8 = 0))]
10631pub fn _mm256_maskz_dbsad_epu8<const IMM8: i32>(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
10632    unsafe {
10633        static_assert_uimm_bits!(IMM8, 8);
10634        let a = a.as_u8x32();
10635        let b = b.as_u8x32();
10636        let r = vdbpsadbw256(a, b, IMM8);
10637        transmute(simd_select_bitmask(k, r, u16x16::ZERO))
10638    }
10639}
10640
10641/// Compute the sum of absolute differences (SADs) of quadruplets of unsigned 8-bit integers in a compared to those in b, and store the 16-bit results in dst. Four SADs are performed on four 8-bit quadruplets for each 64-bit lane. The first two SADs use the lower 8-bit quadruplet of the lane from a, and the last two SADs use the uppper 8-bit quadruplet of the lane from a. Quadruplets from b are selected from within 128-bit lanes according to the control in imm8, and each SAD in each 64-bit lane uses the selected quadruplet at 8-bit offsets.
10642///
10643/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_dbsad_epu8&expand=2108)
10644#[inline]
10645#[target_feature(enable = "avx512bw,avx512vl")]
10646#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10647#[rustc_legacy_const_generics(2)]
10648#[cfg_attr(test, assert_instr(vdbpsadbw, IMM8 = 0))]
10649pub fn _mm_dbsad_epu8<const IMM8: i32>(a: __m128i, b: __m128i) -> __m128i {
10650    unsafe {
10651        static_assert_uimm_bits!(IMM8, 8);
10652        let a = a.as_u8x16();
10653        let b = b.as_u8x16();
10654        let r = vdbpsadbw128(a, b, IMM8);
10655        transmute(r)
10656    }
10657}
10658
10659/// Compute the sum of absolute differences (SADs) of quadruplets of unsigned 8-bit integers in a compared to those in b, and store the 16-bit results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). Four SADs are performed on four 8-bit quadruplets for each 64-bit lane. The first two SADs use the lower 8-bit quadruplet of the lane from a, and the last two SADs use the uppper 8-bit quadruplet of the lane from a. Quadruplets from b are selected from within 128-bit lanes according to the control in imm8, and each SAD in each 64-bit lane uses the selected quadruplet at 8-bit offsets.
10660///
10661/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_dbsad_epu8&expand=2109)
10662#[inline]
10663#[target_feature(enable = "avx512bw,avx512vl")]
10664#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10665#[rustc_legacy_const_generics(4)]
10666#[cfg_attr(test, assert_instr(vdbpsadbw, IMM8 = 0))]
10667pub fn _mm_mask_dbsad_epu8<const IMM8: i32>(
10668    src: __m128i,
10669    k: __mmask8,
10670    a: __m128i,
10671    b: __m128i,
10672) -> __m128i {
10673    unsafe {
10674        static_assert_uimm_bits!(IMM8, 8);
10675        let a = a.as_u8x16();
10676        let b = b.as_u8x16();
10677        let r = vdbpsadbw128(a, b, IMM8);
10678        transmute(simd_select_bitmask(k, r, src.as_u16x8()))
10679    }
10680}
10681
10682/// Compute the sum of absolute differences (SADs) of quadruplets of unsigned 8-bit integers in a compared to those in b, and store the 16-bit results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). Four SADs are performed on four 8-bit quadruplets for each 64-bit lane. The first two SADs use the lower 8-bit quadruplet of the lane from a, and the last two SADs use the uppper 8-bit quadruplet of the lane from a. Quadruplets from b are selected from within 128-bit lanes according to the control in imm8, and each SAD in each 64-bit lane uses the selected quadruplet at 8-bit offsets.
10683///
10684/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_dbsad_epu8&expand=2110)
10685#[inline]
10686#[target_feature(enable = "avx512bw,avx512vl")]
10687#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10688#[rustc_legacy_const_generics(3)]
10689#[cfg_attr(test, assert_instr(vdbpsadbw, IMM8 = 0))]
10690pub fn _mm_maskz_dbsad_epu8<const IMM8: i32>(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
10691    unsafe {
10692        static_assert_uimm_bits!(IMM8, 8);
10693        let a = a.as_u8x16();
10694        let b = b.as_u8x16();
10695        let r = vdbpsadbw128(a, b, IMM8);
10696        transmute(simd_select_bitmask(k, r, u16x8::ZERO))
10697    }
10698}
10699
10700/// Set each bit of mask register k based on the most significant bit of the corresponding packed 16-bit integer in a.
10701///
10702/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_movepi16_mask&expand=3873)
10703#[inline]
10704#[target_feature(enable = "avx512bw")]
10705#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10706#[cfg_attr(test, assert_instr(vpmovw2m))]
10707#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10708pub const fn _mm512_movepi16_mask(a: __m512i) -> __mmask32 {
10709    let filter = _mm512_set1_epi16(1 << 15);
10710    let a = _mm512_and_si512(a, filter);
10711    _mm512_cmpeq_epi16_mask(a, filter)
10712}
10713
10714/// Set each bit of mask register k based on the most significant bit of the corresponding packed 16-bit integer in a.
10715///
10716/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_movepi16_mask&expand=3872)
10717#[inline]
10718#[target_feature(enable = "avx512bw,avx512vl")]
10719#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10720#[cfg_attr(test, assert_instr(vpmovw2m))]
10721#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10722pub const fn _mm256_movepi16_mask(a: __m256i) -> __mmask16 {
10723    let filter = _mm256_set1_epi16(1 << 15);
10724    let a = _mm256_and_si256(a, filter);
10725    _mm256_cmpeq_epi16_mask(a, filter)
10726}
10727
10728/// Set each bit of mask register k based on the most significant bit of the corresponding packed 16-bit integer in a.
10729///
10730/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_movepi16_mask&expand=3871)
10731#[inline]
10732#[target_feature(enable = "avx512bw,avx512vl")]
10733#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10734#[cfg_attr(test, assert_instr(vpmovw2m))]
10735#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10736pub const fn _mm_movepi16_mask(a: __m128i) -> __mmask8 {
10737    let filter = _mm_set1_epi16(1 << 15);
10738    let a = _mm_and_si128(a, filter);
10739    _mm_cmpeq_epi16_mask(a, filter)
10740}
10741
10742/// Set each bit of mask register k based on the most significant bit of the corresponding packed 8-bit integer in a.
10743///
10744/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_movepi8_mask&expand=3883)
10745#[inline]
10746#[target_feature(enable = "avx512bw")]
10747#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10748#[cfg_attr(test, assert_instr(vpmovb2m))]
10749#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10750pub const fn _mm512_movepi8_mask(a: __m512i) -> __mmask64 {
10751    let filter = _mm512_set1_epi8(1 << 7);
10752    let a = _mm512_and_si512(a, filter);
10753    _mm512_cmpeq_epi8_mask(a, filter)
10754}
10755
10756/// Set each bit of mask register k based on the most significant bit of the corresponding packed 8-bit integer in a.
10757///
10758/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_movepi8_mask&expand=3882)
10759#[inline]
10760#[target_feature(enable = "avx512bw,avx512vl")]
10761#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10762#[cfg_attr(test, assert_instr(vpmovmskb))]
10763// should be vpmovb2m but compiled to vpmovmskb in the test shim because that takes less cycles than
10764// using vpmovb2m plus converting the mask register to a standard register.
10765#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10766pub const fn _mm256_movepi8_mask(a: __m256i) -> __mmask32 {
10767    let filter = _mm256_set1_epi8(1 << 7);
10768    let a = _mm256_and_si256(a, filter);
10769    _mm256_cmpeq_epi8_mask(a, filter)
10770}
10771
10772/// Set each bit of mask register k based on the most significant bit of the corresponding packed 8-bit integer in a.
10773///
10774/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_movepi8_mask&expand=3881)
10775#[inline]
10776#[target_feature(enable = "avx512bw,avx512vl")]
10777#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10778#[cfg_attr(test, assert_instr(vpmovmskb))]
10779// should be vpmovb2m but compiled to vpmovmskb in the test shim because that takes less cycles than
10780// using vpmovb2m plus converting the mask register to a standard register.
10781#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10782pub const fn _mm_movepi8_mask(a: __m128i) -> __mmask16 {
10783    let filter = _mm_set1_epi8(1 << 7);
10784    let a = _mm_and_si128(a, filter);
10785    _mm_cmpeq_epi8_mask(a, filter)
10786}
10787
10788/// Set each packed 16-bit integer in dst to all ones or all zeros based on the value of the corresponding bit in k.
10789///
10790/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_movm_epi16&expand=3886)
10791#[inline]
10792#[target_feature(enable = "avx512bw")]
10793#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10794#[cfg_attr(test, assert_instr(vpmovm2w))]
10795#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10796pub const fn _mm512_movm_epi16(k: __mmask32) -> __m512i {
10797    unsafe {
10798        let one = _mm512_set1_epi16(
10799            1 << 15
10800                | 1 << 14
10801                | 1 << 13
10802                | 1 << 12
10803                | 1 << 11
10804                | 1 << 10
10805                | 1 << 9
10806                | 1 << 8
10807                | 1 << 7
10808                | 1 << 6
10809                | 1 << 5
10810                | 1 << 4
10811                | 1 << 3
10812                | 1 << 2
10813                | 1 << 1
10814                | 1 << 0,
10815        )
10816        .as_i16x32();
10817        transmute(simd_select_bitmask(k, one, i16x32::ZERO))
10818    }
10819}
10820
10821/// Set each packed 16-bit integer in dst to all ones or all zeros based on the value of the corresponding bit in k.
10822///
10823/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_movm_epi16&expand=3885)
10824#[inline]
10825#[target_feature(enable = "avx512bw,avx512vl")]
10826#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10827#[cfg_attr(test, assert_instr(vpmovm2w))]
10828#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10829pub const fn _mm256_movm_epi16(k: __mmask16) -> __m256i {
10830    unsafe {
10831        let one = _mm256_set1_epi16(
10832            1 << 15
10833                | 1 << 14
10834                | 1 << 13
10835                | 1 << 12
10836                | 1 << 11
10837                | 1 << 10
10838                | 1 << 9
10839                | 1 << 8
10840                | 1 << 7
10841                | 1 << 6
10842                | 1 << 5
10843                | 1 << 4
10844                | 1 << 3
10845                | 1 << 2
10846                | 1 << 1
10847                | 1 << 0,
10848        )
10849        .as_i16x16();
10850        transmute(simd_select_bitmask(k, one, i16x16::ZERO))
10851    }
10852}
10853
10854/// Set each packed 16-bit integer in dst to all ones or all zeros based on the value of the corresponding bit in k.
10855///
10856/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_movm_epi16&expand=3884)
10857#[inline]
10858#[target_feature(enable = "avx512bw,avx512vl")]
10859#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10860#[cfg_attr(test, assert_instr(vpmovm2w))]
10861#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10862pub const fn _mm_movm_epi16(k: __mmask8) -> __m128i {
10863    unsafe {
10864        let one = _mm_set1_epi16(
10865            1 << 15
10866                | 1 << 14
10867                | 1 << 13
10868                | 1 << 12
10869                | 1 << 11
10870                | 1 << 10
10871                | 1 << 9
10872                | 1 << 8
10873                | 1 << 7
10874                | 1 << 6
10875                | 1 << 5
10876                | 1 << 4
10877                | 1 << 3
10878                | 1 << 2
10879                | 1 << 1
10880                | 1 << 0,
10881        )
10882        .as_i16x8();
10883        transmute(simd_select_bitmask(k, one, i16x8::ZERO))
10884    }
10885}
10886
10887/// Set each packed 8-bit integer in dst to all ones or all zeros based on the value of the corresponding bit in k.
10888///
10889/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_movm_epi8&expand=3895)
10890#[inline]
10891#[target_feature(enable = "avx512bw")]
10892#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10893#[cfg_attr(test, assert_instr(vpmovm2b))]
10894#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10895pub const fn _mm512_movm_epi8(k: __mmask64) -> __m512i {
10896    unsafe {
10897        let one =
10898            _mm512_set1_epi8(1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0)
10899                .as_i8x64();
10900        transmute(simd_select_bitmask(k, one, i8x64::ZERO))
10901    }
10902}
10903
10904/// Set each packed 8-bit integer in dst to all ones or all zeros based on the value of the corresponding bit in k.
10905///
10906/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_movm_epi8&expand=3894)
10907#[inline]
10908#[target_feature(enable = "avx512bw,avx512vl")]
10909#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10910#[cfg_attr(test, assert_instr(vpmovm2b))]
10911#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10912pub const fn _mm256_movm_epi8(k: __mmask32) -> __m256i {
10913    unsafe {
10914        let one =
10915            _mm256_set1_epi8(1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0)
10916                .as_i8x32();
10917        transmute(simd_select_bitmask(k, one, i8x32::ZERO))
10918    }
10919}
10920
10921/// Set each packed 8-bit integer in dst to all ones or all zeros based on the value of the corresponding bit in k.
10922///
10923/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_movm_epi8&expand=3893)
10924#[inline]
10925#[target_feature(enable = "avx512bw,avx512vl")]
10926#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10927#[cfg_attr(test, assert_instr(vpmovm2b))]
10928#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10929pub const fn _mm_movm_epi8(k: __mmask16) -> __m128i {
10930    unsafe {
10931        let one =
10932            _mm_set1_epi8(1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0)
10933                .as_i8x16();
10934        transmute(simd_select_bitmask(k, one, i8x16::ZERO))
10935    }
10936}
10937
10938/// Convert 32-bit mask a into an integer value, and store the result in dst.
10939///
10940/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#_cvtmask32_u32)
10941#[inline]
10942#[target_feature(enable = "avx512bw")]
10943#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10944#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10945pub const fn _cvtmask32_u32(a: __mmask32) -> u32 {
10946    a
10947}
10948
10949/// Convert integer value a into an 32-bit mask, and store the result in k.
10950///
10951/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_cvtu32_mask32)
10952#[inline]
10953#[target_feature(enable = "avx512bw")]
10954#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10955#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10956pub const fn _cvtu32_mask32(a: u32) -> __mmask32 {
10957    a
10958}
10959
10960/// Add 32-bit masks in a and b, and store the result in k.
10961///
10962/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kadd_mask32&expand=3207)
10963#[inline]
10964#[target_feature(enable = "avx512bw")]
10965#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10966#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10967pub const fn _kadd_mask32(a: __mmask32, b: __mmask32) -> __mmask32 {
10968    a.wrapping_add(b)
10969}
10970
10971/// Add 64-bit masks in a and b, and store the result in k.
10972///
10973/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kadd_mask64&expand=3208)
10974#[inline]
10975#[target_feature(enable = "avx512bw")]
10976#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10977#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10978pub const fn _kadd_mask64(a: __mmask64, b: __mmask64) -> __mmask64 {
10979    a.wrapping_add(b)
10980}
10981
10982/// Compute the bitwise AND of 32-bit masks a and b, and store the result in k.
10983///
10984/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kand_mask32&expand=3213)
10985#[inline]
10986#[target_feature(enable = "avx512bw")]
10987#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10988#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10989pub const fn _kand_mask32(a: __mmask32, b: __mmask32) -> __mmask32 {
10990    a & b
10991}
10992
10993/// Compute the bitwise AND of 64-bit masks a and b, and store the result in k.
10994///
10995/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kand_mask64&expand=3214)
10996#[inline]
10997#[target_feature(enable = "avx512bw")]
10998#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10999#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11000pub const fn _kand_mask64(a: __mmask64, b: __mmask64) -> __mmask64 {
11001    a & b
11002}
11003
11004/// Compute the bitwise NOT of 32-bit mask a, and store the result in k.
11005///
11006/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_knot_mask32&expand=3234)
11007#[inline]
11008#[target_feature(enable = "avx512bw")]
11009#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11010#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11011pub const fn _knot_mask32(a: __mmask32) -> __mmask32 {
11012    !a
11013}
11014
11015/// Compute the bitwise NOT of 64-bit mask a, and store the result in k.
11016///
11017/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_knot_mask64&expand=3235)
11018#[inline]
11019#[target_feature(enable = "avx512bw")]
11020#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11021#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11022pub const fn _knot_mask64(a: __mmask64) -> __mmask64 {
11023    !a
11024}
11025
11026/// Compute the bitwise NOT of 32-bit masks a and then AND with b, and store the result in k.
11027///
11028/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kandn_mask32&expand=3219)
11029#[inline]
11030#[target_feature(enable = "avx512bw")]
11031#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11032#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11033pub const fn _kandn_mask32(a: __mmask32, b: __mmask32) -> __mmask32 {
11034    _knot_mask32(a) & b
11035}
11036
11037/// Compute the bitwise NOT of 64-bit masks a and then AND with b, and store the result in k.
11038///
11039/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kandn_mask64&expand=3220)
11040#[inline]
11041#[target_feature(enable = "avx512bw")]
11042#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11043#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11044pub const fn _kandn_mask64(a: __mmask64, b: __mmask64) -> __mmask64 {
11045    _knot_mask64(a) & b
11046}
11047
11048/// Compute the bitwise OR of 32-bit masks a and b, and store the result in k.
11049///
11050/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kor_mask32&expand=3240)
11051#[inline]
11052#[target_feature(enable = "avx512bw")]
11053#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11054#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11055pub const fn _kor_mask32(a: __mmask32, b: __mmask32) -> __mmask32 {
11056    a | b
11057}
11058
11059/// Compute the bitwise OR of 64-bit masks a and b, and store the result in k.
11060///
11061/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kor_mask64&expand=3241)
11062#[inline]
11063#[target_feature(enable = "avx512bw")]
11064#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11065#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11066pub const fn _kor_mask64(a: __mmask64, b: __mmask64) -> __mmask64 {
11067    a | b
11068}
11069
11070/// Compute the bitwise XOR of 32-bit masks a and b, and store the result in k.
11071///
11072/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kxor_mask32&expand=3292)
11073#[inline]
11074#[target_feature(enable = "avx512bw")]
11075#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11076#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11077pub const fn _kxor_mask32(a: __mmask32, b: __mmask32) -> __mmask32 {
11078    a ^ b
11079}
11080
11081/// Compute the bitwise XOR of 64-bit masks a and b, and store the result in k.
11082///
11083/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kxor_mask64&expand=3293)
11084#[inline]
11085#[target_feature(enable = "avx512bw")]
11086#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11087#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11088pub const fn _kxor_mask64(a: __mmask64, b: __mmask64) -> __mmask64 {
11089    a ^ b
11090}
11091
11092/// Compute the bitwise XNOR of 32-bit masks a and b, and store the result in k.
11093///
11094/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kxnor_mask32&expand=3286)
11095#[inline]
11096#[target_feature(enable = "avx512bw")]
11097#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11098#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11099pub const fn _kxnor_mask32(a: __mmask32, b: __mmask32) -> __mmask32 {
11100    _knot_mask32(a ^ b)
11101}
11102
11103/// Compute the bitwise XNOR of 64-bit masks a and b, and store the result in k.
11104///
11105/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kxnor_mask64&expand=3287)
11106#[inline]
11107#[target_feature(enable = "avx512bw")]
11108#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11109#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11110pub const fn _kxnor_mask64(a: __mmask64, b: __mmask64) -> __mmask64 {
11111    _knot_mask64(a ^ b)
11112}
11113
11114/// Compute the bitwise OR of 32-bit masks a and b. If the result is all zeros, store 1 in dst, otherwise
11115/// store 0 in dst. If the result is all ones, store 1 in all_ones, otherwise store 0 in all_ones.
11116///
11117/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kortest_mask32_u8)
11118#[inline]
11119#[target_feature(enable = "avx512bw")]
11120#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11121#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11122pub const unsafe fn _kortest_mask32_u8(a: __mmask32, b: __mmask32, all_ones: *mut u8) -> u8 {
11123    let tmp = _kor_mask32(a, b);
11124    *all_ones = (tmp == 0xffffffff) as u8;
11125    (tmp == 0) as u8
11126}
11127
11128/// Compute the bitwise OR of 64-bit masks a and b. If the result is all zeros, store 1 in dst, otherwise
11129/// store 0 in dst. If the result is all ones, store 1 in all_ones, otherwise store 0 in all_ones.
11130///
11131/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kortest_mask64_u8)
11132#[inline]
11133#[target_feature(enable = "avx512bw")]
11134#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11135#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11136pub const unsafe fn _kortest_mask64_u8(a: __mmask64, b: __mmask64, all_ones: *mut u8) -> u8 {
11137    let tmp = _kor_mask64(a, b);
11138    *all_ones = (tmp == 0xffffffff_ffffffff) as u8;
11139    (tmp == 0) as u8
11140}
11141
11142/// Compute the bitwise OR of 32-bit masks a and b. If the result is all ones, store 1 in dst, otherwise
11143/// store 0 in dst.
11144///
11145/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kortestc_mask32_u8)
11146#[inline]
11147#[target_feature(enable = "avx512bw")]
11148#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11149#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11150pub const fn _kortestc_mask32_u8(a: __mmask32, b: __mmask32) -> u8 {
11151    (_kor_mask32(a, b) == 0xffffffff) as u8
11152}
11153
11154/// Compute the bitwise OR of 64-bit masks a and b. If the result is all ones, store 1 in dst, otherwise
11155/// store 0 in dst.
11156///
11157/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kortestc_mask64_u8)
11158#[inline]
11159#[target_feature(enable = "avx512bw")]
11160#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11161#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11162pub const fn _kortestc_mask64_u8(a: __mmask64, b: __mmask64) -> u8 {
11163    (_kor_mask64(a, b) == 0xffffffff_ffffffff) as u8
11164}
11165
11166/// Compute the bitwise OR of 32-bit masks a and b. If the result is all zeros, store 1 in dst, otherwise
11167/// store 0 in dst.
11168///
11169/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kortestz_mask32_u8)
11170#[inline]
11171#[target_feature(enable = "avx512bw")]
11172#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11173#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11174pub const fn _kortestz_mask32_u8(a: __mmask32, b: __mmask32) -> u8 {
11175    (_kor_mask32(a, b) == 0) as u8
11176}
11177
11178/// Compute the bitwise OR of 64-bit masks a and b. If the result is all zeros, store 1 in dst, otherwise
11179/// store 0 in dst.
11180///
11181/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kortestz_mask64_u8)
11182#[inline]
11183#[target_feature(enable = "avx512bw")]
11184#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11185#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11186pub const fn _kortestz_mask64_u8(a: __mmask64, b: __mmask64) -> u8 {
11187    (_kor_mask64(a, b) == 0) as u8
11188}
11189
11190/// Shift the bits of 32-bit mask a left by count while shifting in zeros, and store the least significant 32 bits of the result in k.
11191///
11192/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kshiftli_mask32)
11193#[inline]
11194#[target_feature(enable = "avx512bw")]
11195#[rustc_legacy_const_generics(1)]
11196#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11197#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11198pub const fn _kshiftli_mask32<const COUNT: u32>(a: __mmask32) -> __mmask32 {
11199    a.unbounded_shl(COUNT)
11200}
11201
11202/// Shift the bits of 64-bit mask a left by count while shifting in zeros, and store the least significant 32 bits of the result in k.
11203///
11204/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kshiftli_mask64)
11205#[inline]
11206#[target_feature(enable = "avx512bw")]
11207#[rustc_legacy_const_generics(1)]
11208#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11209#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11210pub const fn _kshiftli_mask64<const COUNT: u32>(a: __mmask64) -> __mmask64 {
11211    a.unbounded_shl(COUNT)
11212}
11213
11214/// Shift the bits of 32-bit mask a right by count while shifting in zeros, and store the least significant 32 bits of the result in k.
11215///
11216/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kshiftri_mask32)
11217#[inline]
11218#[target_feature(enable = "avx512bw")]
11219#[rustc_legacy_const_generics(1)]
11220#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11221#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11222pub const fn _kshiftri_mask32<const COUNT: u32>(a: __mmask32) -> __mmask32 {
11223    a.unbounded_shr(COUNT)
11224}
11225
11226/// Shift the bits of 64-bit mask a right by count while shifting in zeros, and store the least significant 32 bits of the result in k.
11227///
11228/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kshiftri_mask64)
11229#[inline]
11230#[target_feature(enable = "avx512bw")]
11231#[rustc_legacy_const_generics(1)]
11232#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11233#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11234pub const fn _kshiftri_mask64<const COUNT: u32>(a: __mmask64) -> __mmask64 {
11235    a.unbounded_shr(COUNT)
11236}
11237
11238/// Compute the bitwise AND of 32-bit masks a and b, and if the result is all zeros, store 1 in dst,
11239/// otherwise store 0 in dst. Compute the bitwise NOT of a and then AND with b, if the result is all
11240/// zeros, store 1 in and_not, otherwise store 0 in and_not.
11241///
11242/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_ktest_mask32_u8)
11243#[inline]
11244#[target_feature(enable = "avx512bw")]
11245#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11246#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11247pub const unsafe fn _ktest_mask32_u8(a: __mmask32, b: __mmask32, and_not: *mut u8) -> u8 {
11248    *and_not = (_kandn_mask32(a, b) == 0) as u8;
11249    (_kand_mask32(a, b) == 0) as u8
11250}
11251
11252/// Compute the bitwise AND of 64-bit masks a and b, and if the result is all zeros, store 1 in dst,
11253/// otherwise store 0 in dst. Compute the bitwise NOT of a and then AND with b, if the result is all
11254/// zeros, store 1 in and_not, otherwise store 0 in and_not.
11255///
11256/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_ktest_mask64_u8)
11257#[inline]
11258#[target_feature(enable = "avx512bw")]
11259#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11260#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11261pub const unsafe fn _ktest_mask64_u8(a: __mmask64, b: __mmask64, and_not: *mut u8) -> u8 {
11262    *and_not = (_kandn_mask64(a, b) == 0) as u8;
11263    (_kand_mask64(a, b) == 0) as u8
11264}
11265
11266/// Compute the bitwise NOT of 32-bit mask a and then AND with 16-bit mask b, if the result is all
11267/// zeros, store 1 in dst, otherwise store 0 in dst.
11268///
11269/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_ktestc_mask32_u8)
11270#[inline]
11271#[target_feature(enable = "avx512bw")]
11272#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11273#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11274pub const fn _ktestc_mask32_u8(a: __mmask32, b: __mmask32) -> u8 {
11275    (_kandn_mask32(a, b) == 0) as u8
11276}
11277
11278/// Compute the bitwise NOT of 64-bit mask a and then AND with 8-bit mask b, if the result is all
11279/// zeros, store 1 in dst, otherwise store 0 in dst.
11280///
11281/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_ktestc_mask64_u8)
11282#[inline]
11283#[target_feature(enable = "avx512bw")]
11284#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11285#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11286pub const fn _ktestc_mask64_u8(a: __mmask64, b: __mmask64) -> u8 {
11287    (_kandn_mask64(a, b) == 0) as u8
11288}
11289
11290/// Compute the bitwise AND of 32-bit masks a and  b, if the result is all zeros, store 1 in dst, otherwise
11291/// store 0 in dst.
11292///
11293/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_ktestz_mask32_u8)
11294#[inline]
11295#[target_feature(enable = "avx512bw")]
11296#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11297#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11298pub const fn _ktestz_mask32_u8(a: __mmask32, b: __mmask32) -> u8 {
11299    (_kand_mask32(a, b) == 0) as u8
11300}
11301
11302/// Compute the bitwise AND of 64-bit masks a and  b, if the result is all zeros, store 1 in dst, otherwise
11303/// store 0 in dst.
11304///
11305/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_ktestz_mask64_u8)
11306#[inline]
11307#[target_feature(enable = "avx512bw")]
11308#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11309#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11310pub const fn _ktestz_mask64_u8(a: __mmask64, b: __mmask64) -> u8 {
11311    (_kand_mask64(a, b) == 0) as u8
11312}
11313
11314/// Unpack and interleave 16 bits from masks a and b, and store the 32-bit result in k.
11315///
11316/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_kunpackw)
11317#[inline]
11318#[target_feature(enable = "avx512bw")]
11319#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11320#[cfg_attr(test, assert_instr(mov))] // generate normal and code instead of kunpckwd
11321#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11322pub const fn _mm512_kunpackw(a: __mmask32, b: __mmask32) -> __mmask32 {
11323    ((a & 0xffff) << 16) | (b & 0xffff)
11324}
11325
11326/// Unpack and interleave 32 bits from masks a and b, and store the 64-bit result in k.
11327///
11328/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_kunpackd)
11329#[inline]
11330#[target_feature(enable = "avx512bw")]
11331#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11332#[cfg_attr(test, assert_instr(mov))] // generate normal and code instead of kunpckdq
11333#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11334pub const fn _mm512_kunpackd(a: __mmask64, b: __mmask64) -> __mmask64 {
11335    ((a & 0xffffffff) << 32) | (b & 0xffffffff)
11336}
11337
11338/// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the results in dst.
11339///
11340/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cvtepi16_epi8&expand=1407)
11341#[inline]
11342#[target_feature(enable = "avx512bw")]
11343#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11344#[cfg_attr(test, assert_instr(vpmovwb))]
11345#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11346pub const fn _mm512_cvtepi16_epi8(a: __m512i) -> __m256i {
11347    unsafe {
11348        let a = a.as_i16x32();
11349        transmute::<i8x32, _>(simd_cast(a))
11350    }
11351}
11352
11353/// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
11354///
11355/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cvtepi16_epi8&expand=1408)
11356#[inline]
11357#[target_feature(enable = "avx512bw")]
11358#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11359#[cfg_attr(test, assert_instr(vpmovwb))]
11360#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11361pub const fn _mm512_mask_cvtepi16_epi8(src: __m256i, k: __mmask32, a: __m512i) -> __m256i {
11362    unsafe {
11363        let convert = _mm512_cvtepi16_epi8(a).as_i8x32();
11364        transmute(simd_select_bitmask(k, convert, src.as_i8x32()))
11365    }
11366}
11367
11368/// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
11369///
11370/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_cvtepi16_epi8&expand=1409)
11371#[inline]
11372#[target_feature(enable = "avx512bw")]
11373#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11374#[cfg_attr(test, assert_instr(vpmovwb))]
11375#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11376pub const fn _mm512_maskz_cvtepi16_epi8(k: __mmask32, a: __m512i) -> __m256i {
11377    unsafe {
11378        let convert = _mm512_cvtepi16_epi8(a).as_i8x32();
11379        transmute(simd_select_bitmask(k, convert, i8x32::ZERO))
11380    }
11381}
11382
11383/// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the results in dst.
11384///
11385/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cvtepi16_epi8&expand=1404)
11386#[inline]
11387#[target_feature(enable = "avx512bw,avx512vl")]
11388#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11389#[cfg_attr(test, assert_instr(vpmovwb))]
11390#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11391pub const fn _mm256_cvtepi16_epi8(a: __m256i) -> __m128i {
11392    unsafe {
11393        let a = a.as_i16x16();
11394        transmute::<i8x16, _>(simd_cast(a))
11395    }
11396}
11397
11398/// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
11399///
11400/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cvtepi16_epi8&expand=1405)
11401#[inline]
11402#[target_feature(enable = "avx512bw,avx512vl")]
11403#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11404#[cfg_attr(test, assert_instr(vpmovwb))]
11405#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11406pub const fn _mm256_mask_cvtepi16_epi8(src: __m128i, k: __mmask16, a: __m256i) -> __m128i {
11407    unsafe {
11408        let convert = _mm256_cvtepi16_epi8(a).as_i8x16();
11409        transmute(simd_select_bitmask(k, convert, src.as_i8x16()))
11410    }
11411}
11412
11413/// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
11414///
11415/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_cvtepi16_epi8&expand=1406)
11416#[inline]
11417#[target_feature(enable = "avx512bw,avx512vl")]
11418#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11419#[cfg_attr(test, assert_instr(vpmovwb))]
11420#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11421pub const fn _mm256_maskz_cvtepi16_epi8(k: __mmask16, a: __m256i) -> __m128i {
11422    unsafe {
11423        let convert = _mm256_cvtepi16_epi8(a).as_i8x16();
11424        transmute(simd_select_bitmask(k, convert, i8x16::ZERO))
11425    }
11426}
11427
11428/// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the results in dst.
11429///
11430/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cvtepi16_epi8&expand=1401)
11431#[inline]
11432#[target_feature(enable = "avx512bw,avx512vl")]
11433#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11434#[cfg_attr(test, assert_instr(vpmovwb))]
11435#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11436pub const fn _mm_cvtepi16_epi8(a: __m128i) -> __m128i {
11437    unsafe {
11438        let a = a.as_i16x8();
11439        let v256: i16x16 = simd_shuffle!(
11440            a,
11441            i16x8::ZERO,
11442            [0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8]
11443        );
11444        transmute::<i8x16, _>(simd_cast(v256))
11445    }
11446}
11447
11448/// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
11449///
11450/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cvtepi16_epi8&expand=1402)
11451#[inline]
11452#[target_feature(enable = "avx512bw,avx512vl")]
11453#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11454#[cfg_attr(test, assert_instr(vpmovwb))]
11455#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11456pub const fn _mm_mask_cvtepi16_epi8(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
11457    unsafe {
11458        let a = _mm_cvtepi16_epi8(a).as_i8x16();
11459        let src = simd_shuffle!(
11460            src.as_i8x16(),
11461            i8x16::ZERO,
11462            [0, 1, 2, 3, 4, 5, 6, 7, 16, 16, 16, 16, 16, 16, 16, 16]
11463        );
11464        simd_select_bitmask(k as u16, a, src).as_m128i()
11465    }
11466}
11467
11468/// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
11469///
11470/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_cvtepi16_epi8&expand=1403)
11471#[inline]
11472#[target_feature(enable = "avx512bw,avx512vl")]
11473#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11474#[cfg_attr(test, assert_instr(vpmovwb))]
11475#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11476pub const fn _mm_maskz_cvtepi16_epi8(k: __mmask8, a: __m128i) -> __m128i {
11477    _mm_mask_cvtepi16_epi8(_mm_setzero_si128(), k, a)
11478}
11479
11480/// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst.
11481///
11482/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cvtsepi16_epi8&expand=1807)
11483#[inline]
11484#[target_feature(enable = "avx512bw")]
11485#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11486#[cfg_attr(test, assert_instr(vpmovswb))]
11487#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11488pub const fn _mm512_cvtsepi16_epi8(a: __m512i) -> __m256i {
11489    unsafe {
11490        simd_cast::<_, i8x32>(simd_imax(
11491            simd_imin(a.as_i16x32(), i16x32::splat(i8::MAX as _)),
11492            i16x32::splat(i8::MIN as _),
11493        ))
11494        .as_m256i()
11495    }
11496}
11497
11498/// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
11499///
11500/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cvtsepi16_epi8&expand=1808)
11501#[inline]
11502#[target_feature(enable = "avx512bw")]
11503#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11504#[cfg_attr(test, assert_instr(vpmovswb))]
11505#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11506pub const fn _mm512_mask_cvtsepi16_epi8(src: __m256i, k: __mmask32, a: __m512i) -> __m256i {
11507    unsafe {
11508        simd_select_bitmask(k, _mm512_cvtsepi16_epi8(a).as_i8x32(), src.as_i8x32()).as_m256i()
11509    }
11510}
11511
11512/// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
11513///
11514/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_cvtsepi16_epi8&expand=1809)
11515#[inline]
11516#[target_feature(enable = "avx512bw")]
11517#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11518#[cfg_attr(test, assert_instr(vpmovswb))]
11519#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11520pub const fn _mm512_maskz_cvtsepi16_epi8(k: __mmask32, a: __m512i) -> __m256i {
11521    unsafe { simd_select_bitmask(k, _mm512_cvtsepi16_epi8(a).as_i8x32(), i8x32::ZERO).as_m256i() }
11522}
11523
11524/// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst.
11525///
11526/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cvtsepi16_epi8&expand=1804)
11527#[inline]
11528#[target_feature(enable = "avx512bw,avx512vl")]
11529#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11530#[cfg_attr(test, assert_instr(vpmovswb))]
11531#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11532pub const fn _mm256_cvtsepi16_epi8(a: __m256i) -> __m128i {
11533    unsafe {
11534        simd_cast::<_, i8x16>(simd_imax(
11535            simd_imin(a.as_i16x16(), i16x16::splat(i8::MAX as _)),
11536            i16x16::splat(i8::MIN as _),
11537        ))
11538        .as_m128i()
11539    }
11540}
11541
11542/// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
11543///
11544/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cvtsepi16_epi8&expand=1805)
11545#[inline]
11546#[target_feature(enable = "avx512bw,avx512vl")]
11547#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11548#[cfg_attr(test, assert_instr(vpmovswb))]
11549#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11550pub const fn _mm256_mask_cvtsepi16_epi8(src: __m128i, k: __mmask16, a: __m256i) -> __m128i {
11551    unsafe {
11552        simd_select_bitmask(k, _mm256_cvtsepi16_epi8(a).as_i8x16(), src.as_i8x16()).as_m128i()
11553    }
11554}
11555
11556/// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
11557///
11558/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_cvtsepi16_epi8&expand=1806)
11559#[inline]
11560#[target_feature(enable = "avx512bw,avx512vl")]
11561#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11562#[cfg_attr(test, assert_instr(vpmovswb))]
11563#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11564pub const fn _mm256_maskz_cvtsepi16_epi8(k: __mmask16, a: __m256i) -> __m128i {
11565    unsafe { simd_select_bitmask(k, _mm256_cvtsepi16_epi8(a).as_i8x16(), i8x16::ZERO).as_m128i() }
11566}
11567
11568/// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst.
11569///
11570/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cvtsepi16_epi8&expand=1801)
11571#[inline]
11572#[target_feature(enable = "avx512bw,avx512vl")]
11573#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11574#[cfg_attr(test, assert_instr(vpmovswb))]
11575pub fn _mm_cvtsepi16_epi8(a: __m128i) -> __m128i {
11576    unsafe { transmute(vpmovswb128(a.as_i16x8(), i8x16::ZERO, 0b11111111)) }
11577}
11578
11579/// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
11580///
11581/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cvtsepi16_epi8&expand=1802)
11582#[inline]
11583#[target_feature(enable = "avx512bw,avx512vl")]
11584#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11585#[cfg_attr(test, assert_instr(vpmovswb))]
11586pub fn _mm_mask_cvtsepi16_epi8(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
11587    unsafe { transmute(vpmovswb128(a.as_i16x8(), src.as_i8x16(), k)) }
11588}
11589
11590/// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
11591///
11592/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_cvtsepi16_epi8&expand=1803)
11593#[inline]
11594#[target_feature(enable = "avx512bw,avx512vl")]
11595#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11596#[cfg_attr(test, assert_instr(vpmovswb))]
11597pub fn _mm_maskz_cvtsepi16_epi8(k: __mmask8, a: __m128i) -> __m128i {
11598    unsafe { transmute(vpmovswb128(a.as_i16x8(), i8x16::ZERO, k)) }
11599}
11600
11601/// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst.
11602///
11603/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cvtusepi16_epi8&expand=2042)
11604#[inline]
11605#[target_feature(enable = "avx512bw")]
11606#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11607#[cfg_attr(test, assert_instr(vpmovuswb))]
11608#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11609pub const fn _mm512_cvtusepi16_epi8(a: __m512i) -> __m256i {
11610    unsafe {
11611        simd_cast::<_, u8x32>(simd_imin(a.as_u16x32(), u16x32::splat(u8::MAX as _))).as_m256i()
11612    }
11613}
11614
11615/// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
11616///
11617/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cvtusepi16_epi8&expand=2043)
11618#[inline]
11619#[target_feature(enable = "avx512bw")]
11620#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11621#[cfg_attr(test, assert_instr(vpmovuswb))]
11622#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11623pub const fn _mm512_mask_cvtusepi16_epi8(src: __m256i, k: __mmask32, a: __m512i) -> __m256i {
11624    unsafe {
11625        simd_select_bitmask(k, _mm512_cvtusepi16_epi8(a).as_u8x32(), src.as_u8x32()).as_m256i()
11626    }
11627}
11628
11629/// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
11630///
11631/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_cvtusepi16_epi8&expand=2044)
11632#[inline]
11633#[target_feature(enable = "avx512bw")]
11634#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11635#[cfg_attr(test, assert_instr(vpmovuswb))]
11636#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11637pub const fn _mm512_maskz_cvtusepi16_epi8(k: __mmask32, a: __m512i) -> __m256i {
11638    unsafe { simd_select_bitmask(k, _mm512_cvtusepi16_epi8(a).as_u8x32(), u8x32::ZERO).as_m256i() }
11639}
11640
11641/// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst.
11642///
11643/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cvtusepi16_epi8&expand=2039)
11644#[inline]
11645#[target_feature(enable = "avx512bw,avx512vl")]
11646#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11647#[cfg_attr(test, assert_instr(vpmovuswb))]
11648#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11649pub const fn _mm256_cvtusepi16_epi8(a: __m256i) -> __m128i {
11650    unsafe {
11651        simd_cast::<_, u8x16>(simd_imin(a.as_u16x16(), u16x16::splat(u8::MAX as _))).as_m128i()
11652    }
11653}
11654
11655/// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
11656///
11657/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cvtusepi16_epi8&expand=2040)
11658#[inline]
11659#[target_feature(enable = "avx512bw,avx512vl")]
11660#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11661#[cfg_attr(test, assert_instr(vpmovuswb))]
11662#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11663pub const fn _mm256_mask_cvtusepi16_epi8(src: __m128i, k: __mmask16, a: __m256i) -> __m128i {
11664    unsafe {
11665        simd_select_bitmask(k, _mm256_cvtusepi16_epi8(a).as_u8x16(), src.as_u8x16()).as_m128i()
11666    }
11667}
11668
11669/// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
11670///
11671/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_cvtusepi16_epi8&expand=2041)
11672#[inline]
11673#[target_feature(enable = "avx512bw,avx512vl")]
11674#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11675#[cfg_attr(test, assert_instr(vpmovuswb))]
11676#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11677pub const fn _mm256_maskz_cvtusepi16_epi8(k: __mmask16, a: __m256i) -> __m128i {
11678    unsafe { simd_select_bitmask(k, _mm256_cvtusepi16_epi8(a).as_u8x16(), u8x16::ZERO).as_m128i() }
11679}
11680
11681/// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst.
11682///
11683/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cvtusepi16_epi8&expand=2036)
11684#[inline]
11685#[target_feature(enable = "avx512bw,avx512vl")]
11686#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11687#[cfg_attr(test, assert_instr(vpmovuswb))]
11688pub fn _mm_cvtusepi16_epi8(a: __m128i) -> __m128i {
11689    unsafe { transmute(vpmovuswb128(a.as_u16x8(), u8x16::ZERO, 0b11111111)) }
11690}
11691
11692/// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
11693///
11694/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cvtusepi16_epi8&expand=2037)
11695#[inline]
11696#[target_feature(enable = "avx512bw,avx512vl")]
11697#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11698#[cfg_attr(test, assert_instr(vpmovuswb))]
11699pub fn _mm_mask_cvtusepi16_epi8(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
11700    unsafe { transmute(vpmovuswb128(a.as_u16x8(), src.as_u8x16(), k)) }
11701}
11702
11703/// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
11704///
11705/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_cvtusepi16_epi8&expand=2038)
11706#[inline]
11707#[target_feature(enable = "avx512bw,avx512vl")]
11708#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11709#[cfg_attr(test, assert_instr(vpmovuswb))]
11710pub fn _mm_maskz_cvtusepi16_epi8(k: __mmask8, a: __m128i) -> __m128i {
11711    unsafe { transmute(vpmovuswb128(a.as_u16x8(), u8x16::ZERO, k)) }
11712}
11713
11714/// Sign extend packed 8-bit integers in a to packed 16-bit integers, and store the results in dst.
11715///
11716/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cvtepi8_epi16&expand=1526)
11717#[inline]
11718#[target_feature(enable = "avx512bw")]
11719#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11720#[cfg_attr(test, assert_instr(vpmovsxbw))]
11721#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11722pub const fn _mm512_cvtepi8_epi16(a: __m256i) -> __m512i {
11723    unsafe {
11724        let a = a.as_i8x32();
11725        transmute::<i16x32, _>(simd_cast(a))
11726    }
11727}
11728
11729/// Sign extend packed 8-bit integers in a to packed 16-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
11730///
11731/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cvtepi8_epi16&expand=1527)
11732#[inline]
11733#[target_feature(enable = "avx512bw")]
11734#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11735#[cfg_attr(test, assert_instr(vpmovsxbw))]
11736#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11737pub const fn _mm512_mask_cvtepi8_epi16(src: __m512i, k: __mmask32, a: __m256i) -> __m512i {
11738    unsafe {
11739        let convert = _mm512_cvtepi8_epi16(a).as_i16x32();
11740        transmute(simd_select_bitmask(k, convert, src.as_i16x32()))
11741    }
11742}
11743
11744/// Sign extend packed 8-bit integers in a to packed 16-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
11745///
11746/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_cvtepi8_epi16&expand=1528)
11747#[inline]
11748#[target_feature(enable = "avx512bw")]
11749#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11750#[cfg_attr(test, assert_instr(vpmovsxbw))]
11751#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11752pub const fn _mm512_maskz_cvtepi8_epi16(k: __mmask32, a: __m256i) -> __m512i {
11753    unsafe {
11754        let convert = _mm512_cvtepi8_epi16(a).as_i16x32();
11755        transmute(simd_select_bitmask(k, convert, i16x32::ZERO))
11756    }
11757}
11758
11759/// Sign extend packed 8-bit integers in a to packed 16-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
11760///
11761/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cvtepi8_epi16&expand=1524)
11762#[inline]
11763#[target_feature(enable = "avx512bw,avx512vl")]
11764#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11765#[cfg_attr(test, assert_instr(vpmovsxbw))]
11766#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11767pub const fn _mm256_mask_cvtepi8_epi16(src: __m256i, k: __mmask16, a: __m128i) -> __m256i {
11768    unsafe {
11769        let convert = _mm256_cvtepi8_epi16(a).as_i16x16();
11770        transmute(simd_select_bitmask(k, convert, src.as_i16x16()))
11771    }
11772}
11773
11774/// Sign extend packed 8-bit integers in a to packed 16-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
11775///
11776/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_cvtepi8_epi16&expand=1525)
11777#[inline]
11778#[target_feature(enable = "avx512bw,avx512vl")]
11779#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11780#[cfg_attr(test, assert_instr(vpmovsxbw))]
11781#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11782pub const fn _mm256_maskz_cvtepi8_epi16(k: __mmask16, a: __m128i) -> __m256i {
11783    unsafe {
11784        let convert = _mm256_cvtepi8_epi16(a).as_i16x16();
11785        transmute(simd_select_bitmask(k, convert, i16x16::ZERO))
11786    }
11787}
11788
11789/// Sign extend packed 8-bit integers in a to packed 16-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
11790///
11791/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cvtepi8_epi16&expand=1521)
11792#[inline]
11793#[target_feature(enable = "avx512bw,avx512vl")]
11794#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11795#[cfg_attr(test, assert_instr(vpmovsxbw))]
11796#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11797pub const fn _mm_mask_cvtepi8_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
11798    unsafe {
11799        let convert = _mm_cvtepi8_epi16(a).as_i16x8();
11800        transmute(simd_select_bitmask(k, convert, src.as_i16x8()))
11801    }
11802}
11803
11804/// Sign extend packed 8-bit integers in a to packed 16-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
11805///
11806/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_cvtepi8_epi16&expand=1522)
11807#[inline]
11808#[target_feature(enable = "avx512bw,avx512vl")]
11809#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11810#[cfg_attr(test, assert_instr(vpmovsxbw))]
11811#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11812pub const fn _mm_maskz_cvtepi8_epi16(k: __mmask8, a: __m128i) -> __m128i {
11813    unsafe {
11814        let convert = _mm_cvtepi8_epi16(a).as_i16x8();
11815        transmute(simd_select_bitmask(k, convert, i16x8::ZERO))
11816    }
11817}
11818
11819/// Zero extend packed unsigned 8-bit integers in a to packed 16-bit integers, and store the results in dst.
11820///
11821/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cvtepu8_epi16&expand=1612)
11822#[inline]
11823#[target_feature(enable = "avx512bw")]
11824#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11825#[cfg_attr(test, assert_instr(vpmovzxbw))]
11826#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11827pub const fn _mm512_cvtepu8_epi16(a: __m256i) -> __m512i {
11828    unsafe {
11829        let a = a.as_u8x32();
11830        transmute::<i16x32, _>(simd_cast(a))
11831    }
11832}
11833
11834/// Zero extend packed unsigned 8-bit integers in a to packed 16-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
11835///
11836/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cvtepu8_epi16&expand=1613)
11837#[inline]
11838#[target_feature(enable = "avx512bw")]
11839#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11840#[cfg_attr(test, assert_instr(vpmovzxbw))]
11841#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11842pub const fn _mm512_mask_cvtepu8_epi16(src: __m512i, k: __mmask32, a: __m256i) -> __m512i {
11843    unsafe {
11844        let convert = _mm512_cvtepu8_epi16(a).as_i16x32();
11845        transmute(simd_select_bitmask(k, convert, src.as_i16x32()))
11846    }
11847}
11848
11849/// Zero extend packed unsigned 8-bit integers in a to packed 16-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
11850///
11851/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_cvtepu8_epi16&expand=1614)
11852#[inline]
11853#[target_feature(enable = "avx512bw")]
11854#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11855#[cfg_attr(test, assert_instr(vpmovzxbw))]
11856#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11857pub const fn _mm512_maskz_cvtepu8_epi16(k: __mmask32, a: __m256i) -> __m512i {
11858    unsafe {
11859        let convert = _mm512_cvtepu8_epi16(a).as_i16x32();
11860        transmute(simd_select_bitmask(k, convert, i16x32::ZERO))
11861    }
11862}
11863
11864/// Zero extend packed unsigned 8-bit integers in a to packed 16-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
11865///
11866/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cvtepu8_epi16&expand=1610)
11867#[inline]
11868#[target_feature(enable = "avx512bw,avx512vl")]
11869#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11870#[cfg_attr(test, assert_instr(vpmovzxbw))]
11871#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11872pub const fn _mm256_mask_cvtepu8_epi16(src: __m256i, k: __mmask16, a: __m128i) -> __m256i {
11873    unsafe {
11874        let convert = _mm256_cvtepu8_epi16(a).as_i16x16();
11875        transmute(simd_select_bitmask(k, convert, src.as_i16x16()))
11876    }
11877}
11878
11879/// Zero extend packed unsigned 8-bit integers in a to packed 16-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
11880///
11881/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_cvtepu8_epi16&expand=1611)
11882#[inline]
11883#[target_feature(enable = "avx512bw,avx512vl")]
11884#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11885#[cfg_attr(test, assert_instr(vpmovzxbw))]
11886#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11887pub const fn _mm256_maskz_cvtepu8_epi16(k: __mmask16, a: __m128i) -> __m256i {
11888    unsafe {
11889        let convert = _mm256_cvtepu8_epi16(a).as_i16x16();
11890        transmute(simd_select_bitmask(k, convert, i16x16::ZERO))
11891    }
11892}
11893
11894/// Zero extend packed unsigned 8-bit integers in a to packed 16-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
11895///
11896/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cvtepu8_epi16&expand=1607)
11897#[inline]
11898#[target_feature(enable = "avx512bw,avx512vl")]
11899#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11900#[cfg_attr(test, assert_instr(vpmovzxbw))]
11901#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11902pub const fn _mm_mask_cvtepu8_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
11903    unsafe {
11904        let convert = _mm_cvtepu8_epi16(a).as_i16x8();
11905        transmute(simd_select_bitmask(k, convert, src.as_i16x8()))
11906    }
11907}
11908
11909/// Zero extend packed unsigned 8-bit integers in a to packed 16-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
11910///
11911/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_cvtepu8_epi16&expand=1608)
11912#[inline]
11913#[target_feature(enable = "avx512bw,avx512vl")]
11914#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11915#[cfg_attr(test, assert_instr(vpmovzxbw))]
11916#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11917pub const fn _mm_maskz_cvtepu8_epi16(k: __mmask8, a: __m128i) -> __m128i {
11918    unsafe {
11919        let convert = _mm_cvtepu8_epi16(a).as_i16x8();
11920        transmute(simd_select_bitmask(k, convert, i16x8::ZERO))
11921    }
11922}
11923
11924/// Shift 128-bit lanes in a left by imm8 bytes while shifting in zeros, and store the results in dst.
11925///
11926/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_bslli_epi128&expand=591)
11927#[inline]
11928#[target_feature(enable = "avx512bw")]
11929#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11930#[cfg_attr(test, assert_instr(vpslldq, IMM8 = 3))]
11931#[rustc_legacy_const_generics(1)]
11932#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11933pub const fn _mm512_bslli_epi128<const IMM8: i32>(a: __m512i) -> __m512i {
11934    unsafe {
11935        static_assert_uimm_bits!(IMM8, 8);
11936        const fn mask(shift: i32, i: u32) -> u32 {
11937            let shift = shift as u32 & 0xff;
11938            if shift > 15 || i % 16 < shift {
11939                0
11940            } else {
11941                64 + (i - shift)
11942            }
11943        }
11944        let a = a.as_i8x64();
11945        let zero = i8x64::ZERO;
11946        let r: i8x64 = simd_shuffle!(
11947            zero,
11948            a,
11949            [
11950                mask(IMM8, 0),
11951                mask(IMM8, 1),
11952                mask(IMM8, 2),
11953                mask(IMM8, 3),
11954                mask(IMM8, 4),
11955                mask(IMM8, 5),
11956                mask(IMM8, 6),
11957                mask(IMM8, 7),
11958                mask(IMM8, 8),
11959                mask(IMM8, 9),
11960                mask(IMM8, 10),
11961                mask(IMM8, 11),
11962                mask(IMM8, 12),
11963                mask(IMM8, 13),
11964                mask(IMM8, 14),
11965                mask(IMM8, 15),
11966                mask(IMM8, 16),
11967                mask(IMM8, 17),
11968                mask(IMM8, 18),
11969                mask(IMM8, 19),
11970                mask(IMM8, 20),
11971                mask(IMM8, 21),
11972                mask(IMM8, 22),
11973                mask(IMM8, 23),
11974                mask(IMM8, 24),
11975                mask(IMM8, 25),
11976                mask(IMM8, 26),
11977                mask(IMM8, 27),
11978                mask(IMM8, 28),
11979                mask(IMM8, 29),
11980                mask(IMM8, 30),
11981                mask(IMM8, 31),
11982                mask(IMM8, 32),
11983                mask(IMM8, 33),
11984                mask(IMM8, 34),
11985                mask(IMM8, 35),
11986                mask(IMM8, 36),
11987                mask(IMM8, 37),
11988                mask(IMM8, 38),
11989                mask(IMM8, 39),
11990                mask(IMM8, 40),
11991                mask(IMM8, 41),
11992                mask(IMM8, 42),
11993                mask(IMM8, 43),
11994                mask(IMM8, 44),
11995                mask(IMM8, 45),
11996                mask(IMM8, 46),
11997                mask(IMM8, 47),
11998                mask(IMM8, 48),
11999                mask(IMM8, 49),
12000                mask(IMM8, 50),
12001                mask(IMM8, 51),
12002                mask(IMM8, 52),
12003                mask(IMM8, 53),
12004                mask(IMM8, 54),
12005                mask(IMM8, 55),
12006                mask(IMM8, 56),
12007                mask(IMM8, 57),
12008                mask(IMM8, 58),
12009                mask(IMM8, 59),
12010                mask(IMM8, 60),
12011                mask(IMM8, 61),
12012                mask(IMM8, 62),
12013                mask(IMM8, 63),
12014            ],
12015        );
12016        transmute(r)
12017    }
12018}
12019
12020/// Shift 128-bit lanes in a right by imm8 bytes while shifting in zeros, and store the results in dst.
12021///
12022/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_bsrli_epi128&expand=594)
12023#[inline]
12024#[target_feature(enable = "avx512bw")]
12025#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12026#[cfg_attr(test, assert_instr(vpsrldq, IMM8 = 3))]
12027#[rustc_legacy_const_generics(1)]
12028#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
12029pub const fn _mm512_bsrli_epi128<const IMM8: i32>(a: __m512i) -> __m512i {
12030    unsafe {
12031        static_assert_uimm_bits!(IMM8, 8);
12032        const fn mask(shift: i32, i: u32) -> u32 {
12033            let shift = shift as u32 & 0xff;
12034            if shift > 15 || (15 - (i % 16)) < shift {
12035                0
12036            } else {
12037                64 + (i + shift)
12038            }
12039        }
12040        let a = a.as_i8x64();
12041        let zero = i8x64::ZERO;
12042        let r: i8x64 = simd_shuffle!(
12043            zero,
12044            a,
12045            [
12046                mask(IMM8, 0),
12047                mask(IMM8, 1),
12048                mask(IMM8, 2),
12049                mask(IMM8, 3),
12050                mask(IMM8, 4),
12051                mask(IMM8, 5),
12052                mask(IMM8, 6),
12053                mask(IMM8, 7),
12054                mask(IMM8, 8),
12055                mask(IMM8, 9),
12056                mask(IMM8, 10),
12057                mask(IMM8, 11),
12058                mask(IMM8, 12),
12059                mask(IMM8, 13),
12060                mask(IMM8, 14),
12061                mask(IMM8, 15),
12062                mask(IMM8, 16),
12063                mask(IMM8, 17),
12064                mask(IMM8, 18),
12065                mask(IMM8, 19),
12066                mask(IMM8, 20),
12067                mask(IMM8, 21),
12068                mask(IMM8, 22),
12069                mask(IMM8, 23),
12070                mask(IMM8, 24),
12071                mask(IMM8, 25),
12072                mask(IMM8, 26),
12073                mask(IMM8, 27),
12074                mask(IMM8, 28),
12075                mask(IMM8, 29),
12076                mask(IMM8, 30),
12077                mask(IMM8, 31),
12078                mask(IMM8, 32),
12079                mask(IMM8, 33),
12080                mask(IMM8, 34),
12081                mask(IMM8, 35),
12082                mask(IMM8, 36),
12083                mask(IMM8, 37),
12084                mask(IMM8, 38),
12085                mask(IMM8, 39),
12086                mask(IMM8, 40),
12087                mask(IMM8, 41),
12088                mask(IMM8, 42),
12089                mask(IMM8, 43),
12090                mask(IMM8, 44),
12091                mask(IMM8, 45),
12092                mask(IMM8, 46),
12093                mask(IMM8, 47),
12094                mask(IMM8, 48),
12095                mask(IMM8, 49),
12096                mask(IMM8, 50),
12097                mask(IMM8, 51),
12098                mask(IMM8, 52),
12099                mask(IMM8, 53),
12100                mask(IMM8, 54),
12101                mask(IMM8, 55),
12102                mask(IMM8, 56),
12103                mask(IMM8, 57),
12104                mask(IMM8, 58),
12105                mask(IMM8, 59),
12106                mask(IMM8, 60),
12107                mask(IMM8, 61),
12108                mask(IMM8, 62),
12109                mask(IMM8, 63),
12110            ],
12111        );
12112        transmute(r)
12113    }
12114}
12115
12116/// Concatenate pairs of 16-byte blocks in a and b into a 32-byte temporary result, shift the result right by imm8 bytes, and store the low 16 bytes in dst.
12117/// Unlike [`_mm_alignr_epi8`], [`_mm256_alignr_epi8`] functions, where the entire input vectors are concatenated to the temporary result,
12118/// this concatenation happens in 4 steps, where each step builds 32-byte temporary result.
12119///
12120/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_alignr_epi8&expand=263)
12121#[inline]
12122#[target_feature(enable = "avx512bw")]
12123#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12124#[cfg_attr(test, assert_instr(vpalignr, IMM8 = 1))]
12125#[rustc_legacy_const_generics(2)]
12126#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
12127pub const fn _mm512_alignr_epi8<const IMM8: i32>(a: __m512i, b: __m512i) -> __m512i {
12128    const fn mask(shift: u32, i: u32) -> u32 {
12129        let shift = shift % 16;
12130        let mod_i = i % 16;
12131        if mod_i < (16 - shift) {
12132            i + shift
12133        } else {
12134            i + 48 + shift
12135        }
12136    }
12137
12138    // If palignr is shifting the pair of vectors more than the size of two
12139    // lanes, emit zero.
12140    if IMM8 >= 32 {
12141        return _mm512_setzero_si512();
12142    }
12143    // If palignr is shifting the pair of input vectors more than one lane,
12144    // but less than two lanes, convert to shifting in zeroes.
12145    let (a, b) = if IMM8 > 16 {
12146        (_mm512_setzero_si512(), a)
12147    } else {
12148        (a, b)
12149    };
12150    unsafe {
12151        if IMM8 == 16 {
12152            return transmute(a);
12153        }
12154
12155        let r: i8x64 = simd_shuffle!(
12156            b.as_i8x64(),
12157            a.as_i8x64(),
12158            [
12159                mask(IMM8 as u32, 0),
12160                mask(IMM8 as u32, 1),
12161                mask(IMM8 as u32, 2),
12162                mask(IMM8 as u32, 3),
12163                mask(IMM8 as u32, 4),
12164                mask(IMM8 as u32, 5),
12165                mask(IMM8 as u32, 6),
12166                mask(IMM8 as u32, 7),
12167                mask(IMM8 as u32, 8),
12168                mask(IMM8 as u32, 9),
12169                mask(IMM8 as u32, 10),
12170                mask(IMM8 as u32, 11),
12171                mask(IMM8 as u32, 12),
12172                mask(IMM8 as u32, 13),
12173                mask(IMM8 as u32, 14),
12174                mask(IMM8 as u32, 15),
12175                mask(IMM8 as u32, 16),
12176                mask(IMM8 as u32, 17),
12177                mask(IMM8 as u32, 18),
12178                mask(IMM8 as u32, 19),
12179                mask(IMM8 as u32, 20),
12180                mask(IMM8 as u32, 21),
12181                mask(IMM8 as u32, 22),
12182                mask(IMM8 as u32, 23),
12183                mask(IMM8 as u32, 24),
12184                mask(IMM8 as u32, 25),
12185                mask(IMM8 as u32, 26),
12186                mask(IMM8 as u32, 27),
12187                mask(IMM8 as u32, 28),
12188                mask(IMM8 as u32, 29),
12189                mask(IMM8 as u32, 30),
12190                mask(IMM8 as u32, 31),
12191                mask(IMM8 as u32, 32),
12192                mask(IMM8 as u32, 33),
12193                mask(IMM8 as u32, 34),
12194                mask(IMM8 as u32, 35),
12195                mask(IMM8 as u32, 36),
12196                mask(IMM8 as u32, 37),
12197                mask(IMM8 as u32, 38),
12198                mask(IMM8 as u32, 39),
12199                mask(IMM8 as u32, 40),
12200                mask(IMM8 as u32, 41),
12201                mask(IMM8 as u32, 42),
12202                mask(IMM8 as u32, 43),
12203                mask(IMM8 as u32, 44),
12204                mask(IMM8 as u32, 45),
12205                mask(IMM8 as u32, 46),
12206                mask(IMM8 as u32, 47),
12207                mask(IMM8 as u32, 48),
12208                mask(IMM8 as u32, 49),
12209                mask(IMM8 as u32, 50),
12210                mask(IMM8 as u32, 51),
12211                mask(IMM8 as u32, 52),
12212                mask(IMM8 as u32, 53),
12213                mask(IMM8 as u32, 54),
12214                mask(IMM8 as u32, 55),
12215                mask(IMM8 as u32, 56),
12216                mask(IMM8 as u32, 57),
12217                mask(IMM8 as u32, 58),
12218                mask(IMM8 as u32, 59),
12219                mask(IMM8 as u32, 60),
12220                mask(IMM8 as u32, 61),
12221                mask(IMM8 as u32, 62),
12222                mask(IMM8 as u32, 63),
12223            ],
12224        );
12225        transmute(r)
12226    }
12227}
12228
12229/// Concatenate pairs of 16-byte blocks in a and b into a 32-byte temporary result, shift the result right by imm8 bytes, and store the low 16 bytes in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
12230///
12231/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_alignr_epi8&expand=264)
12232#[inline]
12233#[target_feature(enable = "avx512bw")]
12234#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12235#[cfg_attr(test, assert_instr(vpalignr, IMM8 = 1))]
12236#[rustc_legacy_const_generics(4)]
12237#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
12238pub const fn _mm512_mask_alignr_epi8<const IMM8: i32>(
12239    src: __m512i,
12240    k: __mmask64,
12241    a: __m512i,
12242    b: __m512i,
12243) -> __m512i {
12244    unsafe {
12245        static_assert_uimm_bits!(IMM8, 8);
12246        let r = _mm512_alignr_epi8::<IMM8>(a, b);
12247        transmute(simd_select_bitmask(k, r.as_i8x64(), src.as_i8x64()))
12248    }
12249}
12250
12251/// Concatenate pairs of 16-byte blocks in a and b into a 32-byte temporary result, shift the result right by imm8 bytes, and store the low 16 bytes in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
12252///
12253/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_alignr_epi8&expand=265)
12254#[inline]
12255#[target_feature(enable = "avx512bw")]
12256#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12257#[cfg_attr(test, assert_instr(vpalignr, IMM8 = 1))]
12258#[rustc_legacy_const_generics(3)]
12259#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
12260pub const fn _mm512_maskz_alignr_epi8<const IMM8: i32>(
12261    k: __mmask64,
12262    a: __m512i,
12263    b: __m512i,
12264) -> __m512i {
12265    unsafe {
12266        static_assert_uimm_bits!(IMM8, 8);
12267        let r = _mm512_alignr_epi8::<IMM8>(a, b);
12268        transmute(simd_select_bitmask(k, r.as_i8x64(), i8x64::ZERO))
12269    }
12270}
12271
12272/// Concatenate pairs of 16-byte blocks in a and b into a 32-byte temporary result, shift the result right by imm8 bytes, and store the low 16 bytes in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
12273///
12274/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_alignr_epi8&expand=261)
12275#[inline]
12276#[target_feature(enable = "avx512bw,avx512vl")]
12277#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12278#[rustc_legacy_const_generics(4)]
12279#[cfg_attr(test, assert_instr(vpalignr, IMM8 = 5))]
12280#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
12281pub const fn _mm256_mask_alignr_epi8<const IMM8: i32>(
12282    src: __m256i,
12283    k: __mmask32,
12284    a: __m256i,
12285    b: __m256i,
12286) -> __m256i {
12287    unsafe {
12288        static_assert_uimm_bits!(IMM8, 8);
12289        let r = _mm256_alignr_epi8::<IMM8>(a, b);
12290        transmute(simd_select_bitmask(k, r.as_i8x32(), src.as_i8x32()))
12291    }
12292}
12293
12294/// Concatenate pairs of 16-byte blocks in a and b into a 32-byte temporary result, shift the result right by imm8 bytes, and store the low 16 bytes in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
12295///
12296/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_alignr_epi8&expand=262)
12297#[inline]
12298#[target_feature(enable = "avx512bw,avx512vl")]
12299#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12300#[rustc_legacy_const_generics(3)]
12301#[cfg_attr(test, assert_instr(vpalignr, IMM8 = 5))]
12302#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
12303pub const fn _mm256_maskz_alignr_epi8<const IMM8: i32>(
12304    k: __mmask32,
12305    a: __m256i,
12306    b: __m256i,
12307) -> __m256i {
12308    unsafe {
12309        static_assert_uimm_bits!(IMM8, 8);
12310        let r = _mm256_alignr_epi8::<IMM8>(a, b);
12311        transmute(simd_select_bitmask(k, r.as_i8x32(), i8x32::ZERO))
12312    }
12313}
12314
12315/// Concatenate pairs of 16-byte blocks in a and b into a 32-byte temporary result, shift the result right by imm8 bytes, and store the low 16 bytes in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
12316///
12317/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_alignr_epi8&expand=258)
12318#[inline]
12319#[target_feature(enable = "avx512bw,avx512vl")]
12320#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12321#[rustc_legacy_const_generics(4)]
12322#[cfg_attr(test, assert_instr(vpalignr, IMM8 = 5))]
12323#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
12324pub const fn _mm_mask_alignr_epi8<const IMM8: i32>(
12325    src: __m128i,
12326    k: __mmask16,
12327    a: __m128i,
12328    b: __m128i,
12329) -> __m128i {
12330    unsafe {
12331        static_assert_uimm_bits!(IMM8, 8);
12332        let r = _mm_alignr_epi8::<IMM8>(a, b);
12333        transmute(simd_select_bitmask(k, r.as_i8x16(), src.as_i8x16()))
12334    }
12335}
12336
12337/// Concatenate pairs of 16-byte blocks in a and b into a 32-byte temporary result, shift the result right by imm8 bytes, and store the low 16 bytes in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
12338///
12339/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_alignr_epi8&expand=259)
12340#[inline]
12341#[target_feature(enable = "avx512bw,avx512vl")]
12342#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12343#[rustc_legacy_const_generics(3)]
12344#[cfg_attr(test, assert_instr(vpalignr, IMM8 = 5))]
12345#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
12346pub const fn _mm_maskz_alignr_epi8<const IMM8: i32>(
12347    k: __mmask16,
12348    a: __m128i,
12349    b: __m128i,
12350) -> __m128i {
12351    unsafe {
12352        static_assert_uimm_bits!(IMM8, 8);
12353        let r = _mm_alignr_epi8::<IMM8>(a, b);
12354        transmute(simd_select_bitmask(k, r.as_i8x16(), i8x16::ZERO))
12355    }
12356}
12357
12358/// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
12359///
12360/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cvtsepi16_storeu_epi8&expand=1812)
12361#[inline]
12362#[target_feature(enable = "avx512bw")]
12363#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12364#[cfg_attr(test, assert_instr(vpmovswb))]
12365pub unsafe fn _mm512_mask_cvtsepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask32, a: __m512i) {
12366    vpmovswbmem(mem_addr, a.as_i16x32(), k);
12367}
12368
12369/// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
12370///
12371/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cvtsepi16_storeu_epi8&expand=1811)
12372#[inline]
12373#[target_feature(enable = "avx512bw,avx512vl")]
12374#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12375#[cfg_attr(test, assert_instr(vpmovswb))]
12376pub unsafe fn _mm256_mask_cvtsepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask16, a: __m256i) {
12377    let mask = simd_select_bitmask(k, i16x16::splat(!0), i16x16::ZERO);
12378
12379    let max = simd_splat(i16::from(i8::MAX));
12380    let min = simd_splat(i16::from(i8::MIN));
12381
12382    let v = simd_imax(simd_imin(a.as_i16x16(), max), min);
12383    let truncated: i8x16 = simd_cast(v);
12384    simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, truncated);
12385}
12386
12387/// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
12388///
12389/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cvtsepi16_storeu_epi8&expand=1810)
12390#[inline]
12391#[target_feature(enable = "avx512bw,avx512vl")]
12392#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12393#[cfg_attr(test, assert_instr(vpmovswb))]
12394pub unsafe fn _mm_mask_cvtsepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask8, a: __m128i) {
12395    let mask = simd_select_bitmask(k, i16x8::splat(!0), i16x8::ZERO);
12396
12397    let max = simd_splat(i16::from(i8::MAX));
12398    let min = simd_splat(i16::from(i8::MIN));
12399
12400    let v = simd_imax(simd_imin(a.as_i16x8(), max), min);
12401    let truncated: i8x8 = simd_cast(v);
12402    simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, truncated);
12403}
12404
12405/// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
12406///
12407/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cvtepi16_storeu_epi8&expand=1412)
12408#[inline]
12409#[target_feature(enable = "avx512bw")]
12410#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12411#[cfg_attr(test, assert_instr(vpmovwb))]
12412#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
12413pub const unsafe fn _mm512_mask_cvtepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask32, a: __m512i) {
12414    let result = _mm512_cvtepi16_epi8(a).as_i8x32();
12415    let mask = simd_select_bitmask(k, i8x32::splat(!0), i8x32::ZERO);
12416    simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, result);
12417}
12418
12419/// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
12420///
12421/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cvtepi16_storeu_epi8&expand=1411)
12422#[inline]
12423#[target_feature(enable = "avx512bw,avx512vl")]
12424#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12425#[cfg_attr(test, assert_instr(vpmovwb))]
12426#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
12427pub const unsafe fn _mm256_mask_cvtepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask16, a: __m256i) {
12428    let result = _mm256_cvtepi16_epi8(a).as_i8x16();
12429    let mask = simd_select_bitmask(k, i8x16::splat(!0), i8x16::ZERO);
12430    simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, result);
12431}
12432
12433/// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
12434///
12435/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cvtepi16_storeu_epi8&expand=1410)
12436#[inline]
12437#[target_feature(enable = "avx512bw,avx512vl")]
12438#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12439#[cfg_attr(test, assert_instr(vpmovwb))]
12440#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
12441pub const unsafe fn _mm_mask_cvtepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask8, a: __m128i) {
12442    let result: i8x8 = simd_shuffle!(
12443        _mm_cvtepi16_epi8(a).as_i8x16(),
12444        i8x16::ZERO,
12445        [0, 1, 2, 3, 4, 5, 6, 7]
12446    );
12447    let mask = simd_select_bitmask(k, i8x8::splat(!0), i8x8::ZERO);
12448    simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, result);
12449}
12450
12451/// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
12452///
12453/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cvtusepi16_storeu_epi8&expand=2047)
12454#[inline]
12455#[target_feature(enable = "avx512bw")]
12456#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12457#[cfg_attr(test, assert_instr(vpmovuswb))]
12458pub unsafe fn _mm512_mask_cvtusepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask32, a: __m512i) {
12459    vpmovuswbmem(mem_addr, a.as_i16x32(), k);
12460}
12461
12462/// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
12463///
12464/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cvtusepi16_storeu_epi8&expand=2046)
12465#[inline]
12466#[target_feature(enable = "avx512bw,avx512vl")]
12467#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12468#[cfg_attr(test, assert_instr(vpmovuswb))]
12469pub unsafe fn _mm256_mask_cvtusepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask16, a: __m256i) {
12470    let mask = simd_select_bitmask(k, i16x16::splat(!0), i16x16::ZERO);
12471    let mem_addr = mem_addr.cast::<u8>();
12472    let max = simd_splat(u16::from(u8::MAX));
12473
12474    let truncated: u8x16 = simd_cast(simd_imin(a.as_u16x16(), max));
12475    simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, truncated);
12476}
12477
12478/// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
12479///
12480/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cvtusepi16_storeu_epi8&expand=2045)
12481#[inline]
12482#[target_feature(enable = "avx512bw,avx512vl")]
12483#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12484#[cfg_attr(test, assert_instr(vpmovuswb))]
12485pub unsafe fn _mm_mask_cvtusepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask8, a: __m128i) {
12486    let mask = simd_select_bitmask(k, i16x8::splat(!0), i16x8::ZERO);
12487    let mem_addr = mem_addr.cast::<u8>();
12488    let max = simd_splat(u16::from(u8::MAX));
12489
12490    let v = a.as_u16x8();
12491    let v = simd_imin(v, max);
12492
12493    let truncated: u8x8 = simd_cast(v);
12494    simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, truncated);
12495}
12496
12497#[allow(improper_ctypes)]
12498unsafe extern "llvm-intrinsic" {
12499    #[link_name = "llvm.x86.avx512.pmul.hr.sw.512"]
12500    fn vpmulhrsw(a: i16x32, b: i16x32) -> i16x32;
12501
12502    #[link_name = "llvm.x86.avx512.pmaddw.d.512"]
12503    fn vpmaddwd(a: i16x32, b: i16x32) -> i32x16;
12504    #[link_name = "llvm.x86.avx512.pmaddubs.w.512"]
12505    fn vpmaddubsw(a: u8x64, b: i8x64) -> i16x32;
12506
12507    #[link_name = "llvm.x86.avx512.packssdw.512"]
12508    fn vpackssdw(a: i32x16, b: i32x16) -> i16x32;
12509    #[link_name = "llvm.x86.avx512.packsswb.512"]
12510    fn vpacksswb(a: i16x32, b: i16x32) -> i8x64;
12511    #[link_name = "llvm.x86.avx512.packusdw.512"]
12512    fn vpackusdw(a: i32x16, b: i32x16) -> u16x32;
12513    #[link_name = "llvm.x86.avx512.packuswb.512"]
12514    fn vpackuswb(a: i16x32, b: i16x32) -> u8x64;
12515
12516    #[link_name = "llvm.x86.avx512.psll.w.512"]
12517    fn vpsllw(a: i16x32, count: i16x8) -> i16x32;
12518
12519    #[link_name = "llvm.x86.avx512.psllv.w.512"]
12520    fn vpsllvw(a: i16x32, b: i16x32) -> i16x32;
12521    #[link_name = "llvm.x86.avx512.psllv.w.256"]
12522    fn vpsllvw256(a: i16x16, b: i16x16) -> i16x16;
12523    #[link_name = "llvm.x86.avx512.psllv.w.128"]
12524    fn vpsllvw128(a: i16x8, b: i16x8) -> i16x8;
12525
12526    #[link_name = "llvm.x86.avx512.psrl.w.512"]
12527    fn vpsrlw(a: i16x32, count: i16x8) -> i16x32;
12528
12529    #[link_name = "llvm.x86.avx512.psrlv.w.512"]
12530    fn vpsrlvw(a: i16x32, b: i16x32) -> i16x32;
12531    #[link_name = "llvm.x86.avx512.psrlv.w.256"]
12532    fn vpsrlvw256(a: i16x16, b: i16x16) -> i16x16;
12533    #[link_name = "llvm.x86.avx512.psrlv.w.128"]
12534    fn vpsrlvw128(a: i16x8, b: i16x8) -> i16x8;
12535
12536    #[link_name = "llvm.x86.avx512.psra.w.512"]
12537    fn vpsraw(a: i16x32, count: i16x8) -> i16x32;
12538
12539    #[link_name = "llvm.x86.avx512.psrav.w.512"]
12540    fn vpsravw(a: i16x32, count: i16x32) -> i16x32;
12541    #[link_name = "llvm.x86.avx512.psrav.w.256"]
12542    fn vpsravw256(a: i16x16, count: i16x16) -> i16x16;
12543    #[link_name = "llvm.x86.avx512.psrav.w.128"]
12544    fn vpsravw128(a: i16x8, count: i16x8) -> i16x8;
12545
12546    #[link_name = "llvm.x86.avx512.vpermi2var.hi.512"]
12547    fn vpermi2w(a: i16x32, idx: i16x32, b: i16x32) -> i16x32;
12548    #[link_name = "llvm.x86.avx512.vpermi2var.hi.256"]
12549    fn vpermi2w256(a: i16x16, idx: i16x16, b: i16x16) -> i16x16;
12550    #[link_name = "llvm.x86.avx512.vpermi2var.hi.128"]
12551    fn vpermi2w128(a: i16x8, idx: i16x8, b: i16x8) -> i16x8;
12552
12553    #[link_name = "llvm.x86.avx512.permvar.hi.512"]
12554    fn vpermw(a: i16x32, idx: i16x32) -> i16x32;
12555    #[link_name = "llvm.x86.avx512.permvar.hi.256"]
12556    fn vpermw256(a: i16x16, idx: i16x16) -> i16x16;
12557    #[link_name = "llvm.x86.avx512.permvar.hi.128"]
12558    fn vpermw128(a: i16x8, idx: i16x8) -> i16x8;
12559
12560    #[link_name = "llvm.x86.avx512.pshuf.b.512"]
12561    fn vpshufb(a: i8x64, b: i8x64) -> i8x64;
12562
12563    #[link_name = "llvm.x86.avx512.psad.bw.512"]
12564    fn vpsadbw(a: u8x64, b: u8x64) -> u64x8;
12565
12566    #[link_name = "llvm.x86.avx512.dbpsadbw.512"]
12567    fn vdbpsadbw(a: u8x64, b: u8x64, imm8: i32) -> u16x32;
12568    #[link_name = "llvm.x86.avx512.dbpsadbw.256"]
12569    fn vdbpsadbw256(a: u8x32, b: u8x32, imm8: i32) -> u16x16;
12570    #[link_name = "llvm.x86.avx512.dbpsadbw.128"]
12571    fn vdbpsadbw128(a: u8x16, b: u8x16, imm8: i32) -> u16x8;
12572
12573    #[link_name = "llvm.x86.avx512.mask.pmovs.wb.128"]
12574    fn vpmovswb128(a: i16x8, src: i8x16, mask: u8) -> i8x16;
12575
12576    #[link_name = "llvm.x86.avx512.mask.pmovus.wb.128"]
12577    fn vpmovuswb128(a: u16x8, src: u8x16, mask: u8) -> u8x16;
12578
12579    #[link_name = "llvm.x86.avx512.mask.pmovs.wb.mem.512"]
12580    fn vpmovswbmem(mem_addr: *mut i8, a: i16x32, mask: u32);
12581
12582    #[link_name = "llvm.x86.avx512.mask.pmovus.wb.mem.512"]
12583    fn vpmovuswbmem(mem_addr: *mut i8, a: i16x32, mask: u32);
12584}
12585
12586#[cfg(test)]
12587mod tests {
12588    use crate::core_arch::assert_eq_const as assert_eq;
12589
12590    use stdarch_test::simd_test;
12591
12592    use crate::core_arch::x86::*;
12593    use crate::hint::black_box;
12594    use crate::mem::{self};
12595
12596    #[simd_test(enable = "avx512bw")]
12597    const fn test_mm512_abs_epi16() {
12598        let a = _mm512_set1_epi16(-1);
12599        let r = _mm512_abs_epi16(a);
12600        let e = _mm512_set1_epi16(1);
12601        assert_eq_m512i(r, e);
12602    }
12603
12604    #[simd_test(enable = "avx512bw")]
12605    const fn test_mm512_mask_abs_epi16() {
12606        let a = _mm512_set1_epi16(-1);
12607        let r = _mm512_mask_abs_epi16(a, 0, a);
12608        assert_eq_m512i(r, a);
12609        let r = _mm512_mask_abs_epi16(a, 0b00000000_11111111_00000000_11111111, a);
12610        #[rustfmt::skip]
12611        let e = _mm512_set_epi16(-1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1,
12612                                 -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1);
12613        assert_eq_m512i(r, e);
12614    }
12615
12616    #[simd_test(enable = "avx512bw")]
12617    const fn test_mm512_maskz_abs_epi16() {
12618        let a = _mm512_set1_epi16(-1);
12619        let r = _mm512_maskz_abs_epi16(0, a);
12620        assert_eq_m512i(r, _mm512_setzero_si512());
12621        let r = _mm512_maskz_abs_epi16(0b00000000_11111111_00000000_11111111, a);
12622        #[rustfmt::skip]
12623        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
12624                                  0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
12625        assert_eq_m512i(r, e);
12626    }
12627
12628    #[simd_test(enable = "avx512bw,avx512vl")]
12629    const fn test_mm256_mask_abs_epi16() {
12630        let a = _mm256_set1_epi16(-1);
12631        let r = _mm256_mask_abs_epi16(a, 0, a);
12632        assert_eq_m256i(r, a);
12633        let r = _mm256_mask_abs_epi16(a, 0b00000000_11111111, a);
12634        let e = _mm256_set_epi16(-1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1);
12635        assert_eq_m256i(r, e);
12636    }
12637
12638    #[simd_test(enable = "avx512bw,avx512vl")]
12639    const fn test_mm256_maskz_abs_epi16() {
12640        let a = _mm256_set1_epi16(-1);
12641        let r = _mm256_maskz_abs_epi16(0, a);
12642        assert_eq_m256i(r, _mm256_setzero_si256());
12643        let r = _mm256_maskz_abs_epi16(0b00000000_11111111, a);
12644        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
12645        assert_eq_m256i(r, e);
12646    }
12647
12648    #[simd_test(enable = "avx512bw,avx512vl")]
12649    const fn test_mm_mask_abs_epi16() {
12650        let a = _mm_set1_epi16(-1);
12651        let r = _mm_mask_abs_epi16(a, 0, a);
12652        assert_eq_m128i(r, a);
12653        let r = _mm_mask_abs_epi16(a, 0b00001111, a);
12654        let e = _mm_set_epi16(-1, -1, -1, -1, 1, 1, 1, 1);
12655        assert_eq_m128i(r, e);
12656    }
12657
12658    #[simd_test(enable = "avx512bw,avx512vl")]
12659    const fn test_mm_maskz_abs_epi16() {
12660        let a = _mm_set1_epi16(-1);
12661        let r = _mm_maskz_abs_epi16(0, a);
12662        assert_eq_m128i(r, _mm_setzero_si128());
12663        let r = _mm_maskz_abs_epi16(0b00001111, a);
12664        let e = _mm_set_epi16(0, 0, 0, 0, 1, 1, 1, 1);
12665        assert_eq_m128i(r, e);
12666    }
12667
12668    #[simd_test(enable = "avx512bw")]
12669    const fn test_mm512_abs_epi8() {
12670        let a = _mm512_set1_epi8(-1);
12671        let r = _mm512_abs_epi8(a);
12672        let e = _mm512_set1_epi8(1);
12673        assert_eq_m512i(r, e);
12674    }
12675
12676    #[simd_test(enable = "avx512bw")]
12677    const fn test_mm512_mask_abs_epi8() {
12678        let a = _mm512_set1_epi8(-1);
12679        let r = _mm512_mask_abs_epi8(a, 0, a);
12680        assert_eq_m512i(r, a);
12681        let r = _mm512_mask_abs_epi8(
12682            a,
12683            0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
12684            a,
12685        );
12686        #[rustfmt::skip]
12687        let e = _mm512_set_epi8(-1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1,
12688                                -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1,
12689                                -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1,
12690                                -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1);
12691        assert_eq_m512i(r, e);
12692    }
12693
12694    #[simd_test(enable = "avx512bw")]
12695    const fn test_mm512_maskz_abs_epi8() {
12696        let a = _mm512_set1_epi8(-1);
12697        let r = _mm512_maskz_abs_epi8(0, a);
12698        assert_eq_m512i(r, _mm512_setzero_si512());
12699        let r = _mm512_maskz_abs_epi8(
12700            0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
12701            a,
12702        );
12703        #[rustfmt::skip]
12704        let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
12705                                0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
12706                                0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
12707                                0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
12708        assert_eq_m512i(r, e);
12709    }
12710
12711    #[simd_test(enable = "avx512bw,avx512vl")]
12712    const fn test_mm256_mask_abs_epi8() {
12713        let a = _mm256_set1_epi8(-1);
12714        let r = _mm256_mask_abs_epi8(a, 0, a);
12715        assert_eq_m256i(r, a);
12716        let r = _mm256_mask_abs_epi8(a, 0b00000000_11111111_00000000_11111111, a);
12717        #[rustfmt::skip]
12718        let e = _mm256_set_epi8(-1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1,
12719                                -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1);
12720        assert_eq_m256i(r, e);
12721    }
12722
12723    #[simd_test(enable = "avx512bw,avx512vl")]
12724    const fn test_mm256_maskz_abs_epi8() {
12725        let a = _mm256_set1_epi8(-1);
12726        let r = _mm256_maskz_abs_epi8(0, a);
12727        assert_eq_m256i(r, _mm256_setzero_si256());
12728        let r = _mm256_maskz_abs_epi8(0b00000000_11111111_00000000_11111111, a);
12729        #[rustfmt::skip]
12730        let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
12731                                0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
12732        assert_eq_m256i(r, e);
12733    }
12734
12735    #[simd_test(enable = "avx512bw,avx512vl")]
12736    const fn test_mm_mask_abs_epi8() {
12737        let a = _mm_set1_epi8(-1);
12738        let r = _mm_mask_abs_epi8(a, 0, a);
12739        assert_eq_m128i(r, a);
12740        let r = _mm_mask_abs_epi8(a, 0b00000000_11111111, a);
12741        let e = _mm_set_epi8(-1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1);
12742        assert_eq_m128i(r, e);
12743    }
12744
12745    #[simd_test(enable = "avx512bw,avx512vl")]
12746    const fn test_mm_maskz_abs_epi8() {
12747        let a = _mm_set1_epi8(-1);
12748        let r = _mm_maskz_abs_epi8(0, a);
12749        assert_eq_m128i(r, _mm_setzero_si128());
12750        let r = _mm_maskz_abs_epi8(0b00000000_11111111, a);
12751        #[rustfmt::skip]
12752        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
12753        assert_eq_m128i(r, e);
12754    }
12755
12756    #[simd_test(enable = "avx512bw")]
12757    const fn test_mm512_add_epi16() {
12758        let a = _mm512_set1_epi16(1);
12759        let b = _mm512_set1_epi16(2);
12760        let r = _mm512_add_epi16(a, b);
12761        let e = _mm512_set1_epi16(3);
12762        assert_eq_m512i(r, e);
12763    }
12764
12765    #[simd_test(enable = "avx512bw")]
12766    const fn test_mm512_mask_add_epi16() {
12767        let a = _mm512_set1_epi16(1);
12768        let b = _mm512_set1_epi16(2);
12769        let r = _mm512_mask_add_epi16(a, 0, a, b);
12770        assert_eq_m512i(r, a);
12771        let r = _mm512_mask_add_epi16(a, 0b00000000_11111111_00000000_11111111, a, b);
12772        #[rustfmt::skip]
12773        let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
12774                                 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3);
12775        assert_eq_m512i(r, e);
12776    }
12777
12778    #[simd_test(enable = "avx512bw")]
12779    const fn test_mm512_maskz_add_epi16() {
12780        let a = _mm512_set1_epi16(1);
12781        let b = _mm512_set1_epi16(2);
12782        let r = _mm512_maskz_add_epi16(0, a, b);
12783        assert_eq_m512i(r, _mm512_setzero_si512());
12784        let r = _mm512_maskz_add_epi16(0b00000000_11111111_00000000_11111111, a, b);
12785        #[rustfmt::skip]
12786        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3,
12787                                 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3);
12788        assert_eq_m512i(r, e);
12789    }
12790
12791    #[simd_test(enable = "avx512bw,avx512vl")]
12792    const fn test_mm256_mask_add_epi16() {
12793        let a = _mm256_set1_epi16(1);
12794        let b = _mm256_set1_epi16(2);
12795        let r = _mm256_mask_add_epi16(a, 0, a, b);
12796        assert_eq_m256i(r, a);
12797        let r = _mm256_mask_add_epi16(a, 0b00000000_11111111, a, b);
12798        let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3);
12799        assert_eq_m256i(r, e);
12800    }
12801
12802    #[simd_test(enable = "avx512bw,avx512vl")]
12803    const fn test_mm256_maskz_add_epi16() {
12804        let a = _mm256_set1_epi16(1);
12805        let b = _mm256_set1_epi16(2);
12806        let r = _mm256_maskz_add_epi16(0, a, b);
12807        assert_eq_m256i(r, _mm256_setzero_si256());
12808        let r = _mm256_maskz_add_epi16(0b00000000_11111111, a, b);
12809        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3);
12810        assert_eq_m256i(r, e);
12811    }
12812
12813    #[simd_test(enable = "avx512bw,avx512vl")]
12814    const fn test_mm_mask_add_epi16() {
12815        let a = _mm_set1_epi16(1);
12816        let b = _mm_set1_epi16(2);
12817        let r = _mm_mask_add_epi16(a, 0, a, b);
12818        assert_eq_m128i(r, a);
12819        let r = _mm_mask_add_epi16(a, 0b00001111, a, b);
12820        let e = _mm_set_epi16(1, 1, 1, 1, 3, 3, 3, 3);
12821        assert_eq_m128i(r, e);
12822    }
12823
12824    #[simd_test(enable = "avx512bw,avx512vl")]
12825    const fn test_mm_maskz_add_epi16() {
12826        let a = _mm_set1_epi16(1);
12827        let b = _mm_set1_epi16(2);
12828        let r = _mm_maskz_add_epi16(0, a, b);
12829        assert_eq_m128i(r, _mm_setzero_si128());
12830        let r = _mm_maskz_add_epi16(0b00001111, a, b);
12831        let e = _mm_set_epi16(0, 0, 0, 0, 3, 3, 3, 3);
12832        assert_eq_m128i(r, e);
12833    }
12834
12835    #[simd_test(enable = "avx512bw")]
12836    const fn test_mm512_add_epi8() {
12837        let a = _mm512_set1_epi8(1);
12838        let b = _mm512_set1_epi8(2);
12839        let r = _mm512_add_epi8(a, b);
12840        let e = _mm512_set1_epi8(3);
12841        assert_eq_m512i(r, e);
12842    }
12843
12844    #[simd_test(enable = "avx512bw")]
12845    const fn test_mm512_mask_add_epi8() {
12846        let a = _mm512_set1_epi8(1);
12847        let b = _mm512_set1_epi8(2);
12848        let r = _mm512_mask_add_epi8(a, 0, a, b);
12849        assert_eq_m512i(r, a);
12850        let r = _mm512_mask_add_epi8(
12851            a,
12852            0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
12853            a,
12854            b,
12855        );
12856        #[rustfmt::skip]
12857        let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
12858                                1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
12859                                1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
12860                                1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3);
12861        assert_eq_m512i(r, e);
12862    }
12863
12864    #[simd_test(enable = "avx512bw")]
12865    const fn test_mm512_maskz_add_epi8() {
12866        let a = _mm512_set1_epi8(1);
12867        let b = _mm512_set1_epi8(2);
12868        let r = _mm512_maskz_add_epi8(0, a, b);
12869        assert_eq_m512i(r, _mm512_setzero_si512());
12870        let r = _mm512_maskz_add_epi8(
12871            0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
12872            a,
12873            b,
12874        );
12875        #[rustfmt::skip]
12876        let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3,
12877                                0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3,
12878                                0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3,
12879                                0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3);
12880        assert_eq_m512i(r, e);
12881    }
12882
12883    #[simd_test(enable = "avx512bw,avx512vl")]
12884    const fn test_mm256_mask_add_epi8() {
12885        let a = _mm256_set1_epi8(1);
12886        let b = _mm256_set1_epi8(2);
12887        let r = _mm256_mask_add_epi8(a, 0, a, b);
12888        assert_eq_m256i(r, a);
12889        let r = _mm256_mask_add_epi8(a, 0b00000000_11111111_00000000_11111111, a, b);
12890        #[rustfmt::skip]
12891        let e = _mm256_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
12892                                1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3);
12893        assert_eq_m256i(r, e);
12894    }
12895
12896    #[simd_test(enable = "avx512bw,avx512vl")]
12897    const fn test_mm256_maskz_add_epi8() {
12898        let a = _mm256_set1_epi8(1);
12899        let b = _mm256_set1_epi8(2);
12900        let r = _mm256_maskz_add_epi8(0, a, b);
12901        assert_eq_m256i(r, _mm256_setzero_si256());
12902        let r = _mm256_maskz_add_epi8(0b00000000_11111111_00000000_11111111, a, b);
12903        #[rustfmt::skip]
12904        let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3,
12905                                0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3);
12906        assert_eq_m256i(r, e);
12907    }
12908
12909    #[simd_test(enable = "avx512bw,avx512vl")]
12910    const fn test_mm_mask_add_epi8() {
12911        let a = _mm_set1_epi8(1);
12912        let b = _mm_set1_epi8(2);
12913        let r = _mm_mask_add_epi8(a, 0, a, b);
12914        assert_eq_m128i(r, a);
12915        let r = _mm_mask_add_epi8(a, 0b00000000_11111111, a, b);
12916        let e = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3);
12917        assert_eq_m128i(r, e);
12918    }
12919
12920    #[simd_test(enable = "avx512bw,avx512vl")]
12921    const fn test_mm_maskz_add_epi8() {
12922        let a = _mm_set1_epi8(1);
12923        let b = _mm_set1_epi8(2);
12924        let r = _mm_maskz_add_epi8(0, a, b);
12925        assert_eq_m128i(r, _mm_setzero_si128());
12926        let r = _mm_maskz_add_epi8(0b00000000_11111111, a, b);
12927        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3);
12928        assert_eq_m128i(r, e);
12929    }
12930
12931    #[simd_test(enable = "avx512bw")]
12932    const fn test_mm512_adds_epu16() {
12933        let a = _mm512_set1_epi16(1);
12934        let b = _mm512_set1_epi16(u16::MAX as i16);
12935        let r = _mm512_adds_epu16(a, b);
12936        let e = _mm512_set1_epi16(u16::MAX as i16);
12937        assert_eq_m512i(r, e);
12938    }
12939
12940    #[simd_test(enable = "avx512bw")]
12941    const fn test_mm512_mask_adds_epu16() {
12942        let a = _mm512_set1_epi16(1);
12943        let b = _mm512_set1_epi16(u16::MAX as i16);
12944        let r = _mm512_mask_adds_epu16(a, 0, a, b);
12945        assert_eq_m512i(r, a);
12946        let r = _mm512_mask_adds_epu16(a, 0b00000000_00000000_00000000_00001111, a, b);
12947        #[rustfmt::skip]
12948        let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
12949                                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, u16::MAX as i16, u16::MAX as i16, u16::MAX as i16, u16::MAX as i16);
12950        assert_eq_m512i(r, e);
12951    }
12952
12953    #[simd_test(enable = "avx512bw")]
12954    const fn test_mm512_maskz_adds_epu16() {
12955        let a = _mm512_set1_epi16(1);
12956        let b = _mm512_set1_epi16(u16::MAX as i16);
12957        let r = _mm512_maskz_adds_epu16(0, a, b);
12958        assert_eq_m512i(r, _mm512_setzero_si512());
12959        let r = _mm512_maskz_adds_epu16(0b00000000_00000000_00000000_00001111, a, b);
12960        #[rustfmt::skip]
12961        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
12962                                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, u16::MAX as i16, u16::MAX as i16, u16::MAX as i16, u16::MAX as i16);
12963        assert_eq_m512i(r, e);
12964    }
12965
12966    #[simd_test(enable = "avx512bw,avx512vl")]
12967    const fn test_mm256_mask_adds_epu16() {
12968        let a = _mm256_set1_epi16(1);
12969        let b = _mm256_set1_epi16(u16::MAX as i16);
12970        let r = _mm256_mask_adds_epu16(a, 0, a, b);
12971        assert_eq_m256i(r, a);
12972        let r = _mm256_mask_adds_epu16(a, 0b00000000_00001111, a, b);
12973        #[rustfmt::skip]
12974        let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, u16::MAX as i16, u16::MAX as i16, u16::MAX as i16, u16::MAX as i16);
12975        assert_eq_m256i(r, e);
12976    }
12977
12978    #[simd_test(enable = "avx512bw,avx512vl")]
12979    const fn test_mm256_maskz_adds_epu16() {
12980        let a = _mm256_set1_epi16(1);
12981        let b = _mm256_set1_epi16(u16::MAX as i16);
12982        let r = _mm256_maskz_adds_epu16(0, a, b);
12983        assert_eq_m256i(r, _mm256_setzero_si256());
12984        let r = _mm256_maskz_adds_epu16(0b00000000_00001111, a, b);
12985        #[rustfmt::skip]
12986        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, u16::MAX as i16, u16::MAX as i16, u16::MAX as i16, u16::MAX as i16);
12987        assert_eq_m256i(r, e);
12988    }
12989
12990    #[simd_test(enable = "avx512bw,avx512vl")]
12991    const fn test_mm_mask_adds_epu16() {
12992        let a = _mm_set1_epi16(1);
12993        let b = _mm_set1_epi16(u16::MAX as i16);
12994        let r = _mm_mask_adds_epu16(a, 0, a, b);
12995        assert_eq_m128i(r, a);
12996        let r = _mm_mask_adds_epu16(a, 0b00001111, a, b);
12997        #[rustfmt::skip]
12998        let e = _mm_set_epi16(1, 1, 1, 1, u16::MAX as i16, u16::MAX as i16, u16::MAX as i16, u16::MAX as i16);
12999        assert_eq_m128i(r, e);
13000    }
13001
13002    #[simd_test(enable = "avx512bw,avx512vl")]
13003    const fn test_mm_maskz_adds_epu16() {
13004        let a = _mm_set1_epi16(1);
13005        let b = _mm_set1_epi16(u16::MAX as i16);
13006        let r = _mm_maskz_adds_epu16(0, a, b);
13007        assert_eq_m128i(r, _mm_setzero_si128());
13008        let r = _mm_maskz_adds_epu16(0b00001111, a, b);
13009        #[rustfmt::skip]
13010        let e = _mm_set_epi16(0, 0, 0, 0, u16::MAX as i16, u16::MAX as i16, u16::MAX as i16, u16::MAX as i16);
13011        assert_eq_m128i(r, e);
13012    }
13013
13014    #[simd_test(enable = "avx512bw")]
13015    const fn test_mm512_adds_epu8() {
13016        let a = _mm512_set1_epi8(1);
13017        let b = _mm512_set1_epi8(u8::MAX as i8);
13018        let r = _mm512_adds_epu8(a, b);
13019        let e = _mm512_set1_epi8(u8::MAX as i8);
13020        assert_eq_m512i(r, e);
13021    }
13022
13023    #[simd_test(enable = "avx512bw")]
13024    const fn test_mm512_mask_adds_epu8() {
13025        let a = _mm512_set1_epi8(1);
13026        let b = _mm512_set1_epi8(u8::MAX as i8);
13027        let r = _mm512_mask_adds_epu8(a, 0, a, b);
13028        assert_eq_m512i(r, a);
13029        let r = _mm512_mask_adds_epu8(
13030            a,
13031            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
13032            a,
13033            b,
13034        );
13035        #[rustfmt::skip]
13036        let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13037                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13038                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13039                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8);
13040        assert_eq_m512i(r, e);
13041    }
13042
13043    #[simd_test(enable = "avx512bw")]
13044    const fn test_mm512_maskz_adds_epu8() {
13045        let a = _mm512_set1_epi8(1);
13046        let b = _mm512_set1_epi8(u8::MAX as i8);
13047        let r = _mm512_maskz_adds_epu8(0, a, b);
13048        assert_eq_m512i(r, _mm512_setzero_si512());
13049        let r = _mm512_maskz_adds_epu8(
13050            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
13051            a,
13052            b,
13053        );
13054        #[rustfmt::skip]
13055        let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13056                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13057                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13058                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8);
13059        assert_eq_m512i(r, e);
13060    }
13061
13062    #[simd_test(enable = "avx512bw,avx512vl")]
13063    const fn test_mm256_mask_adds_epu8() {
13064        let a = _mm256_set1_epi8(1);
13065        let b = _mm256_set1_epi8(u8::MAX as i8);
13066        let r = _mm256_mask_adds_epu8(a, 0, a, b);
13067        assert_eq_m256i(r, a);
13068        let r = _mm256_mask_adds_epu8(a, 0b00000000_00000000_00000000_00001111, a, b);
13069        #[rustfmt::skip]
13070        let e = _mm256_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13071                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8);
13072        assert_eq_m256i(r, e);
13073    }
13074
13075    #[simd_test(enable = "avx512bw,avx512vl")]
13076    const fn test_mm256_maskz_adds_epu8() {
13077        let a = _mm256_set1_epi8(1);
13078        let b = _mm256_set1_epi8(u8::MAX as i8);
13079        let r = _mm256_maskz_adds_epu8(0, a, b);
13080        assert_eq_m256i(r, _mm256_setzero_si256());
13081        let r = _mm256_maskz_adds_epu8(0b00000000_00000000_00000000_00001111, a, b);
13082        #[rustfmt::skip]
13083        let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13084                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8);
13085        assert_eq_m256i(r, e);
13086    }
13087
13088    #[simd_test(enable = "avx512bw,avx512vl")]
13089    const fn test_mm_mask_adds_epu8() {
13090        let a = _mm_set1_epi8(1);
13091        let b = _mm_set1_epi8(u8::MAX as i8);
13092        let r = _mm_mask_adds_epu8(a, 0, a, b);
13093        assert_eq_m128i(r, a);
13094        let r = _mm_mask_adds_epu8(a, 0b00000000_00001111, a, b);
13095        #[rustfmt::skip]
13096        let e = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8);
13097        assert_eq_m128i(r, e);
13098    }
13099
13100    #[simd_test(enable = "avx512bw,avx512vl")]
13101    const fn test_mm_maskz_adds_epu8() {
13102        let a = _mm_set1_epi8(1);
13103        let b = _mm_set1_epi8(u8::MAX as i8);
13104        let r = _mm_maskz_adds_epu8(0, a, b);
13105        assert_eq_m128i(r, _mm_setzero_si128());
13106        let r = _mm_maskz_adds_epu8(0b00000000_00001111, a, b);
13107        #[rustfmt::skip]
13108        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8);
13109        assert_eq_m128i(r, e);
13110    }
13111
13112    #[simd_test(enable = "avx512bw")]
13113    const fn test_mm512_adds_epi16() {
13114        let a = _mm512_set1_epi16(1);
13115        let b = _mm512_set1_epi16(i16::MAX);
13116        let r = _mm512_adds_epi16(a, b);
13117        let e = _mm512_set1_epi16(i16::MAX);
13118        assert_eq_m512i(r, e);
13119    }
13120
13121    #[simd_test(enable = "avx512bw")]
13122    const fn test_mm512_mask_adds_epi16() {
13123        let a = _mm512_set1_epi16(1);
13124        let b = _mm512_set1_epi16(i16::MAX);
13125        let r = _mm512_mask_adds_epi16(a, 0, a, b);
13126        assert_eq_m512i(r, a);
13127        let r = _mm512_mask_adds_epi16(a, 0b00000000_00000000_00000000_00001111, a, b);
13128        #[rustfmt::skip]
13129        let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13130                                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
13131        assert_eq_m512i(r, e);
13132    }
13133
13134    #[simd_test(enable = "avx512bw")]
13135    const fn test_mm512_maskz_adds_epi16() {
13136        let a = _mm512_set1_epi16(1);
13137        let b = _mm512_set1_epi16(i16::MAX);
13138        let r = _mm512_maskz_adds_epi16(0, a, b);
13139        assert_eq_m512i(r, _mm512_setzero_si512());
13140        let r = _mm512_maskz_adds_epi16(0b00000000_00000000_00000000_00001111, a, b);
13141        #[rustfmt::skip]
13142        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13143                                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
13144        assert_eq_m512i(r, e);
13145    }
13146
13147    #[simd_test(enable = "avx512bw,avx512vl")]
13148    const fn test_mm256_mask_adds_epi16() {
13149        let a = _mm256_set1_epi16(1);
13150        let b = _mm256_set1_epi16(i16::MAX);
13151        let r = _mm256_mask_adds_epi16(a, 0, a, b);
13152        assert_eq_m256i(r, a);
13153        let r = _mm256_mask_adds_epi16(a, 0b00000000_00001111, a, b);
13154        #[rustfmt::skip]
13155        let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
13156        assert_eq_m256i(r, e);
13157    }
13158
13159    #[simd_test(enable = "avx512bw,avx512vl")]
13160    const fn test_mm256_maskz_adds_epi16() {
13161        let a = _mm256_set1_epi16(1);
13162        let b = _mm256_set1_epi16(i16::MAX);
13163        let r = _mm256_maskz_adds_epi16(0, a, b);
13164        assert_eq_m256i(r, _mm256_setzero_si256());
13165        let r = _mm256_maskz_adds_epi16(0b00000000_00001111, a, b);
13166        #[rustfmt::skip]
13167        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
13168        assert_eq_m256i(r, e);
13169    }
13170
13171    #[simd_test(enable = "avx512bw,avx512vl")]
13172    const fn test_mm_mask_adds_epi16() {
13173        let a = _mm_set1_epi16(1);
13174        let b = _mm_set1_epi16(i16::MAX);
13175        let r = _mm_mask_adds_epi16(a, 0, a, b);
13176        assert_eq_m128i(r, a);
13177        let r = _mm_mask_adds_epi16(a, 0b00001111, a, b);
13178        let e = _mm_set_epi16(1, 1, 1, 1, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
13179        assert_eq_m128i(r, e);
13180    }
13181
13182    #[simd_test(enable = "avx512bw,avx512vl")]
13183    const fn test_mm_maskz_adds_epi16() {
13184        let a = _mm_set1_epi16(1);
13185        let b = _mm_set1_epi16(i16::MAX);
13186        let r = _mm_maskz_adds_epi16(0, a, b);
13187        assert_eq_m128i(r, _mm_setzero_si128());
13188        let r = _mm_maskz_adds_epi16(0b00001111, a, b);
13189        let e = _mm_set_epi16(0, 0, 0, 0, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
13190        assert_eq_m128i(r, e);
13191    }
13192
13193    #[simd_test(enable = "avx512bw")]
13194    const fn test_mm512_adds_epi8() {
13195        let a = _mm512_set1_epi8(1);
13196        let b = _mm512_set1_epi8(i8::MAX);
13197        let r = _mm512_adds_epi8(a, b);
13198        let e = _mm512_set1_epi8(i8::MAX);
13199        assert_eq_m512i(r, e);
13200    }
13201
13202    #[simd_test(enable = "avx512bw")]
13203    const fn test_mm512_mask_adds_epi8() {
13204        let a = _mm512_set1_epi8(1);
13205        let b = _mm512_set1_epi8(i8::MAX);
13206        let r = _mm512_mask_adds_epi8(a, 0, a, b);
13207        assert_eq_m512i(r, a);
13208        let r = _mm512_mask_adds_epi8(
13209            a,
13210            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
13211            a,
13212            b,
13213        );
13214        #[rustfmt::skip]
13215        let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13216                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13217                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13218                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
13219        assert_eq_m512i(r, e);
13220    }
13221
13222    #[simd_test(enable = "avx512bw")]
13223    const fn test_mm512_maskz_adds_epi8() {
13224        let a = _mm512_set1_epi8(1);
13225        let b = _mm512_set1_epi8(i8::MAX);
13226        let r = _mm512_maskz_adds_epi8(0, a, b);
13227        assert_eq_m512i(r, _mm512_setzero_si512());
13228        let r = _mm512_maskz_adds_epi8(
13229            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
13230            a,
13231            b,
13232        );
13233        #[rustfmt::skip]
13234        let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13235                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13236                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13237                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
13238        assert_eq_m512i(r, e);
13239    }
13240
13241    #[simd_test(enable = "avx512bw,avx512vl")]
13242    const fn test_mm256_mask_adds_epi8() {
13243        let a = _mm256_set1_epi8(1);
13244        let b = _mm256_set1_epi8(i8::MAX);
13245        let r = _mm256_mask_adds_epi8(a, 0, a, b);
13246        assert_eq_m256i(r, a);
13247        let r = _mm256_mask_adds_epi8(a, 0b00000000_00000000_00000000_00001111, a, b);
13248        #[rustfmt::skip]
13249        let e = _mm256_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13250                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
13251        assert_eq_m256i(r, e);
13252    }
13253
13254    #[simd_test(enable = "avx512bw,avx512vl")]
13255    const fn test_mm256_maskz_adds_epi8() {
13256        let a = _mm256_set1_epi8(1);
13257        let b = _mm256_set1_epi8(i8::MAX);
13258        let r = _mm256_maskz_adds_epi8(0, a, b);
13259        assert_eq_m256i(r, _mm256_setzero_si256());
13260        let r = _mm256_maskz_adds_epi8(0b00000000_00000000_00000000_00001111, a, b);
13261        #[rustfmt::skip]
13262        let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13263                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
13264        assert_eq_m256i(r, e);
13265    }
13266
13267    #[simd_test(enable = "avx512bw,avx512vl")]
13268    const fn test_mm_mask_adds_epi8() {
13269        let a = _mm_set1_epi8(1);
13270        let b = _mm_set1_epi8(i8::MAX);
13271        let r = _mm_mask_adds_epi8(a, 0, a, b);
13272        assert_eq_m128i(r, a);
13273        let r = _mm_mask_adds_epi8(a, 0b00000000_00001111, a, b);
13274        #[rustfmt::skip]
13275        let e = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
13276        assert_eq_m128i(r, e);
13277    }
13278
13279    #[simd_test(enable = "avx512bw,avx512vl")]
13280    const fn test_mm_maskz_adds_epi8() {
13281        let a = _mm_set1_epi8(1);
13282        let b = _mm_set1_epi8(i8::MAX);
13283        let r = _mm_maskz_adds_epi8(0, a, b);
13284        assert_eq_m128i(r, _mm_setzero_si128());
13285        let r = _mm_maskz_adds_epi8(0b00000000_00001111, a, b);
13286        #[rustfmt::skip]
13287        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
13288        assert_eq_m128i(r, e);
13289    }
13290
13291    #[simd_test(enable = "avx512bw")]
13292    const fn test_mm512_sub_epi16() {
13293        let a = _mm512_set1_epi16(1);
13294        let b = _mm512_set1_epi16(2);
13295        let r = _mm512_sub_epi16(a, b);
13296        let e = _mm512_set1_epi16(-1);
13297        assert_eq_m512i(r, e);
13298    }
13299
13300    #[simd_test(enable = "avx512bw")]
13301    const fn test_mm512_mask_sub_epi16() {
13302        let a = _mm512_set1_epi16(1);
13303        let b = _mm512_set1_epi16(2);
13304        let r = _mm512_mask_sub_epi16(a, 0, a, b);
13305        assert_eq_m512i(r, a);
13306        let r = _mm512_mask_sub_epi16(a, 0b00000000_11111111_00000000_11111111, a, b);
13307        #[rustfmt::skip]
13308        let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1,
13309                                 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1);
13310        assert_eq_m512i(r, e);
13311    }
13312
13313    #[simd_test(enable = "avx512bw")]
13314    const fn test_mm512_maskz_sub_epi16() {
13315        let a = _mm512_set1_epi16(1);
13316        let b = _mm512_set1_epi16(2);
13317        let r = _mm512_maskz_sub_epi16(0, a, b);
13318        assert_eq_m512i(r, _mm512_setzero_si512());
13319        let r = _mm512_maskz_sub_epi16(0b00000000_11111111_00000000_11111111, a, b);
13320        #[rustfmt::skip]
13321        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1,
13322                                 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
13323        assert_eq_m512i(r, e);
13324    }
13325
13326    #[simd_test(enable = "avx512bw,avx512vl")]
13327    const fn test_mm256_mask_sub_epi16() {
13328        let a = _mm256_set1_epi16(1);
13329        let b = _mm256_set1_epi16(2);
13330        let r = _mm256_mask_sub_epi16(a, 0, a, b);
13331        assert_eq_m256i(r, a);
13332        let r = _mm256_mask_sub_epi16(a, 0b00000000_11111111, a, b);
13333        let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1);
13334        assert_eq_m256i(r, e);
13335    }
13336
13337    #[simd_test(enable = "avx512bw,avx512vl")]
13338    const fn test_mm256_maskz_sub_epi16() {
13339        let a = _mm256_set1_epi16(1);
13340        let b = _mm256_set1_epi16(2);
13341        let r = _mm256_maskz_sub_epi16(0, a, b);
13342        assert_eq_m256i(r, _mm256_setzero_si256());
13343        let r = _mm256_maskz_sub_epi16(0b00000000_11111111, a, b);
13344        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
13345        assert_eq_m256i(r, e);
13346    }
13347
13348    #[simd_test(enable = "avx512bw,avx512vl")]
13349    const fn test_mm_mask_sub_epi16() {
13350        let a = _mm_set1_epi16(1);
13351        let b = _mm_set1_epi16(2);
13352        let r = _mm_mask_sub_epi16(a, 0, a, b);
13353        assert_eq_m128i(r, a);
13354        let r = _mm_mask_sub_epi16(a, 0b00001111, a, b);
13355        let e = _mm_set_epi16(1, 1, 1, 1, -1, -1, -1, -1);
13356        assert_eq_m128i(r, e);
13357    }
13358
13359    #[simd_test(enable = "avx512bw,avx512vl")]
13360    const fn test_mm_maskz_sub_epi16() {
13361        let a = _mm_set1_epi16(1);
13362        let b = _mm_set1_epi16(2);
13363        let r = _mm_maskz_sub_epi16(0, a, b);
13364        assert_eq_m128i(r, _mm_setzero_si128());
13365        let r = _mm_maskz_sub_epi16(0b00001111, a, b);
13366        let e = _mm_set_epi16(0, 0, 0, 0, -1, -1, -1, -1);
13367        assert_eq_m128i(r, e);
13368    }
13369
13370    #[simd_test(enable = "avx512bw")]
13371    const fn test_mm512_sub_epi8() {
13372        let a = _mm512_set1_epi8(1);
13373        let b = _mm512_set1_epi8(2);
13374        let r = _mm512_sub_epi8(a, b);
13375        let e = _mm512_set1_epi8(-1);
13376        assert_eq_m512i(r, e);
13377    }
13378
13379    #[simd_test(enable = "avx512bw")]
13380    const fn test_mm512_mask_sub_epi8() {
13381        let a = _mm512_set1_epi8(1);
13382        let b = _mm512_set1_epi8(2);
13383        let r = _mm512_mask_sub_epi8(a, 0, a, b);
13384        assert_eq_m512i(r, a);
13385        let r = _mm512_mask_sub_epi8(
13386            a,
13387            0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
13388            a,
13389            b,
13390        );
13391        #[rustfmt::skip]
13392        let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1,
13393                                1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1,
13394                                1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1,
13395                                1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1);
13396        assert_eq_m512i(r, e);
13397    }
13398
13399    #[simd_test(enable = "avx512bw")]
13400    const fn test_mm512_maskz_sub_epi8() {
13401        let a = _mm512_set1_epi8(1);
13402        let b = _mm512_set1_epi8(2);
13403        let r = _mm512_maskz_sub_epi8(0, a, b);
13404        assert_eq_m512i(r, _mm512_setzero_si512());
13405        let r = _mm512_maskz_sub_epi8(
13406            0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
13407            a,
13408            b,
13409        );
13410        #[rustfmt::skip]
13411        let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1,
13412                                0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1,
13413                                0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1,
13414                                0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
13415        assert_eq_m512i(r, e);
13416    }
13417
13418    #[simd_test(enable = "avx512bw,avx512vl")]
13419    const fn test_mm256_mask_sub_epi8() {
13420        let a = _mm256_set1_epi8(1);
13421        let b = _mm256_set1_epi8(2);
13422        let r = _mm256_mask_sub_epi8(a, 0, a, b);
13423        assert_eq_m256i(r, a);
13424        let r = _mm256_mask_sub_epi8(a, 0b00000000_11111111_00000000_11111111, a, b);
13425        #[rustfmt::skip]
13426        let e = _mm256_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1,
13427                                1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1);
13428        assert_eq_m256i(r, e);
13429    }
13430
13431    #[simd_test(enable = "avx512bw,avx512vl")]
13432    const fn test_mm256_maskz_sub_epi8() {
13433        let a = _mm256_set1_epi8(1);
13434        let b = _mm256_set1_epi8(2);
13435        let r = _mm256_maskz_sub_epi8(0, a, b);
13436        assert_eq_m256i(r, _mm256_setzero_si256());
13437        let r = _mm256_maskz_sub_epi8(0b00000000_11111111_00000000_11111111, a, b);
13438        #[rustfmt::skip]
13439        let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1,
13440                                0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
13441        assert_eq_m256i(r, e);
13442    }
13443
13444    #[simd_test(enable = "avx512bw,avx512vl")]
13445    const fn test_mm_mask_sub_epi8() {
13446        let a = _mm_set1_epi8(1);
13447        let b = _mm_set1_epi8(2);
13448        let r = _mm_mask_sub_epi8(a, 0, a, b);
13449        assert_eq_m128i(r, a);
13450        let r = _mm_mask_sub_epi8(a, 0b00000000_11111111, a, b);
13451        let e = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1);
13452        assert_eq_m128i(r, e);
13453    }
13454
13455    #[simd_test(enable = "avx512bw,avx512vl")]
13456    const fn test_mm_maskz_sub_epi8() {
13457        let a = _mm_set1_epi8(1);
13458        let b = _mm_set1_epi8(2);
13459        let r = _mm_maskz_sub_epi8(0, a, b);
13460        assert_eq_m128i(r, _mm_setzero_si128());
13461        let r = _mm_maskz_sub_epi8(0b00000000_11111111, a, b);
13462        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
13463        assert_eq_m128i(r, e);
13464    }
13465
13466    #[simd_test(enable = "avx512bw")]
13467    const fn test_mm512_subs_epu16() {
13468        let a = _mm512_set1_epi16(1);
13469        let b = _mm512_set1_epi16(u16::MAX as i16);
13470        let r = _mm512_subs_epu16(a, b);
13471        let e = _mm512_set1_epi16(0);
13472        assert_eq_m512i(r, e);
13473    }
13474
13475    #[simd_test(enable = "avx512bw")]
13476    const fn test_mm512_mask_subs_epu16() {
13477        let a = _mm512_set1_epi16(1);
13478        let b = _mm512_set1_epi16(u16::MAX as i16);
13479        let r = _mm512_mask_subs_epu16(a, 0, a, b);
13480        assert_eq_m512i(r, a);
13481        let r = _mm512_mask_subs_epu16(a, 0b00000000_00000000_00000000_00001111, a, b);
13482        #[rustfmt::skip]
13483        let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13484                                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
13485        assert_eq_m512i(r, e);
13486    }
13487
13488    #[simd_test(enable = "avx512bw")]
13489    const fn test_mm512_maskz_subs_epu16() {
13490        let a = _mm512_set1_epi16(1);
13491        let b = _mm512_set1_epi16(u16::MAX as i16);
13492        let r = _mm512_maskz_subs_epu16(0, a, b);
13493        assert_eq_m512i(r, _mm512_setzero_si512());
13494        let r = _mm512_maskz_subs_epu16(0b00000000_00000000_00000000_00001111, a, b);
13495        #[rustfmt::skip]
13496        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13497                                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
13498        assert_eq_m512i(r, e);
13499    }
13500
13501    #[simd_test(enable = "avx512bw,avx512vl")]
13502    const fn test_mm256_mask_subs_epu16() {
13503        let a = _mm256_set1_epi16(1);
13504        let b = _mm256_set1_epi16(u16::MAX as i16);
13505        let r = _mm256_mask_subs_epu16(a, 0, a, b);
13506        assert_eq_m256i(r, a);
13507        let r = _mm256_mask_subs_epu16(a, 0b00000000_00001111, a, b);
13508        let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
13509        assert_eq_m256i(r, e);
13510    }
13511
13512    #[simd_test(enable = "avx512bw,avx512vl")]
13513    const fn test_mm256_maskz_subs_epu16() {
13514        let a = _mm256_set1_epi16(1);
13515        let b = _mm256_set1_epi16(u16::MAX as i16);
13516        let r = _mm256_maskz_subs_epu16(0, a, b);
13517        assert_eq_m256i(r, _mm256_setzero_si256());
13518        let r = _mm256_maskz_subs_epu16(0b00000000_00001111, a, b);
13519        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
13520        assert_eq_m256i(r, e);
13521    }
13522
13523    #[simd_test(enable = "avx512bw,avx512vl")]
13524    const fn test_mm_mask_subs_epu16() {
13525        let a = _mm_set1_epi16(1);
13526        let b = _mm_set1_epi16(u16::MAX as i16);
13527        let r = _mm_mask_subs_epu16(a, 0, a, b);
13528        assert_eq_m128i(r, a);
13529        let r = _mm_mask_subs_epu16(a, 0b00001111, a, b);
13530        let e = _mm_set_epi16(1, 1, 1, 1, 0, 0, 0, 0);
13531        assert_eq_m128i(r, e);
13532    }
13533
13534    #[simd_test(enable = "avx512bw,avx512vl")]
13535    const fn test_mm_maskz_subs_epu16() {
13536        let a = _mm_set1_epi16(1);
13537        let b = _mm_set1_epi16(u16::MAX as i16);
13538        let r = _mm_maskz_subs_epu16(0, a, b);
13539        assert_eq_m128i(r, _mm_setzero_si128());
13540        let r = _mm_maskz_subs_epu16(0b00001111, a, b);
13541        let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, 0, 0);
13542        assert_eq_m128i(r, e);
13543    }
13544
13545    #[simd_test(enable = "avx512bw")]
13546    const fn test_mm512_subs_epu8() {
13547        let a = _mm512_set1_epi8(1);
13548        let b = _mm512_set1_epi8(u8::MAX as i8);
13549        let r = _mm512_subs_epu8(a, b);
13550        let e = _mm512_set1_epi8(0);
13551        assert_eq_m512i(r, e);
13552    }
13553
13554    #[simd_test(enable = "avx512bw")]
13555    const fn test_mm512_mask_subs_epu8() {
13556        let a = _mm512_set1_epi8(1);
13557        let b = _mm512_set1_epi8(u8::MAX as i8);
13558        let r = _mm512_mask_subs_epu8(a, 0, a, b);
13559        assert_eq_m512i(r, a);
13560        let r = _mm512_mask_subs_epu8(
13561            a,
13562            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
13563            a,
13564            b,
13565        );
13566        #[rustfmt::skip]
13567        let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13568                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13569                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13570                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
13571        assert_eq_m512i(r, e);
13572    }
13573
13574    #[simd_test(enable = "avx512bw")]
13575    const fn test_mm512_maskz_subs_epu8() {
13576        let a = _mm512_set1_epi8(1);
13577        let b = _mm512_set1_epi8(u8::MAX as i8);
13578        let r = _mm512_maskz_subs_epu8(0, a, b);
13579        assert_eq_m512i(r, _mm512_setzero_si512());
13580        let r = _mm512_maskz_subs_epu8(
13581            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
13582            a,
13583            b,
13584        );
13585        #[rustfmt::skip]
13586        let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13587                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13588                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13589                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
13590        assert_eq_m512i(r, e);
13591    }
13592
13593    #[simd_test(enable = "avx512bw,avx512vl")]
13594    const fn test_mm256_mask_subs_epu8() {
13595        let a = _mm256_set1_epi8(1);
13596        let b = _mm256_set1_epi8(u8::MAX as i8);
13597        let r = _mm256_mask_subs_epu8(a, 0, a, b);
13598        assert_eq_m256i(r, a);
13599        let r = _mm256_mask_subs_epu8(a, 0b00000000_00000000_00000000_00001111, a, b);
13600        #[rustfmt::skip]
13601        let e = _mm256_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13602                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
13603        assert_eq_m256i(r, e);
13604    }
13605
13606    #[simd_test(enable = "avx512bw,avx512vl")]
13607    const fn test_mm256_maskz_subs_epu8() {
13608        let a = _mm256_set1_epi8(1);
13609        let b = _mm256_set1_epi8(u8::MAX as i8);
13610        let r = _mm256_maskz_subs_epu8(0, a, b);
13611        assert_eq_m256i(r, _mm256_setzero_si256());
13612        let r = _mm256_maskz_subs_epu8(0b00000000_00000000_00000000_00001111, a, b);
13613        #[rustfmt::skip]
13614        let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13615                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
13616        assert_eq_m256i(r, e);
13617    }
13618
13619    #[simd_test(enable = "avx512bw,avx512vl")]
13620    const fn test_mm_mask_subs_epu8() {
13621        let a = _mm_set1_epi8(1);
13622        let b = _mm_set1_epi8(u8::MAX as i8);
13623        let r = _mm_mask_subs_epu8(a, 0, a, b);
13624        assert_eq_m128i(r, a);
13625        let r = _mm_mask_subs_epu8(a, 0b00000000_00001111, a, b);
13626        let e = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
13627        assert_eq_m128i(r, e);
13628    }
13629
13630    #[simd_test(enable = "avx512bw,avx512vl")]
13631    const fn test_mm_maskz_subs_epu8() {
13632        let a = _mm_set1_epi8(1);
13633        let b = _mm_set1_epi8(u8::MAX as i8);
13634        let r = _mm_maskz_subs_epu8(0, a, b);
13635        assert_eq_m128i(r, _mm_setzero_si128());
13636        let r = _mm_maskz_subs_epu8(0b00000000_00001111, a, b);
13637        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
13638        assert_eq_m128i(r, e);
13639    }
13640
13641    #[simd_test(enable = "avx512bw")]
13642    const fn test_mm512_subs_epi16() {
13643        let a = _mm512_set1_epi16(-1);
13644        let b = _mm512_set1_epi16(i16::MAX);
13645        let r = _mm512_subs_epi16(a, b);
13646        let e = _mm512_set1_epi16(i16::MIN);
13647        assert_eq_m512i(r, e);
13648    }
13649
13650    #[simd_test(enable = "avx512bw")]
13651    const fn test_mm512_mask_subs_epi16() {
13652        let a = _mm512_set1_epi16(-1);
13653        let b = _mm512_set1_epi16(i16::MAX);
13654        let r = _mm512_mask_subs_epi16(a, 0, a, b);
13655        assert_eq_m512i(r, a);
13656        let r = _mm512_mask_subs_epi16(a, 0b00000000_00000000_00000000_00001111, a, b);
13657        #[rustfmt::skip]
13658        let e = _mm512_set_epi16(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
13659                                 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, i16::MIN, i16::MIN, i16::MIN, i16::MIN);
13660        assert_eq_m512i(r, e);
13661    }
13662
13663    #[simd_test(enable = "avx512bw")]
13664    const fn test_mm512_maskz_subs_epi16() {
13665        let a = _mm512_set1_epi16(-1);
13666        let b = _mm512_set1_epi16(i16::MAX);
13667        let r = _mm512_maskz_subs_epi16(0, a, b);
13668        assert_eq_m512i(r, _mm512_setzero_si512());
13669        let r = _mm512_maskz_subs_epi16(0b00000000_00000000_00000000_00001111, a, b);
13670        #[rustfmt::skip]
13671        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13672                                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i16::MIN, i16::MIN, i16::MIN, i16::MIN);
13673        assert_eq_m512i(r, e);
13674    }
13675
13676    #[simd_test(enable = "avx512bw,avx512vl")]
13677    const fn test_mm256_mask_subs_epi16() {
13678        let a = _mm256_set1_epi16(-1);
13679        let b = _mm256_set1_epi16(i16::MAX);
13680        let r = _mm256_mask_subs_epi16(a, 0, a, b);
13681        assert_eq_m256i(r, a);
13682        let r = _mm256_mask_subs_epi16(a, 0b00000000_00001111, a, b);
13683        #[rustfmt::skip]
13684        let e = _mm256_set_epi16(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, i16::MIN, i16::MIN, i16::MIN, i16::MIN);
13685        assert_eq_m256i(r, e);
13686    }
13687
13688    #[simd_test(enable = "avx512bw,avx512vl")]
13689    const fn test_mm256_maskz_subs_epi16() {
13690        let a = _mm256_set1_epi16(-1);
13691        let b = _mm256_set1_epi16(i16::MAX);
13692        let r = _mm256_maskz_subs_epi16(0, a, b);
13693        assert_eq_m256i(r, _mm256_setzero_si256());
13694        let r = _mm256_maskz_subs_epi16(0b00000000_00001111, a, b);
13695        #[rustfmt::skip]
13696        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i16::MIN, i16::MIN, i16::MIN, i16::MIN);
13697        assert_eq_m256i(r, e);
13698    }
13699
13700    #[simd_test(enable = "avx512bw,avx512vl")]
13701    const fn test_mm_mask_subs_epi16() {
13702        let a = _mm_set1_epi16(-1);
13703        let b = _mm_set1_epi16(i16::MAX);
13704        let r = _mm_mask_subs_epi16(a, 0, a, b);
13705        assert_eq_m128i(r, a);
13706        let r = _mm_mask_subs_epi16(a, 0b00001111, a, b);
13707        let e = _mm_set_epi16(-1, -1, -1, -1, i16::MIN, i16::MIN, i16::MIN, i16::MIN);
13708        assert_eq_m128i(r, e);
13709    }
13710
13711    #[simd_test(enable = "avx512bw,avx512vl")]
13712    const fn test_mm_maskz_subs_epi16() {
13713        let a = _mm_set1_epi16(-1);
13714        let b = _mm_set1_epi16(i16::MAX);
13715        let r = _mm_maskz_subs_epi16(0, a, b);
13716        assert_eq_m128i(r, _mm_setzero_si128());
13717        let r = _mm_maskz_subs_epi16(0b00001111, a, b);
13718        let e = _mm_set_epi16(0, 0, 0, 0, i16::MIN, i16::MIN, i16::MIN, i16::MIN);
13719        assert_eq_m128i(r, e);
13720    }
13721
13722    #[simd_test(enable = "avx512bw")]
13723    const fn test_mm512_subs_epi8() {
13724        let a = _mm512_set1_epi8(-1);
13725        let b = _mm512_set1_epi8(i8::MAX);
13726        let r = _mm512_subs_epi8(a, b);
13727        let e = _mm512_set1_epi8(i8::MIN);
13728        assert_eq_m512i(r, e);
13729    }
13730
13731    #[simd_test(enable = "avx512bw")]
13732    const fn test_mm512_mask_subs_epi8() {
13733        let a = _mm512_set1_epi8(-1);
13734        let b = _mm512_set1_epi8(i8::MAX);
13735        let r = _mm512_mask_subs_epi8(a, 0, a, b);
13736        assert_eq_m512i(r, a);
13737        let r = _mm512_mask_subs_epi8(
13738            a,
13739            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
13740            a,
13741            b,
13742        );
13743        #[rustfmt::skip]
13744        let e = _mm512_set_epi8(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
13745                                -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
13746                                -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
13747                                -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, i8::MIN, i8::MIN, i8::MIN, i8::MIN);
13748        assert_eq_m512i(r, e);
13749    }
13750
13751    #[simd_test(enable = "avx512bw")]
13752    const fn test_mm512_maskz_subs_epi8() {
13753        let a = _mm512_set1_epi8(-1);
13754        let b = _mm512_set1_epi8(i8::MAX);
13755        let r = _mm512_maskz_subs_epi8(0, a, b);
13756        assert_eq_m512i(r, _mm512_setzero_si512());
13757        let r = _mm512_maskz_subs_epi8(
13758            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
13759            a,
13760            b,
13761        );
13762        #[rustfmt::skip]
13763        let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13764                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13765                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13766                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i8::MIN, i8::MIN, i8::MIN, i8::MIN);
13767        assert_eq_m512i(r, e);
13768    }
13769
13770    #[simd_test(enable = "avx512bw,avx512vl")]
13771    const fn test_mm256_mask_subs_epi8() {
13772        let a = _mm256_set1_epi8(-1);
13773        let b = _mm256_set1_epi8(i8::MAX);
13774        let r = _mm256_mask_subs_epi8(a, 0, a, b);
13775        assert_eq_m256i(r, a);
13776        let r = _mm256_mask_subs_epi8(a, 0b00000000_00000000_00000000_00001111, a, b);
13777        #[rustfmt::skip]
13778        let e = _mm256_set_epi8(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
13779                                -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, i8::MIN, i8::MIN, i8::MIN, i8::MIN);
13780        assert_eq_m256i(r, e);
13781    }
13782
13783    #[simd_test(enable = "avx512bw,avx512vl")]
13784    const fn test_mm256_maskz_subs_epi8() {
13785        let a = _mm256_set1_epi8(-1);
13786        let b = _mm256_set1_epi8(i8::MAX);
13787        let r = _mm256_maskz_subs_epi8(0, a, b);
13788        assert_eq_m256i(r, _mm256_setzero_si256());
13789        let r = _mm256_maskz_subs_epi8(0b00000000_00000000_00000000_00001111, a, b);
13790        #[rustfmt::skip]
13791        let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13792                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i8::MIN, i8::MIN, i8::MIN, i8::MIN);
13793        assert_eq_m256i(r, e);
13794    }
13795
13796    #[simd_test(enable = "avx512bw,avx512vl")]
13797    const fn test_mm_mask_subs_epi8() {
13798        let a = _mm_set1_epi8(-1);
13799        let b = _mm_set1_epi8(i8::MAX);
13800        let r = _mm_mask_subs_epi8(a, 0, a, b);
13801        assert_eq_m128i(r, a);
13802        let r = _mm_mask_subs_epi8(a, 0b00000000_00001111, a, b);
13803        #[rustfmt::skip]
13804        let e = _mm_set_epi8(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, i8::MIN, i8::MIN, i8::MIN, i8::MIN);
13805        assert_eq_m128i(r, e);
13806    }
13807
13808    #[simd_test(enable = "avx512bw,avx512vl")]
13809    const fn test_mm_maskz_subs_epi8() {
13810        let a = _mm_set1_epi8(-1);
13811        let b = _mm_set1_epi8(i8::MAX);
13812        let r = _mm_maskz_subs_epi8(0, a, b);
13813        assert_eq_m128i(r, _mm_setzero_si128());
13814        let r = _mm_maskz_subs_epi8(0b00000000_00001111, a, b);
13815        #[rustfmt::skip]
13816        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i8::MIN, i8::MIN, i8::MIN, i8::MIN);
13817        assert_eq_m128i(r, e);
13818    }
13819
13820    #[simd_test(enable = "avx512bw")]
13821    const fn test_mm512_mulhi_epu16() {
13822        let a = _mm512_set1_epi16(1);
13823        let b = _mm512_set1_epi16(1);
13824        let r = _mm512_mulhi_epu16(a, b);
13825        let e = _mm512_set1_epi16(0);
13826        assert_eq_m512i(r, e);
13827    }
13828
13829    #[simd_test(enable = "avx512bw")]
13830    const fn test_mm512_mask_mulhi_epu16() {
13831        let a = _mm512_set1_epi16(1);
13832        let b = _mm512_set1_epi16(1);
13833        let r = _mm512_mask_mulhi_epu16(a, 0, a, b);
13834        assert_eq_m512i(r, a);
13835        let r = _mm512_mask_mulhi_epu16(a, 0b00000000_00000000_00000000_00001111, a, b);
13836        #[rustfmt::skip]
13837        let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13838                                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
13839        assert_eq_m512i(r, e);
13840    }
13841
13842    #[simd_test(enable = "avx512bw")]
13843    const fn test_mm512_maskz_mulhi_epu16() {
13844        let a = _mm512_set1_epi16(1);
13845        let b = _mm512_set1_epi16(1);
13846        let r = _mm512_maskz_mulhi_epu16(0, a, b);
13847        assert_eq_m512i(r, _mm512_setzero_si512());
13848        let r = _mm512_maskz_mulhi_epu16(0b00000000_00000000_00000000_00001111, a, b);
13849        #[rustfmt::skip]
13850        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13851                                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
13852        assert_eq_m512i(r, e);
13853    }
13854
13855    #[simd_test(enable = "avx512bw,avx512vl")]
13856    const fn test_mm256_mask_mulhi_epu16() {
13857        let a = _mm256_set1_epi16(1);
13858        let b = _mm256_set1_epi16(1);
13859        let r = _mm256_mask_mulhi_epu16(a, 0, a, b);
13860        assert_eq_m256i(r, a);
13861        let r = _mm256_mask_mulhi_epu16(a, 0b00000000_00001111, a, b);
13862        let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
13863        assert_eq_m256i(r, e);
13864    }
13865
13866    #[simd_test(enable = "avx512bw,avx512vl")]
13867    const fn test_mm256_maskz_mulhi_epu16() {
13868        let a = _mm256_set1_epi16(1);
13869        let b = _mm256_set1_epi16(1);
13870        let r = _mm256_maskz_mulhi_epu16(0, a, b);
13871        assert_eq_m256i(r, _mm256_setzero_si256());
13872        let r = _mm256_maskz_mulhi_epu16(0b00000000_00001111, a, b);
13873        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
13874        assert_eq_m256i(r, e);
13875    }
13876
13877    #[simd_test(enable = "avx512bw,avx512vl")]
13878    const fn test_mm_mask_mulhi_epu16() {
13879        let a = _mm_set1_epi16(1);
13880        let b = _mm_set1_epi16(1);
13881        let r = _mm_mask_mulhi_epu16(a, 0, a, b);
13882        assert_eq_m128i(r, a);
13883        let r = _mm_mask_mulhi_epu16(a, 0b00001111, a, b);
13884        let e = _mm_set_epi16(1, 1, 1, 1, 0, 0, 0, 0);
13885        assert_eq_m128i(r, e);
13886    }
13887
13888    #[simd_test(enable = "avx512bw,avx512vl")]
13889    const fn test_mm_maskz_mulhi_epu16() {
13890        let a = _mm_set1_epi16(1);
13891        let b = _mm_set1_epi16(1);
13892        let r = _mm_maskz_mulhi_epu16(0, a, b);
13893        assert_eq_m128i(r, _mm_setzero_si128());
13894        let r = _mm_maskz_mulhi_epu16(0b00001111, a, b);
13895        let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, 0, 0);
13896        assert_eq_m128i(r, e);
13897    }
13898
13899    #[simd_test(enable = "avx512bw")]
13900    const fn test_mm512_mulhi_epi16() {
13901        let a = _mm512_set1_epi16(1);
13902        let b = _mm512_set1_epi16(1);
13903        let r = _mm512_mulhi_epi16(a, b);
13904        let e = _mm512_set1_epi16(0);
13905        assert_eq_m512i(r, e);
13906    }
13907
13908    #[simd_test(enable = "avx512bw")]
13909    const fn test_mm512_mask_mulhi_epi16() {
13910        let a = _mm512_set1_epi16(1);
13911        let b = _mm512_set1_epi16(1);
13912        let r = _mm512_mask_mulhi_epi16(a, 0, a, b);
13913        assert_eq_m512i(r, a);
13914        let r = _mm512_mask_mulhi_epi16(a, 0b00000000_00000000_00000000_00001111, a, b);
13915        #[rustfmt::skip]
13916        let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13917                                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
13918        assert_eq_m512i(r, e);
13919    }
13920
13921    #[simd_test(enable = "avx512bw")]
13922    const fn test_mm512_maskz_mulhi_epi16() {
13923        let a = _mm512_set1_epi16(1);
13924        let b = _mm512_set1_epi16(1);
13925        let r = _mm512_maskz_mulhi_epi16(0, a, b);
13926        assert_eq_m512i(r, _mm512_setzero_si512());
13927        let r = _mm512_maskz_mulhi_epi16(0b00000000_00000000_00000000_00001111, a, b);
13928        #[rustfmt::skip]
13929        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13930                                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
13931        assert_eq_m512i(r, e);
13932    }
13933
13934    #[simd_test(enable = "avx512bw,avx512vl")]
13935    const fn test_mm256_mask_mulhi_epi16() {
13936        let a = _mm256_set1_epi16(1);
13937        let b = _mm256_set1_epi16(1);
13938        let r = _mm256_mask_mulhi_epi16(a, 0, a, b);
13939        assert_eq_m256i(r, a);
13940        let r = _mm256_mask_mulhi_epi16(a, 0b00000000_00001111, a, b);
13941        let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
13942        assert_eq_m256i(r, e);
13943    }
13944
13945    #[simd_test(enable = "avx512bw,avx512vl")]
13946    const fn test_mm256_maskz_mulhi_epi16() {
13947        let a = _mm256_set1_epi16(1);
13948        let b = _mm256_set1_epi16(1);
13949        let r = _mm256_maskz_mulhi_epi16(0, a, b);
13950        assert_eq_m256i(r, _mm256_setzero_si256());
13951        let r = _mm256_maskz_mulhi_epi16(0b00000000_00001111, a, b);
13952        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
13953        assert_eq_m256i(r, e);
13954    }
13955
13956    #[simd_test(enable = "avx512bw,avx512vl")]
13957    const fn test_mm_mask_mulhi_epi16() {
13958        let a = _mm_set1_epi16(1);
13959        let b = _mm_set1_epi16(1);
13960        let r = _mm_mask_mulhi_epi16(a, 0, a, b);
13961        assert_eq_m128i(r, a);
13962        let r = _mm_mask_mulhi_epi16(a, 0b00001111, a, b);
13963        let e = _mm_set_epi16(1, 1, 1, 1, 0, 0, 0, 0);
13964        assert_eq_m128i(r, e);
13965    }
13966
13967    #[simd_test(enable = "avx512bw,avx512vl")]
13968    const fn test_mm_maskz_mulhi_epi16() {
13969        let a = _mm_set1_epi16(1);
13970        let b = _mm_set1_epi16(1);
13971        let r = _mm_maskz_mulhi_epi16(0, a, b);
13972        assert_eq_m128i(r, _mm_setzero_si128());
13973        let r = _mm_maskz_mulhi_epi16(0b00001111, a, b);
13974        let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, 0, 0);
13975        assert_eq_m128i(r, e);
13976    }
13977
13978    #[simd_test(enable = "avx512bw")]
13979    fn test_mm512_mulhrs_epi16() {
13980        let a = _mm512_set1_epi16(1);
13981        let b = _mm512_set1_epi16(1);
13982        let r = _mm512_mulhrs_epi16(a, b);
13983        let e = _mm512_set1_epi16(0);
13984        assert_eq_m512i(r, e);
13985    }
13986
13987    #[simd_test(enable = "avx512bw")]
13988    fn test_mm512_mask_mulhrs_epi16() {
13989        let a = _mm512_set1_epi16(1);
13990        let b = _mm512_set1_epi16(1);
13991        let r = _mm512_mask_mulhrs_epi16(a, 0, a, b);
13992        assert_eq_m512i(r, a);
13993        let r = _mm512_mask_mulhrs_epi16(a, 0b00000000_00000000_00000000_00001111, a, b);
13994        #[rustfmt::skip]
13995        let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13996                                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
13997        assert_eq_m512i(r, e);
13998    }
13999
14000    #[simd_test(enable = "avx512bw")]
14001    fn test_mm512_maskz_mulhrs_epi16() {
14002        let a = _mm512_set1_epi16(1);
14003        let b = _mm512_set1_epi16(1);
14004        let r = _mm512_maskz_mulhrs_epi16(0, a, b);
14005        assert_eq_m512i(r, _mm512_setzero_si512());
14006        let r = _mm512_maskz_mulhrs_epi16(0b00000000_00000000_00000000_00001111, a, b);
14007        #[rustfmt::skip]
14008        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
14009                                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
14010        assert_eq_m512i(r, e);
14011    }
14012
14013    #[simd_test(enable = "avx512bw,avx512vl")]
14014    fn test_mm256_mask_mulhrs_epi16() {
14015        let a = _mm256_set1_epi16(1);
14016        let b = _mm256_set1_epi16(1);
14017        let r = _mm256_mask_mulhrs_epi16(a, 0, a, b);
14018        assert_eq_m256i(r, a);
14019        let r = _mm256_mask_mulhrs_epi16(a, 0b00000000_00001111, a, b);
14020        let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
14021        assert_eq_m256i(r, e);
14022    }
14023
14024    #[simd_test(enable = "avx512bw,avx512vl")]
14025    fn test_mm256_maskz_mulhrs_epi16() {
14026        let a = _mm256_set1_epi16(1);
14027        let b = _mm256_set1_epi16(1);
14028        let r = _mm256_maskz_mulhrs_epi16(0, a, b);
14029        assert_eq_m256i(r, _mm256_setzero_si256());
14030        let r = _mm256_maskz_mulhrs_epi16(0b00000000_00001111, a, b);
14031        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
14032        assert_eq_m256i(r, e);
14033    }
14034
14035    #[simd_test(enable = "avx512bw,avx512vl")]
14036    fn test_mm_mask_mulhrs_epi16() {
14037        let a = _mm_set1_epi16(1);
14038        let b = _mm_set1_epi16(1);
14039        let r = _mm_mask_mulhrs_epi16(a, 0, a, b);
14040        assert_eq_m128i(r, a);
14041        let r = _mm_mask_mulhrs_epi16(a, 0b00001111, a, b);
14042        let e = _mm_set_epi16(1, 1, 1, 1, 0, 0, 0, 0);
14043        assert_eq_m128i(r, e);
14044    }
14045
14046    #[simd_test(enable = "avx512bw,avx512vl")]
14047    fn test_mm_maskz_mulhrs_epi16() {
14048        let a = _mm_set1_epi16(1);
14049        let b = _mm_set1_epi16(1);
14050        let r = _mm_maskz_mulhrs_epi16(0, a, b);
14051        assert_eq_m128i(r, _mm_setzero_si128());
14052        let r = _mm_maskz_mulhrs_epi16(0b00001111, a, b);
14053        let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, 0, 0);
14054        assert_eq_m128i(r, e);
14055    }
14056
14057    #[simd_test(enable = "avx512bw")]
14058    const fn test_mm512_mullo_epi16() {
14059        let a = _mm512_set1_epi16(1);
14060        let b = _mm512_set1_epi16(1);
14061        let r = _mm512_mullo_epi16(a, b);
14062        let e = _mm512_set1_epi16(1);
14063        assert_eq_m512i(r, e);
14064    }
14065
14066    #[simd_test(enable = "avx512bw")]
14067    const fn test_mm512_mask_mullo_epi16() {
14068        let a = _mm512_set1_epi16(1);
14069        let b = _mm512_set1_epi16(1);
14070        let r = _mm512_mask_mullo_epi16(a, 0, a, b);
14071        assert_eq_m512i(r, a);
14072        let r = _mm512_mask_mullo_epi16(a, 0b00000000_00000000_00000000_00001111, a, b);
14073        #[rustfmt::skip]
14074        let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
14075                                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
14076        assert_eq_m512i(r, e);
14077    }
14078
14079    #[simd_test(enable = "avx512bw")]
14080    const fn test_mm512_maskz_mullo_epi16() {
14081        let a = _mm512_set1_epi16(1);
14082        let b = _mm512_set1_epi16(1);
14083        let r = _mm512_maskz_mullo_epi16(0, a, b);
14084        assert_eq_m512i(r, _mm512_setzero_si512());
14085        let r = _mm512_maskz_mullo_epi16(0b00000000_00000000_00000000_00001111, a, b);
14086        #[rustfmt::skip]
14087        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
14088                                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1);
14089        assert_eq_m512i(r, e);
14090    }
14091
14092    #[simd_test(enable = "avx512bw,avx512vl")]
14093    const fn test_mm256_mask_mullo_epi16() {
14094        let a = _mm256_set1_epi16(1);
14095        let b = _mm256_set1_epi16(1);
14096        let r = _mm256_mask_mullo_epi16(a, 0, a, b);
14097        assert_eq_m256i(r, a);
14098        let r = _mm256_mask_mullo_epi16(a, 0b00000000_00001111, a, b);
14099        let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
14100        assert_eq_m256i(r, e);
14101    }
14102
14103    #[simd_test(enable = "avx512bw,avx512vl")]
14104    const fn test_mm256_maskz_mullo_epi16() {
14105        let a = _mm256_set1_epi16(1);
14106        let b = _mm256_set1_epi16(1);
14107        let r = _mm256_maskz_mullo_epi16(0, a, b);
14108        assert_eq_m256i(r, _mm256_setzero_si256());
14109        let r = _mm256_maskz_mullo_epi16(0b00000000_00001111, a, b);
14110        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1);
14111        assert_eq_m256i(r, e);
14112    }
14113
14114    #[simd_test(enable = "avx512bw,avx512vl")]
14115    const fn test_mm_mask_mullo_epi16() {
14116        let a = _mm_set1_epi16(1);
14117        let b = _mm_set1_epi16(1);
14118        let r = _mm_mask_mullo_epi16(a, 0, a, b);
14119        assert_eq_m128i(r, a);
14120        let r = _mm_mask_mullo_epi16(a, 0b00001111, a, b);
14121        let e = _mm_set_epi16(1, 1, 1, 1, 1, 1, 1, 1);
14122        assert_eq_m128i(r, e);
14123    }
14124
14125    #[simd_test(enable = "avx512bw,avx512vl")]
14126    const fn test_mm_maskz_mullo_epi16() {
14127        let a = _mm_set1_epi16(1);
14128        let b = _mm_set1_epi16(1);
14129        let r = _mm_maskz_mullo_epi16(0, a, b);
14130        assert_eq_m128i(r, _mm_setzero_si128());
14131        let r = _mm_maskz_mullo_epi16(0b00001111, a, b);
14132        let e = _mm_set_epi16(0, 0, 0, 0, 1, 1, 1, 1);
14133        assert_eq_m128i(r, e);
14134    }
14135
14136    #[simd_test(enable = "avx512bw")]
14137    const fn test_mm512_max_epu16() {
14138        #[rustfmt::skip]
14139        let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14140                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14141        #[rustfmt::skip]
14142        let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14143                                 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14144        let r = _mm512_max_epu16(a, b);
14145        #[rustfmt::skip]
14146        let e = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15,
14147                                 15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15);
14148        assert_eq_m512i(r, e);
14149    }
14150
14151    #[simd_test(enable = "avx512bw")]
14152    const fn test_mm512_mask_max_epu16() {
14153        #[rustfmt::skip]
14154        let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14155                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14156        #[rustfmt::skip]
14157        let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14158                                 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14159        let r = _mm512_mask_max_epu16(a, 0, a, b);
14160        assert_eq_m512i(r, a);
14161        let r = _mm512_mask_max_epu16(a, 0b00000000_11111111_00000000_11111111, a, b);
14162        #[rustfmt::skip]
14163        let e = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14164                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14165        assert_eq_m512i(r, e);
14166    }
14167
14168    #[simd_test(enable = "avx512bw")]
14169    const fn test_mm512_maskz_max_epu16() {
14170        #[rustfmt::skip]
14171        let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14172                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14173        #[rustfmt::skip]
14174        let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14175                                 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14176        let r = _mm512_maskz_max_epu16(0, a, b);
14177        assert_eq_m512i(r, _mm512_setzero_si512());
14178        let r = _mm512_maskz_max_epu16(0b00000000_11111111_00000000_11111111, a, b);
14179        #[rustfmt::skip]
14180        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
14181                                 0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
14182        assert_eq_m512i(r, e);
14183    }
14184
14185    #[simd_test(enable = "avx512bw,avx512vl")]
14186    const fn test_mm256_mask_max_epu16() {
14187        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14188        let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14189        let r = _mm256_mask_max_epu16(a, 0, a, b);
14190        assert_eq_m256i(r, a);
14191        let r = _mm256_mask_max_epu16(a, 0b00000000_11111111, a, b);
14192        let e = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14193        assert_eq_m256i(r, e);
14194    }
14195
14196    #[simd_test(enable = "avx512bw,avx512vl")]
14197    const fn test_mm256_maskz_max_epu16() {
14198        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14199        let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14200        let r = _mm256_maskz_max_epu16(0, a, b);
14201        assert_eq_m256i(r, _mm256_setzero_si256());
14202        let r = _mm256_maskz_max_epu16(0b00000000_11111111, a, b);
14203        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
14204        assert_eq_m256i(r, e);
14205    }
14206
14207    #[simd_test(enable = "avx512bw,avx512vl")]
14208    const fn test_mm_mask_max_epu16() {
14209        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
14210        let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0);
14211        let r = _mm_mask_max_epu16(a, 0, a, b);
14212        assert_eq_m128i(r, a);
14213        let r = _mm_mask_max_epu16(a, 0b00001111, a, b);
14214        let e = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
14215        assert_eq_m128i(r, e);
14216    }
14217
14218    #[simd_test(enable = "avx512bw,avx512vl")]
14219    const fn test_mm_maskz_max_epu16() {
14220        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
14221        let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0);
14222        let r = _mm_maskz_max_epu16(0, a, b);
14223        assert_eq_m128i(r, _mm_setzero_si128());
14224        let r = _mm_maskz_max_epu16(0b00001111, a, b);
14225        let e = _mm_set_epi16(0, 0, 0, 0, 4, 5, 6, 7);
14226        assert_eq_m128i(r, e);
14227    }
14228
14229    #[simd_test(enable = "avx512bw")]
14230    const fn test_mm512_max_epu8() {
14231        #[rustfmt::skip]
14232        let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14233                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14234                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14235                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14236        #[rustfmt::skip]
14237        let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14238                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14239                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14240                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14241        let r = _mm512_max_epu8(a, b);
14242        #[rustfmt::skip]
14243        let e = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15,
14244                                15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15,
14245                                15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15,
14246                                15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15);
14247        assert_eq_m512i(r, e);
14248    }
14249
14250    #[simd_test(enable = "avx512bw")]
14251    const fn test_mm512_mask_max_epu8() {
14252        #[rustfmt::skip]
14253        let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14254                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14255                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14256                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14257        #[rustfmt::skip]
14258        let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14259                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14260                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14261                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14262        let r = _mm512_mask_max_epu8(a, 0, a, b);
14263        assert_eq_m512i(r, a);
14264        let r = _mm512_mask_max_epu8(
14265            a,
14266            0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
14267            a,
14268            b,
14269        );
14270        #[rustfmt::skip]
14271        let e = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14272                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14273                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14274                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14275        assert_eq_m512i(r, e);
14276    }
14277
14278    #[simd_test(enable = "avx512bw")]
14279    const fn test_mm512_maskz_max_epu8() {
14280        #[rustfmt::skip]
14281        let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14282                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14283                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14284                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14285        #[rustfmt::skip]
14286        let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14287                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14288                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14289                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14290        let r = _mm512_maskz_max_epu8(0, a, b);
14291        assert_eq_m512i(r, _mm512_setzero_si512());
14292        let r = _mm512_maskz_max_epu8(
14293            0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
14294            a,
14295            b,
14296        );
14297        #[rustfmt::skip]
14298        let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
14299                                0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
14300                                0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
14301                                0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
14302        assert_eq_m512i(r, e);
14303    }
14304
14305    #[simd_test(enable = "avx512bw,avx512vl")]
14306    const fn test_mm256_mask_max_epu8() {
14307        #[rustfmt::skip]
14308        let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14309                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14310        #[rustfmt::skip]
14311        let b = _mm256_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14312                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14313        let r = _mm256_mask_max_epu8(a, 0, a, b);
14314        assert_eq_m256i(r, a);
14315        let r = _mm256_mask_max_epu8(a, 0b00000000_11111111_00000000_11111111, a, b);
14316        #[rustfmt::skip]
14317        let e = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14318                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14319        assert_eq_m256i(r, e);
14320    }
14321
14322    #[simd_test(enable = "avx512bw,avx512vl")]
14323    const fn test_mm256_maskz_max_epu8() {
14324        #[rustfmt::skip]
14325        let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14326                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14327        #[rustfmt::skip]
14328        let b = _mm256_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14329                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14330        let r = _mm256_maskz_max_epu8(0, a, b);
14331        assert_eq_m256i(r, _mm256_setzero_si256());
14332        let r = _mm256_maskz_max_epu8(0b00000000_11111111_00000000_11111111, a, b);
14333        #[rustfmt::skip]
14334        let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
14335                                0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
14336        assert_eq_m256i(r, e);
14337    }
14338
14339    #[simd_test(enable = "avx512bw,avx512vl")]
14340    const fn test_mm_mask_max_epu8() {
14341        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14342        let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14343        let r = _mm_mask_max_epu8(a, 0, a, b);
14344        assert_eq_m128i(r, a);
14345        let r = _mm_mask_max_epu8(a, 0b00000000_11111111, a, b);
14346        let e = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14347        assert_eq_m128i(r, e);
14348    }
14349
14350    #[simd_test(enable = "avx512bw,avx512vl")]
14351    const fn test_mm_maskz_max_epu8() {
14352        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14353        let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14354        let r = _mm_maskz_max_epu8(0, a, b);
14355        assert_eq_m128i(r, _mm_setzero_si128());
14356        let r = _mm_maskz_max_epu8(0b00000000_11111111, a, b);
14357        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
14358        assert_eq_m128i(r, e);
14359    }
14360
14361    #[simd_test(enable = "avx512bw")]
14362    const fn test_mm512_max_epi16() {
14363        #[rustfmt::skip]
14364        let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14365                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14366        #[rustfmt::skip]
14367        let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14368                                 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14369        let r = _mm512_max_epi16(a, b);
14370        #[rustfmt::skip]
14371        let e = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15,
14372                                 15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15);
14373        assert_eq_m512i(r, e);
14374    }
14375
14376    #[simd_test(enable = "avx512bw")]
14377    const fn test_mm512_mask_max_epi16() {
14378        #[rustfmt::skip]
14379        let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14380                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14381        #[rustfmt::skip]
14382        let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14383                                 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14384        let r = _mm512_mask_max_epi16(a, 0, a, b);
14385        assert_eq_m512i(r, a);
14386        let r = _mm512_mask_max_epi16(a, 0b00000000_11111111_00000000_11111111, a, b);
14387        #[rustfmt::skip]
14388        let e = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14389                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14390        assert_eq_m512i(r, e);
14391    }
14392
14393    #[simd_test(enable = "avx512bw")]
14394    const fn test_mm512_maskz_max_epi16() {
14395        #[rustfmt::skip]
14396        let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14397                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14398        #[rustfmt::skip]
14399        let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14400                                 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14401        let r = _mm512_maskz_max_epi16(0, a, b);
14402        assert_eq_m512i(r, _mm512_setzero_si512());
14403        let r = _mm512_maskz_max_epi16(0b00000000_11111111_00000000_11111111, a, b);
14404        #[rustfmt::skip]
14405        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
14406                                 0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
14407        assert_eq_m512i(r, e);
14408    }
14409
14410    #[simd_test(enable = "avx512bw,avx512vl")]
14411    const fn test_mm256_mask_max_epi16() {
14412        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14413        let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14414        let r = _mm256_mask_max_epi16(a, 0, a, b);
14415        assert_eq_m256i(r, a);
14416        let r = _mm256_mask_max_epi16(a, 0b00000000_11111111, a, b);
14417        let e = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14418        assert_eq_m256i(r, e);
14419    }
14420
14421    #[simd_test(enable = "avx512bw,avx512vl")]
14422    const fn test_mm256_maskz_max_epi16() {
14423        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14424        let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14425        let r = _mm256_maskz_max_epi16(0, a, b);
14426        assert_eq_m256i(r, _mm256_setzero_si256());
14427        let r = _mm256_maskz_max_epi16(0b00000000_11111111, a, b);
14428        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
14429        assert_eq_m256i(r, e);
14430    }
14431
14432    #[simd_test(enable = "avx512bw,avx512vl")]
14433    const fn test_mm_mask_max_epi16() {
14434        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
14435        let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0);
14436        let r = _mm_mask_max_epi16(a, 0, a, b);
14437        assert_eq_m128i(r, a);
14438        let r = _mm_mask_max_epi16(a, 0b00001111, a, b);
14439        let e = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
14440        assert_eq_m128i(r, e);
14441    }
14442
14443    #[simd_test(enable = "avx512bw,avx512vl")]
14444    const fn test_mm_maskz_max_epi16() {
14445        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
14446        let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0);
14447        let r = _mm_maskz_max_epi16(0, a, b);
14448        assert_eq_m128i(r, _mm_setzero_si128());
14449        let r = _mm_maskz_max_epi16(0b00001111, a, b);
14450        let e = _mm_set_epi16(0, 0, 0, 0, 4, 5, 6, 7);
14451        assert_eq_m128i(r, e);
14452    }
14453
14454    #[simd_test(enable = "avx512bw")]
14455    const fn test_mm512_max_epi8() {
14456        #[rustfmt::skip]
14457        let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14458                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14459                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14460                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14461        #[rustfmt::skip]
14462        let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14463                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14464                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14465                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14466        let r = _mm512_max_epi8(a, b);
14467        #[rustfmt::skip]
14468        let e = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15,
14469                                15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15,
14470                                15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15,
14471                                15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15);
14472        assert_eq_m512i(r, e);
14473    }
14474
14475    #[simd_test(enable = "avx512bw")]
14476    const fn test_mm512_mask_max_epi8() {
14477        #[rustfmt::skip]
14478        let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14479                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14480                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14481                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14482        #[rustfmt::skip]
14483        let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14484                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14485                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14486                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14487        let r = _mm512_mask_max_epi8(a, 0, a, b);
14488        assert_eq_m512i(r, a);
14489        let r = _mm512_mask_max_epi8(
14490            a,
14491            0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
14492            a,
14493            b,
14494        );
14495        #[rustfmt::skip]
14496        let e = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14497                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14498                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14499                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14500        assert_eq_m512i(r, e);
14501    }
14502
14503    #[simd_test(enable = "avx512bw")]
14504    const fn test_mm512_maskz_max_epi8() {
14505        #[rustfmt::skip]
14506        let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14507                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14508                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14509                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14510        #[rustfmt::skip]
14511        let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14512                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14513                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14514                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14515        let r = _mm512_maskz_max_epi8(0, a, b);
14516        assert_eq_m512i(r, _mm512_setzero_si512());
14517        let r = _mm512_maskz_max_epi8(
14518            0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
14519            a,
14520            b,
14521        );
14522        #[rustfmt::skip]
14523        let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
14524                                0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
14525                                0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
14526                                0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
14527        assert_eq_m512i(r, e);
14528    }
14529
14530    #[simd_test(enable = "avx512bw,avx512vl")]
14531    const fn test_mm256_mask_max_epi8() {
14532        #[rustfmt::skip]
14533        let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14534                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14535        #[rustfmt::skip]
14536        let b = _mm256_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14537                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14538        let r = _mm256_mask_max_epi8(a, 0, a, b);
14539        assert_eq_m256i(r, a);
14540        let r = _mm256_mask_max_epi8(a, 0b00000000_11111111_00000000_11111111, a, b);
14541        #[rustfmt::skip]
14542        let e = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14543                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14544        assert_eq_m256i(r, e);
14545    }
14546
14547    #[simd_test(enable = "avx512bw,avx512vl")]
14548    const fn test_mm256_maskz_max_epi8() {
14549        #[rustfmt::skip]
14550        let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14551                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14552        #[rustfmt::skip]
14553        let b = _mm256_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14554                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14555        let r = _mm256_maskz_max_epi8(0, a, b);
14556        assert_eq_m256i(r, _mm256_setzero_si256());
14557        let r = _mm256_maskz_max_epi8(0b00000000_11111111_00000000_11111111, a, b);
14558        #[rustfmt::skip]
14559        let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
14560                                0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
14561        assert_eq_m256i(r, e);
14562    }
14563
14564    #[simd_test(enable = "avx512bw,avx512vl")]
14565    const fn test_mm_mask_max_epi8() {
14566        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14567        let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14568        let r = _mm_mask_max_epi8(a, 0, a, b);
14569        assert_eq_m128i(r, a);
14570        let r = _mm_mask_max_epi8(a, 0b00000000_11111111, a, b);
14571        let e = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14572        assert_eq_m128i(r, e);
14573    }
14574
14575    #[simd_test(enable = "avx512bw,avx512vl")]
14576    const fn test_mm_maskz_max_epi8() {
14577        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14578        let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14579        let r = _mm_maskz_max_epi8(0, a, b);
14580        assert_eq_m128i(r, _mm_setzero_si128());
14581        let r = _mm_maskz_max_epi8(0b00000000_11111111, a, b);
14582        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
14583        assert_eq_m128i(r, e);
14584    }
14585
14586    #[simd_test(enable = "avx512bw")]
14587    const fn test_mm512_min_epu16() {
14588        #[rustfmt::skip]
14589        let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14590                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14591        #[rustfmt::skip]
14592        let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14593                                 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14594        let r = _mm512_min_epu16(a, b);
14595        #[rustfmt::skip]
14596        let e = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14597                                 0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
14598        assert_eq_m512i(r, e);
14599    }
14600
14601    #[simd_test(enable = "avx512bw")]
14602    const fn test_mm512_mask_min_epu16() {
14603        #[rustfmt::skip]
14604        let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14605                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14606        #[rustfmt::skip]
14607        let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14608                                 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14609        let r = _mm512_mask_min_epu16(a, 0, a, b);
14610        assert_eq_m512i(r, a);
14611        let r = _mm512_mask_min_epu16(a, 0b00000000_11111111_00000000_11111111, a, b);
14612        #[rustfmt::skip]
14613        let e = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14614                                 0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
14615        assert_eq_m512i(r, e);
14616    }
14617
14618    #[simd_test(enable = "avx512bw")]
14619    const fn test_mm512_maskz_min_epu16() {
14620        #[rustfmt::skip]
14621        let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14622                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14623        #[rustfmt::skip]
14624        let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14625                                 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14626        let r = _mm512_maskz_min_epu16(0, a, b);
14627        assert_eq_m512i(r, _mm512_setzero_si512());
14628        let r = _mm512_maskz_min_epu16(0b00000000_11111111_00000000_11111111, a, b);
14629        #[rustfmt::skip]
14630        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
14631                                 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
14632        assert_eq_m512i(r, e);
14633    }
14634
14635    #[simd_test(enable = "avx512bw,avx512vl")]
14636    const fn test_mm256_mask_min_epu16() {
14637        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14638        let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14639        let r = _mm256_mask_min_epu16(a, 0, a, b);
14640        assert_eq_m256i(r, a);
14641        let r = _mm256_mask_min_epu16(a, 0b00000000_11111111, a, b);
14642        let e = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
14643        assert_eq_m256i(r, e);
14644    }
14645
14646    #[simd_test(enable = "avx512bw,avx512vl")]
14647    const fn test_mm256_maskz_min_epu16() {
14648        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14649        let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14650        let r = _mm256_maskz_min_epu16(0, a, b);
14651        assert_eq_m256i(r, _mm256_setzero_si256());
14652        let r = _mm256_maskz_min_epu16(0b00000000_11111111, a, b);
14653        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
14654        assert_eq_m256i(r, e);
14655    }
14656
14657    #[simd_test(enable = "avx512bw,avx512vl")]
14658    const fn test_mm_mask_min_epu16() {
14659        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
14660        let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0);
14661        let r = _mm_mask_min_epu16(a, 0, a, b);
14662        assert_eq_m128i(r, a);
14663        let r = _mm_mask_min_epu16(a, 0b00001111, a, b);
14664        let e = _mm_set_epi16(0, 1, 2, 3, 3, 2, 1, 0);
14665        assert_eq_m128i(r, e);
14666    }
14667
14668    #[simd_test(enable = "avx512bw,avx512vl")]
14669    const fn test_mm_maskz_min_epu16() {
14670        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
14671        let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0);
14672        let r = _mm_maskz_min_epu16(0, a, b);
14673        assert_eq_m128i(r, _mm_setzero_si128());
14674        let r = _mm_maskz_min_epu16(0b00001111, a, b);
14675        let e = _mm_set_epi16(0, 0, 0, 0, 3, 2, 1, 0);
14676        assert_eq_m128i(r, e);
14677    }
14678
14679    #[simd_test(enable = "avx512bw")]
14680    const fn test_mm512_min_epu8() {
14681        #[rustfmt::skip]
14682        let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14683                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14684                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14685                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14686        #[rustfmt::skip]
14687        let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14688                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14689                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14690                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14691        let r = _mm512_min_epu8(a, b);
14692        #[rustfmt::skip]
14693        let e = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14694                                0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14695                                0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14696                                0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
14697        assert_eq_m512i(r, e);
14698    }
14699
14700    #[simd_test(enable = "avx512bw")]
14701    const fn test_mm512_mask_min_epu8() {
14702        #[rustfmt::skip]
14703        let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14704                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14705                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14706                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14707        #[rustfmt::skip]
14708        let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14709                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14710                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14711                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14712        let r = _mm512_mask_min_epu8(a, 0, a, b);
14713        assert_eq_m512i(r, a);
14714        let r = _mm512_mask_min_epu8(
14715            a,
14716            0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
14717            a,
14718            b,
14719        );
14720        #[rustfmt::skip]
14721        let e = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14722                                0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14723                                0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14724                                0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
14725        assert_eq_m512i(r, e);
14726    }
14727
14728    #[simd_test(enable = "avx512bw")]
14729    const fn test_mm512_maskz_min_epu8() {
14730        #[rustfmt::skip]
14731        let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14732                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14733                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14734                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14735        #[rustfmt::skip]
14736        let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14737                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14738                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14739                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14740        let r = _mm512_maskz_min_epu8(0, a, b);
14741        assert_eq_m512i(r, _mm512_setzero_si512());
14742        let r = _mm512_maskz_min_epu8(
14743            0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
14744            a,
14745            b,
14746        );
14747        #[rustfmt::skip]
14748        let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
14749                                0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
14750                                0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
14751                                0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
14752        assert_eq_m512i(r, e);
14753    }
14754
14755    #[simd_test(enable = "avx512bw,avx512vl")]
14756    const fn test_mm256_mask_min_epu8() {
14757        #[rustfmt::skip]
14758        let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14759                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14760        #[rustfmt::skip]
14761        let b = _mm256_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14762                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14763        let r = _mm256_mask_min_epu8(a, 0, a, b);
14764        assert_eq_m256i(r, a);
14765        let r = _mm256_mask_min_epu8(a, 0b00000000_11111111_00000000_11111111, a, b);
14766        #[rustfmt::skip]
14767        let e = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14768                                0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
14769        assert_eq_m256i(r, e);
14770    }
14771
14772    #[simd_test(enable = "avx512bw,avx512vl")]
14773    const fn test_mm256_maskz_min_epu8() {
14774        #[rustfmt::skip]
14775        let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14776                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14777        #[rustfmt::skip]
14778        let b = _mm256_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14779                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14780        let r = _mm256_maskz_min_epu8(0, a, b);
14781        assert_eq_m256i(r, _mm256_setzero_si256());
14782        let r = _mm256_maskz_min_epu8(0b00000000_11111111_00000000_11111111, a, b);
14783        #[rustfmt::skip]
14784        let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
14785                                0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
14786        assert_eq_m256i(r, e);
14787    }
14788
14789    #[simd_test(enable = "avx512bw,avx512vl")]
14790    const fn test_mm_mask_min_epu8() {
14791        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14792        let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14793        let r = _mm_mask_min_epu8(a, 0, a, b);
14794        assert_eq_m128i(r, a);
14795        let r = _mm_mask_min_epu8(a, 0b00000000_11111111, a, b);
14796        let e = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
14797        assert_eq_m128i(r, e);
14798    }
14799
14800    #[simd_test(enable = "avx512bw,avx512vl")]
14801    const fn test_mm_maskz_min_epu8() {
14802        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14803        let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14804        let r = _mm_maskz_min_epu8(0, a, b);
14805        assert_eq_m128i(r, _mm_setzero_si128());
14806        let r = _mm_maskz_min_epu8(0b00000000_11111111, a, b);
14807        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
14808        assert_eq_m128i(r, e);
14809    }
14810
14811    #[simd_test(enable = "avx512bw")]
14812    const fn test_mm512_min_epi16() {
14813        #[rustfmt::skip]
14814        let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14815                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14816        #[rustfmt::skip]
14817        let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14818                                 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14819        let r = _mm512_min_epi16(a, b);
14820        #[rustfmt::skip]
14821        let e = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14822                                 0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
14823        assert_eq_m512i(r, e);
14824    }
14825
14826    #[simd_test(enable = "avx512bw")]
14827    const fn test_mm512_mask_min_epi16() {
14828        #[rustfmt::skip]
14829        let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14830                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14831        #[rustfmt::skip]
14832        let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14833                                 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14834        let r = _mm512_mask_min_epi16(a, 0, a, b);
14835        assert_eq_m512i(r, a);
14836        let r = _mm512_mask_min_epi16(a, 0b00000000_11111111_00000000_11111111, a, b);
14837        #[rustfmt::skip]
14838        let e = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14839                                 0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
14840        assert_eq_m512i(r, e);
14841    }
14842
14843    #[simd_test(enable = "avx512bw")]
14844    const fn test_mm512_maskz_min_epi16() {
14845        #[rustfmt::skip]
14846        let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14847                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14848        #[rustfmt::skip]
14849        let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14850                                 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14851        let r = _mm512_maskz_min_epi16(0, a, b);
14852        assert_eq_m512i(r, _mm512_setzero_si512());
14853        let r = _mm512_maskz_min_epi16(0b00000000_11111111_00000000_11111111, a, b);
14854        #[rustfmt::skip]
14855        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
14856                                 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
14857        assert_eq_m512i(r, e);
14858    }
14859
14860    #[simd_test(enable = "avx512bw,avx512vl")]
14861    const fn test_mm256_mask_min_epi16() {
14862        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14863        let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14864        let r = _mm256_mask_min_epi16(a, 0, a, b);
14865        assert_eq_m256i(r, a);
14866        let r = _mm256_mask_min_epi16(a, 0b00000000_11111111, a, b);
14867        let e = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
14868        assert_eq_m256i(r, e);
14869    }
14870
14871    #[simd_test(enable = "avx512bw,avx512vl")]
14872    const fn test_mm256_maskz_min_epi16() {
14873        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14874        let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14875        let r = _mm256_maskz_min_epi16(0, a, b);
14876        assert_eq_m256i(r, _mm256_setzero_si256());
14877        let r = _mm256_maskz_min_epi16(0b00000000_11111111, a, b);
14878        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
14879        assert_eq_m256i(r, e);
14880    }
14881
14882    #[simd_test(enable = "avx512bw,avx512vl")]
14883    const fn test_mm_mask_min_epi16() {
14884        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
14885        let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0);
14886        let r = _mm_mask_min_epi16(a, 0, a, b);
14887        assert_eq_m128i(r, a);
14888        let r = _mm_mask_min_epi16(a, 0b00001111, a, b);
14889        let e = _mm_set_epi16(0, 1, 2, 3, 3, 2, 1, 0);
14890        assert_eq_m128i(r, e);
14891    }
14892
14893    #[simd_test(enable = "avx512bw,avx512vl")]
14894    const fn test_mm_maskz_min_epi16() {
14895        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
14896        let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0);
14897        let r = _mm_maskz_min_epi16(0, a, b);
14898        assert_eq_m128i(r, _mm_setzero_si128());
14899        let r = _mm_maskz_min_epi16(0b00001111, a, b);
14900        let e = _mm_set_epi16(0, 0, 0, 0, 3, 2, 1, 0);
14901        assert_eq_m128i(r, e);
14902    }
14903
14904    #[simd_test(enable = "avx512bw")]
14905    const fn test_mm512_min_epi8() {
14906        #[rustfmt::skip]
14907        let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14908                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14909                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14910                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14911        #[rustfmt::skip]
14912        let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14913                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14914                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14915                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14916        let r = _mm512_min_epi8(a, b);
14917        #[rustfmt::skip]
14918        let e = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14919                                0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14920                                0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14921                                0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
14922        assert_eq_m512i(r, e);
14923    }
14924
14925    #[simd_test(enable = "avx512bw")]
14926    const fn test_mm512_mask_min_epi8() {
14927        #[rustfmt::skip]
14928        let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14929                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14930                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14931                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14932        #[rustfmt::skip]
14933        let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14934                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14935                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14936                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14937        let r = _mm512_mask_min_epi8(a, 0, a, b);
14938        assert_eq_m512i(r, a);
14939        let r = _mm512_mask_min_epi8(
14940            a,
14941            0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
14942            a,
14943            b,
14944        );
14945        #[rustfmt::skip]
14946        let e = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14947                                0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14948                                0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14949                                0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
14950        assert_eq_m512i(r, e);
14951    }
14952
14953    #[simd_test(enable = "avx512bw")]
14954    const fn test_mm512_maskz_min_epi8() {
14955        #[rustfmt::skip]
14956        let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14957                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14958                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14959                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14960        #[rustfmt::skip]
14961        let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14962                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14963                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14964                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14965        let r = _mm512_maskz_min_epi8(0, a, b);
14966        assert_eq_m512i(r, _mm512_setzero_si512());
14967        let r = _mm512_maskz_min_epi8(
14968            0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
14969            a,
14970            b,
14971        );
14972        #[rustfmt::skip]
14973        let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
14974                                0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
14975                                0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
14976                                0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
14977        assert_eq_m512i(r, e);
14978    }
14979
14980    #[simd_test(enable = "avx512bw,avx512vl")]
14981    const fn test_mm256_mask_min_epi8() {
14982        #[rustfmt::skip]
14983        let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14984                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14985        #[rustfmt::skip]
14986        let b = _mm256_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14987                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14988        let r = _mm256_mask_min_epi8(a, 0, a, b);
14989        assert_eq_m256i(r, a);
14990        let r = _mm256_mask_min_epi8(a, 0b00000000_11111111_00000000_11111111, a, b);
14991        #[rustfmt::skip]
14992        let e = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14993                                0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
14994        assert_eq_m256i(r, e);
14995    }
14996
14997    #[simd_test(enable = "avx512bw,avx512vl")]
14998    const fn test_mm256_maskz_min_epi8() {
14999        #[rustfmt::skip]
15000        let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
15001                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
15002        #[rustfmt::skip]
15003        let b = _mm256_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15004                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
15005        let r = _mm256_maskz_min_epi8(0, a, b);
15006        assert_eq_m256i(r, _mm256_setzero_si256());
15007        let r = _mm256_maskz_min_epi8(0b00000000_11111111_00000000_11111111, a, b);
15008        #[rustfmt::skip]
15009        let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
15010                                0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
15011        assert_eq_m256i(r, e);
15012    }
15013
15014    #[simd_test(enable = "avx512bw,avx512vl")]
15015    const fn test_mm_mask_min_epi8() {
15016        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
15017        let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
15018        let r = _mm_mask_min_epi8(a, 0, a, b);
15019        assert_eq_m128i(r, a);
15020        let r = _mm_mask_min_epi8(a, 0b00000000_11111111, a, b);
15021        let e = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
15022        assert_eq_m128i(r, e);
15023    }
15024
15025    #[simd_test(enable = "avx512bw,avx512vl")]
15026    const fn test_mm_maskz_min_epi8() {
15027        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
15028        let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
15029        let r = _mm_maskz_min_epi8(0, a, b);
15030        assert_eq_m128i(r, _mm_setzero_si128());
15031        let r = _mm_maskz_min_epi8(0b00000000_11111111, a, b);
15032        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
15033        assert_eq_m128i(r, e);
15034    }
15035
15036    #[simd_test(enable = "avx512bw")]
15037    const fn test_mm512_cmplt_epu16_mask() {
15038        let a = _mm512_set1_epi16(-2);
15039        let b = _mm512_set1_epi16(-1);
15040        let m = _mm512_cmplt_epu16_mask(a, b);
15041        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15042    }
15043
15044    #[simd_test(enable = "avx512bw")]
15045    const fn test_mm512_mask_cmplt_epu16_mask() {
15046        let a = _mm512_set1_epi16(-2);
15047        let b = _mm512_set1_epi16(-1);
15048        let mask = 0b01010101_01010101_01010101_01010101;
15049        let r = _mm512_mask_cmplt_epu16_mask(mask, a, b);
15050        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15051    }
15052
15053    #[simd_test(enable = "avx512bw,avx512vl")]
15054    const fn test_mm256_cmplt_epu16_mask() {
15055        let a = _mm256_set1_epi16(-2);
15056        let b = _mm256_set1_epi16(-1);
15057        let m = _mm256_cmplt_epu16_mask(a, b);
15058        assert_eq!(m, 0b11111111_11111111);
15059    }
15060
15061    #[simd_test(enable = "avx512bw,avx512vl")]
15062    const fn test_mm256_mask_cmplt_epu16_mask() {
15063        let a = _mm256_set1_epi16(-2);
15064        let b = _mm256_set1_epi16(-1);
15065        let mask = 0b01010101_01010101;
15066        let r = _mm256_mask_cmplt_epu16_mask(mask, a, b);
15067        assert_eq!(r, 0b01010101_01010101);
15068    }
15069
15070    #[simd_test(enable = "avx512bw,avx512vl")]
15071    const fn test_mm_cmplt_epu16_mask() {
15072        let a = _mm_set1_epi16(-2);
15073        let b = _mm_set1_epi16(-1);
15074        let m = _mm_cmplt_epu16_mask(a, b);
15075        assert_eq!(m, 0b11111111);
15076    }
15077
15078    #[simd_test(enable = "avx512bw,avx512vl")]
15079    const fn test_mm_mask_cmplt_epu16_mask() {
15080        let a = _mm_set1_epi16(-2);
15081        let b = _mm_set1_epi16(-1);
15082        let mask = 0b01010101;
15083        let r = _mm_mask_cmplt_epu16_mask(mask, a, b);
15084        assert_eq!(r, 0b01010101);
15085    }
15086
15087    #[simd_test(enable = "avx512bw")]
15088    const fn test_mm512_cmplt_epu8_mask() {
15089        let a = _mm512_set1_epi8(-2);
15090        let b = _mm512_set1_epi8(-1);
15091        let m = _mm512_cmplt_epu8_mask(a, b);
15092        assert_eq!(
15093            m,
15094            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
15095        );
15096    }
15097
15098    #[simd_test(enable = "avx512bw")]
15099    const fn test_mm512_mask_cmplt_epu8_mask() {
15100        let a = _mm512_set1_epi8(-2);
15101        let b = _mm512_set1_epi8(-1);
15102        let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
15103        let r = _mm512_mask_cmplt_epu8_mask(mask, a, b);
15104        assert_eq!(
15105            r,
15106            0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
15107        );
15108    }
15109
15110    #[simd_test(enable = "avx512bw,avx512vl")]
15111    const fn test_mm256_cmplt_epu8_mask() {
15112        let a = _mm256_set1_epi8(-2);
15113        let b = _mm256_set1_epi8(-1);
15114        let m = _mm256_cmplt_epu8_mask(a, b);
15115        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15116    }
15117
15118    #[simd_test(enable = "avx512bw,avx512vl")]
15119    const fn test_mm256_mask_cmplt_epu8_mask() {
15120        let a = _mm256_set1_epi8(-2);
15121        let b = _mm256_set1_epi8(-1);
15122        let mask = 0b01010101_01010101_01010101_01010101;
15123        let r = _mm256_mask_cmplt_epu8_mask(mask, a, b);
15124        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15125    }
15126
15127    #[simd_test(enable = "avx512bw,avx512vl")]
15128    const fn test_mm_cmplt_epu8_mask() {
15129        let a = _mm_set1_epi8(-2);
15130        let b = _mm_set1_epi8(-1);
15131        let m = _mm_cmplt_epu8_mask(a, b);
15132        assert_eq!(m, 0b11111111_11111111);
15133    }
15134
15135    #[simd_test(enable = "avx512bw,avx512vl")]
15136    const fn test_mm_mask_cmplt_epu8_mask() {
15137        let a = _mm_set1_epi8(-2);
15138        let b = _mm_set1_epi8(-1);
15139        let mask = 0b01010101_01010101;
15140        let r = _mm_mask_cmplt_epu8_mask(mask, a, b);
15141        assert_eq!(r, 0b01010101_01010101);
15142    }
15143
15144    #[simd_test(enable = "avx512bw")]
15145    const fn test_mm512_cmplt_epi16_mask() {
15146        let a = _mm512_set1_epi16(-2);
15147        let b = _mm512_set1_epi16(-1);
15148        let m = _mm512_cmplt_epi16_mask(a, b);
15149        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15150    }
15151
15152    #[simd_test(enable = "avx512bw")]
15153    const fn test_mm512_mask_cmplt_epi16_mask() {
15154        let a = _mm512_set1_epi16(-2);
15155        let b = _mm512_set1_epi16(-1);
15156        let mask = 0b01010101_01010101_01010101_01010101;
15157        let r = _mm512_mask_cmplt_epi16_mask(mask, a, b);
15158        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15159    }
15160
15161    #[simd_test(enable = "avx512bw,avx512vl")]
15162    const fn test_mm256_cmplt_epi16_mask() {
15163        let a = _mm256_set1_epi16(-2);
15164        let b = _mm256_set1_epi16(-1);
15165        let m = _mm256_cmplt_epi16_mask(a, b);
15166        assert_eq!(m, 0b11111111_11111111);
15167    }
15168
15169    #[simd_test(enable = "avx512bw,avx512vl")]
15170    const fn test_mm256_mask_cmplt_epi16_mask() {
15171        let a = _mm256_set1_epi16(-2);
15172        let b = _mm256_set1_epi16(-1);
15173        let mask = 0b01010101_01010101;
15174        let r = _mm256_mask_cmplt_epi16_mask(mask, a, b);
15175        assert_eq!(r, 0b01010101_01010101);
15176    }
15177
15178    #[simd_test(enable = "avx512bw,avx512vl")]
15179    const fn test_mm_cmplt_epi16_mask() {
15180        let a = _mm_set1_epi16(-2);
15181        let b = _mm_set1_epi16(-1);
15182        let m = _mm_cmplt_epi16_mask(a, b);
15183        assert_eq!(m, 0b11111111);
15184    }
15185
15186    #[simd_test(enable = "avx512bw,avx512vl")]
15187    const fn test_mm_mask_cmplt_epi16_mask() {
15188        let a = _mm_set1_epi16(-2);
15189        let b = _mm_set1_epi16(-1);
15190        let mask = 0b01010101;
15191        let r = _mm_mask_cmplt_epi16_mask(mask, a, b);
15192        assert_eq!(r, 0b01010101);
15193    }
15194
15195    #[simd_test(enable = "avx512bw")]
15196    const fn test_mm512_cmplt_epi8_mask() {
15197        let a = _mm512_set1_epi8(-2);
15198        let b = _mm512_set1_epi8(-1);
15199        let m = _mm512_cmplt_epi8_mask(a, b);
15200        assert_eq!(
15201            m,
15202            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
15203        );
15204    }
15205
15206    #[simd_test(enable = "avx512bw")]
15207    const fn test_mm512_mask_cmplt_epi8_mask() {
15208        let a = _mm512_set1_epi8(-2);
15209        let b = _mm512_set1_epi8(-1);
15210        let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
15211        let r = _mm512_mask_cmplt_epi8_mask(mask, a, b);
15212        assert_eq!(
15213            r,
15214            0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
15215        );
15216    }
15217
15218    #[simd_test(enable = "avx512bw,avx512vl")]
15219    const fn test_mm256_cmplt_epi8_mask() {
15220        let a = _mm256_set1_epi8(-2);
15221        let b = _mm256_set1_epi8(-1);
15222        let m = _mm256_cmplt_epi8_mask(a, b);
15223        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15224    }
15225
15226    #[simd_test(enable = "avx512bw,avx512vl")]
15227    const fn test_mm256_mask_cmplt_epi8_mask() {
15228        let a = _mm256_set1_epi8(-2);
15229        let b = _mm256_set1_epi8(-1);
15230        let mask = 0b01010101_01010101_01010101_01010101;
15231        let r = _mm256_mask_cmplt_epi8_mask(mask, a, b);
15232        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15233    }
15234
15235    #[simd_test(enable = "avx512bw,avx512vl")]
15236    const fn test_mm_cmplt_epi8_mask() {
15237        let a = _mm_set1_epi8(-2);
15238        let b = _mm_set1_epi8(-1);
15239        let m = _mm_cmplt_epi8_mask(a, b);
15240        assert_eq!(m, 0b11111111_11111111);
15241    }
15242
15243    #[simd_test(enable = "avx512bw,avx512vl")]
15244    const fn test_mm_mask_cmplt_epi8_mask() {
15245        let a = _mm_set1_epi8(-2);
15246        let b = _mm_set1_epi8(-1);
15247        let mask = 0b01010101_01010101;
15248        let r = _mm_mask_cmplt_epi8_mask(mask, a, b);
15249        assert_eq!(r, 0b01010101_01010101);
15250    }
15251
15252    #[simd_test(enable = "avx512bw")]
15253    const fn test_mm512_cmpgt_epu16_mask() {
15254        let a = _mm512_set1_epi16(2);
15255        let b = _mm512_set1_epi16(1);
15256        let m = _mm512_cmpgt_epu16_mask(a, b);
15257        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15258    }
15259
15260    #[simd_test(enable = "avx512bw")]
15261    const fn test_mm512_mask_cmpgt_epu16_mask() {
15262        let a = _mm512_set1_epi16(2);
15263        let b = _mm512_set1_epi16(1);
15264        let mask = 0b01010101_01010101_01010101_01010101;
15265        let r = _mm512_mask_cmpgt_epu16_mask(mask, a, b);
15266        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15267    }
15268
15269    #[simd_test(enable = "avx512bw,avx512vl")]
15270    const fn test_mm256_cmpgt_epu16_mask() {
15271        let a = _mm256_set1_epi16(2);
15272        let b = _mm256_set1_epi16(1);
15273        let m = _mm256_cmpgt_epu16_mask(a, b);
15274        assert_eq!(m, 0b11111111_11111111);
15275    }
15276
15277    #[simd_test(enable = "avx512bw,avx512vl")]
15278    const fn test_mm256_mask_cmpgt_epu16_mask() {
15279        let a = _mm256_set1_epi16(2);
15280        let b = _mm256_set1_epi16(1);
15281        let mask = 0b01010101_01010101;
15282        let r = _mm256_mask_cmpgt_epu16_mask(mask, a, b);
15283        assert_eq!(r, 0b01010101_01010101);
15284    }
15285
15286    #[simd_test(enable = "avx512bw,avx512vl")]
15287    const fn test_mm_cmpgt_epu16_mask() {
15288        let a = _mm_set1_epi16(2);
15289        let b = _mm_set1_epi16(1);
15290        let m = _mm_cmpgt_epu16_mask(a, b);
15291        assert_eq!(m, 0b11111111);
15292    }
15293
15294    #[simd_test(enable = "avx512bw,avx512vl")]
15295    const fn test_mm_mask_cmpgt_epu16_mask() {
15296        let a = _mm_set1_epi16(2);
15297        let b = _mm_set1_epi16(1);
15298        let mask = 0b01010101;
15299        let r = _mm_mask_cmpgt_epu16_mask(mask, a, b);
15300        assert_eq!(r, 0b01010101);
15301    }
15302
15303    #[simd_test(enable = "avx512bw")]
15304    const fn test_mm512_cmpgt_epu8_mask() {
15305        let a = _mm512_set1_epi8(2);
15306        let b = _mm512_set1_epi8(1);
15307        let m = _mm512_cmpgt_epu8_mask(a, b);
15308        assert_eq!(
15309            m,
15310            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
15311        );
15312    }
15313
15314    #[simd_test(enable = "avx512bw")]
15315    const fn test_mm512_mask_cmpgt_epu8_mask() {
15316        let a = _mm512_set1_epi8(2);
15317        let b = _mm512_set1_epi8(1);
15318        let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
15319        let r = _mm512_mask_cmpgt_epu8_mask(mask, a, b);
15320        assert_eq!(
15321            r,
15322            0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
15323        );
15324    }
15325
15326    #[simd_test(enable = "avx512bw,avx512vl")]
15327    const fn test_mm256_cmpgt_epu8_mask() {
15328        let a = _mm256_set1_epi8(2);
15329        let b = _mm256_set1_epi8(1);
15330        let m = _mm256_cmpgt_epu8_mask(a, b);
15331        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15332    }
15333
15334    #[simd_test(enable = "avx512bw,avx512vl")]
15335    const fn test_mm256_mask_cmpgt_epu8_mask() {
15336        let a = _mm256_set1_epi8(2);
15337        let b = _mm256_set1_epi8(1);
15338        let mask = 0b01010101_01010101_01010101_01010101;
15339        let r = _mm256_mask_cmpgt_epu8_mask(mask, a, b);
15340        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15341    }
15342
15343    #[simd_test(enable = "avx512bw,avx512vl")]
15344    const fn test_mm_cmpgt_epu8_mask() {
15345        let a = _mm_set1_epi8(2);
15346        let b = _mm_set1_epi8(1);
15347        let m = _mm_cmpgt_epu8_mask(a, b);
15348        assert_eq!(m, 0b11111111_11111111);
15349    }
15350
15351    #[simd_test(enable = "avx512bw,avx512vl")]
15352    const fn test_mm_mask_cmpgt_epu8_mask() {
15353        let a = _mm_set1_epi8(2);
15354        let b = _mm_set1_epi8(1);
15355        let mask = 0b01010101_01010101;
15356        let r = _mm_mask_cmpgt_epu8_mask(mask, a, b);
15357        assert_eq!(r, 0b01010101_01010101);
15358    }
15359
15360    #[simd_test(enable = "avx512bw")]
15361    const fn test_mm512_cmpgt_epi16_mask() {
15362        let a = _mm512_set1_epi16(2);
15363        let b = _mm512_set1_epi16(-1);
15364        let m = _mm512_cmpgt_epi16_mask(a, b);
15365        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15366    }
15367
15368    #[simd_test(enable = "avx512bw")]
15369    const fn test_mm512_mask_cmpgt_epi16_mask() {
15370        let a = _mm512_set1_epi16(2);
15371        let b = _mm512_set1_epi16(-1);
15372        let mask = 0b01010101_01010101_01010101_01010101;
15373        let r = _mm512_mask_cmpgt_epi16_mask(mask, a, b);
15374        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15375    }
15376
15377    #[simd_test(enable = "avx512bw,avx512vl")]
15378    const fn test_mm256_cmpgt_epi16_mask() {
15379        let a = _mm256_set1_epi16(2);
15380        let b = _mm256_set1_epi16(-1);
15381        let m = _mm256_cmpgt_epi16_mask(a, b);
15382        assert_eq!(m, 0b11111111_11111111);
15383    }
15384
15385    #[simd_test(enable = "avx512bw,avx512vl")]
15386    const fn test_mm256_mask_cmpgt_epi16_mask() {
15387        let a = _mm256_set1_epi16(2);
15388        let b = _mm256_set1_epi16(-1);
15389        let mask = 0b001010101_01010101;
15390        let r = _mm256_mask_cmpgt_epi16_mask(mask, a, b);
15391        assert_eq!(r, 0b01010101_01010101);
15392    }
15393
15394    #[simd_test(enable = "avx512bw,avx512vl")]
15395    const fn test_mm_cmpgt_epi16_mask() {
15396        let a = _mm_set1_epi16(2);
15397        let b = _mm_set1_epi16(-1);
15398        let m = _mm_cmpgt_epi16_mask(a, b);
15399        assert_eq!(m, 0b11111111);
15400    }
15401
15402    #[simd_test(enable = "avx512bw,avx512vl")]
15403    const fn test_mm_mask_cmpgt_epi16_mask() {
15404        let a = _mm_set1_epi16(2);
15405        let b = _mm_set1_epi16(-1);
15406        let mask = 0b01010101;
15407        let r = _mm_mask_cmpgt_epi16_mask(mask, a, b);
15408        assert_eq!(r, 0b01010101);
15409    }
15410
15411    #[simd_test(enable = "avx512bw")]
15412    const fn test_mm512_cmpgt_epi8_mask() {
15413        let a = _mm512_set1_epi8(2);
15414        let b = _mm512_set1_epi8(-1);
15415        let m = _mm512_cmpgt_epi8_mask(a, b);
15416        assert_eq!(
15417            m,
15418            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
15419        );
15420    }
15421
15422    #[simd_test(enable = "avx512bw")]
15423    const fn test_mm512_mask_cmpgt_epi8_mask() {
15424        let a = _mm512_set1_epi8(2);
15425        let b = _mm512_set1_epi8(-1);
15426        let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
15427        let r = _mm512_mask_cmpgt_epi8_mask(mask, a, b);
15428        assert_eq!(
15429            r,
15430            0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
15431        );
15432    }
15433
15434    #[simd_test(enable = "avx512bw,avx512vl")]
15435    const fn test_mm256_cmpgt_epi8_mask() {
15436        let a = _mm256_set1_epi8(2);
15437        let b = _mm256_set1_epi8(-1);
15438        let m = _mm256_cmpgt_epi8_mask(a, b);
15439        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15440    }
15441
15442    #[simd_test(enable = "avx512bw,avx512vl")]
15443    const fn test_mm256_mask_cmpgt_epi8_mask() {
15444        let a = _mm256_set1_epi8(2);
15445        let b = _mm256_set1_epi8(-1);
15446        let mask = 0b01010101_01010101_01010101_01010101;
15447        let r = _mm256_mask_cmpgt_epi8_mask(mask, a, b);
15448        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15449    }
15450
15451    #[simd_test(enable = "avx512bw,avx512vl")]
15452    const fn test_mm_cmpgt_epi8_mask() {
15453        let a = _mm_set1_epi8(2);
15454        let b = _mm_set1_epi8(-1);
15455        let m = _mm_cmpgt_epi8_mask(a, b);
15456        assert_eq!(m, 0b11111111_11111111);
15457    }
15458
15459    #[simd_test(enable = "avx512bw,avx512vl")]
15460    const fn test_mm_mask_cmpgt_epi8_mask() {
15461        let a = _mm_set1_epi8(2);
15462        let b = _mm_set1_epi8(-1);
15463        let mask = 0b01010101_01010101;
15464        let r = _mm_mask_cmpgt_epi8_mask(mask, a, b);
15465        assert_eq!(r, 0b01010101_01010101);
15466    }
15467
15468    #[simd_test(enable = "avx512bw")]
15469    const fn test_mm512_cmple_epu16_mask() {
15470        let a = _mm512_set1_epi16(-1);
15471        let b = _mm512_set1_epi16(-1);
15472        let m = _mm512_cmple_epu16_mask(a, b);
15473        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15474    }
15475
15476    #[simd_test(enable = "avx512bw")]
15477    const fn test_mm512_mask_cmple_epu16_mask() {
15478        let a = _mm512_set1_epi16(-1);
15479        let b = _mm512_set1_epi16(-1);
15480        let mask = 0b01010101_01010101_01010101_01010101;
15481        let r = _mm512_mask_cmple_epu16_mask(mask, a, b);
15482        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15483    }
15484
15485    #[simd_test(enable = "avx512bw,avx512vl")]
15486    const fn test_mm256_cmple_epu16_mask() {
15487        let a = _mm256_set1_epi16(-1);
15488        let b = _mm256_set1_epi16(-1);
15489        let m = _mm256_cmple_epu16_mask(a, b);
15490        assert_eq!(m, 0b11111111_11111111);
15491    }
15492
15493    #[simd_test(enable = "avx512bw,avx512vl")]
15494    const fn test_mm256_mask_cmple_epu16_mask() {
15495        let a = _mm256_set1_epi16(-1);
15496        let b = _mm256_set1_epi16(-1);
15497        let mask = 0b01010101_01010101;
15498        let r = _mm256_mask_cmple_epu16_mask(mask, a, b);
15499        assert_eq!(r, 0b01010101_01010101);
15500    }
15501
15502    #[simd_test(enable = "avx512bw,avx512vl")]
15503    const fn test_mm_cmple_epu16_mask() {
15504        let a = _mm_set1_epi16(-1);
15505        let b = _mm_set1_epi16(-1);
15506        let m = _mm_cmple_epu16_mask(a, b);
15507        assert_eq!(m, 0b11111111);
15508    }
15509
15510    #[simd_test(enable = "avx512bw,avx512vl")]
15511    const fn test_mm_mask_cmple_epu16_mask() {
15512        let a = _mm_set1_epi16(-1);
15513        let b = _mm_set1_epi16(-1);
15514        let mask = 0b01010101;
15515        let r = _mm_mask_cmple_epu16_mask(mask, a, b);
15516        assert_eq!(r, 0b01010101);
15517    }
15518
15519    #[simd_test(enable = "avx512bw")]
15520    const fn test_mm512_cmple_epu8_mask() {
15521        let a = _mm512_set1_epi8(-1);
15522        let b = _mm512_set1_epi8(-1);
15523        let m = _mm512_cmple_epu8_mask(a, b);
15524        assert_eq!(
15525            m,
15526            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
15527        );
15528    }
15529
15530    #[simd_test(enable = "avx512bw")]
15531    const fn test_mm512_mask_cmple_epu8_mask() {
15532        let a = _mm512_set1_epi8(-1);
15533        let b = _mm512_set1_epi8(-1);
15534        let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
15535        let r = _mm512_mask_cmple_epu8_mask(mask, a, b);
15536        assert_eq!(
15537            r,
15538            0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
15539        );
15540    }
15541
15542    #[simd_test(enable = "avx512bw,avx512vl")]
15543    const fn test_mm256_cmple_epu8_mask() {
15544        let a = _mm256_set1_epi8(-1);
15545        let b = _mm256_set1_epi8(-1);
15546        let m = _mm256_cmple_epu8_mask(a, b);
15547        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15548    }
15549
15550    #[simd_test(enable = "avx512bw,avx512vl")]
15551    const fn test_mm256_mask_cmple_epu8_mask() {
15552        let a = _mm256_set1_epi8(-1);
15553        let b = _mm256_set1_epi8(-1);
15554        let mask = 0b01010101_01010101_01010101_01010101;
15555        let r = _mm256_mask_cmple_epu8_mask(mask, a, b);
15556        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15557    }
15558
15559    #[simd_test(enable = "avx512bw,avx512vl")]
15560    const fn test_mm_cmple_epu8_mask() {
15561        let a = _mm_set1_epi8(-1);
15562        let b = _mm_set1_epi8(-1);
15563        let m = _mm_cmple_epu8_mask(a, b);
15564        assert_eq!(m, 0b11111111_11111111);
15565    }
15566
15567    #[simd_test(enable = "avx512bw,avx512vl")]
15568    const fn test_mm_mask_cmple_epu8_mask() {
15569        let a = _mm_set1_epi8(-1);
15570        let b = _mm_set1_epi8(-1);
15571        let mask = 0b01010101_01010101;
15572        let r = _mm_mask_cmple_epu8_mask(mask, a, b);
15573        assert_eq!(r, 0b01010101_01010101);
15574    }
15575
15576    #[simd_test(enable = "avx512bw")]
15577    const fn test_mm512_cmple_epi16_mask() {
15578        let a = _mm512_set1_epi16(-1);
15579        let b = _mm512_set1_epi16(-1);
15580        let m = _mm512_cmple_epi16_mask(a, b);
15581        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15582    }
15583
15584    #[simd_test(enable = "avx512bw")]
15585    const fn test_mm512_mask_cmple_epi16_mask() {
15586        let a = _mm512_set1_epi16(-1);
15587        let b = _mm512_set1_epi16(-1);
15588        let mask = 0b01010101_01010101_01010101_01010101;
15589        let r = _mm512_mask_cmple_epi16_mask(mask, a, b);
15590        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15591    }
15592
15593    #[simd_test(enable = "avx512bw,avx512vl")]
15594    const fn test_mm256_cmple_epi16_mask() {
15595        let a = _mm256_set1_epi16(-1);
15596        let b = _mm256_set1_epi16(-1);
15597        let m = _mm256_cmple_epi16_mask(a, b);
15598        assert_eq!(m, 0b11111111_11111111);
15599    }
15600
15601    #[simd_test(enable = "avx512bw,avx512vl")]
15602    const fn test_mm256_mask_cmple_epi16_mask() {
15603        let a = _mm256_set1_epi16(-1);
15604        let b = _mm256_set1_epi16(-1);
15605        let mask = 0b01010101_01010101;
15606        let r = _mm256_mask_cmple_epi16_mask(mask, a, b);
15607        assert_eq!(r, 0b01010101_01010101);
15608    }
15609
15610    #[simd_test(enable = "avx512bw,avx512vl")]
15611    const fn test_mm_cmple_epi16_mask() {
15612        let a = _mm_set1_epi16(-1);
15613        let b = _mm_set1_epi16(-1);
15614        let m = _mm_cmple_epi16_mask(a, b);
15615        assert_eq!(m, 0b11111111);
15616    }
15617
15618    #[simd_test(enable = "avx512bw,avx512vl")]
15619    const fn test_mm_mask_cmple_epi16_mask() {
15620        let a = _mm_set1_epi16(-1);
15621        let b = _mm_set1_epi16(-1);
15622        let mask = 0b01010101;
15623        let r = _mm_mask_cmple_epi16_mask(mask, a, b);
15624        assert_eq!(r, 0b01010101);
15625    }
15626
15627    #[simd_test(enable = "avx512bw")]
15628    const fn test_mm512_cmple_epi8_mask() {
15629        let a = _mm512_set1_epi8(-1);
15630        let b = _mm512_set1_epi8(-1);
15631        let m = _mm512_cmple_epi8_mask(a, b);
15632        assert_eq!(
15633            m,
15634            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
15635        );
15636    }
15637
15638    #[simd_test(enable = "avx512bw")]
15639    const fn test_mm512_mask_cmple_epi8_mask() {
15640        let a = _mm512_set1_epi8(-1);
15641        let b = _mm512_set1_epi8(-1);
15642        let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
15643        let r = _mm512_mask_cmple_epi8_mask(mask, a, b);
15644        assert_eq!(
15645            r,
15646            0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
15647        );
15648    }
15649
15650    #[simd_test(enable = "avx512bw,avx512vl")]
15651    const fn test_mm256_cmple_epi8_mask() {
15652        let a = _mm256_set1_epi8(-1);
15653        let b = _mm256_set1_epi8(-1);
15654        let m = _mm256_cmple_epi8_mask(a, b);
15655        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15656    }
15657
15658    #[simd_test(enable = "avx512bw,avx512vl")]
15659    const fn test_mm256_mask_cmple_epi8_mask() {
15660        let a = _mm256_set1_epi8(-1);
15661        let b = _mm256_set1_epi8(-1);
15662        let mask = 0b01010101_01010101_01010101_01010101;
15663        let r = _mm256_mask_cmple_epi8_mask(mask, a, b);
15664        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15665    }
15666
15667    #[simd_test(enable = "avx512bw,avx512vl")]
15668    const fn test_mm_cmple_epi8_mask() {
15669        let a = _mm_set1_epi8(-1);
15670        let b = _mm_set1_epi8(-1);
15671        let m = _mm_cmple_epi8_mask(a, b);
15672        assert_eq!(m, 0b11111111_11111111);
15673    }
15674
15675    #[simd_test(enable = "avx512bw,avx512vl")]
15676    const fn test_mm_mask_cmple_epi8_mask() {
15677        let a = _mm_set1_epi8(-1);
15678        let b = _mm_set1_epi8(-1);
15679        let mask = 0b01010101_01010101;
15680        let r = _mm_mask_cmple_epi8_mask(mask, a, b);
15681        assert_eq!(r, 0b01010101_01010101);
15682    }
15683
15684    #[simd_test(enable = "avx512bw")]
15685    const fn test_mm512_cmpge_epu16_mask() {
15686        let a = _mm512_set1_epi16(1);
15687        let b = _mm512_set1_epi16(1);
15688        let m = _mm512_cmpge_epu16_mask(a, b);
15689        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15690    }
15691
15692    #[simd_test(enable = "avx512bw")]
15693    const fn test_mm512_mask_cmpge_epu16_mask() {
15694        let a = _mm512_set1_epi16(1);
15695        let b = _mm512_set1_epi16(1);
15696        let mask = 0b01010101_01010101_01010101_01010101;
15697        let r = _mm512_mask_cmpge_epu16_mask(mask, a, b);
15698        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15699    }
15700
15701    #[simd_test(enable = "avx512bw,avx512vl")]
15702    const fn test_mm256_cmpge_epu16_mask() {
15703        let a = _mm256_set1_epi16(1);
15704        let b = _mm256_set1_epi16(1);
15705        let m = _mm256_cmpge_epu16_mask(a, b);
15706        assert_eq!(m, 0b11111111_11111111);
15707    }
15708
15709    #[simd_test(enable = "avx512bw,avx512vl")]
15710    const fn test_mm256_mask_cmpge_epu16_mask() {
15711        let a = _mm256_set1_epi16(1);
15712        let b = _mm256_set1_epi16(1);
15713        let mask = 0b01010101_01010101;
15714        let r = _mm256_mask_cmpge_epu16_mask(mask, a, b);
15715        assert_eq!(r, 0b01010101_01010101);
15716    }
15717
15718    #[simd_test(enable = "avx512bw,avx512vl")]
15719    const fn test_mm_cmpge_epu16_mask() {
15720        let a = _mm_set1_epi16(1);
15721        let b = _mm_set1_epi16(1);
15722        let m = _mm_cmpge_epu16_mask(a, b);
15723        assert_eq!(m, 0b11111111);
15724    }
15725
15726    #[simd_test(enable = "avx512bw,avx512vl")]
15727    const fn test_mm_mask_cmpge_epu16_mask() {
15728        let a = _mm_set1_epi16(1);
15729        let b = _mm_set1_epi16(1);
15730        let mask = 0b01010101;
15731        let r = _mm_mask_cmpge_epu16_mask(mask, a, b);
15732        assert_eq!(r, 0b01010101);
15733    }
15734
15735    #[simd_test(enable = "avx512bw")]
15736    const fn test_mm512_cmpge_epu8_mask() {
15737        let a = _mm512_set1_epi8(1);
15738        let b = _mm512_set1_epi8(1);
15739        let m = _mm512_cmpge_epu8_mask(a, b);
15740        assert_eq!(
15741            m,
15742            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
15743        );
15744    }
15745
15746    #[simd_test(enable = "avx512bw")]
15747    const fn test_mm512_mask_cmpge_epu8_mask() {
15748        let a = _mm512_set1_epi8(1);
15749        let b = _mm512_set1_epi8(1);
15750        let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
15751        let r = _mm512_mask_cmpge_epu8_mask(mask, a, b);
15752        assert_eq!(
15753            r,
15754            0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
15755        );
15756    }
15757
15758    #[simd_test(enable = "avx512bw,avx512vl")]
15759    const fn test_mm256_cmpge_epu8_mask() {
15760        let a = _mm256_set1_epi8(1);
15761        let b = _mm256_set1_epi8(1);
15762        let m = _mm256_cmpge_epu8_mask(a, b);
15763        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15764    }
15765
15766    #[simd_test(enable = "avx512bw,avx512vl")]
15767    const fn test_mm256_mask_cmpge_epu8_mask() {
15768        let a = _mm256_set1_epi8(1);
15769        let b = _mm256_set1_epi8(1);
15770        let mask = 0b01010101_01010101_01010101_01010101;
15771        let r = _mm256_mask_cmpge_epu8_mask(mask, a, b);
15772        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15773    }
15774
15775    #[simd_test(enable = "avx512bw,avx512vl")]
15776    const fn test_mm_cmpge_epu8_mask() {
15777        let a = _mm_set1_epi8(1);
15778        let b = _mm_set1_epi8(1);
15779        let m = _mm_cmpge_epu8_mask(a, b);
15780        assert_eq!(m, 0b11111111_11111111);
15781    }
15782
15783    #[simd_test(enable = "avx512bw,avx512vl")]
15784    const fn test_mm_mask_cmpge_epu8_mask() {
15785        let a = _mm_set1_epi8(1);
15786        let b = _mm_set1_epi8(1);
15787        let mask = 0b01010101_01010101;
15788        let r = _mm_mask_cmpge_epu8_mask(mask, a, b);
15789        assert_eq!(r, 0b01010101_01010101);
15790    }
15791
15792    #[simd_test(enable = "avx512bw")]
15793    const fn test_mm512_cmpge_epi16_mask() {
15794        let a = _mm512_set1_epi16(-1);
15795        let b = _mm512_set1_epi16(-1);
15796        let m = _mm512_cmpge_epi16_mask(a, b);
15797        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15798    }
15799
15800    #[simd_test(enable = "avx512bw")]
15801    const fn test_mm512_mask_cmpge_epi16_mask() {
15802        let a = _mm512_set1_epi16(-1);
15803        let b = _mm512_set1_epi16(-1);
15804        let mask = 0b01010101_01010101_01010101_01010101;
15805        let r = _mm512_mask_cmpge_epi16_mask(mask, a, b);
15806        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15807    }
15808
15809    #[simd_test(enable = "avx512bw,avx512vl")]
15810    const fn test_mm256_cmpge_epi16_mask() {
15811        let a = _mm256_set1_epi16(-1);
15812        let b = _mm256_set1_epi16(-1);
15813        let m = _mm256_cmpge_epi16_mask(a, b);
15814        assert_eq!(m, 0b11111111_11111111);
15815    }
15816
15817    #[simd_test(enable = "avx512bw,avx512vl")]
15818    const fn test_mm256_mask_cmpge_epi16_mask() {
15819        let a = _mm256_set1_epi16(-1);
15820        let b = _mm256_set1_epi16(-1);
15821        let mask = 0b01010101_01010101;
15822        let r = _mm256_mask_cmpge_epi16_mask(mask, a, b);
15823        assert_eq!(r, 0b01010101_01010101);
15824    }
15825
15826    #[simd_test(enable = "avx512bw,avx512vl")]
15827    const fn test_mm_cmpge_epi16_mask() {
15828        let a = _mm_set1_epi16(-1);
15829        let b = _mm_set1_epi16(-1);
15830        let m = _mm_cmpge_epi16_mask(a, b);
15831        assert_eq!(m, 0b11111111);
15832    }
15833
15834    #[simd_test(enable = "avx512bw,avx512vl")]
15835    const fn test_mm_mask_cmpge_epi16_mask() {
15836        let a = _mm_set1_epi16(-1);
15837        let b = _mm_set1_epi16(-1);
15838        let mask = 0b01010101;
15839        let r = _mm_mask_cmpge_epi16_mask(mask, a, b);
15840        assert_eq!(r, 0b01010101);
15841    }
15842
15843    #[simd_test(enable = "avx512bw")]
15844    const fn test_mm512_cmpge_epi8_mask() {
15845        let a = _mm512_set1_epi8(-1);
15846        let b = _mm512_set1_epi8(-1);
15847        let m = _mm512_cmpge_epi8_mask(a, b);
15848        assert_eq!(
15849            m,
15850            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
15851        );
15852    }
15853
15854    #[simd_test(enable = "avx512bw")]
15855    const fn test_mm512_mask_cmpge_epi8_mask() {
15856        let a = _mm512_set1_epi8(-1);
15857        let b = _mm512_set1_epi8(-1);
15858        let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
15859        let r = _mm512_mask_cmpge_epi8_mask(mask, a, b);
15860        assert_eq!(
15861            r,
15862            0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
15863        );
15864    }
15865
15866    #[simd_test(enable = "avx512bw,avx512vl")]
15867    const fn test_mm256_cmpge_epi8_mask() {
15868        let a = _mm256_set1_epi8(-1);
15869        let b = _mm256_set1_epi8(-1);
15870        let m = _mm256_cmpge_epi8_mask(a, b);
15871        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15872    }
15873
15874    #[simd_test(enable = "avx512bw,avx512vl")]
15875    const fn test_mm256_mask_cmpge_epi8_mask() {
15876        let a = _mm256_set1_epi8(-1);
15877        let b = _mm256_set1_epi8(-1);
15878        let mask = 0b01010101_01010101_01010101_01010101;
15879        let r = _mm256_mask_cmpge_epi8_mask(mask, a, b);
15880        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15881    }
15882
15883    #[simd_test(enable = "avx512bw,avx512vl")]
15884    const fn test_mm_cmpge_epi8_mask() {
15885        let a = _mm_set1_epi8(-1);
15886        let b = _mm_set1_epi8(-1);
15887        let m = _mm_cmpge_epi8_mask(a, b);
15888        assert_eq!(m, 0b11111111_11111111);
15889    }
15890
15891    #[simd_test(enable = "avx512bw,avx512vl")]
15892    const fn test_mm_mask_cmpge_epi8_mask() {
15893        let a = _mm_set1_epi8(-1);
15894        let b = _mm_set1_epi8(-1);
15895        let mask = 0b01010101_01010101;
15896        let r = _mm_mask_cmpge_epi8_mask(mask, a, b);
15897        assert_eq!(r, 0b01010101_01010101);
15898    }
15899
15900    #[simd_test(enable = "avx512bw")]
15901    const fn test_mm512_cmpeq_epu16_mask() {
15902        let a = _mm512_set1_epi16(1);
15903        let b = _mm512_set1_epi16(1);
15904        let m = _mm512_cmpeq_epu16_mask(a, b);
15905        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15906    }
15907
15908    #[simd_test(enable = "avx512bw")]
15909    const fn test_mm512_mask_cmpeq_epu16_mask() {
15910        let a = _mm512_set1_epi16(1);
15911        let b = _mm512_set1_epi16(1);
15912        let mask = 0b01010101_01010101_01010101_01010101;
15913        let r = _mm512_mask_cmpeq_epu16_mask(mask, a, b);
15914        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15915    }
15916
15917    #[simd_test(enable = "avx512bw,avx512vl")]
15918    const fn test_mm256_cmpeq_epu16_mask() {
15919        let a = _mm256_set1_epi16(1);
15920        let b = _mm256_set1_epi16(1);
15921        let m = _mm256_cmpeq_epu16_mask(a, b);
15922        assert_eq!(m, 0b11111111_11111111);
15923    }
15924
15925    #[simd_test(enable = "avx512bw,avx512vl")]
15926    const fn test_mm256_mask_cmpeq_epu16_mask() {
15927        let a = _mm256_set1_epi16(1);
15928        let b = _mm256_set1_epi16(1);
15929        let mask = 0b01010101_01010101;
15930        let r = _mm256_mask_cmpeq_epu16_mask(mask, a, b);
15931        assert_eq!(r, 0b01010101_01010101);
15932    }
15933
15934    #[simd_test(enable = "avx512bw,avx512vl")]
15935    const fn test_mm_cmpeq_epu16_mask() {
15936        let a = _mm_set1_epi16(1);
15937        let b = _mm_set1_epi16(1);
15938        let m = _mm_cmpeq_epu16_mask(a, b);
15939        assert_eq!(m, 0b11111111);
15940    }
15941
15942    #[simd_test(enable = "avx512bw,avx512vl")]
15943    const fn test_mm_mask_cmpeq_epu16_mask() {
15944        let a = _mm_set1_epi16(1);
15945        let b = _mm_set1_epi16(1);
15946        let mask = 0b01010101;
15947        let r = _mm_mask_cmpeq_epu16_mask(mask, a, b);
15948        assert_eq!(r, 0b01010101);
15949    }
15950
15951    #[simd_test(enable = "avx512bw")]
15952    const fn test_mm512_cmpeq_epu8_mask() {
15953        let a = _mm512_set1_epi8(1);
15954        let b = _mm512_set1_epi8(1);
15955        let m = _mm512_cmpeq_epu8_mask(a, b);
15956        assert_eq!(
15957            m,
15958            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
15959        );
15960    }
15961
15962    #[simd_test(enable = "avx512bw")]
15963    const fn test_mm512_mask_cmpeq_epu8_mask() {
15964        let a = _mm512_set1_epi8(1);
15965        let b = _mm512_set1_epi8(1);
15966        let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
15967        let r = _mm512_mask_cmpeq_epu8_mask(mask, a, b);
15968        assert_eq!(
15969            r,
15970            0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
15971        );
15972    }
15973
15974    #[simd_test(enable = "avx512bw,avx512vl")]
15975    const fn test_mm256_cmpeq_epu8_mask() {
15976        let a = _mm256_set1_epi8(1);
15977        let b = _mm256_set1_epi8(1);
15978        let m = _mm256_cmpeq_epu8_mask(a, b);
15979        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15980    }
15981
15982    #[simd_test(enable = "avx512bw,avx512vl")]
15983    const fn test_mm256_mask_cmpeq_epu8_mask() {
15984        let a = _mm256_set1_epi8(1);
15985        let b = _mm256_set1_epi8(1);
15986        let mask = 0b01010101_01010101_01010101_01010101;
15987        let r = _mm256_mask_cmpeq_epu8_mask(mask, a, b);
15988        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15989    }
15990
15991    #[simd_test(enable = "avx512bw,avx512vl")]
15992    const fn test_mm_cmpeq_epu8_mask() {
15993        let a = _mm_set1_epi8(1);
15994        let b = _mm_set1_epi8(1);
15995        let m = _mm_cmpeq_epu8_mask(a, b);
15996        assert_eq!(m, 0b11111111_11111111);
15997    }
15998
15999    #[simd_test(enable = "avx512bw,avx512vl")]
16000    const fn test_mm_mask_cmpeq_epu8_mask() {
16001        let a = _mm_set1_epi8(1);
16002        let b = _mm_set1_epi8(1);
16003        let mask = 0b01010101_01010101;
16004        let r = _mm_mask_cmpeq_epu8_mask(mask, a, b);
16005        assert_eq!(r, 0b01010101_01010101);
16006    }
16007
16008    #[simd_test(enable = "avx512bw")]
16009    const fn test_mm512_cmpeq_epi16_mask() {
16010        let a = _mm512_set1_epi16(-1);
16011        let b = _mm512_set1_epi16(-1);
16012        let m = _mm512_cmpeq_epi16_mask(a, b);
16013        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
16014    }
16015
16016    #[simd_test(enable = "avx512bw")]
16017    const fn test_mm512_mask_cmpeq_epi16_mask() {
16018        let a = _mm512_set1_epi16(-1);
16019        let b = _mm512_set1_epi16(-1);
16020        let mask = 0b01010101_01010101_01010101_01010101;
16021        let r = _mm512_mask_cmpeq_epi16_mask(mask, a, b);
16022        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
16023    }
16024
16025    #[simd_test(enable = "avx512bw,avx512vl")]
16026    const fn test_mm256_cmpeq_epi16_mask() {
16027        let a = _mm256_set1_epi16(-1);
16028        let b = _mm256_set1_epi16(-1);
16029        let m = _mm256_cmpeq_epi16_mask(a, b);
16030        assert_eq!(m, 0b11111111_11111111);
16031    }
16032
16033    #[simd_test(enable = "avx512bw,avx512vl")]
16034    const fn test_mm256_mask_cmpeq_epi16_mask() {
16035        let a = _mm256_set1_epi16(-1);
16036        let b = _mm256_set1_epi16(-1);
16037        let mask = 0b01010101_01010101;
16038        let r = _mm256_mask_cmpeq_epi16_mask(mask, a, b);
16039        assert_eq!(r, 0b01010101_01010101);
16040    }
16041
16042    #[simd_test(enable = "avx512bw,avx512vl")]
16043    const fn test_mm_cmpeq_epi16_mask() {
16044        let a = _mm_set1_epi16(-1);
16045        let b = _mm_set1_epi16(-1);
16046        let m = _mm_cmpeq_epi16_mask(a, b);
16047        assert_eq!(m, 0b11111111);
16048    }
16049
16050    #[simd_test(enable = "avx512bw,avx512vl")]
16051    const fn test_mm_mask_cmpeq_epi16_mask() {
16052        let a = _mm_set1_epi16(-1);
16053        let b = _mm_set1_epi16(-1);
16054        let mask = 0b01010101;
16055        let r = _mm_mask_cmpeq_epi16_mask(mask, a, b);
16056        assert_eq!(r, 0b01010101);
16057    }
16058
16059    #[simd_test(enable = "avx512bw")]
16060    const fn test_mm512_cmpeq_epi8_mask() {
16061        let a = _mm512_set1_epi8(-1);
16062        let b = _mm512_set1_epi8(-1);
16063        let m = _mm512_cmpeq_epi8_mask(a, b);
16064        assert_eq!(
16065            m,
16066            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
16067        );
16068    }
16069
16070    #[simd_test(enable = "avx512bw")]
16071    const fn test_mm512_mask_cmpeq_epi8_mask() {
16072        let a = _mm512_set1_epi8(-1);
16073        let b = _mm512_set1_epi8(-1);
16074        let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
16075        let r = _mm512_mask_cmpeq_epi8_mask(mask, a, b);
16076        assert_eq!(
16077            r,
16078            0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
16079        );
16080    }
16081
16082    #[simd_test(enable = "avx512bw,avx512vl")]
16083    const fn test_mm256_cmpeq_epi8_mask() {
16084        let a = _mm256_set1_epi8(-1);
16085        let b = _mm256_set1_epi8(-1);
16086        let m = _mm256_cmpeq_epi8_mask(a, b);
16087        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
16088    }
16089
16090    #[simd_test(enable = "avx512bw,avx512vl")]
16091    const fn test_mm256_mask_cmpeq_epi8_mask() {
16092        let a = _mm256_set1_epi8(-1);
16093        let b = _mm256_set1_epi8(-1);
16094        let mask = 0b01010101_01010101_01010101_01010101;
16095        let r = _mm256_mask_cmpeq_epi8_mask(mask, a, b);
16096        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
16097    }
16098
16099    #[simd_test(enable = "avx512bw,avx512vl")]
16100    const fn test_mm_cmpeq_epi8_mask() {
16101        let a = _mm_set1_epi8(-1);
16102        let b = _mm_set1_epi8(-1);
16103        let m = _mm_cmpeq_epi8_mask(a, b);
16104        assert_eq!(m, 0b11111111_11111111);
16105    }
16106
16107    #[simd_test(enable = "avx512bw,avx512vl")]
16108    const fn test_mm_mask_cmpeq_epi8_mask() {
16109        let a = _mm_set1_epi8(-1);
16110        let b = _mm_set1_epi8(-1);
16111        let mask = 0b01010101_01010101;
16112        let r = _mm_mask_cmpeq_epi8_mask(mask, a, b);
16113        assert_eq!(r, 0b01010101_01010101);
16114    }
16115
16116    #[simd_test(enable = "avx512bw")]
16117    const fn test_mm512_cmpneq_epu16_mask() {
16118        let a = _mm512_set1_epi16(2);
16119        let b = _mm512_set1_epi16(1);
16120        let m = _mm512_cmpneq_epu16_mask(a, b);
16121        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
16122    }
16123
16124    #[simd_test(enable = "avx512bw")]
16125    const fn test_mm512_mask_cmpneq_epu16_mask() {
16126        let a = _mm512_set1_epi16(2);
16127        let b = _mm512_set1_epi16(1);
16128        let mask = 0b01010101_01010101_01010101_01010101;
16129        let r = _mm512_mask_cmpneq_epu16_mask(mask, a, b);
16130        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
16131    }
16132
16133    #[simd_test(enable = "avx512bw,avx512vl")]
16134    const fn test_mm256_cmpneq_epu16_mask() {
16135        let a = _mm256_set1_epi16(2);
16136        let b = _mm256_set1_epi16(1);
16137        let m = _mm256_cmpneq_epu16_mask(a, b);
16138        assert_eq!(m, 0b11111111_11111111);
16139    }
16140
16141    #[simd_test(enable = "avx512bw,avx512vl")]
16142    const fn test_mm256_mask_cmpneq_epu16_mask() {
16143        let a = _mm256_set1_epi16(2);
16144        let b = _mm256_set1_epi16(1);
16145        let mask = 0b01010101_01010101;
16146        let r = _mm256_mask_cmpneq_epu16_mask(mask, a, b);
16147        assert_eq!(r, 0b01010101_01010101);
16148    }
16149
16150    #[simd_test(enable = "avx512bw,avx512vl")]
16151    const fn test_mm_cmpneq_epu16_mask() {
16152        let a = _mm_set1_epi16(2);
16153        let b = _mm_set1_epi16(1);
16154        let m = _mm_cmpneq_epu16_mask(a, b);
16155        assert_eq!(m, 0b11111111);
16156    }
16157
16158    #[simd_test(enable = "avx512bw,avx512vl")]
16159    const fn test_mm_mask_cmpneq_epu16_mask() {
16160        let a = _mm_set1_epi16(2);
16161        let b = _mm_set1_epi16(1);
16162        let mask = 0b01010101;
16163        let r = _mm_mask_cmpneq_epu16_mask(mask, a, b);
16164        assert_eq!(r, 0b01010101);
16165    }
16166
16167    #[simd_test(enable = "avx512bw")]
16168    const fn test_mm512_cmpneq_epu8_mask() {
16169        let a = _mm512_set1_epi8(2);
16170        let b = _mm512_set1_epi8(1);
16171        let m = _mm512_cmpneq_epu8_mask(a, b);
16172        assert_eq!(
16173            m,
16174            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
16175        );
16176    }
16177
16178    #[simd_test(enable = "avx512bw")]
16179    const fn test_mm512_mask_cmpneq_epu8_mask() {
16180        let a = _mm512_set1_epi8(2);
16181        let b = _mm512_set1_epi8(1);
16182        let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
16183        let r = _mm512_mask_cmpneq_epu8_mask(mask, a, b);
16184        assert_eq!(
16185            r,
16186            0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
16187        );
16188    }
16189
16190    #[simd_test(enable = "avx512bw,avx512vl")]
16191    const fn test_mm256_cmpneq_epu8_mask() {
16192        let a = _mm256_set1_epi8(2);
16193        let b = _mm256_set1_epi8(1);
16194        let m = _mm256_cmpneq_epu8_mask(a, b);
16195        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
16196    }
16197
16198    #[simd_test(enable = "avx512bw,avx512vl")]
16199    const fn test_mm256_mask_cmpneq_epu8_mask() {
16200        let a = _mm256_set1_epi8(2);
16201        let b = _mm256_set1_epi8(1);
16202        let mask = 0b01010101_01010101_01010101_01010101;
16203        let r = _mm256_mask_cmpneq_epu8_mask(mask, a, b);
16204        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
16205    }
16206
16207    #[simd_test(enable = "avx512bw,avx512vl")]
16208    const fn test_mm_cmpneq_epu8_mask() {
16209        let a = _mm_set1_epi8(2);
16210        let b = _mm_set1_epi8(1);
16211        let m = _mm_cmpneq_epu8_mask(a, b);
16212        assert_eq!(m, 0b11111111_11111111);
16213    }
16214
16215    #[simd_test(enable = "avx512bw,avx512vl")]
16216    const fn test_mm_mask_cmpneq_epu8_mask() {
16217        let a = _mm_set1_epi8(2);
16218        let b = _mm_set1_epi8(1);
16219        let mask = 0b01010101_01010101;
16220        let r = _mm_mask_cmpneq_epu8_mask(mask, a, b);
16221        assert_eq!(r, 0b01010101_01010101);
16222    }
16223
16224    #[simd_test(enable = "avx512bw")]
16225    const fn test_mm512_cmpneq_epi16_mask() {
16226        let a = _mm512_set1_epi16(1);
16227        let b = _mm512_set1_epi16(-1);
16228        let m = _mm512_cmpneq_epi16_mask(a, b);
16229        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
16230    }
16231
16232    #[simd_test(enable = "avx512bw")]
16233    const fn test_mm512_mask_cmpneq_epi16_mask() {
16234        let a = _mm512_set1_epi16(1);
16235        let b = _mm512_set1_epi16(-1);
16236        let mask = 0b01010101_01010101_01010101_01010101;
16237        let r = _mm512_mask_cmpneq_epi16_mask(mask, a, b);
16238        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
16239    }
16240
16241    #[simd_test(enable = "avx512bw,avx512vl")]
16242    const fn test_mm256_cmpneq_epi16_mask() {
16243        let a = _mm256_set1_epi16(1);
16244        let b = _mm256_set1_epi16(-1);
16245        let m = _mm256_cmpneq_epi16_mask(a, b);
16246        assert_eq!(m, 0b11111111_11111111);
16247    }
16248
16249    #[simd_test(enable = "avx512bw,avx512vl")]
16250    const fn test_mm256_mask_cmpneq_epi16_mask() {
16251        let a = _mm256_set1_epi16(1);
16252        let b = _mm256_set1_epi16(-1);
16253        let mask = 0b01010101_01010101;
16254        let r = _mm256_mask_cmpneq_epi16_mask(mask, a, b);
16255        assert_eq!(r, 0b01010101_01010101);
16256    }
16257
16258    #[simd_test(enable = "avx512bw,avx512vl")]
16259    const fn test_mm_cmpneq_epi16_mask() {
16260        let a = _mm_set1_epi16(1);
16261        let b = _mm_set1_epi16(-1);
16262        let m = _mm_cmpneq_epi16_mask(a, b);
16263        assert_eq!(m, 0b11111111);
16264    }
16265
16266    #[simd_test(enable = "avx512bw,avx512vl")]
16267    const fn test_mm_mask_cmpneq_epi16_mask() {
16268        let a = _mm_set1_epi16(1);
16269        let b = _mm_set1_epi16(-1);
16270        let mask = 0b01010101;
16271        let r = _mm_mask_cmpneq_epi16_mask(mask, a, b);
16272        assert_eq!(r, 0b01010101);
16273    }
16274
16275    #[simd_test(enable = "avx512bw")]
16276    const fn test_mm512_cmpneq_epi8_mask() {
16277        let a = _mm512_set1_epi8(1);
16278        let b = _mm512_set1_epi8(-1);
16279        let m = _mm512_cmpneq_epi8_mask(a, b);
16280        assert_eq!(
16281            m,
16282            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
16283        );
16284    }
16285
16286    #[simd_test(enable = "avx512bw")]
16287    const fn test_mm512_mask_cmpneq_epi8_mask() {
16288        let a = _mm512_set1_epi8(1);
16289        let b = _mm512_set1_epi8(-1);
16290        let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
16291        let r = _mm512_mask_cmpneq_epi8_mask(mask, a, b);
16292        assert_eq!(
16293            r,
16294            0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
16295        );
16296    }
16297
16298    #[simd_test(enable = "avx512bw,avx512vl")]
16299    const fn test_mm256_cmpneq_epi8_mask() {
16300        let a = _mm256_set1_epi8(1);
16301        let b = _mm256_set1_epi8(-1);
16302        let m = _mm256_cmpneq_epi8_mask(a, b);
16303        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
16304    }
16305
16306    #[simd_test(enable = "avx512bw,avx512vl")]
16307    const fn test_mm256_mask_cmpneq_epi8_mask() {
16308        let a = _mm256_set1_epi8(1);
16309        let b = _mm256_set1_epi8(-1);
16310        let mask = 0b01010101_01010101_01010101_01010101;
16311        let r = _mm256_mask_cmpneq_epi8_mask(mask, a, b);
16312        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
16313    }
16314
16315    #[simd_test(enable = "avx512bw,avx512vl")]
16316    const fn test_mm_cmpneq_epi8_mask() {
16317        let a = _mm_set1_epi8(1);
16318        let b = _mm_set1_epi8(-1);
16319        let m = _mm_cmpneq_epi8_mask(a, b);
16320        assert_eq!(m, 0b11111111_11111111);
16321    }
16322
16323    #[simd_test(enable = "avx512bw,avx512vl")]
16324    const fn test_mm_mask_cmpneq_epi8_mask() {
16325        let a = _mm_set1_epi8(1);
16326        let b = _mm_set1_epi8(-1);
16327        let mask = 0b01010101_01010101;
16328        let r = _mm_mask_cmpneq_epi8_mask(mask, a, b);
16329        assert_eq!(r, 0b01010101_01010101);
16330    }
16331
16332    #[simd_test(enable = "avx512bw")]
16333    const fn test_mm512_cmp_epu16_mask() {
16334        let a = _mm512_set1_epi16(0);
16335        let b = _mm512_set1_epi16(1);
16336        let m = _mm512_cmp_epu16_mask::<_MM_CMPINT_LT>(a, b);
16337        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
16338    }
16339
16340    #[simd_test(enable = "avx512bw")]
16341    const fn test_mm512_mask_cmp_epu16_mask() {
16342        let a = _mm512_set1_epi16(0);
16343        let b = _mm512_set1_epi16(1);
16344        let mask = 0b01010101_01010101_01010101_01010101;
16345        let r = _mm512_mask_cmp_epu16_mask::<_MM_CMPINT_LT>(mask, a, b);
16346        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
16347    }
16348
16349    #[simd_test(enable = "avx512bw,avx512vl")]
16350    const fn test_mm256_cmp_epu16_mask() {
16351        let a = _mm256_set1_epi16(0);
16352        let b = _mm256_set1_epi16(1);
16353        let m = _mm256_cmp_epu16_mask::<_MM_CMPINT_LT>(a, b);
16354        assert_eq!(m, 0b11111111_11111111);
16355    }
16356
16357    #[simd_test(enable = "avx512bw,avx512vl")]
16358    const fn test_mm256_mask_cmp_epu16_mask() {
16359        let a = _mm256_set1_epi16(0);
16360        let b = _mm256_set1_epi16(1);
16361        let mask = 0b01010101_01010101;
16362        let r = _mm256_mask_cmp_epu16_mask::<_MM_CMPINT_LT>(mask, a, b);
16363        assert_eq!(r, 0b01010101_01010101);
16364    }
16365
16366    #[simd_test(enable = "avx512bw,avx512vl")]
16367    const fn test_mm_cmp_epu16_mask() {
16368        let a = _mm_set1_epi16(0);
16369        let b = _mm_set1_epi16(1);
16370        let m = _mm_cmp_epu16_mask::<_MM_CMPINT_LT>(a, b);
16371        assert_eq!(m, 0b11111111);
16372    }
16373
16374    #[simd_test(enable = "avx512bw,avx512vl")]
16375    const fn test_mm_mask_cmp_epu16_mask() {
16376        let a = _mm_set1_epi16(0);
16377        let b = _mm_set1_epi16(1);
16378        let mask = 0b01010101;
16379        let r = _mm_mask_cmp_epu16_mask::<_MM_CMPINT_LT>(mask, a, b);
16380        assert_eq!(r, 0b01010101);
16381    }
16382
16383    #[simd_test(enable = "avx512bw")]
16384    const fn test_mm512_cmp_epu8_mask() {
16385        let a = _mm512_set1_epi8(0);
16386        let b = _mm512_set1_epi8(1);
16387        let m = _mm512_cmp_epu8_mask::<_MM_CMPINT_LT>(a, b);
16388        assert_eq!(
16389            m,
16390            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
16391        );
16392    }
16393
16394    #[simd_test(enable = "avx512bw")]
16395    const fn test_mm512_mask_cmp_epu8_mask() {
16396        let a = _mm512_set1_epi8(0);
16397        let b = _mm512_set1_epi8(1);
16398        let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
16399        let r = _mm512_mask_cmp_epu8_mask::<_MM_CMPINT_LT>(mask, a, b);
16400        assert_eq!(
16401            r,
16402            0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
16403        );
16404    }
16405
16406    #[simd_test(enable = "avx512bw,avx512vl")]
16407    const fn test_mm256_cmp_epu8_mask() {
16408        let a = _mm256_set1_epi8(0);
16409        let b = _mm256_set1_epi8(1);
16410        let m = _mm256_cmp_epu8_mask::<_MM_CMPINT_LT>(a, b);
16411        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
16412    }
16413
16414    #[simd_test(enable = "avx512bw,avx512vl")]
16415    const fn test_mm256_mask_cmp_epu8_mask() {
16416        let a = _mm256_set1_epi8(0);
16417        let b = _mm256_set1_epi8(1);
16418        let mask = 0b01010101_01010101_01010101_01010101;
16419        let r = _mm256_mask_cmp_epu8_mask::<_MM_CMPINT_LT>(mask, a, b);
16420        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
16421    }
16422
16423    #[simd_test(enable = "avx512bw,avx512vl")]
16424    const fn test_mm_cmp_epu8_mask() {
16425        let a = _mm_set1_epi8(0);
16426        let b = _mm_set1_epi8(1);
16427        let m = _mm_cmp_epu8_mask::<_MM_CMPINT_LT>(a, b);
16428        assert_eq!(m, 0b11111111_11111111);
16429    }
16430
16431    #[simd_test(enable = "avx512bw,avx512vl")]
16432    const fn test_mm_mask_cmp_epu8_mask() {
16433        let a = _mm_set1_epi8(0);
16434        let b = _mm_set1_epi8(1);
16435        let mask = 0b01010101_01010101;
16436        let r = _mm_mask_cmp_epu8_mask::<_MM_CMPINT_LT>(mask, a, b);
16437        assert_eq!(r, 0b01010101_01010101);
16438    }
16439
16440    #[simd_test(enable = "avx512bw")]
16441    const fn test_mm512_cmp_epi16_mask() {
16442        let a = _mm512_set1_epi16(0);
16443        let b = _mm512_set1_epi16(1);
16444        let m = _mm512_cmp_epi16_mask::<_MM_CMPINT_LT>(a, b);
16445        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
16446    }
16447
16448    #[simd_test(enable = "avx512bw")]
16449    const fn test_mm512_mask_cmp_epi16_mask() {
16450        let a = _mm512_set1_epi16(0);
16451        let b = _mm512_set1_epi16(1);
16452        let mask = 0b01010101_01010101_01010101_01010101;
16453        let r = _mm512_mask_cmp_epi16_mask::<_MM_CMPINT_LT>(mask, a, b);
16454        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
16455    }
16456
16457    #[simd_test(enable = "avx512bw,avx512vl")]
16458    const fn test_mm256_cmp_epi16_mask() {
16459        let a = _mm256_set1_epi16(0);
16460        let b = _mm256_set1_epi16(1);
16461        let m = _mm256_cmp_epi16_mask::<_MM_CMPINT_LT>(a, b);
16462        assert_eq!(m, 0b11111111_11111111);
16463    }
16464
16465    #[simd_test(enable = "avx512bw,avx512vl")]
16466    const fn test_mm256_mask_cmp_epi16_mask() {
16467        let a = _mm256_set1_epi16(0);
16468        let b = _mm256_set1_epi16(1);
16469        let mask = 0b01010101_01010101;
16470        let r = _mm256_mask_cmp_epi16_mask::<_MM_CMPINT_LT>(mask, a, b);
16471        assert_eq!(r, 0b01010101_01010101);
16472    }
16473
16474    #[simd_test(enable = "avx512bw,avx512vl")]
16475    const fn test_mm_cmp_epi16_mask() {
16476        let a = _mm_set1_epi16(0);
16477        let b = _mm_set1_epi16(1);
16478        let m = _mm_cmp_epi16_mask::<_MM_CMPINT_LT>(a, b);
16479        assert_eq!(m, 0b11111111);
16480    }
16481
16482    #[simd_test(enable = "avx512bw,avx512vl")]
16483    const fn test_mm_mask_cmp_epi16_mask() {
16484        let a = _mm_set1_epi16(0);
16485        let b = _mm_set1_epi16(1);
16486        let mask = 0b01010101;
16487        let r = _mm_mask_cmp_epi16_mask::<_MM_CMPINT_LT>(mask, a, b);
16488        assert_eq!(r, 0b01010101);
16489    }
16490
16491    #[simd_test(enable = "avx512bw")]
16492    const fn test_mm512_cmp_epi8_mask() {
16493        let a = _mm512_set1_epi8(0);
16494        let b = _mm512_set1_epi8(1);
16495        let m = _mm512_cmp_epi8_mask::<_MM_CMPINT_LT>(a, b);
16496        assert_eq!(
16497            m,
16498            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
16499        );
16500    }
16501
16502    #[simd_test(enable = "avx512bw")]
16503    const fn test_mm512_mask_cmp_epi8_mask() {
16504        let a = _mm512_set1_epi8(0);
16505        let b = _mm512_set1_epi8(1);
16506        let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
16507        let r = _mm512_mask_cmp_epi8_mask::<_MM_CMPINT_LT>(mask, a, b);
16508        assert_eq!(
16509            r,
16510            0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
16511        );
16512    }
16513
16514    #[simd_test(enable = "avx512bw,avx512vl")]
16515    const fn test_mm256_cmp_epi8_mask() {
16516        let a = _mm256_set1_epi8(0);
16517        let b = _mm256_set1_epi8(1);
16518        let m = _mm256_cmp_epi8_mask::<_MM_CMPINT_LT>(a, b);
16519        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
16520    }
16521
16522    #[simd_test(enable = "avx512bw,avx512vl")]
16523    const fn test_mm256_mask_cmp_epi8_mask() {
16524        let a = _mm256_set1_epi8(0);
16525        let b = _mm256_set1_epi8(1);
16526        let mask = 0b01010101_01010101_01010101_01010101;
16527        let r = _mm256_mask_cmp_epi8_mask::<_MM_CMPINT_LT>(mask, a, b);
16528        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
16529    }
16530
16531    #[simd_test(enable = "avx512bw,avx512vl")]
16532    const fn test_mm_cmp_epi8_mask() {
16533        let a = _mm_set1_epi8(0);
16534        let b = _mm_set1_epi8(1);
16535        let m = _mm_cmp_epi8_mask::<_MM_CMPINT_LT>(a, b);
16536        assert_eq!(m, 0b11111111_11111111);
16537    }
16538
16539    #[simd_test(enable = "avx512bw,avx512vl")]
16540    const fn test_mm_mask_cmp_epi8_mask() {
16541        let a = _mm_set1_epi8(0);
16542        let b = _mm_set1_epi8(1);
16543        let mask = 0b01010101_01010101;
16544        let r = _mm_mask_cmp_epi8_mask::<_MM_CMPINT_LT>(mask, a, b);
16545        assert_eq!(r, 0b01010101_01010101);
16546    }
16547
16548    #[simd_test(enable = "avx512bw,avx512vl")]
16549    const fn test_mm256_reduce_add_epi16() {
16550        let a = _mm256_set1_epi16(1);
16551        let e = _mm256_reduce_add_epi16(a);
16552        assert_eq!(16, e);
16553    }
16554
16555    #[simd_test(enable = "avx512bw,avx512vl")]
16556    const fn test_mm256_mask_reduce_add_epi16() {
16557        let a = _mm256_set1_epi16(1);
16558        let e = _mm256_mask_reduce_add_epi16(0b11111111_00000000, a);
16559        assert_eq!(8, e);
16560    }
16561
16562    #[simd_test(enable = "avx512bw,avx512vl")]
16563    const fn test_mm_reduce_add_epi16() {
16564        let a = _mm_set1_epi16(1);
16565        let e = _mm_reduce_add_epi16(a);
16566        assert_eq!(8, e);
16567    }
16568
16569    #[simd_test(enable = "avx512bw,avx512vl")]
16570    const fn test_mm_mask_reduce_add_epi16() {
16571        let a = _mm_set1_epi16(1);
16572        let e = _mm_mask_reduce_add_epi16(0b11110000, a);
16573        assert_eq!(4, e);
16574    }
16575
16576    #[simd_test(enable = "avx512bw,avx512vl")]
16577    const fn test_mm256_reduce_add_epi8() {
16578        let a = _mm256_set1_epi8(1);
16579        let e = _mm256_reduce_add_epi8(a);
16580        assert_eq!(32, e);
16581    }
16582
16583    #[simd_test(enable = "avx512bw,avx512vl")]
16584    const fn test_mm256_mask_reduce_add_epi8() {
16585        let a = _mm256_set1_epi8(1);
16586        let e = _mm256_mask_reduce_add_epi8(0b11111111_00000000_11111111_00000000, a);
16587        assert_eq!(16, e);
16588    }
16589
16590    #[simd_test(enable = "avx512bw,avx512vl")]
16591    const fn test_mm_reduce_add_epi8() {
16592        let a = _mm_set1_epi8(1);
16593        let e = _mm_reduce_add_epi8(a);
16594        assert_eq!(16, e);
16595    }
16596
16597    #[simd_test(enable = "avx512bw,avx512vl")]
16598    const fn test_mm_mask_reduce_add_epi8() {
16599        let a = _mm_set1_epi8(1);
16600        let e = _mm_mask_reduce_add_epi8(0b11111111_00000000, a);
16601        assert_eq!(8, e);
16602    }
16603
16604    #[simd_test(enable = "avx512bw,avx512vl")]
16605    const fn test_mm256_reduce_and_epi16() {
16606        let a = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
16607        let e = _mm256_reduce_and_epi16(a);
16608        assert_eq!(0, e);
16609    }
16610
16611    #[simd_test(enable = "avx512bw,avx512vl")]
16612    const fn test_mm256_mask_reduce_and_epi16() {
16613        let a = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
16614        let e = _mm256_mask_reduce_and_epi16(0b11111111_00000000, a);
16615        assert_eq!(1, e);
16616    }
16617
16618    #[simd_test(enable = "avx512bw,avx512vl")]
16619    const fn test_mm_reduce_and_epi16() {
16620        let a = _mm_set_epi16(1, 1, 1, 1, 2, 2, 2, 2);
16621        let e = _mm_reduce_and_epi16(a);
16622        assert_eq!(0, e);
16623    }
16624
16625    #[simd_test(enable = "avx512bw,avx512vl")]
16626    const fn test_mm_mask_reduce_and_epi16() {
16627        let a = _mm_set_epi16(1, 1, 1, 1, 2, 2, 2, 2);
16628        let e = _mm_mask_reduce_and_epi16(0b11110000, a);
16629        assert_eq!(1, e);
16630    }
16631
16632    #[simd_test(enable = "avx512bw,avx512vl")]
16633    const fn test_mm256_reduce_and_epi8() {
16634        let a = _mm256_set_epi8(
16635            1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
16636            2, 2, 2,
16637        );
16638        let e = _mm256_reduce_and_epi8(a);
16639        assert_eq!(0, e);
16640    }
16641
16642    #[simd_test(enable = "avx512bw,avx512vl")]
16643    const fn test_mm256_mask_reduce_and_epi8() {
16644        let a = _mm256_set_epi8(
16645            1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
16646            2, 2, 2,
16647        );
16648        let e = _mm256_mask_reduce_and_epi8(0b11111111_00000000_11111111_00000000, a);
16649        assert_eq!(1, e);
16650    }
16651
16652    #[simd_test(enable = "avx512bw,avx512vl")]
16653    const fn test_mm_reduce_and_epi8() {
16654        let a = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
16655        let e = _mm_reduce_and_epi8(a);
16656        assert_eq!(0, e);
16657    }
16658
16659    #[simd_test(enable = "avx512bw,avx512vl")]
16660    const fn test_mm_mask_reduce_and_epi8() {
16661        let a = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
16662        let e = _mm_mask_reduce_and_epi8(0b11111111_00000000, a);
16663        assert_eq!(1, e);
16664    }
16665
16666    #[simd_test(enable = "avx512bw,avx512vl")]
16667    const fn test_mm256_reduce_mul_epi16() {
16668        let a = _mm256_set_epi16(2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1);
16669        let e = _mm256_reduce_mul_epi16(a);
16670        assert_eq!(256, e);
16671    }
16672
16673    #[simd_test(enable = "avx512bw,avx512vl")]
16674    const fn test_mm256_mask_reduce_mul_epi16() {
16675        let a = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
16676        let e = _mm256_mask_reduce_mul_epi16(0b11111111_00000000, a);
16677        assert_eq!(1, e);
16678    }
16679
16680    #[simd_test(enable = "avx512bw,avx512vl")]
16681    const fn test_mm_reduce_mul_epi16() {
16682        let a = _mm_set_epi16(2, 2, 2, 2, 1, 1, 1, 1);
16683        let e = _mm_reduce_mul_epi16(a);
16684        assert_eq!(16, e);
16685    }
16686
16687    #[simd_test(enable = "avx512bw,avx512vl")]
16688    const fn test_mm_mask_reduce_mul_epi16() {
16689        let a = _mm_set_epi16(1, 1, 1, 1, 2, 2, 2, 2);
16690        let e = _mm_mask_reduce_mul_epi16(0b11110000, a);
16691        assert_eq!(1, e);
16692    }
16693
16694    #[simd_test(enable = "avx512bw,avx512vl")]
16695    const fn test_mm256_reduce_mul_epi8() {
16696        let a = _mm256_set_epi8(
16697            1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
16698            2, 2, 2,
16699        );
16700        let e = _mm256_reduce_mul_epi8(a);
16701        assert_eq!(64, e);
16702    }
16703
16704    #[simd_test(enable = "avx512bw,avx512vl")]
16705    const fn test_mm256_mask_reduce_mul_epi8() {
16706        let a = _mm256_set_epi8(
16707            1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
16708            2, 2, 2,
16709        );
16710        let e = _mm256_mask_reduce_mul_epi8(0b11111111_00000000_11111111_00000000, a);
16711        assert_eq!(1, e);
16712    }
16713
16714    #[simd_test(enable = "avx512bw,avx512vl")]
16715    const fn test_mm_reduce_mul_epi8() {
16716        let a = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2);
16717        let e = _mm_reduce_mul_epi8(a);
16718        assert_eq!(8, e);
16719    }
16720
16721    #[simd_test(enable = "avx512bw,avx512vl")]
16722    const fn test_mm_mask_reduce_mul_epi8() {
16723        let a = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2);
16724        let e = _mm_mask_reduce_mul_epi8(0b11111111_00000000, a);
16725        assert_eq!(1, e);
16726    }
16727
16728    #[simd_test(enable = "avx512bw,avx512vl")]
16729    const fn test_mm256_reduce_max_epi16() {
16730        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16731        let e: i16 = _mm256_reduce_max_epi16(a);
16732        assert_eq!(15, e);
16733    }
16734
16735    #[simd_test(enable = "avx512bw,avx512vl")]
16736    const fn test_mm256_mask_reduce_max_epi16() {
16737        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16738        let e: i16 = _mm256_mask_reduce_max_epi16(0b11111111_00000000, a);
16739        assert_eq!(7, e);
16740    }
16741
16742    #[simd_test(enable = "avx512bw,avx512vl")]
16743    const fn test_mm_reduce_max_epi16() {
16744        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
16745        let e: i16 = _mm_reduce_max_epi16(a);
16746        assert_eq!(7, e);
16747    }
16748
16749    #[simd_test(enable = "avx512bw,avx512vl")]
16750    const fn test_mm_mask_reduce_max_epi16() {
16751        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
16752        let e: i16 = _mm_mask_reduce_max_epi16(0b11110000, a);
16753        assert_eq!(3, e);
16754    }
16755
16756    #[simd_test(enable = "avx512bw,avx512vl")]
16757    const fn test_mm256_reduce_max_epi8() {
16758        let a = _mm256_set_epi8(
16759            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
16760            24, 25, 26, 27, 28, 29, 30, 31,
16761        );
16762        let e: i8 = _mm256_reduce_max_epi8(a);
16763        assert_eq!(31, e);
16764    }
16765
16766    #[simd_test(enable = "avx512bw,avx512vl")]
16767    const fn test_mm256_mask_reduce_max_epi8() {
16768        let a = _mm256_set_epi8(
16769            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
16770            24, 25, 26, 27, 28, 29, 30, 31,
16771        );
16772        let e: i8 = _mm256_mask_reduce_max_epi8(0b1111111111111111_0000000000000000, a);
16773        assert_eq!(15, e);
16774    }
16775
16776    #[simd_test(enable = "avx512bw,avx512vl")]
16777    const fn test_mm_reduce_max_epi8() {
16778        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16779        let e: i8 = _mm_reduce_max_epi8(a);
16780        assert_eq!(15, e);
16781    }
16782
16783    #[simd_test(enable = "avx512bw,avx512vl")]
16784    const fn test_mm_mask_reduce_max_epi8() {
16785        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16786        let e: i8 = _mm_mask_reduce_max_epi8(0b11111111_00000000, a);
16787        assert_eq!(7, e);
16788    }
16789
16790    #[simd_test(enable = "avx512bw,avx512vl")]
16791    const fn test_mm256_reduce_max_epu16() {
16792        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16793        let e: u16 = _mm256_reduce_max_epu16(a);
16794        assert_eq!(15, e);
16795    }
16796
16797    #[simd_test(enable = "avx512bw,avx512vl")]
16798    const fn test_mm256_mask_reduce_max_epu16() {
16799        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16800        let e: u16 = _mm256_mask_reduce_max_epu16(0b11111111_00000000, a);
16801        assert_eq!(7, e);
16802    }
16803
16804    #[simd_test(enable = "avx512bw,avx512vl")]
16805    const fn test_mm_reduce_max_epu16() {
16806        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
16807        let e: u16 = _mm_reduce_max_epu16(a);
16808        assert_eq!(7, e);
16809    }
16810
16811    #[simd_test(enable = "avx512bw,avx512vl")]
16812    const fn test_mm_mask_reduce_max_epu16() {
16813        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
16814        let e: u16 = _mm_mask_reduce_max_epu16(0b11110000, a);
16815        assert_eq!(3, e);
16816    }
16817
16818    #[simd_test(enable = "avx512bw,avx512vl")]
16819    const fn test_mm256_reduce_max_epu8() {
16820        let a = _mm256_set_epi8(
16821            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
16822            24, 25, 26, 27, 28, 29, 30, 31,
16823        );
16824        let e: u8 = _mm256_reduce_max_epu8(a);
16825        assert_eq!(31, e);
16826    }
16827
16828    #[simd_test(enable = "avx512bw,avx512vl")]
16829    const fn test_mm256_mask_reduce_max_epu8() {
16830        let a = _mm256_set_epi8(
16831            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
16832            24, 25, 26, 27, 28, 29, 30, 31,
16833        );
16834        let e: u8 = _mm256_mask_reduce_max_epu8(0b1111111111111111_0000000000000000, a);
16835        assert_eq!(15, e);
16836    }
16837
16838    #[simd_test(enable = "avx512bw,avx512vl")]
16839    const fn test_mm_reduce_max_epu8() {
16840        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16841        let e: u8 = _mm_reduce_max_epu8(a);
16842        assert_eq!(15, e);
16843    }
16844
16845    #[simd_test(enable = "avx512bw,avx512vl")]
16846    const fn test_mm_mask_reduce_max_epu8() {
16847        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16848        let e: u8 = _mm_mask_reduce_max_epu8(0b11111111_00000000, a);
16849        assert_eq!(7, e);
16850    }
16851
16852    #[simd_test(enable = "avx512bw,avx512vl")]
16853    const fn test_mm256_reduce_min_epi16() {
16854        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16855        let e: i16 = _mm256_reduce_min_epi16(a);
16856        assert_eq!(0, e);
16857    }
16858
16859    #[simd_test(enable = "avx512bw,avx512vl")]
16860    const fn test_mm256_mask_reduce_min_epi16() {
16861        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16862        let e: i16 = _mm256_mask_reduce_min_epi16(0b11111111_00000000, a);
16863        assert_eq!(0, e);
16864    }
16865
16866    #[simd_test(enable = "avx512bw,avx512vl")]
16867    const fn test_mm_reduce_min_epi16() {
16868        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
16869        let e: i16 = _mm_reduce_min_epi16(a);
16870        assert_eq!(0, e);
16871    }
16872
16873    #[simd_test(enable = "avx512bw,avx512vl")]
16874    const fn test_mm_mask_reduce_min_epi16() {
16875        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
16876        let e: i16 = _mm_mask_reduce_min_epi16(0b11110000, a);
16877        assert_eq!(0, e);
16878    }
16879
16880    #[simd_test(enable = "avx512bw,avx512vl")]
16881    const fn test_mm256_reduce_min_epi8() {
16882        let a = _mm256_set_epi8(
16883            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
16884            24, 25, 26, 27, 28, 29, 30, 31,
16885        );
16886        let e: i8 = _mm256_reduce_min_epi8(a);
16887        assert_eq!(0, e);
16888    }
16889
16890    #[simd_test(enable = "avx512bw,avx512vl")]
16891    const fn test_mm256_mask_reduce_min_epi8() {
16892        let a = _mm256_set_epi8(
16893            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
16894            24, 25, 26, 27, 28, 29, 30, 31,
16895        );
16896        let e: i8 = _mm256_mask_reduce_min_epi8(0b1111111111111111_0000000000000000, a);
16897        assert_eq!(0, e);
16898    }
16899
16900    #[simd_test(enable = "avx512bw,avx512vl")]
16901    const fn test_mm_reduce_min_epi8() {
16902        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16903        let e: i8 = _mm_reduce_min_epi8(a);
16904        assert_eq!(0, e);
16905    }
16906
16907    #[simd_test(enable = "avx512bw,avx512vl")]
16908    const fn test_mm_mask_reduce_min_epi8() {
16909        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16910        let e: i8 = _mm_mask_reduce_min_epi8(0b11111111_00000000, a);
16911        assert_eq!(0, e);
16912    }
16913
16914    #[simd_test(enable = "avx512bw,avx512vl")]
16915    const fn test_mm256_reduce_min_epu16() {
16916        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16917        let e: u16 = _mm256_reduce_min_epu16(a);
16918        assert_eq!(0, e);
16919    }
16920
16921    #[simd_test(enable = "avx512bw,avx512vl")]
16922    const fn test_mm256_mask_reduce_min_epu16() {
16923        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16924        let e: u16 = _mm256_mask_reduce_min_epu16(0b11111111_00000000, a);
16925        assert_eq!(0, e);
16926    }
16927
16928    #[simd_test(enable = "avx512bw,avx512vl")]
16929    const fn test_mm_reduce_min_epu16() {
16930        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
16931        let e: u16 = _mm_reduce_min_epu16(a);
16932        assert_eq!(0, e);
16933    }
16934
16935    #[simd_test(enable = "avx512bw,avx512vl")]
16936    const fn test_mm_mask_reduce_min_epu16() {
16937        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
16938        let e: u16 = _mm_mask_reduce_min_epu16(0b11110000, a);
16939        assert_eq!(0, e);
16940    }
16941
16942    #[simd_test(enable = "avx512bw,avx512vl")]
16943    const fn test_mm256_reduce_min_epu8() {
16944        let a = _mm256_set_epi8(
16945            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
16946            24, 25, 26, 27, 28, 29, 30, 31,
16947        );
16948        let e: u8 = _mm256_reduce_min_epu8(a);
16949        assert_eq!(0, e);
16950    }
16951
16952    #[simd_test(enable = "avx512bw,avx512vl")]
16953    const fn test_mm256_mask_reduce_min_epu8() {
16954        let a = _mm256_set_epi8(
16955            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
16956            24, 25, 26, 27, 28, 29, 30, 31,
16957        );
16958        let e: u8 = _mm256_mask_reduce_min_epu8(0b1111111111111111_0000000000000000, a);
16959        assert_eq!(0, e);
16960    }
16961
16962    #[simd_test(enable = "avx512bw,avx512vl")]
16963    const fn test_mm_reduce_min_epu8() {
16964        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16965        let e: u8 = _mm_reduce_min_epu8(a);
16966        assert_eq!(0, e);
16967    }
16968
16969    #[simd_test(enable = "avx512bw,avx512vl")]
16970    const fn test_mm_mask_reduce_min_epu8() {
16971        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16972        let e: u8 = _mm_mask_reduce_min_epu8(0b11111111_00000000, a);
16973        assert_eq!(0, e);
16974    }
16975
16976    #[simd_test(enable = "avx512bw,avx512vl")]
16977    const fn test_mm256_reduce_or_epi16() {
16978        let a = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
16979        let e = _mm256_reduce_or_epi16(a);
16980        assert_eq!(3, e);
16981    }
16982
16983    #[simd_test(enable = "avx512bw,avx512vl")]
16984    const fn test_mm256_mask_reduce_or_epi16() {
16985        let a = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
16986        let e = _mm256_mask_reduce_or_epi16(0b11111111_00000000, a);
16987        assert_eq!(1, e);
16988    }
16989
16990    #[simd_test(enable = "avx512bw,avx512vl")]
16991    const fn test_mm_reduce_or_epi16() {
16992        let a = _mm_set_epi16(1, 1, 1, 1, 2, 2, 2, 2);
16993        let e = _mm_reduce_or_epi16(a);
16994        assert_eq!(3, e);
16995    }
16996
16997    #[simd_test(enable = "avx512bw,avx512vl")]
16998    const fn test_mm_mask_reduce_or_epi16() {
16999        let a = _mm_set_epi16(1, 1, 1, 1, 2, 2, 2, 2);
17000        let e = _mm_mask_reduce_or_epi16(0b11110000, a);
17001        assert_eq!(1, e);
17002    }
17003
17004    #[simd_test(enable = "avx512bw,avx512vl")]
17005    const fn test_mm256_reduce_or_epi8() {
17006        let a = _mm256_set_epi8(
17007            1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
17008            2, 2, 2,
17009        );
17010        let e = _mm256_reduce_or_epi8(a);
17011        assert_eq!(3, e);
17012    }
17013
17014    #[simd_test(enable = "avx512bw,avx512vl")]
17015    const fn test_mm256_mask_reduce_or_epi8() {
17016        let a = _mm256_set_epi8(
17017            1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
17018            2, 2, 2,
17019        );
17020        let e = _mm256_mask_reduce_or_epi8(0b11111111_00000000_11111111_00000000, a);
17021        assert_eq!(1, e);
17022    }
17023
17024    #[simd_test(enable = "avx512bw,avx512vl")]
17025    const fn test_mm_reduce_or_epi8() {
17026        let a = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
17027        let e = _mm_reduce_or_epi8(a);
17028        assert_eq!(3, e);
17029    }
17030
17031    #[simd_test(enable = "avx512bw,avx512vl")]
17032    const fn test_mm_mask_reduce_or_epi8() {
17033        let a = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
17034        let e = _mm_mask_reduce_or_epi8(0b11111111_00000000, a);
17035        assert_eq!(1, e);
17036    }
17037
17038    #[simd_test(enable = "avx512bw")]
17039    const fn test_mm512_loadu_epi16() {
17040        #[rustfmt::skip]
17041        let a: [i16; 32] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32];
17042        let r = unsafe { _mm512_loadu_epi16(&a[0]) };
17043        #[rustfmt::skip]
17044        let e = _mm512_set_epi16(32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
17045        assert_eq_m512i(r, e);
17046    }
17047
17048    #[simd_test(enable = "avx512bw,avx512vl")]
17049    const fn test_mm256_loadu_epi16() {
17050        let a: [i16; 16] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
17051        let r = unsafe { _mm256_loadu_epi16(&a[0]) };
17052        let e = _mm256_set_epi16(16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
17053        assert_eq_m256i(r, e);
17054    }
17055
17056    #[simd_test(enable = "avx512bw,avx512vl")]
17057    const fn test_mm_loadu_epi16() {
17058        let a: [i16; 8] = [1, 2, 3, 4, 5, 6, 7, 8];
17059        let r = unsafe { _mm_loadu_epi16(&a[0]) };
17060        let e = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
17061        assert_eq_m128i(r, e);
17062    }
17063
17064    #[simd_test(enable = "avx512bw")]
17065    const fn test_mm512_loadu_epi8() {
17066        #[rustfmt::skip]
17067        let a: [i8; 64] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
17068                           1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32];
17069        let r = unsafe { _mm512_loadu_epi8(&a[0]) };
17070        #[rustfmt::skip]
17071        let e = _mm512_set_epi8(32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1,
17072                                32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
17073        assert_eq_m512i(r, e);
17074    }
17075
17076    #[simd_test(enable = "avx512bw,avx512vl")]
17077    const fn test_mm256_loadu_epi8() {
17078        #[rustfmt::skip]
17079        let a: [i8; 32] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32];
17080        let r = unsafe { _mm256_loadu_epi8(&a[0]) };
17081        #[rustfmt::skip]
17082        let e = _mm256_set_epi8(32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
17083        assert_eq_m256i(r, e);
17084    }
17085
17086    #[simd_test(enable = "avx512bw,avx512vl")]
17087    const fn test_mm_loadu_epi8() {
17088        let a: [i8; 16] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
17089        let r = unsafe { _mm_loadu_epi8(&a[0]) };
17090        let e = _mm_set_epi8(16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
17091        assert_eq_m128i(r, e);
17092    }
17093
17094    #[simd_test(enable = "avx512bw")]
17095    const fn test_mm512_storeu_epi16() {
17096        let a = _mm512_set1_epi16(9);
17097        let mut r = _mm512_undefined_epi32();
17098        unsafe {
17099            _mm512_storeu_epi16(&mut r as *mut _ as *mut i16, a);
17100        }
17101        assert_eq_m512i(r, a);
17102    }
17103
17104    #[simd_test(enable = "avx512bw,avx512vl")]
17105    const fn test_mm256_storeu_epi16() {
17106        let a = _mm256_set1_epi16(9);
17107        let mut r = _mm256_set1_epi32(0);
17108        unsafe {
17109            _mm256_storeu_epi16(&mut r as *mut _ as *mut i16, a);
17110        }
17111        assert_eq_m256i(r, a);
17112    }
17113
17114    #[simd_test(enable = "avx512bw,avx512vl")]
17115    const fn test_mm_storeu_epi16() {
17116        let a = _mm_set1_epi16(9);
17117        let mut r = _mm_set1_epi32(0);
17118        unsafe {
17119            _mm_storeu_epi16(&mut r as *mut _ as *mut i16, a);
17120        }
17121        assert_eq_m128i(r, a);
17122    }
17123
17124    #[simd_test(enable = "avx512bw")]
17125    const fn test_mm512_storeu_epi8() {
17126        let a = _mm512_set1_epi8(9);
17127        let mut r = _mm512_undefined_epi32();
17128        unsafe {
17129            _mm512_storeu_epi8(&mut r as *mut _ as *mut i8, a);
17130        }
17131        assert_eq_m512i(r, a);
17132    }
17133
17134    #[simd_test(enable = "avx512bw,avx512vl")]
17135    const fn test_mm256_storeu_epi8() {
17136        let a = _mm256_set1_epi8(9);
17137        let mut r = _mm256_set1_epi32(0);
17138        unsafe {
17139            _mm256_storeu_epi8(&mut r as *mut _ as *mut i8, a);
17140        }
17141        assert_eq_m256i(r, a);
17142    }
17143
17144    #[simd_test(enable = "avx512bw,avx512vl")]
17145    const fn test_mm_storeu_epi8() {
17146        let a = _mm_set1_epi8(9);
17147        let mut r = _mm_set1_epi32(0);
17148        unsafe {
17149            _mm_storeu_epi8(&mut r as *mut _ as *mut i8, a);
17150        }
17151        assert_eq_m128i(r, a);
17152    }
17153
17154    #[simd_test(enable = "avx512bw")]
17155    const fn test_mm512_mask_loadu_epi16() {
17156        let src = _mm512_set1_epi16(42);
17157        let a = &[
17158            1_i16, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
17159            24, 25, 26, 27, 28, 29, 30, 31, 32,
17160        ];
17161        let p = a.as_ptr();
17162        let m = 0b10101010_11001100_11101000_11001010;
17163        let r = unsafe { _mm512_mask_loadu_epi16(src, m, black_box(p)) };
17164        let e = &[
17165            42_i16, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16, 42, 42, 19, 20, 42, 42,
17166            23, 24, 42, 26, 42, 28, 42, 30, 42, 32,
17167        ];
17168        let e = unsafe { _mm512_loadu_epi16(e.as_ptr()) };
17169        assert_eq_m512i(r, e);
17170    }
17171
17172    #[simd_test(enable = "avx512bw")]
17173    const fn test_mm512_maskz_loadu_epi16() {
17174        let a = &[
17175            1_i16, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
17176            24, 25, 26, 27, 28, 29, 30, 31, 32,
17177        ];
17178        let p = a.as_ptr();
17179        let m = 0b10101010_11001100_11101000_11001010;
17180        let r = unsafe { _mm512_maskz_loadu_epi16(m, black_box(p)) };
17181        let e = &[
17182            0_i16, 2, 0, 4, 0, 0, 7, 8, 0, 0, 0, 12, 0, 14, 15, 16, 0, 0, 19, 20, 0, 0, 23, 24, 0,
17183            26, 0, 28, 0, 30, 0, 32,
17184        ];
17185        let e = unsafe { _mm512_loadu_epi16(e.as_ptr()) };
17186        assert_eq_m512i(r, e);
17187    }
17188
17189    #[simd_test(enable = "avx512bw")]
17190    const fn test_mm512_mask_storeu_epi16() {
17191        let mut r = [42_i16; 32];
17192        let a = &[
17193            1_i16, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
17194            24, 25, 26, 27, 28, 29, 30, 31, 32,
17195        ];
17196        let a = unsafe { _mm512_loadu_epi16(a.as_ptr()) };
17197        let m = 0b10101010_11001100_11101000_11001010;
17198        unsafe {
17199            _mm512_mask_storeu_epi16(r.as_mut_ptr(), m, a);
17200        }
17201        let e = &[
17202            42_i16, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16, 42, 42, 19, 20, 42, 42,
17203            23, 24, 42, 26, 42, 28, 42, 30, 42, 32,
17204        ];
17205        let e = unsafe { _mm512_loadu_epi16(e.as_ptr()) };
17206        assert_eq_m512i(unsafe { _mm512_loadu_epi16(r.as_ptr()) }, e);
17207    }
17208
17209    #[simd_test(enable = "avx512bw")]
17210    const fn test_mm512_mask_loadu_epi8() {
17211        let src = _mm512_set1_epi8(42);
17212        let a = &[
17213            1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
17214            24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
17215            46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
17216        ];
17217        let p = a.as_ptr();
17218        let m = 0b00000000_11111111_11111111_00000000_10101010_11001100_11101000_11001010;
17219        let r = unsafe { _mm512_mask_loadu_epi8(src, m, black_box(p)) };
17220        let e = &[
17221            42_i8, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16, 42, 42, 19, 20, 42, 42,
17222            23, 24, 42, 26, 42, 28, 42, 30, 42, 32, 42, 42, 42, 42, 42, 42, 42, 42, 41, 42, 43, 44,
17223            45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 42, 42, 42, 42, 42, 42, 42, 42,
17224        ];
17225        let e = unsafe { _mm512_loadu_epi8(e.as_ptr()) };
17226        assert_eq_m512i(r, e);
17227    }
17228
17229    #[simd_test(enable = "avx512bw")]
17230    const fn test_mm512_maskz_loadu_epi8() {
17231        let a = &[
17232            1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
17233            24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
17234            46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
17235        ];
17236        let p = a.as_ptr();
17237        let m = 0b00000000_11111111_11111111_00000000_10101010_11001100_11101000_11001010;
17238        let r = unsafe { _mm512_maskz_loadu_epi8(m, black_box(p)) };
17239        let e = &[
17240            0_i8, 2, 0, 4, 0, 0, 7, 8, 0, 0, 0, 12, 0, 14, 15, 16, 0, 0, 19, 20, 0, 0, 23, 24, 0,
17241            26, 0, 28, 0, 30, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 41, 42, 43, 44, 45, 46, 47, 48, 49,
17242            50, 51, 52, 53, 54, 55, 56, 0, 0, 0, 0, 0, 0, 0, 0,
17243        ];
17244        let e = unsafe { _mm512_loadu_epi8(e.as_ptr()) };
17245        assert_eq_m512i(r, e);
17246    }
17247
17248    #[simd_test(enable = "avx512bw")]
17249    const fn test_mm512_mask_storeu_epi8() {
17250        let mut r = [42_i8; 64];
17251        let a = &[
17252            1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
17253            24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
17254            46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
17255        ];
17256        let a = unsafe { _mm512_loadu_epi8(a.as_ptr()) };
17257        let m = 0b00000000_11111111_11111111_00000000_10101010_11001100_11101000_11001010;
17258        unsafe {
17259            _mm512_mask_storeu_epi8(r.as_mut_ptr(), m, a);
17260        }
17261        let e = &[
17262            42_i8, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16, 42, 42, 19, 20, 42, 42,
17263            23, 24, 42, 26, 42, 28, 42, 30, 42, 32, 42, 42, 42, 42, 42, 42, 42, 42, 41, 42, 43, 44,
17264            45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 42, 42, 42, 42, 42, 42, 42, 42,
17265        ];
17266        let e = unsafe { _mm512_loadu_epi8(e.as_ptr()) };
17267        assert_eq_m512i(unsafe { _mm512_loadu_epi8(r.as_ptr()) }, e);
17268    }
17269
17270    #[simd_test(enable = "avx512bw,avx512vl")]
17271    const fn test_mm256_mask_loadu_epi16() {
17272        let src = _mm256_set1_epi16(42);
17273        let a = &[1_i16, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
17274        let p = a.as_ptr();
17275        let m = 0b11101000_11001010;
17276        let r = unsafe { _mm256_mask_loadu_epi16(src, m, black_box(p)) };
17277        let e = &[
17278            42_i16, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16,
17279        ];
17280        let e = unsafe { _mm256_loadu_epi16(e.as_ptr()) };
17281        assert_eq_m256i(r, e);
17282    }
17283
17284    #[simd_test(enable = "avx512bw,avx512vl")]
17285    const fn test_mm256_maskz_loadu_epi16() {
17286        let a = &[1_i16, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
17287        let p = a.as_ptr();
17288        let m = 0b11101000_11001010;
17289        let r = unsafe { _mm256_maskz_loadu_epi16(m, black_box(p)) };
17290        let e = &[0_i16, 2, 0, 4, 0, 0, 7, 8, 0, 0, 0, 12, 0, 14, 15, 16];
17291        let e = unsafe { _mm256_loadu_epi16(e.as_ptr()) };
17292        assert_eq_m256i(r, e);
17293    }
17294
17295    #[simd_test(enable = "avx512bw,avx512vl")]
17296    const fn test_mm256_mask_storeu_epi16() {
17297        let mut r = [42_i16; 16];
17298        let a = &[1_i16, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
17299        let a = unsafe { _mm256_loadu_epi16(a.as_ptr()) };
17300        let m = 0b11101000_11001010;
17301        unsafe {
17302            _mm256_mask_storeu_epi16(r.as_mut_ptr(), m, a);
17303        }
17304        let e = &[
17305            42_i16, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16,
17306        ];
17307        let e = unsafe { _mm256_loadu_epi16(e.as_ptr()) };
17308        assert_eq_m256i(unsafe { _mm256_loadu_epi16(r.as_ptr()) }, e);
17309    }
17310
17311    #[simd_test(enable = "avx512bw,avx512vl")]
17312    const fn test_mm256_mask_loadu_epi8() {
17313        let src = _mm256_set1_epi8(42);
17314        let a = &[
17315            1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
17316            24, 25, 26, 27, 28, 29, 30, 31, 32,
17317        ];
17318        let p = a.as_ptr();
17319        let m = 0b10101010_11001100_11101000_11001010;
17320        let r = unsafe { _mm256_mask_loadu_epi8(src, m, black_box(p)) };
17321        let e = &[
17322            42_i8, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16, 42, 42, 19, 20, 42, 42,
17323            23, 24, 42, 26, 42, 28, 42, 30, 42, 32,
17324        ];
17325        let e = unsafe { _mm256_loadu_epi8(e.as_ptr()) };
17326        assert_eq_m256i(r, e);
17327    }
17328
17329    #[simd_test(enable = "avx512bw,avx512vl")]
17330    const fn test_mm256_maskz_loadu_epi8() {
17331        let a = &[
17332            1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
17333            24, 25, 26, 27, 28, 29, 30, 31, 32,
17334        ];
17335        let p = a.as_ptr();
17336        let m = 0b10101010_11001100_11101000_11001010;
17337        let r = unsafe { _mm256_maskz_loadu_epi8(m, black_box(p)) };
17338        let e = &[
17339            0_i8, 2, 0, 4, 0, 0, 7, 8, 0, 0, 0, 12, 0, 14, 15, 16, 0, 0, 19, 20, 0, 0, 23, 24, 0,
17340            26, 0, 28, 0, 30, 0, 32,
17341        ];
17342        let e = unsafe { _mm256_loadu_epi8(e.as_ptr()) };
17343        assert_eq_m256i(r, e);
17344    }
17345
17346    #[simd_test(enable = "avx512bw,avx512vl")]
17347    const fn test_mm256_mask_storeu_epi8() {
17348        let mut r = [42_i8; 32];
17349        let a = &[
17350            1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
17351            24, 25, 26, 27, 28, 29, 30, 31, 32,
17352        ];
17353        let a = unsafe { _mm256_loadu_epi8(a.as_ptr()) };
17354        let m = 0b10101010_11001100_11101000_11001010;
17355        unsafe {
17356            _mm256_mask_storeu_epi8(r.as_mut_ptr(), m, a);
17357        }
17358        let e = &[
17359            42_i8, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16, 42, 42, 19, 20, 42, 42,
17360            23, 24, 42, 26, 42, 28, 42, 30, 42, 32,
17361        ];
17362        let e = unsafe { _mm256_loadu_epi8(e.as_ptr()) };
17363        assert_eq_m256i(unsafe { _mm256_loadu_epi8(r.as_ptr()) }, e);
17364    }
17365
17366    #[simd_test(enable = "avx512bw,avx512vl")]
17367    const fn test_mm_mask_loadu_epi16() {
17368        let src = _mm_set1_epi16(42);
17369        let a = &[1_i16, 2, 3, 4, 5, 6, 7, 8];
17370        let p = a.as_ptr();
17371        let m = 0b11001010;
17372        let r = unsafe { _mm_mask_loadu_epi16(src, m, black_box(p)) };
17373        let e = &[42_i16, 2, 42, 4, 42, 42, 7, 8];
17374        let e = unsafe { _mm_loadu_epi16(e.as_ptr()) };
17375        assert_eq_m128i(r, e);
17376    }
17377
17378    #[simd_test(enable = "avx512bw,avx512vl")]
17379    const fn test_mm_maskz_loadu_epi16() {
17380        let a = &[1_i16, 2, 3, 4, 5, 6, 7, 8];
17381        let p = a.as_ptr();
17382        let m = 0b11001010;
17383        let r = unsafe { _mm_maskz_loadu_epi16(m, black_box(p)) };
17384        let e = &[0_i16, 2, 0, 4, 0, 0, 7, 8];
17385        let e = unsafe { _mm_loadu_epi16(e.as_ptr()) };
17386        assert_eq_m128i(r, e);
17387    }
17388
17389    #[simd_test(enable = "avx512bw,avx512vl")]
17390    const fn test_mm_mask_storeu_epi16() {
17391        let mut r = [42_i16; 8];
17392        let a = &[1_i16, 2, 3, 4, 5, 6, 7, 8];
17393        let a = unsafe { _mm_loadu_epi16(a.as_ptr()) };
17394        let m = 0b11001010;
17395        unsafe { _mm_mask_storeu_epi16(r.as_mut_ptr(), m, a) };
17396        let e = &[42_i16, 2, 42, 4, 42, 42, 7, 8];
17397        let e = unsafe { _mm_loadu_epi16(e.as_ptr()) };
17398        assert_eq_m128i(unsafe { _mm_loadu_epi16(r.as_ptr()) }, e);
17399    }
17400
17401    #[simd_test(enable = "avx512bw,avx512vl")]
17402    const fn test_mm_mask_loadu_epi8() {
17403        let src = _mm_set1_epi8(42);
17404        let a = &[1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
17405        let p = a.as_ptr();
17406        let m = 0b11101000_11001010;
17407        let r = unsafe { _mm_mask_loadu_epi8(src, m, black_box(p)) };
17408        let e = &[
17409            42_i8, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16,
17410        ];
17411        let e = unsafe { _mm_loadu_epi8(e.as_ptr()) };
17412        assert_eq_m128i(r, e);
17413    }
17414
17415    #[simd_test(enable = "avx512bw,avx512vl")]
17416    const fn test_mm_maskz_loadu_epi8() {
17417        let a = &[1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
17418        let p = a.as_ptr();
17419        let m = 0b11101000_11001010;
17420        let r = unsafe { _mm_maskz_loadu_epi8(m, black_box(p)) };
17421        let e = &[0_i8, 2, 0, 4, 0, 0, 7, 8, 0, 0, 0, 12, 0, 14, 15, 16];
17422        let e = unsafe { _mm_loadu_epi8(e.as_ptr()) };
17423        assert_eq_m128i(r, e);
17424    }
17425
17426    #[simd_test(enable = "avx512bw,avx512vl")]
17427    const fn test_mm_mask_storeu_epi8() {
17428        let mut r = [42_i8; 16];
17429        let a = &[1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
17430        let a = unsafe { _mm_loadu_epi8(a.as_ptr()) };
17431        let m = 0b11101000_11001010;
17432        unsafe { _mm_mask_storeu_epi8(r.as_mut_ptr(), m, a) };
17433        let e = &[
17434            42_i8, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16,
17435        ];
17436        let e = unsafe { _mm_loadu_epi8(e.as_ptr()) };
17437        assert_eq_m128i(unsafe { _mm_loadu_epi8(r.as_ptr()) }, e);
17438    }
17439
17440    #[simd_test(enable = "avx512bw")]
17441    fn test_mm512_madd_epi16() {
17442        let a = _mm512_set1_epi16(1);
17443        let b = _mm512_set1_epi16(1);
17444        let r = _mm512_madd_epi16(a, b);
17445        let e = _mm512_set1_epi32(2);
17446        assert_eq_m512i(r, e);
17447    }
17448
17449    #[simd_test(enable = "avx512bw")]
17450    fn test_mm512_mask_madd_epi16() {
17451        let a = _mm512_set1_epi16(1);
17452        let b = _mm512_set1_epi16(1);
17453        let r = _mm512_mask_madd_epi16(a, 0, a, b);
17454        assert_eq_m512i(r, a);
17455        let r = _mm512_mask_madd_epi16(a, 0b00000000_00001111, a, b);
17456        let e = _mm512_set_epi32(
17457            1 << 16 | 1,
17458            1 << 16 | 1,
17459            1 << 16 | 1,
17460            1 << 16 | 1,
17461            1 << 16 | 1,
17462            1 << 16 | 1,
17463            1 << 16 | 1,
17464            1 << 16 | 1,
17465            1 << 16 | 1,
17466            1 << 16 | 1,
17467            1 << 16 | 1,
17468            1 << 16 | 1,
17469            2,
17470            2,
17471            2,
17472            2,
17473        );
17474        assert_eq_m512i(r, e);
17475    }
17476
17477    #[simd_test(enable = "avx512bw")]
17478    fn test_mm512_maskz_madd_epi16() {
17479        let a = _mm512_set1_epi16(1);
17480        let b = _mm512_set1_epi16(1);
17481        let r = _mm512_maskz_madd_epi16(0, a, b);
17482        assert_eq_m512i(r, _mm512_setzero_si512());
17483        let r = _mm512_maskz_madd_epi16(0b00000000_00001111, a, b);
17484        let e = _mm512_set_epi32(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2);
17485        assert_eq_m512i(r, e);
17486    }
17487
17488    #[simd_test(enable = "avx512bw,avx512vl")]
17489    fn test_mm256_mask_madd_epi16() {
17490        let a = _mm256_set1_epi16(1);
17491        let b = _mm256_set1_epi16(1);
17492        let r = _mm256_mask_madd_epi16(a, 0, a, b);
17493        assert_eq_m256i(r, a);
17494        let r = _mm256_mask_madd_epi16(a, 0b00001111, a, b);
17495        let e = _mm256_set_epi32(
17496            1 << 16 | 1,
17497            1 << 16 | 1,
17498            1 << 16 | 1,
17499            1 << 16 | 1,
17500            2,
17501            2,
17502            2,
17503            2,
17504        );
17505        assert_eq_m256i(r, e);
17506    }
17507
17508    #[simd_test(enable = "avx512bw,avx512vl")]
17509    fn test_mm256_maskz_madd_epi16() {
17510        let a = _mm256_set1_epi16(1);
17511        let b = _mm256_set1_epi16(1);
17512        let r = _mm256_maskz_madd_epi16(0, a, b);
17513        assert_eq_m256i(r, _mm256_setzero_si256());
17514        let r = _mm256_maskz_madd_epi16(0b00001111, a, b);
17515        let e = _mm256_set_epi32(0, 0, 0, 0, 2, 2, 2, 2);
17516        assert_eq_m256i(r, e);
17517    }
17518
17519    #[simd_test(enable = "avx512bw,avx512vl")]
17520    fn test_mm_mask_madd_epi16() {
17521        let a = _mm_set1_epi16(1);
17522        let b = _mm_set1_epi16(1);
17523        let r = _mm_mask_madd_epi16(a, 0, a, b);
17524        assert_eq_m128i(r, a);
17525        let r = _mm_mask_madd_epi16(a, 0b00001111, a, b);
17526        let e = _mm_set_epi32(2, 2, 2, 2);
17527        assert_eq_m128i(r, e);
17528    }
17529
17530    #[simd_test(enable = "avx512bw,avx512vl")]
17531    fn test_mm_maskz_madd_epi16() {
17532        let a = _mm_set1_epi16(1);
17533        let b = _mm_set1_epi16(1);
17534        let r = _mm_maskz_madd_epi16(0, a, b);
17535        assert_eq_m128i(r, _mm_setzero_si128());
17536        let r = _mm_maskz_madd_epi16(0b00001111, a, b);
17537        let e = _mm_set_epi32(2, 2, 2, 2);
17538        assert_eq_m128i(r, e);
17539    }
17540
17541    #[simd_test(enable = "avx512bw")]
17542    fn test_mm512_maddubs_epi16() {
17543        let a = _mm512_set1_epi8(1);
17544        let b = _mm512_set1_epi8(1);
17545        let r = _mm512_maddubs_epi16(a, b);
17546        let e = _mm512_set1_epi16(2);
17547        assert_eq_m512i(r, e);
17548    }
17549
17550    #[simd_test(enable = "avx512bw")]
17551    fn test_mm512_mask_maddubs_epi16() {
17552        let a = _mm512_set1_epi8(1);
17553        let b = _mm512_set1_epi8(1);
17554        let src = _mm512_set1_epi16(1);
17555        let r = _mm512_mask_maddubs_epi16(src, 0, a, b);
17556        assert_eq_m512i(r, src);
17557        let r = _mm512_mask_add_epi16(src, 0b00000000_00000000_00000000_00000001, a, b);
17558        #[rustfmt::skip]
17559        let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
17560                                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1<<9|2);
17561        assert_eq_m512i(r, e);
17562    }
17563
17564    #[simd_test(enable = "avx512bw")]
17565    fn test_mm512_maskz_maddubs_epi16() {
17566        let a = _mm512_set1_epi8(1);
17567        let b = _mm512_set1_epi8(1);
17568        let r = _mm512_maskz_maddubs_epi16(0, a, b);
17569        assert_eq_m512i(r, _mm512_setzero_si512());
17570        let r = _mm512_maskz_maddubs_epi16(0b00000000_11111111_00000000_11111111, a, b);
17571        #[rustfmt::skip]
17572        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2,
17573                                 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2);
17574        assert_eq_m512i(r, e);
17575    }
17576
17577    #[simd_test(enable = "avx512bw,avx512vl")]
17578    fn test_mm256_mask_maddubs_epi16() {
17579        let a = _mm256_set1_epi8(1);
17580        let b = _mm256_set1_epi8(1);
17581        let src = _mm256_set1_epi16(1);
17582        let r = _mm256_mask_maddubs_epi16(src, 0, a, b);
17583        assert_eq_m256i(r, src);
17584        let r = _mm256_mask_add_epi16(src, 0b00000000_00000001, a, b);
17585        let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 << 9 | 2);
17586        assert_eq_m256i(r, e);
17587    }
17588
17589    #[simd_test(enable = "avx512bw,avx512vl")]
17590    fn test_mm256_maskz_maddubs_epi16() {
17591        let a = _mm256_set1_epi8(1);
17592        let b = _mm256_set1_epi8(1);
17593        let r = _mm256_maskz_maddubs_epi16(0, a, b);
17594        assert_eq_m256i(r, _mm256_setzero_si256());
17595        let r = _mm256_maskz_maddubs_epi16(0b00000000_11111111, a, b);
17596        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2);
17597        assert_eq_m256i(r, e);
17598    }
17599
17600    #[simd_test(enable = "avx512bw,avx512vl")]
17601    fn test_mm_mask_maddubs_epi16() {
17602        let a = _mm_set1_epi8(1);
17603        let b = _mm_set1_epi8(1);
17604        let src = _mm_set1_epi16(1);
17605        let r = _mm_mask_maddubs_epi16(src, 0, a, b);
17606        assert_eq_m128i(r, src);
17607        let r = _mm_mask_add_epi16(src, 0b00000001, a, b);
17608        let e = _mm_set_epi16(1, 1, 1, 1, 1, 1, 1, 1 << 9 | 2);
17609        assert_eq_m128i(r, e);
17610    }
17611
17612    #[simd_test(enable = "avx512bw,avx512vl")]
17613    fn test_mm_maskz_maddubs_epi16() {
17614        let a = _mm_set1_epi8(1);
17615        let b = _mm_set1_epi8(1);
17616        let r = _mm_maskz_maddubs_epi16(0, a, b);
17617        assert_eq_m128i(r, _mm_setzero_si128());
17618        let r = _mm_maskz_maddubs_epi16(0b00001111, a, b);
17619        let e = _mm_set_epi16(0, 0, 0, 0, 2, 2, 2, 2);
17620        assert_eq_m128i(r, e);
17621    }
17622
17623    #[simd_test(enable = "avx512bw")]
17624    fn test_mm512_packs_epi32() {
17625        let a = _mm512_set1_epi32(i32::MAX);
17626        let b = _mm512_set1_epi32(1);
17627        let r = _mm512_packs_epi32(a, b);
17628        #[rustfmt::skip]
17629        let e = _mm512_set_epi16(1, 1, 1, 1, i16::MAX, i16::MAX, i16::MAX, i16::MAX, 1, 1, 1, 1, i16::MAX, i16::MAX, i16::MAX, i16::MAX,
17630                                 1, 1, 1, 1, i16::MAX, i16::MAX, i16::MAX, i16::MAX, 1, 1, 1, 1, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
17631        assert_eq_m512i(r, e);
17632    }
17633
17634    #[simd_test(enable = "avx512bw")]
17635    fn test_mm512_mask_packs_epi32() {
17636        let a = _mm512_set1_epi32(i32::MAX);
17637        let b = _mm512_set1_epi32(1 << 16 | 1);
17638        let r = _mm512_mask_packs_epi32(a, 0, a, b);
17639        assert_eq_m512i(r, a);
17640        let r = _mm512_mask_packs_epi32(b, 0b00000000_00000000_00000000_00001111, a, b);
17641        #[rustfmt::skip]
17642        let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
17643                                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
17644        assert_eq_m512i(r, e);
17645    }
17646
17647    #[simd_test(enable = "avx512bw")]
17648    fn test_mm512_maskz_packs_epi32() {
17649        let a = _mm512_set1_epi32(i32::MAX);
17650        let b = _mm512_set1_epi32(1);
17651        let r = _mm512_maskz_packs_epi32(0, a, b);
17652        assert_eq_m512i(r, _mm512_setzero_si512());
17653        let r = _mm512_maskz_packs_epi32(0b00000000_00000000_00000000_00001111, a, b);
17654        #[rustfmt::skip]
17655        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17656                                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
17657        assert_eq_m512i(r, e);
17658    }
17659
17660    #[simd_test(enable = "avx512bw,avx512vl")]
17661    fn test_mm256_mask_packs_epi32() {
17662        let a = _mm256_set1_epi32(i32::MAX);
17663        let b = _mm256_set1_epi32(1 << 16 | 1);
17664        let r = _mm256_mask_packs_epi32(a, 0, a, b);
17665        assert_eq_m256i(r, a);
17666        let r = _mm256_mask_packs_epi32(b, 0b00000000_00001111, a, b);
17667        #[rustfmt::skip]
17668        let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
17669        assert_eq_m256i(r, e);
17670    }
17671
17672    #[simd_test(enable = "avx512bw,avx512vl")]
17673    fn test_mm256_maskz_packs_epi32() {
17674        let a = _mm256_set1_epi32(i32::MAX);
17675        let b = _mm256_set1_epi32(1);
17676        let r = _mm256_maskz_packs_epi32(0, a, b);
17677        assert_eq_m256i(r, _mm256_setzero_si256());
17678        let r = _mm256_maskz_packs_epi32(0b00000000_00001111, a, b);
17679        #[rustfmt::skip]
17680        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
17681        assert_eq_m256i(r, e);
17682    }
17683
17684    #[simd_test(enable = "avx512bw,avx512vl")]
17685    fn test_mm_mask_packs_epi32() {
17686        let a = _mm_set1_epi32(i32::MAX);
17687        let b = _mm_set1_epi32(1 << 16 | 1);
17688        let r = _mm_mask_packs_epi32(a, 0, a, b);
17689        assert_eq_m128i(r, a);
17690        let r = _mm_mask_packs_epi32(b, 0b00001111, a, b);
17691        let e = _mm_set_epi16(1, 1, 1, 1, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
17692        assert_eq_m128i(r, e);
17693    }
17694
17695    #[simd_test(enable = "avx512bw,avx512vl")]
17696    fn test_mm_maskz_packs_epi32() {
17697        let a = _mm_set1_epi32(i32::MAX);
17698        let b = _mm_set1_epi32(1);
17699        let r = _mm_maskz_packs_epi32(0, a, b);
17700        assert_eq_m128i(r, _mm_setzero_si128());
17701        let r = _mm_maskz_packs_epi32(0b00001111, a, b);
17702        let e = _mm_set_epi16(0, 0, 0, 0, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
17703        assert_eq_m128i(r, e);
17704    }
17705
17706    #[simd_test(enable = "avx512bw")]
17707    fn test_mm512_packs_epi16() {
17708        let a = _mm512_set1_epi16(i16::MAX);
17709        let b = _mm512_set1_epi16(1);
17710        let r = _mm512_packs_epi16(a, b);
17711        #[rustfmt::skip]
17712        let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX,
17713                                1, 1, 1, 1, 1, 1, 1, 1, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX,
17714                                1, 1, 1, 1, 1, 1, 1, 1, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX,
17715                                1, 1, 1, 1, 1, 1, 1, 1, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
17716        assert_eq_m512i(r, e);
17717    }
17718
17719    #[simd_test(enable = "avx512bw")]
17720    fn test_mm512_mask_packs_epi16() {
17721        let a = _mm512_set1_epi16(i16::MAX);
17722        let b = _mm512_set1_epi16(1 << 8 | 1);
17723        let r = _mm512_mask_packs_epi16(a, 0, a, b);
17724        assert_eq_m512i(r, a);
17725        let r = _mm512_mask_packs_epi16(
17726            b,
17727            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
17728            a,
17729            b,
17730        );
17731        #[rustfmt::skip]
17732        let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
17733                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
17734                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
17735                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
17736        assert_eq_m512i(r, e);
17737    }
17738
17739    #[simd_test(enable = "avx512bw")]
17740    fn test_mm512_maskz_packs_epi16() {
17741        let a = _mm512_set1_epi16(i16::MAX);
17742        let b = _mm512_set1_epi16(1);
17743        let r = _mm512_maskz_packs_epi16(0, a, b);
17744        assert_eq_m512i(r, _mm512_setzero_si512());
17745        let r = _mm512_maskz_packs_epi16(
17746            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
17747            a,
17748            b,
17749        );
17750        #[rustfmt::skip]
17751        let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17752                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17753                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17754                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
17755        assert_eq_m512i(r, e);
17756    }
17757
17758    #[simd_test(enable = "avx512bw,avx512vl")]
17759    fn test_mm256_mask_packs_epi16() {
17760        let a = _mm256_set1_epi16(i16::MAX);
17761        let b = _mm256_set1_epi16(1 << 8 | 1);
17762        let r = _mm256_mask_packs_epi16(a, 0, a, b);
17763        assert_eq_m256i(r, a);
17764        let r = _mm256_mask_packs_epi16(b, 0b00000000_00000000_00000000_00001111, a, b);
17765        #[rustfmt::skip]
17766        let e = _mm256_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
17767                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
17768        assert_eq_m256i(r, e);
17769    }
17770
17771    #[simd_test(enable = "avx512bw,avx512vl")]
17772    fn test_mm256_maskz_packs_epi16() {
17773        let a = _mm256_set1_epi16(i16::MAX);
17774        let b = _mm256_set1_epi16(1);
17775        let r = _mm256_maskz_packs_epi16(0, a, b);
17776        assert_eq_m256i(r, _mm256_setzero_si256());
17777        let r = _mm256_maskz_packs_epi16(0b00000000_00000000_00000000_00001111, a, b);
17778        #[rustfmt::skip]
17779        let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17780                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
17781        assert_eq_m256i(r, e);
17782    }
17783
17784    #[simd_test(enable = "avx512bw,avx512vl")]
17785    fn test_mm_mask_packs_epi16() {
17786        let a = _mm_set1_epi16(i16::MAX);
17787        let b = _mm_set1_epi16(1 << 8 | 1);
17788        let r = _mm_mask_packs_epi16(a, 0, a, b);
17789        assert_eq_m128i(r, a);
17790        let r = _mm_mask_packs_epi16(b, 0b00000000_00001111, a, b);
17791        #[rustfmt::skip]
17792        let e = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
17793        assert_eq_m128i(r, e);
17794    }
17795
17796    #[simd_test(enable = "avx512bw,avx512vl")]
17797    fn test_mm_maskz_packs_epi16() {
17798        let a = _mm_set1_epi16(i16::MAX);
17799        let b = _mm_set1_epi16(1);
17800        let r = _mm_maskz_packs_epi16(0, a, b);
17801        assert_eq_m128i(r, _mm_setzero_si128());
17802        let r = _mm_maskz_packs_epi16(0b00000000_00001111, a, b);
17803        #[rustfmt::skip]
17804        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
17805        assert_eq_m128i(r, e);
17806    }
17807
17808    #[simd_test(enable = "avx512bw")]
17809    fn test_mm512_packus_epi32() {
17810        let a = _mm512_set1_epi32(-1);
17811        let b = _mm512_set1_epi32(1);
17812        let r = _mm512_packus_epi32(a, b);
17813        #[rustfmt::skip]
17814        let e = _mm512_set_epi16(1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0,
17815                                 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0);
17816        assert_eq_m512i(r, e);
17817    }
17818
17819    #[simd_test(enable = "avx512bw")]
17820    fn test_mm512_mask_packus_epi32() {
17821        let a = _mm512_set1_epi32(-1);
17822        let b = _mm512_set1_epi32(1 << 16 | 1);
17823        let r = _mm512_mask_packus_epi32(a, 0, a, b);
17824        assert_eq_m512i(r, a);
17825        let r = _mm512_mask_packus_epi32(b, 0b00000000_00000000_00000000_00001111, a, b);
17826        #[rustfmt::skip]
17827        let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
17828                                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
17829        assert_eq_m512i(r, e);
17830    }
17831
17832    #[simd_test(enable = "avx512bw")]
17833    fn test_mm512_maskz_packus_epi32() {
17834        let a = _mm512_set1_epi32(-1);
17835        let b = _mm512_set1_epi32(1);
17836        let r = _mm512_maskz_packus_epi32(0, a, b);
17837        assert_eq_m512i(r, _mm512_setzero_si512());
17838        let r = _mm512_maskz_packus_epi32(0b00000000_00000000_00000000_00001111, a, b);
17839        #[rustfmt::skip]
17840        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17841                                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
17842        assert_eq_m512i(r, e);
17843    }
17844
17845    #[simd_test(enable = "avx512bw,avx512vl")]
17846    fn test_mm256_mask_packus_epi32() {
17847        let a = _mm256_set1_epi32(-1);
17848        let b = _mm256_set1_epi32(1 << 16 | 1);
17849        let r = _mm256_mask_packus_epi32(a, 0, a, b);
17850        assert_eq_m256i(r, a);
17851        let r = _mm256_mask_packus_epi32(b, 0b00000000_00001111, a, b);
17852        let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
17853        assert_eq_m256i(r, e);
17854    }
17855
17856    #[simd_test(enable = "avx512bw,avx512vl")]
17857    fn test_mm256_maskz_packus_epi32() {
17858        let a = _mm256_set1_epi32(-1);
17859        let b = _mm256_set1_epi32(1);
17860        let r = _mm256_maskz_packus_epi32(0, a, b);
17861        assert_eq_m256i(r, _mm256_setzero_si256());
17862        let r = _mm256_maskz_packus_epi32(0b00000000_00001111, a, b);
17863        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
17864        assert_eq_m256i(r, e);
17865    }
17866
17867    #[simd_test(enable = "avx512bw,avx512vl")]
17868    fn test_mm_mask_packus_epi32() {
17869        let a = _mm_set1_epi32(-1);
17870        let b = _mm_set1_epi32(1 << 16 | 1);
17871        let r = _mm_mask_packus_epi32(a, 0, a, b);
17872        assert_eq_m128i(r, a);
17873        let r = _mm_mask_packus_epi32(b, 0b00001111, a, b);
17874        let e = _mm_set_epi16(1, 1, 1, 1, 0, 0, 0, 0);
17875        assert_eq_m128i(r, e);
17876    }
17877
17878    #[simd_test(enable = "avx512bw,avx512vl")]
17879    fn test_mm_maskz_packus_epi32() {
17880        let a = _mm_set1_epi32(-1);
17881        let b = _mm_set1_epi32(1);
17882        let r = _mm_maskz_packus_epi32(0, a, b);
17883        assert_eq_m128i(r, _mm_setzero_si128());
17884        let r = _mm_maskz_packus_epi32(0b00001111, a, b);
17885        let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, 0, 0);
17886        assert_eq_m128i(r, e);
17887    }
17888
17889    #[simd_test(enable = "avx512bw")]
17890    fn test_mm512_packus_epi16() {
17891        let a = _mm512_set1_epi16(-1);
17892        let b = _mm512_set1_epi16(1);
17893        let r = _mm512_packus_epi16(a, b);
17894        #[rustfmt::skip]
17895        let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
17896                                1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
17897                                1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
17898                                1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0);
17899        assert_eq_m512i(r, e);
17900    }
17901
17902    #[simd_test(enable = "avx512bw")]
17903    fn test_mm512_mask_packus_epi16() {
17904        let a = _mm512_set1_epi16(-1);
17905        let b = _mm512_set1_epi16(1 << 8 | 1);
17906        let r = _mm512_mask_packus_epi16(a, 0, a, b);
17907        assert_eq_m512i(r, a);
17908        let r = _mm512_mask_packus_epi16(
17909            b,
17910            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
17911            a,
17912            b,
17913        );
17914        #[rustfmt::skip]
17915        let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
17916                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
17917                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
17918                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
17919        assert_eq_m512i(r, e);
17920    }
17921
17922    #[simd_test(enable = "avx512bw")]
17923    fn test_mm512_maskz_packus_epi16() {
17924        let a = _mm512_set1_epi16(-1);
17925        let b = _mm512_set1_epi16(1);
17926        let r = _mm512_maskz_packus_epi16(0, a, b);
17927        assert_eq_m512i(r, _mm512_setzero_si512());
17928        let r = _mm512_maskz_packus_epi16(
17929            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
17930            a,
17931            b,
17932        );
17933        #[rustfmt::skip]
17934        let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17935                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17936                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17937                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
17938        assert_eq_m512i(r, e);
17939    }
17940
17941    #[simd_test(enable = "avx512bw,avx512vl")]
17942    fn test_mm256_mask_packus_epi16() {
17943        let a = _mm256_set1_epi16(-1);
17944        let b = _mm256_set1_epi16(1 << 8 | 1);
17945        let r = _mm256_mask_packus_epi16(a, 0, a, b);
17946        assert_eq_m256i(r, a);
17947        let r = _mm256_mask_packus_epi16(b, 0b00000000_00000000_00000000_00001111, a, b);
17948        #[rustfmt::skip]
17949        let e = _mm256_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
17950                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
17951        assert_eq_m256i(r, e);
17952    }
17953
17954    #[simd_test(enable = "avx512bw,avx512vl")]
17955    fn test_mm256_maskz_packus_epi16() {
17956        let a = _mm256_set1_epi16(-1);
17957        let b = _mm256_set1_epi16(1);
17958        let r = _mm256_maskz_packus_epi16(0, a, b);
17959        assert_eq_m256i(r, _mm256_setzero_si256());
17960        let r = _mm256_maskz_packus_epi16(0b00000000_00000000_00000000_00001111, a, b);
17961        #[rustfmt::skip]
17962        let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17963                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
17964        assert_eq_m256i(r, e);
17965    }
17966
17967    #[simd_test(enable = "avx512bw,avx512vl")]
17968    fn test_mm_mask_packus_epi16() {
17969        let a = _mm_set1_epi16(-1);
17970        let b = _mm_set1_epi16(1 << 8 | 1);
17971        let r = _mm_mask_packus_epi16(a, 0, a, b);
17972        assert_eq_m128i(r, a);
17973        let r = _mm_mask_packus_epi16(b, 0b00000000_00001111, a, b);
17974        let e = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
17975        assert_eq_m128i(r, e);
17976    }
17977
17978    #[simd_test(enable = "avx512bw,avx512vl")]
17979    fn test_mm_maskz_packus_epi16() {
17980        let a = _mm_set1_epi16(-1);
17981        let b = _mm_set1_epi16(1);
17982        let r = _mm_maskz_packus_epi16(0, a, b);
17983        assert_eq_m128i(r, _mm_setzero_si128());
17984        let r = _mm_maskz_packus_epi16(0b00000000_00001111, a, b);
17985        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
17986        assert_eq_m128i(r, e);
17987    }
17988
17989    #[simd_test(enable = "avx512bw")]
17990    const fn test_mm512_avg_epu16() {
17991        let a = _mm512_set1_epi16(1);
17992        let b = _mm512_set1_epi16(1);
17993        let r = _mm512_avg_epu16(a, b);
17994        let e = _mm512_set1_epi16(1);
17995        assert_eq_m512i(r, e);
17996    }
17997
17998    #[simd_test(enable = "avx512bw")]
17999    const fn test_mm512_mask_avg_epu16() {
18000        let a = _mm512_set1_epi16(1);
18001        let b = _mm512_set1_epi16(1);
18002        let r = _mm512_mask_avg_epu16(a, 0, a, b);
18003        assert_eq_m512i(r, a);
18004        let r = _mm512_mask_avg_epu16(a, 0b00000000_00000000_00000000_00001111, a, b);
18005        #[rustfmt::skip]
18006        let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
18007                                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
18008        assert_eq_m512i(r, e);
18009    }
18010
18011    #[simd_test(enable = "avx512bw")]
18012    const fn test_mm512_maskz_avg_epu16() {
18013        let a = _mm512_set1_epi16(1);
18014        let b = _mm512_set1_epi16(1);
18015        let r = _mm512_maskz_avg_epu16(0, a, b);
18016        assert_eq_m512i(r, _mm512_setzero_si512());
18017        let r = _mm512_maskz_avg_epu16(0b00000000_00000000_00000000_00001111, a, b);
18018        #[rustfmt::skip]
18019        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
18020                                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1);
18021        assert_eq_m512i(r, e);
18022    }
18023
18024    #[simd_test(enable = "avx512bw,avx512vl")]
18025    const fn test_mm256_mask_avg_epu16() {
18026        let a = _mm256_set1_epi16(1);
18027        let b = _mm256_set1_epi16(1);
18028        let r = _mm256_mask_avg_epu16(a, 0, a, b);
18029        assert_eq_m256i(r, a);
18030        let r = _mm256_mask_avg_epu16(a, 0b00000000_00001111, a, b);
18031        let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
18032        assert_eq_m256i(r, e);
18033    }
18034
18035    #[simd_test(enable = "avx512bw,avx512vl")]
18036    const fn test_mm256_maskz_avg_epu16() {
18037        let a = _mm256_set1_epi16(1);
18038        let b = _mm256_set1_epi16(1);
18039        let r = _mm256_maskz_avg_epu16(0, a, b);
18040        assert_eq_m256i(r, _mm256_setzero_si256());
18041        let r = _mm256_maskz_avg_epu16(0b00000000_00001111, a, b);
18042        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1);
18043        assert_eq_m256i(r, e);
18044    }
18045
18046    #[simd_test(enable = "avx512bw,avx512vl")]
18047    const fn test_mm_mask_avg_epu16() {
18048        let a = _mm_set1_epi16(1);
18049        let b = _mm_set1_epi16(1);
18050        let r = _mm_mask_avg_epu16(a, 0, a, b);
18051        assert_eq_m128i(r, a);
18052        let r = _mm_mask_avg_epu16(a, 0b00001111, a, b);
18053        let e = _mm_set_epi16(1, 1, 1, 1, 1, 1, 1, 1);
18054        assert_eq_m128i(r, e);
18055    }
18056
18057    #[simd_test(enable = "avx512bw,avx512vl")]
18058    const fn test_mm_maskz_avg_epu16() {
18059        let a = _mm_set1_epi16(1);
18060        let b = _mm_set1_epi16(1);
18061        let r = _mm_maskz_avg_epu16(0, a, b);
18062        assert_eq_m128i(r, _mm_setzero_si128());
18063        let r = _mm_maskz_avg_epu16(0b00001111, a, b);
18064        let e = _mm_set_epi16(0, 0, 0, 0, 1, 1, 1, 1);
18065        assert_eq_m128i(r, e);
18066    }
18067
18068    #[simd_test(enable = "avx512bw")]
18069    const fn test_mm512_avg_epu8() {
18070        let a = _mm512_set1_epi8(1);
18071        let b = _mm512_set1_epi8(1);
18072        let r = _mm512_avg_epu8(a, b);
18073        let e = _mm512_set1_epi8(1);
18074        assert_eq_m512i(r, e);
18075    }
18076
18077    #[simd_test(enable = "avx512bw")]
18078    const fn test_mm512_mask_avg_epu8() {
18079        let a = _mm512_set1_epi8(1);
18080        let b = _mm512_set1_epi8(1);
18081        let r = _mm512_mask_avg_epu8(a, 0, a, b);
18082        assert_eq_m512i(r, a);
18083        let r = _mm512_mask_avg_epu8(
18084            a,
18085            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
18086            a,
18087            b,
18088        );
18089        #[rustfmt::skip]
18090        let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
18091                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
18092                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
18093                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
18094        assert_eq_m512i(r, e);
18095    }
18096
18097    #[simd_test(enable = "avx512bw")]
18098    const fn test_mm512_maskz_avg_epu8() {
18099        let a = _mm512_set1_epi8(1);
18100        let b = _mm512_set1_epi8(1);
18101        let r = _mm512_maskz_avg_epu8(0, a, b);
18102        assert_eq_m512i(r, _mm512_setzero_si512());
18103        let r = _mm512_maskz_avg_epu8(
18104            0b00000000_000000000_00000000_00000000_00000000_0000000_00000000_00001111,
18105            a,
18106            b,
18107        );
18108        #[rustfmt::skip]
18109        let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
18110                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
18111                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
18112                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1);
18113        assert_eq_m512i(r, e);
18114    }
18115
18116    #[simd_test(enable = "avx512bw,avx512vl")]
18117    const fn test_mm256_mask_avg_epu8() {
18118        let a = _mm256_set1_epi8(1);
18119        let b = _mm256_set1_epi8(1);
18120        let r = _mm256_mask_avg_epu8(a, 0, a, b);
18121        assert_eq_m256i(r, a);
18122        let r = _mm256_mask_avg_epu8(a, 0b00000000_00000000_00000000_00001111, a, b);
18123        #[rustfmt::skip]
18124        let e = _mm256_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
18125                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
18126        assert_eq_m256i(r, e);
18127    }
18128
18129    #[simd_test(enable = "avx512bw,avx512vl")]
18130    const fn test_mm256_maskz_avg_epu8() {
18131        let a = _mm256_set1_epi8(1);
18132        let b = _mm256_set1_epi8(1);
18133        let r = _mm256_maskz_avg_epu8(0, a, b);
18134        assert_eq_m256i(r, _mm256_setzero_si256());
18135        let r = _mm256_maskz_avg_epu8(0b00000000_0000000_00000000_00001111, a, b);
18136        #[rustfmt::skip]
18137        let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
18138                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1);
18139        assert_eq_m256i(r, e);
18140    }
18141
18142    #[simd_test(enable = "avx512bw,avx512vl")]
18143    const fn test_mm_mask_avg_epu8() {
18144        let a = _mm_set1_epi8(1);
18145        let b = _mm_set1_epi8(1);
18146        let r = _mm_mask_avg_epu8(a, 0, a, b);
18147        assert_eq_m128i(r, a);
18148        let r = _mm_mask_avg_epu8(a, 0b00000000_00001111, a, b);
18149        let e = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
18150        assert_eq_m128i(r, e);
18151    }
18152
18153    #[simd_test(enable = "avx512bw,avx512vl")]
18154    const fn test_mm_maskz_avg_epu8() {
18155        let a = _mm_set1_epi8(1);
18156        let b = _mm_set1_epi8(1);
18157        let r = _mm_maskz_avg_epu8(0, a, b);
18158        assert_eq_m128i(r, _mm_setzero_si128());
18159        let r = _mm_maskz_avg_epu8(0b00000000_00001111, a, b);
18160        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1);
18161        assert_eq_m128i(r, e);
18162    }
18163
18164    #[simd_test(enable = "avx512bw")]
18165    fn test_mm512_sll_epi16() {
18166        let a = _mm512_set1_epi16(1 << 15);
18167        let count = _mm_set1_epi16(2);
18168        let r = _mm512_sll_epi16(a, count);
18169        let e = _mm512_set1_epi16(0);
18170        assert_eq_m512i(r, e);
18171    }
18172
18173    #[simd_test(enable = "avx512bw")]
18174    fn test_mm512_mask_sll_epi16() {
18175        let a = _mm512_set1_epi16(1 << 15);
18176        let count = _mm_set1_epi16(2);
18177        let r = _mm512_mask_sll_epi16(a, 0, a, count);
18178        assert_eq_m512i(r, a);
18179        let r = _mm512_mask_sll_epi16(a, 0b11111111_11111111_11111111_11111111, a, count);
18180        let e = _mm512_set1_epi16(0);
18181        assert_eq_m512i(r, e);
18182    }
18183
18184    #[simd_test(enable = "avx512bw")]
18185    fn test_mm512_maskz_sll_epi16() {
18186        let a = _mm512_set1_epi16(1 << 15);
18187        let count = _mm_set1_epi16(2);
18188        let r = _mm512_maskz_sll_epi16(0, a, count);
18189        assert_eq_m512i(r, _mm512_setzero_si512());
18190        let r = _mm512_maskz_sll_epi16(0b11111111_11111111_11111111_11111111, a, count);
18191        let e = _mm512_set1_epi16(0);
18192        assert_eq_m512i(r, e);
18193    }
18194
18195    #[simd_test(enable = "avx512bw,avx512vl")]
18196    fn test_mm256_mask_sll_epi16() {
18197        let a = _mm256_set1_epi16(1 << 15);
18198        let count = _mm_set1_epi16(2);
18199        let r = _mm256_mask_sll_epi16(a, 0, a, count);
18200        assert_eq_m256i(r, a);
18201        let r = _mm256_mask_sll_epi16(a, 0b11111111_11111111, a, count);
18202        let e = _mm256_set1_epi16(0);
18203        assert_eq_m256i(r, e);
18204    }
18205
18206    #[simd_test(enable = "avx512bw,avx512vl")]
18207    fn test_mm256_maskz_sll_epi16() {
18208        let a = _mm256_set1_epi16(1 << 15);
18209        let count = _mm_set1_epi16(2);
18210        let r = _mm256_maskz_sll_epi16(0, a, count);
18211        assert_eq_m256i(r, _mm256_setzero_si256());
18212        let r = _mm256_maskz_sll_epi16(0b11111111_11111111, a, count);
18213        let e = _mm256_set1_epi16(0);
18214        assert_eq_m256i(r, e);
18215    }
18216
18217    #[simd_test(enable = "avx512bw,avx512vl")]
18218    fn test_mm_mask_sll_epi16() {
18219        let a = _mm_set1_epi16(1 << 15);
18220        let count = _mm_set1_epi16(2);
18221        let r = _mm_mask_sll_epi16(a, 0, a, count);
18222        assert_eq_m128i(r, a);
18223        let r = _mm_mask_sll_epi16(a, 0b11111111, a, count);
18224        let e = _mm_set1_epi16(0);
18225        assert_eq_m128i(r, e);
18226    }
18227
18228    #[simd_test(enable = "avx512bw,avx512vl")]
18229    fn test_mm_maskz_sll_epi16() {
18230        let a = _mm_set1_epi16(1 << 15);
18231        let count = _mm_set1_epi16(2);
18232        let r = _mm_maskz_sll_epi16(0, a, count);
18233        assert_eq_m128i(r, _mm_setzero_si128());
18234        let r = _mm_maskz_sll_epi16(0b11111111, a, count);
18235        let e = _mm_set1_epi16(0);
18236        assert_eq_m128i(r, e);
18237    }
18238
18239    #[simd_test(enable = "avx512bw")]
18240    const fn test_mm512_slli_epi16() {
18241        let a = _mm512_set1_epi16(1 << 15);
18242        let r = _mm512_slli_epi16::<1>(a);
18243        let e = _mm512_set1_epi16(0);
18244        assert_eq_m512i(r, e);
18245    }
18246
18247    #[simd_test(enable = "avx512bw")]
18248    const fn test_mm512_mask_slli_epi16() {
18249        let a = _mm512_set1_epi16(1 << 15);
18250        let r = _mm512_mask_slli_epi16::<1>(a, 0, a);
18251        assert_eq_m512i(r, a);
18252        let r = _mm512_mask_slli_epi16::<1>(a, 0b11111111_11111111_11111111_11111111, a);
18253        let e = _mm512_set1_epi16(0);
18254        assert_eq_m512i(r, e);
18255    }
18256
18257    #[simd_test(enable = "avx512bw")]
18258    const fn test_mm512_maskz_slli_epi16() {
18259        let a = _mm512_set1_epi16(1 << 15);
18260        let r = _mm512_maskz_slli_epi16::<1>(0, a);
18261        assert_eq_m512i(r, _mm512_setzero_si512());
18262        let r = _mm512_maskz_slli_epi16::<1>(0b11111111_11111111_11111111_11111111, a);
18263        let e = _mm512_set1_epi16(0);
18264        assert_eq_m512i(r, e);
18265    }
18266
18267    #[simd_test(enable = "avx512bw,avx512vl")]
18268    const fn test_mm256_mask_slli_epi16() {
18269        let a = _mm256_set1_epi16(1 << 15);
18270        let r = _mm256_mask_slli_epi16::<1>(a, 0, a);
18271        assert_eq_m256i(r, a);
18272        let r = _mm256_mask_slli_epi16::<1>(a, 0b11111111_11111111, a);
18273        let e = _mm256_set1_epi16(0);
18274        assert_eq_m256i(r, e);
18275    }
18276
18277    #[simd_test(enable = "avx512bw,avx512vl")]
18278    const fn test_mm256_maskz_slli_epi16() {
18279        let a = _mm256_set1_epi16(1 << 15);
18280        let r = _mm256_maskz_slli_epi16::<1>(0, a);
18281        assert_eq_m256i(r, _mm256_setzero_si256());
18282        let r = _mm256_maskz_slli_epi16::<1>(0b11111111_11111111, a);
18283        let e = _mm256_set1_epi16(0);
18284        assert_eq_m256i(r, e);
18285    }
18286
18287    #[simd_test(enable = "avx512bw,avx512vl")]
18288    const fn test_mm_mask_slli_epi16() {
18289        let a = _mm_set1_epi16(1 << 15);
18290        let r = _mm_mask_slli_epi16::<1>(a, 0, a);
18291        assert_eq_m128i(r, a);
18292        let r = _mm_mask_slli_epi16::<1>(a, 0b11111111, a);
18293        let e = _mm_set1_epi16(0);
18294        assert_eq_m128i(r, e);
18295    }
18296
18297    #[simd_test(enable = "avx512bw,avx512vl")]
18298    const fn test_mm_maskz_slli_epi16() {
18299        let a = _mm_set1_epi16(1 << 15);
18300        let r = _mm_maskz_slli_epi16::<1>(0, a);
18301        assert_eq_m128i(r, _mm_setzero_si128());
18302        let r = _mm_maskz_slli_epi16::<1>(0b11111111, a);
18303        let e = _mm_set1_epi16(0);
18304        assert_eq_m128i(r, e);
18305    }
18306
18307    #[simd_test(enable = "avx512bw")]
18308    fn test_mm512_sllv_epi16() {
18309        let a = _mm512_set1_epi16(1 << 15);
18310        let count = _mm512_set1_epi16(2);
18311        let r = _mm512_sllv_epi16(a, count);
18312        let e = _mm512_set1_epi16(0);
18313        assert_eq_m512i(r, e);
18314    }
18315
18316    #[simd_test(enable = "avx512bw")]
18317    fn test_mm512_mask_sllv_epi16() {
18318        let a = _mm512_set1_epi16(1 << 15);
18319        let count = _mm512_set1_epi16(2);
18320        let r = _mm512_mask_sllv_epi16(a, 0, a, count);
18321        assert_eq_m512i(r, a);
18322        let r = _mm512_mask_sllv_epi16(a, 0b11111111_11111111_11111111_11111111, a, count);
18323        let e = _mm512_set1_epi16(0);
18324        assert_eq_m512i(r, e);
18325    }
18326
18327    #[simd_test(enable = "avx512bw")]
18328    fn test_mm512_maskz_sllv_epi16() {
18329        let a = _mm512_set1_epi16(1 << 15);
18330        let count = _mm512_set1_epi16(2);
18331        let r = _mm512_maskz_sllv_epi16(0, a, count);
18332        assert_eq_m512i(r, _mm512_setzero_si512());
18333        let r = _mm512_maskz_sllv_epi16(0b11111111_11111111_11111111_11111111, a, count);
18334        let e = _mm512_set1_epi16(0);
18335        assert_eq_m512i(r, e);
18336    }
18337
18338    #[simd_test(enable = "avx512bw,avx512vl")]
18339    fn test_mm256_sllv_epi16() {
18340        let a = _mm256_set1_epi16(1 << 15);
18341        let count = _mm256_set1_epi16(2);
18342        let r = _mm256_sllv_epi16(a, count);
18343        let e = _mm256_set1_epi16(0);
18344        assert_eq_m256i(r, e);
18345    }
18346
18347    #[simd_test(enable = "avx512bw,avx512vl")]
18348    fn test_mm256_mask_sllv_epi16() {
18349        let a = _mm256_set1_epi16(1 << 15);
18350        let count = _mm256_set1_epi16(2);
18351        let r = _mm256_mask_sllv_epi16(a, 0, a, count);
18352        assert_eq_m256i(r, a);
18353        let r = _mm256_mask_sllv_epi16(a, 0b11111111_11111111, a, count);
18354        let e = _mm256_set1_epi16(0);
18355        assert_eq_m256i(r, e);
18356    }
18357
18358    #[simd_test(enable = "avx512bw,avx512vl")]
18359    fn test_mm256_maskz_sllv_epi16() {
18360        let a = _mm256_set1_epi16(1 << 15);
18361        let count = _mm256_set1_epi16(2);
18362        let r = _mm256_maskz_sllv_epi16(0, a, count);
18363        assert_eq_m256i(r, _mm256_setzero_si256());
18364        let r = _mm256_maskz_sllv_epi16(0b11111111_11111111, a, count);
18365        let e = _mm256_set1_epi16(0);
18366        assert_eq_m256i(r, e);
18367    }
18368
18369    #[simd_test(enable = "avx512bw,avx512vl")]
18370    fn test_mm_sllv_epi16() {
18371        let a = _mm_set1_epi16(1 << 15);
18372        let count = _mm_set1_epi16(2);
18373        let r = _mm_sllv_epi16(a, count);
18374        let e = _mm_set1_epi16(0);
18375        assert_eq_m128i(r, e);
18376    }
18377
18378    #[simd_test(enable = "avx512bw,avx512vl")]
18379    fn test_mm_mask_sllv_epi16() {
18380        let a = _mm_set1_epi16(1 << 15);
18381        let count = _mm_set1_epi16(2);
18382        let r = _mm_mask_sllv_epi16(a, 0, a, count);
18383        assert_eq_m128i(r, a);
18384        let r = _mm_mask_sllv_epi16(a, 0b11111111, a, count);
18385        let e = _mm_set1_epi16(0);
18386        assert_eq_m128i(r, e);
18387    }
18388
18389    #[simd_test(enable = "avx512bw,avx512vl")]
18390    fn test_mm_maskz_sllv_epi16() {
18391        let a = _mm_set1_epi16(1 << 15);
18392        let count = _mm_set1_epi16(2);
18393        let r = _mm_maskz_sllv_epi16(0, a, count);
18394        assert_eq_m128i(r, _mm_setzero_si128());
18395        let r = _mm_maskz_sllv_epi16(0b11111111, a, count);
18396        let e = _mm_set1_epi16(0);
18397        assert_eq_m128i(r, e);
18398    }
18399
18400    #[simd_test(enable = "avx512bw")]
18401    fn test_mm512_srl_epi16() {
18402        let a = _mm512_set1_epi16(1 << 1);
18403        let count = _mm_set1_epi16(2);
18404        let r = _mm512_srl_epi16(a, count);
18405        let e = _mm512_set1_epi16(0);
18406        assert_eq_m512i(r, e);
18407    }
18408
18409    #[simd_test(enable = "avx512bw")]
18410    fn test_mm512_mask_srl_epi16() {
18411        let a = _mm512_set1_epi16(1 << 1);
18412        let count = _mm_set1_epi16(2);
18413        let r = _mm512_mask_srl_epi16(a, 0, a, count);
18414        assert_eq_m512i(r, a);
18415        let r = _mm512_mask_srl_epi16(a, 0b11111111_11111111_11111111_11111111, a, count);
18416        let e = _mm512_set1_epi16(0);
18417        assert_eq_m512i(r, e);
18418    }
18419
18420    #[simd_test(enable = "avx512bw")]
18421    fn test_mm512_maskz_srl_epi16() {
18422        let a = _mm512_set1_epi16(1 << 1);
18423        let count = _mm_set1_epi16(2);
18424        let r = _mm512_maskz_srl_epi16(0, a, count);
18425        assert_eq_m512i(r, _mm512_setzero_si512());
18426        let r = _mm512_maskz_srl_epi16(0b11111111_11111111_11111111_11111111, a, count);
18427        let e = _mm512_set1_epi16(0);
18428        assert_eq_m512i(r, e);
18429    }
18430
18431    #[simd_test(enable = "avx512bw,avx512vl")]
18432    fn test_mm256_mask_srl_epi16() {
18433        let a = _mm256_set1_epi16(1 << 1);
18434        let count = _mm_set1_epi16(2);
18435        let r = _mm256_mask_srl_epi16(a, 0, a, count);
18436        assert_eq_m256i(r, a);
18437        let r = _mm256_mask_srl_epi16(a, 0b11111111_11111111, a, count);
18438        let e = _mm256_set1_epi16(0);
18439        assert_eq_m256i(r, e);
18440    }
18441
18442    #[simd_test(enable = "avx512bw,avx512vl")]
18443    fn test_mm256_maskz_srl_epi16() {
18444        let a = _mm256_set1_epi16(1 << 1);
18445        let count = _mm_set1_epi16(2);
18446        let r = _mm256_maskz_srl_epi16(0, a, count);
18447        assert_eq_m256i(r, _mm256_setzero_si256());
18448        let r = _mm256_maskz_srl_epi16(0b11111111_11111111, a, count);
18449        let e = _mm256_set1_epi16(0);
18450        assert_eq_m256i(r, e);
18451    }
18452
18453    #[simd_test(enable = "avx512bw,avx512vl")]
18454    fn test_mm_mask_srl_epi16() {
18455        let a = _mm_set1_epi16(1 << 1);
18456        let count = _mm_set1_epi16(2);
18457        let r = _mm_mask_srl_epi16(a, 0, a, count);
18458        assert_eq_m128i(r, a);
18459        let r = _mm_mask_srl_epi16(a, 0b11111111, a, count);
18460        let e = _mm_set1_epi16(0);
18461        assert_eq_m128i(r, e);
18462    }
18463
18464    #[simd_test(enable = "avx512bw,avx512vl")]
18465    fn test_mm_maskz_srl_epi16() {
18466        let a = _mm_set1_epi16(1 << 1);
18467        let count = _mm_set1_epi16(2);
18468        let r = _mm_maskz_srl_epi16(0, a, count);
18469        assert_eq_m128i(r, _mm_setzero_si128());
18470        let r = _mm_maskz_srl_epi16(0b11111111, a, count);
18471        let e = _mm_set1_epi16(0);
18472        assert_eq_m128i(r, e);
18473    }
18474
18475    #[simd_test(enable = "avx512bw")]
18476    const fn test_mm512_srli_epi16() {
18477        let a = _mm512_set1_epi16(1 << 1);
18478        let r = _mm512_srli_epi16::<2>(a);
18479        let e = _mm512_set1_epi16(0);
18480        assert_eq_m512i(r, e);
18481    }
18482
18483    #[simd_test(enable = "avx512bw")]
18484    const fn test_mm512_mask_srli_epi16() {
18485        let a = _mm512_set1_epi16(1 << 1);
18486        let r = _mm512_mask_srli_epi16::<2>(a, 0, a);
18487        assert_eq_m512i(r, a);
18488        let r = _mm512_mask_srli_epi16::<2>(a, 0b11111111_11111111_11111111_11111111, a);
18489        let e = _mm512_set1_epi16(0);
18490        assert_eq_m512i(r, e);
18491    }
18492
18493    #[simd_test(enable = "avx512bw")]
18494    const fn test_mm512_maskz_srli_epi16() {
18495        let a = _mm512_set1_epi16(1 << 1);
18496        let r = _mm512_maskz_srli_epi16::<2>(0, a);
18497        assert_eq_m512i(r, _mm512_setzero_si512());
18498        let r = _mm512_maskz_srli_epi16::<2>(0b11111111_11111111_11111111_11111111, a);
18499        let e = _mm512_set1_epi16(0);
18500        assert_eq_m512i(r, e);
18501    }
18502
18503    #[simd_test(enable = "avx512bw,avx512vl")]
18504    const fn test_mm256_mask_srli_epi16() {
18505        let a = _mm256_set1_epi16(1 << 1);
18506        let r = _mm256_mask_srli_epi16::<2>(a, 0, a);
18507        assert_eq_m256i(r, a);
18508        let r = _mm256_mask_srli_epi16::<2>(a, 0b11111111_11111111, a);
18509        let e = _mm256_set1_epi16(0);
18510        assert_eq_m256i(r, e);
18511    }
18512
18513    #[simd_test(enable = "avx512bw,avx512vl")]
18514    const fn test_mm256_maskz_srli_epi16() {
18515        let a = _mm256_set1_epi16(1 << 1);
18516        let r = _mm256_maskz_srli_epi16::<2>(0, a);
18517        assert_eq_m256i(r, _mm256_setzero_si256());
18518        let r = _mm256_maskz_srli_epi16::<2>(0b11111111_11111111, a);
18519        let e = _mm256_set1_epi16(0);
18520        assert_eq_m256i(r, e);
18521    }
18522
18523    #[simd_test(enable = "avx512bw,avx512vl")]
18524    const fn test_mm_mask_srli_epi16() {
18525        let a = _mm_set1_epi16(1 << 1);
18526        let r = _mm_mask_srli_epi16::<2>(a, 0, a);
18527        assert_eq_m128i(r, a);
18528        let r = _mm_mask_srli_epi16::<2>(a, 0b11111111, a);
18529        let e = _mm_set1_epi16(0);
18530        assert_eq_m128i(r, e);
18531    }
18532
18533    #[simd_test(enable = "avx512bw,avx512vl")]
18534    const fn test_mm_maskz_srli_epi16() {
18535        let a = _mm_set1_epi16(1 << 1);
18536        let r = _mm_maskz_srli_epi16::<2>(0, a);
18537        assert_eq_m128i(r, _mm_setzero_si128());
18538        let r = _mm_maskz_srli_epi16::<2>(0b11111111, a);
18539        let e = _mm_set1_epi16(0);
18540        assert_eq_m128i(r, e);
18541    }
18542
18543    #[simd_test(enable = "avx512bw")]
18544    fn test_mm512_srlv_epi16() {
18545        let a = _mm512_set1_epi16(1 << 1);
18546        let count = _mm512_set1_epi16(2);
18547        let r = _mm512_srlv_epi16(a, count);
18548        let e = _mm512_set1_epi16(0);
18549        assert_eq_m512i(r, e);
18550    }
18551
18552    #[simd_test(enable = "avx512bw")]
18553    fn test_mm512_mask_srlv_epi16() {
18554        let a = _mm512_set1_epi16(1 << 1);
18555        let count = _mm512_set1_epi16(2);
18556        let r = _mm512_mask_srlv_epi16(a, 0, a, count);
18557        assert_eq_m512i(r, a);
18558        let r = _mm512_mask_srlv_epi16(a, 0b11111111_11111111_11111111_11111111, a, count);
18559        let e = _mm512_set1_epi16(0);
18560        assert_eq_m512i(r, e);
18561    }
18562
18563    #[simd_test(enable = "avx512bw")]
18564    fn test_mm512_maskz_srlv_epi16() {
18565        let a = _mm512_set1_epi16(1 << 1);
18566        let count = _mm512_set1_epi16(2);
18567        let r = _mm512_maskz_srlv_epi16(0, a, count);
18568        assert_eq_m512i(r, _mm512_setzero_si512());
18569        let r = _mm512_maskz_srlv_epi16(0b11111111_11111111_11111111_11111111, a, count);
18570        let e = _mm512_set1_epi16(0);
18571        assert_eq_m512i(r, e);
18572    }
18573
18574    #[simd_test(enable = "avx512bw,avx512vl")]
18575    fn test_mm256_srlv_epi16() {
18576        let a = _mm256_set1_epi16(1 << 1);
18577        let count = _mm256_set1_epi16(2);
18578        let r = _mm256_srlv_epi16(a, count);
18579        let e = _mm256_set1_epi16(0);
18580        assert_eq_m256i(r, e);
18581    }
18582
18583    #[simd_test(enable = "avx512bw,avx512vl")]
18584    fn test_mm256_mask_srlv_epi16() {
18585        let a = _mm256_set1_epi16(1 << 1);
18586        let count = _mm256_set1_epi16(2);
18587        let r = _mm256_mask_srlv_epi16(a, 0, a, count);
18588        assert_eq_m256i(r, a);
18589        let r = _mm256_mask_srlv_epi16(a, 0b11111111_11111111, a, count);
18590        let e = _mm256_set1_epi16(0);
18591        assert_eq_m256i(r, e);
18592    }
18593
18594    #[simd_test(enable = "avx512bw,avx512vl")]
18595    fn test_mm256_maskz_srlv_epi16() {
18596        let a = _mm256_set1_epi16(1 << 1);
18597        let count = _mm256_set1_epi16(2);
18598        let r = _mm256_maskz_srlv_epi16(0, a, count);
18599        assert_eq_m256i(r, _mm256_setzero_si256());
18600        let r = _mm256_maskz_srlv_epi16(0b11111111_11111111, a, count);
18601        let e = _mm256_set1_epi16(0);
18602        assert_eq_m256i(r, e);
18603    }
18604
18605    #[simd_test(enable = "avx512bw,avx512vl")]
18606    fn test_mm_srlv_epi16() {
18607        let a = _mm_set1_epi16(1 << 1);
18608        let count = _mm_set1_epi16(2);
18609        let r = _mm_srlv_epi16(a, count);
18610        let e = _mm_set1_epi16(0);
18611        assert_eq_m128i(r, e);
18612    }
18613
18614    #[simd_test(enable = "avx512bw,avx512vl")]
18615    fn test_mm_mask_srlv_epi16() {
18616        let a = _mm_set1_epi16(1 << 1);
18617        let count = _mm_set1_epi16(2);
18618        let r = _mm_mask_srlv_epi16(a, 0, a, count);
18619        assert_eq_m128i(r, a);
18620        let r = _mm_mask_srlv_epi16(a, 0b11111111, a, count);
18621        let e = _mm_set1_epi16(0);
18622        assert_eq_m128i(r, e);
18623    }
18624
18625    #[simd_test(enable = "avx512bw,avx512vl")]
18626    fn test_mm_maskz_srlv_epi16() {
18627        let a = _mm_set1_epi16(1 << 1);
18628        let count = _mm_set1_epi16(2);
18629        let r = _mm_maskz_srlv_epi16(0, a, count);
18630        assert_eq_m128i(r, _mm_setzero_si128());
18631        let r = _mm_maskz_srlv_epi16(0b11111111, a, count);
18632        let e = _mm_set1_epi16(0);
18633        assert_eq_m128i(r, e);
18634    }
18635
18636    #[simd_test(enable = "avx512bw")]
18637    fn test_mm512_sra_epi16() {
18638        let a = _mm512_set1_epi16(8);
18639        let count = _mm_set1_epi16(1);
18640        let r = _mm512_sra_epi16(a, count);
18641        let e = _mm512_set1_epi16(0);
18642        assert_eq_m512i(r, e);
18643    }
18644
18645    #[simd_test(enable = "avx512bw")]
18646    fn test_mm512_mask_sra_epi16() {
18647        let a = _mm512_set1_epi16(8);
18648        let count = _mm_set1_epi16(1);
18649        let r = _mm512_mask_sra_epi16(a, 0, a, count);
18650        assert_eq_m512i(r, a);
18651        let r = _mm512_mask_sra_epi16(a, 0b11111111_11111111_11111111_11111111, a, count);
18652        let e = _mm512_set1_epi16(0);
18653        assert_eq_m512i(r, e);
18654    }
18655
18656    #[simd_test(enable = "avx512bw")]
18657    fn test_mm512_maskz_sra_epi16() {
18658        let a = _mm512_set1_epi16(8);
18659        let count = _mm_set1_epi16(1);
18660        let r = _mm512_maskz_sra_epi16(0, a, count);
18661        assert_eq_m512i(r, _mm512_setzero_si512());
18662        let r = _mm512_maskz_sra_epi16(0b11111111_11111111_11111111_11111111, a, count);
18663        let e = _mm512_set1_epi16(0);
18664        assert_eq_m512i(r, e);
18665    }
18666
18667    #[simd_test(enable = "avx512bw,avx512vl")]
18668    fn test_mm256_mask_sra_epi16() {
18669        let a = _mm256_set1_epi16(8);
18670        let count = _mm_set1_epi16(1);
18671        let r = _mm256_mask_sra_epi16(a, 0, a, count);
18672        assert_eq_m256i(r, a);
18673        let r = _mm256_mask_sra_epi16(a, 0b11111111_11111111, a, count);
18674        let e = _mm256_set1_epi16(0);
18675        assert_eq_m256i(r, e);
18676    }
18677
18678    #[simd_test(enable = "avx512bw,avx512vl")]
18679    fn test_mm256_maskz_sra_epi16() {
18680        let a = _mm256_set1_epi16(8);
18681        let count = _mm_set1_epi16(1);
18682        let r = _mm256_maskz_sra_epi16(0, a, count);
18683        assert_eq_m256i(r, _mm256_setzero_si256());
18684        let r = _mm256_maskz_sra_epi16(0b11111111_11111111, a, count);
18685        let e = _mm256_set1_epi16(0);
18686        assert_eq_m256i(r, e);
18687    }
18688
18689    #[simd_test(enable = "avx512bw,avx512vl")]
18690    fn test_mm_mask_sra_epi16() {
18691        let a = _mm_set1_epi16(8);
18692        let count = _mm_set1_epi16(1);
18693        let r = _mm_mask_sra_epi16(a, 0, a, count);
18694        assert_eq_m128i(r, a);
18695        let r = _mm_mask_sra_epi16(a, 0b11111111, a, count);
18696        let e = _mm_set1_epi16(0);
18697        assert_eq_m128i(r, e);
18698    }
18699
18700    #[simd_test(enable = "avx512bw,avx512vl")]
18701    fn test_mm_maskz_sra_epi16() {
18702        let a = _mm_set1_epi16(8);
18703        let count = _mm_set1_epi16(1);
18704        let r = _mm_maskz_sra_epi16(0, a, count);
18705        assert_eq_m128i(r, _mm_setzero_si128());
18706        let r = _mm_maskz_sra_epi16(0b11111111, a, count);
18707        let e = _mm_set1_epi16(0);
18708        assert_eq_m128i(r, e);
18709    }
18710
18711    #[simd_test(enable = "avx512bw")]
18712    const fn test_mm512_srai_epi16() {
18713        let a = _mm512_set1_epi16(8);
18714        let r = _mm512_srai_epi16::<2>(a);
18715        let e = _mm512_set1_epi16(2);
18716        assert_eq_m512i(r, e);
18717    }
18718
18719    #[simd_test(enable = "avx512bw")]
18720    const fn test_mm512_mask_srai_epi16() {
18721        let a = _mm512_set1_epi16(8);
18722        let r = _mm512_mask_srai_epi16::<2>(a, 0, a);
18723        assert_eq_m512i(r, a);
18724        let r = _mm512_mask_srai_epi16::<2>(a, 0b11111111_11111111_11111111_11111111, a);
18725        let e = _mm512_set1_epi16(2);
18726        assert_eq_m512i(r, e);
18727    }
18728
18729    #[simd_test(enable = "avx512bw")]
18730    const fn test_mm512_maskz_srai_epi16() {
18731        let a = _mm512_set1_epi16(8);
18732        let r = _mm512_maskz_srai_epi16::<2>(0, a);
18733        assert_eq_m512i(r, _mm512_setzero_si512());
18734        let r = _mm512_maskz_srai_epi16::<2>(0b11111111_11111111_11111111_11111111, a);
18735        let e = _mm512_set1_epi16(2);
18736        assert_eq_m512i(r, e);
18737    }
18738
18739    #[simd_test(enable = "avx512bw,avx512vl")]
18740    const fn test_mm256_mask_srai_epi16() {
18741        let a = _mm256_set1_epi16(8);
18742        let r = _mm256_mask_srai_epi16::<2>(a, 0, a);
18743        assert_eq_m256i(r, a);
18744        let r = _mm256_mask_srai_epi16::<2>(a, 0b11111111_11111111, a);
18745        let e = _mm256_set1_epi16(2);
18746        assert_eq_m256i(r, e);
18747    }
18748
18749    #[simd_test(enable = "avx512bw,avx512vl")]
18750    const fn test_mm256_maskz_srai_epi16() {
18751        let a = _mm256_set1_epi16(8);
18752        let r = _mm256_maskz_srai_epi16::<2>(0, a);
18753        assert_eq_m256i(r, _mm256_setzero_si256());
18754        let r = _mm256_maskz_srai_epi16::<2>(0b11111111_11111111, a);
18755        let e = _mm256_set1_epi16(2);
18756        assert_eq_m256i(r, e);
18757    }
18758
18759    #[simd_test(enable = "avx512bw,avx512vl")]
18760    const fn test_mm_mask_srai_epi16() {
18761        let a = _mm_set1_epi16(8);
18762        let r = _mm_mask_srai_epi16::<2>(a, 0, a);
18763        assert_eq_m128i(r, a);
18764        let r = _mm_mask_srai_epi16::<2>(a, 0b11111111, a);
18765        let e = _mm_set1_epi16(2);
18766        assert_eq_m128i(r, e);
18767    }
18768
18769    #[simd_test(enable = "avx512bw,avx512vl")]
18770    const fn test_mm_maskz_srai_epi16() {
18771        let a = _mm_set1_epi16(8);
18772        let r = _mm_maskz_srai_epi16::<2>(0, a);
18773        assert_eq_m128i(r, _mm_setzero_si128());
18774        let r = _mm_maskz_srai_epi16::<2>(0b11111111, a);
18775        let e = _mm_set1_epi16(2);
18776        assert_eq_m128i(r, e);
18777    }
18778
18779    #[simd_test(enable = "avx512bw")]
18780    fn test_mm512_srav_epi16() {
18781        let a = _mm512_set1_epi16(8);
18782        let count = _mm512_set1_epi16(2);
18783        let r = _mm512_srav_epi16(a, count);
18784        let e = _mm512_set1_epi16(2);
18785        assert_eq_m512i(r, e);
18786    }
18787
18788    #[simd_test(enable = "avx512bw")]
18789    fn test_mm512_mask_srav_epi16() {
18790        let a = _mm512_set1_epi16(8);
18791        let count = _mm512_set1_epi16(2);
18792        let r = _mm512_mask_srav_epi16(a, 0, a, count);
18793        assert_eq_m512i(r, a);
18794        let r = _mm512_mask_srav_epi16(a, 0b11111111_11111111_11111111_11111111, a, count);
18795        let e = _mm512_set1_epi16(2);
18796        assert_eq_m512i(r, e);
18797    }
18798
18799    #[simd_test(enable = "avx512bw")]
18800    fn test_mm512_maskz_srav_epi16() {
18801        let a = _mm512_set1_epi16(8);
18802        let count = _mm512_set1_epi16(2);
18803        let r = _mm512_maskz_srav_epi16(0, a, count);
18804        assert_eq_m512i(r, _mm512_setzero_si512());
18805        let r = _mm512_maskz_srav_epi16(0b11111111_11111111_11111111_11111111, a, count);
18806        let e = _mm512_set1_epi16(2);
18807        assert_eq_m512i(r, e);
18808    }
18809
18810    #[simd_test(enable = "avx512bw,avx512vl")]
18811    fn test_mm256_srav_epi16() {
18812        let a = _mm256_set1_epi16(8);
18813        let count = _mm256_set1_epi16(2);
18814        let r = _mm256_srav_epi16(a, count);
18815        let e = _mm256_set1_epi16(2);
18816        assert_eq_m256i(r, e);
18817    }
18818
18819    #[simd_test(enable = "avx512bw,avx512vl")]
18820    fn test_mm256_mask_srav_epi16() {
18821        let a = _mm256_set1_epi16(8);
18822        let count = _mm256_set1_epi16(2);
18823        let r = _mm256_mask_srav_epi16(a, 0, a, count);
18824        assert_eq_m256i(r, a);
18825        let r = _mm256_mask_srav_epi16(a, 0b11111111_11111111, a, count);
18826        let e = _mm256_set1_epi16(2);
18827        assert_eq_m256i(r, e);
18828    }
18829
18830    #[simd_test(enable = "avx512bw,avx512vl")]
18831    fn test_mm256_maskz_srav_epi16() {
18832        let a = _mm256_set1_epi16(8);
18833        let count = _mm256_set1_epi16(2);
18834        let r = _mm256_maskz_srav_epi16(0, a, count);
18835        assert_eq_m256i(r, _mm256_setzero_si256());
18836        let r = _mm256_maskz_srav_epi16(0b11111111_11111111, a, count);
18837        let e = _mm256_set1_epi16(2);
18838        assert_eq_m256i(r, e);
18839    }
18840
18841    #[simd_test(enable = "avx512bw,avx512vl")]
18842    fn test_mm_srav_epi16() {
18843        let a = _mm_set1_epi16(8);
18844        let count = _mm_set1_epi16(2);
18845        let r = _mm_srav_epi16(a, count);
18846        let e = _mm_set1_epi16(2);
18847        assert_eq_m128i(r, e);
18848    }
18849
18850    #[simd_test(enable = "avx512bw,avx512vl")]
18851    fn test_mm_mask_srav_epi16() {
18852        let a = _mm_set1_epi16(8);
18853        let count = _mm_set1_epi16(2);
18854        let r = _mm_mask_srav_epi16(a, 0, a, count);
18855        assert_eq_m128i(r, a);
18856        let r = _mm_mask_srav_epi16(a, 0b11111111, a, count);
18857        let e = _mm_set1_epi16(2);
18858        assert_eq_m128i(r, e);
18859    }
18860
18861    #[simd_test(enable = "avx512bw,avx512vl")]
18862    fn test_mm_maskz_srav_epi16() {
18863        let a = _mm_set1_epi16(8);
18864        let count = _mm_set1_epi16(2);
18865        let r = _mm_maskz_srav_epi16(0, a, count);
18866        assert_eq_m128i(r, _mm_setzero_si128());
18867        let r = _mm_maskz_srav_epi16(0b11111111, a, count);
18868        let e = _mm_set1_epi16(2);
18869        assert_eq_m128i(r, e);
18870    }
18871
18872    #[simd_test(enable = "avx512bw")]
18873    fn test_mm512_permutex2var_epi16() {
18874        #[rustfmt::skip]
18875        let a = _mm512_set_epi16(0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,
18876                                 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
18877        #[rustfmt::skip]
18878        let idx = _mm512_set_epi16(1, 1<<5, 2, 1<<5, 3, 1<<5, 4, 1<<5, 5, 1<<5, 6, 1<<5, 7, 1<<5, 8, 1<<5,
18879                                   9, 1<<5, 10, 1<<5, 11, 1<<5, 12, 1<<5, 13, 1<<5, 14, 1<<5, 15, 1<<5, 16, 1<<5);
18880        let b = _mm512_set1_epi16(100);
18881        let r = _mm512_permutex2var_epi16(a, idx, b);
18882        #[rustfmt::skip]
18883        let e = _mm512_set_epi16(
18884            30, 100, 29, 100, 28, 100, 27, 100, 26, 100, 25, 100, 24, 100, 23, 100,
18885            22, 100, 21, 100, 20, 100, 19, 100, 18, 100, 17, 100, 16, 100, 15, 100,
18886        );
18887        assert_eq_m512i(r, e);
18888    }
18889
18890    #[simd_test(enable = "avx512bw")]
18891    fn test_mm512_mask_permutex2var_epi16() {
18892        #[rustfmt::skip]
18893        let a = _mm512_set_epi16(0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,
18894                                 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
18895        #[rustfmt::skip]
18896        let idx = _mm512_set_epi16(1, 1<<5, 2, 1<<5, 3, 1<<5, 4, 1<<5, 5, 1<<5, 6, 1<<5, 7, 1<<5, 8, 1<<5,
18897                                   9, 1<<5, 10, 1<<5, 11, 1<<5, 12, 1<<5, 13, 1<<5, 14, 1<<5, 15, 1<<5, 16, 1<<5);
18898        let b = _mm512_set1_epi16(100);
18899        let r = _mm512_mask_permutex2var_epi16(a, 0, idx, b);
18900        assert_eq_m512i(r, a);
18901        let r = _mm512_mask_permutex2var_epi16(a, 0b11111111_11111111_11111111_11111111, idx, b);
18902        #[rustfmt::skip]
18903        let e = _mm512_set_epi16(
18904            30, 100, 29, 100, 28, 100, 27, 100, 26, 100, 25, 100, 24, 100, 23, 100,
18905            22, 100, 21, 100, 20, 100, 19, 100, 18, 100, 17, 100, 16, 100, 15, 100,
18906        );
18907        assert_eq_m512i(r, e);
18908    }
18909
18910    #[simd_test(enable = "avx512bw")]
18911    fn test_mm512_maskz_permutex2var_epi16() {
18912        #[rustfmt::skip]
18913        let a = _mm512_set_epi16(0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,
18914                                 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
18915        #[rustfmt::skip]
18916        let idx = _mm512_set_epi16(1, 1<<5, 2, 1<<5, 3, 1<<5, 4, 1<<5, 5, 1<<5, 6, 1<<5, 7, 1<<5, 8, 1<<5,
18917                                   9, 1<<5, 10, 1<<5, 11, 1<<5, 12, 1<<5, 13, 1<<5, 14, 1<<5, 15, 1<<5, 16, 1<<5);
18918        let b = _mm512_set1_epi16(100);
18919        let r = _mm512_maskz_permutex2var_epi16(0, a, idx, b);
18920        assert_eq_m512i(r, _mm512_setzero_si512());
18921        let r = _mm512_maskz_permutex2var_epi16(0b11111111_11111111_11111111_11111111, a, idx, b);
18922        #[rustfmt::skip]
18923        let e = _mm512_set_epi16(
18924            30, 100, 29, 100, 28, 100, 27, 100, 26, 100, 25, 100, 24, 100, 23, 100,
18925            22, 100, 21, 100, 20, 100, 19, 100, 18, 100, 17, 100, 16, 100, 15, 100,
18926        );
18927        assert_eq_m512i(r, e);
18928    }
18929
18930    #[simd_test(enable = "avx512bw")]
18931    fn test_mm512_mask2_permutex2var_epi16() {
18932        #[rustfmt::skip]
18933        let a = _mm512_set_epi16(0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,
18934                                 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
18935        #[rustfmt::skip]
18936        let idx = _mm512_set_epi16(1, 1<<5, 2, 1<<5, 3, 1<<5, 4, 1<<5, 5, 1<<5, 6, 1<<5, 7, 1<<5, 8, 1<<5,
18937                                   9, 1<<5, 10, 1<<5, 11, 1<<5, 12, 1<<5, 13, 1<<5, 14, 1<<5, 15, 1<<5, 16, 1<<5);
18938        let b = _mm512_set1_epi16(100);
18939        let r = _mm512_mask2_permutex2var_epi16(a, idx, 0, b);
18940        assert_eq_m512i(r, idx);
18941        let r = _mm512_mask2_permutex2var_epi16(a, idx, 0b11111111_11111111_11111111_11111111, b);
18942        #[rustfmt::skip]
18943        let e = _mm512_set_epi16(
18944            30, 100, 29, 100, 28, 100, 27, 100, 26, 100, 25, 100, 24, 100, 23, 100,
18945            22, 100, 21, 100, 20, 100, 19, 100, 18, 100, 17, 100, 16, 100, 15, 100,
18946        );
18947        assert_eq_m512i(r, e);
18948    }
18949
18950    #[simd_test(enable = "avx512bw,avx512vl")]
18951    fn test_mm256_permutex2var_epi16() {
18952        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
18953        #[rustfmt::skip]
18954        let idx = _mm256_set_epi16(1, 1<<4, 2, 1<<4, 3, 1<<4, 4, 1<<4, 5, 1<<4, 6, 1<<4, 7, 1<<4, 8, 1<<4);
18955        let b = _mm256_set1_epi16(100);
18956        let r = _mm256_permutex2var_epi16(a, idx, b);
18957        let e = _mm256_set_epi16(
18958            14, 100, 13, 100, 12, 100, 11, 100, 10, 100, 9, 100, 8, 100, 7, 100,
18959        );
18960        assert_eq_m256i(r, e);
18961    }
18962
18963    #[simd_test(enable = "avx512bw,avx512vl")]
18964    fn test_mm256_mask_permutex2var_epi16() {
18965        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
18966        #[rustfmt::skip]
18967        let idx = _mm256_set_epi16(1, 1<<4, 2, 1<<4, 3, 1<<4, 4, 1<<4, 5, 1<<4, 6, 1<<4, 7, 1<<4, 8, 1<<4);
18968        let b = _mm256_set1_epi16(100);
18969        let r = _mm256_mask_permutex2var_epi16(a, 0, idx, b);
18970        assert_eq_m256i(r, a);
18971        let r = _mm256_mask_permutex2var_epi16(a, 0b11111111_11111111, idx, b);
18972        let e = _mm256_set_epi16(
18973            14, 100, 13, 100, 12, 100, 11, 100, 10, 100, 9, 100, 8, 100, 7, 100,
18974        );
18975        assert_eq_m256i(r, e);
18976    }
18977
18978    #[simd_test(enable = "avx512bw,avx512vl")]
18979    fn test_mm256_maskz_permutex2var_epi16() {
18980        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
18981        #[rustfmt::skip]
18982        let idx = _mm256_set_epi16(1, 1<<4, 2, 1<<4, 3, 1<<4, 4, 1<<4, 5, 1<<4, 6, 1<<4, 7, 1<<4, 8, 1<<4);
18983        let b = _mm256_set1_epi16(100);
18984        let r = _mm256_maskz_permutex2var_epi16(0, a, idx, b);
18985        assert_eq_m256i(r, _mm256_setzero_si256());
18986        let r = _mm256_maskz_permutex2var_epi16(0b11111111_11111111, a, idx, b);
18987        let e = _mm256_set_epi16(
18988            14, 100, 13, 100, 12, 100, 11, 100, 10, 100, 9, 100, 8, 100, 7, 100,
18989        );
18990        assert_eq_m256i(r, e);
18991    }
18992
18993    #[simd_test(enable = "avx512bw,avx512vl")]
18994    fn test_mm256_mask2_permutex2var_epi16() {
18995        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
18996        #[rustfmt::skip]
18997        let idx = _mm256_set_epi16(1, 1<<4, 2, 1<<4, 3, 1<<4, 4, 1<<4, 5, 1<<4, 6, 1<<4, 7, 1<<4, 8, 1<<4);
18998        let b = _mm256_set1_epi16(100);
18999        let r = _mm256_mask2_permutex2var_epi16(a, idx, 0, b);
19000        assert_eq_m256i(r, idx);
19001        let r = _mm256_mask2_permutex2var_epi16(a, idx, 0b11111111_11111111, b);
19002        #[rustfmt::skip]
19003        let e = _mm256_set_epi16(
19004            14, 100, 13, 100, 12, 100, 11, 100, 10, 100, 9, 100, 8, 100, 7, 100,
19005        );
19006        assert_eq_m256i(r, e);
19007    }
19008
19009    #[simd_test(enable = "avx512bw,avx512vl")]
19010    fn test_mm_permutex2var_epi16() {
19011        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
19012        let idx = _mm_set_epi16(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3);
19013        let b = _mm_set1_epi16(100);
19014        let r = _mm_permutex2var_epi16(a, idx, b);
19015        let e = _mm_set_epi16(6, 100, 5, 100, 4, 100, 3, 100);
19016        assert_eq_m128i(r, e);
19017    }
19018
19019    #[simd_test(enable = "avx512bw,avx512vl")]
19020    fn test_mm_mask_permutex2var_epi16() {
19021        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
19022        let idx = _mm_set_epi16(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3);
19023        let b = _mm_set1_epi16(100);
19024        let r = _mm_mask_permutex2var_epi16(a, 0, idx, b);
19025        assert_eq_m128i(r, a);
19026        let r = _mm_mask_permutex2var_epi16(a, 0b11111111, idx, b);
19027        let e = _mm_set_epi16(6, 100, 5, 100, 4, 100, 3, 100);
19028        assert_eq_m128i(r, e);
19029    }
19030
19031    #[simd_test(enable = "avx512bw,avx512vl")]
19032    fn test_mm_maskz_permutex2var_epi16() {
19033        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
19034        let idx = _mm_set_epi16(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3);
19035        let b = _mm_set1_epi16(100);
19036        let r = _mm_maskz_permutex2var_epi16(0, a, idx, b);
19037        assert_eq_m128i(r, _mm_setzero_si128());
19038        let r = _mm_maskz_permutex2var_epi16(0b11111111, a, idx, b);
19039        let e = _mm_set_epi16(6, 100, 5, 100, 4, 100, 3, 100);
19040        assert_eq_m128i(r, e);
19041    }
19042
19043    #[simd_test(enable = "avx512bw,avx512vl")]
19044    fn test_mm_mask2_permutex2var_epi16() {
19045        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
19046        let idx = _mm_set_epi16(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3);
19047        let b = _mm_set1_epi16(100);
19048        let r = _mm_mask2_permutex2var_epi16(a, idx, 0, b);
19049        assert_eq_m128i(r, idx);
19050        let r = _mm_mask2_permutex2var_epi16(a, idx, 0b11111111, b);
19051        let e = _mm_set_epi16(6, 100, 5, 100, 4, 100, 3, 100);
19052        assert_eq_m128i(r, e);
19053    }
19054
19055    #[simd_test(enable = "avx512bw")]
19056    fn test_mm512_permutexvar_epi16() {
19057        let idx = _mm512_set1_epi16(1);
19058        #[rustfmt::skip]
19059        let a = _mm512_set_epi16(0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,
19060                                 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
19061        let r = _mm512_permutexvar_epi16(idx, a);
19062        let e = _mm512_set1_epi16(30);
19063        assert_eq_m512i(r, e);
19064    }
19065
19066    #[simd_test(enable = "avx512bw")]
19067    fn test_mm512_mask_permutexvar_epi16() {
19068        let idx = _mm512_set1_epi16(1);
19069        #[rustfmt::skip]
19070        let a = _mm512_set_epi16(0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,
19071                                 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
19072        let r = _mm512_mask_permutexvar_epi16(a, 0, idx, a);
19073        assert_eq_m512i(r, a);
19074        let r = _mm512_mask_permutexvar_epi16(a, 0b11111111_11111111_11111111_11111111, idx, a);
19075        let e = _mm512_set1_epi16(30);
19076        assert_eq_m512i(r, e);
19077    }
19078
19079    #[simd_test(enable = "avx512bw")]
19080    fn test_mm512_maskz_permutexvar_epi16() {
19081        let idx = _mm512_set1_epi16(1);
19082        #[rustfmt::skip]
19083        let a = _mm512_set_epi16(0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,
19084                                 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
19085        let r = _mm512_maskz_permutexvar_epi16(0, idx, a);
19086        assert_eq_m512i(r, _mm512_setzero_si512());
19087        let r = _mm512_maskz_permutexvar_epi16(0b11111111_11111111_11111111_11111111, idx, a);
19088        let e = _mm512_set1_epi16(30);
19089        assert_eq_m512i(r, e);
19090    }
19091
19092    #[simd_test(enable = "avx512bw,avx512vl")]
19093    fn test_mm256_permutexvar_epi16() {
19094        let idx = _mm256_set1_epi16(1);
19095        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
19096        let r = _mm256_permutexvar_epi16(idx, a);
19097        let e = _mm256_set1_epi16(14);
19098        assert_eq_m256i(r, e);
19099    }
19100
19101    #[simd_test(enable = "avx512bw,avx512vl")]
19102    fn test_mm256_mask_permutexvar_epi16() {
19103        let idx = _mm256_set1_epi16(1);
19104        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
19105        let r = _mm256_mask_permutexvar_epi16(a, 0, idx, a);
19106        assert_eq_m256i(r, a);
19107        let r = _mm256_mask_permutexvar_epi16(a, 0b11111111_11111111, idx, a);
19108        let e = _mm256_set1_epi16(14);
19109        assert_eq_m256i(r, e);
19110    }
19111
19112    #[simd_test(enable = "avx512bw,avx512vl")]
19113    fn test_mm256_maskz_permutexvar_epi16() {
19114        let idx = _mm256_set1_epi16(1);
19115        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
19116        let r = _mm256_maskz_permutexvar_epi16(0, idx, a);
19117        assert_eq_m256i(r, _mm256_setzero_si256());
19118        let r = _mm256_maskz_permutexvar_epi16(0b11111111_11111111, idx, a);
19119        let e = _mm256_set1_epi16(14);
19120        assert_eq_m256i(r, e);
19121    }
19122
19123    #[simd_test(enable = "avx512bw,avx512vl")]
19124    fn test_mm_permutexvar_epi16() {
19125        let idx = _mm_set1_epi16(1);
19126        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
19127        let r = _mm_permutexvar_epi16(idx, a);
19128        let e = _mm_set1_epi16(6);
19129        assert_eq_m128i(r, e);
19130    }
19131
19132    #[simd_test(enable = "avx512bw,avx512vl")]
19133    fn test_mm_mask_permutexvar_epi16() {
19134        let idx = _mm_set1_epi16(1);
19135        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
19136        let r = _mm_mask_permutexvar_epi16(a, 0, idx, a);
19137        assert_eq_m128i(r, a);
19138        let r = _mm_mask_permutexvar_epi16(a, 0b11111111, idx, a);
19139        let e = _mm_set1_epi16(6);
19140        assert_eq_m128i(r, e);
19141    }
19142
19143    #[simd_test(enable = "avx512bw,avx512vl")]
19144    fn test_mm_maskz_permutexvar_epi16() {
19145        let idx = _mm_set1_epi16(1);
19146        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
19147        let r = _mm_maskz_permutexvar_epi16(0, idx, a);
19148        assert_eq_m128i(r, _mm_setzero_si128());
19149        let r = _mm_maskz_permutexvar_epi16(0b11111111, idx, a);
19150        let e = _mm_set1_epi16(6);
19151        assert_eq_m128i(r, e);
19152    }
19153
19154    #[simd_test(enable = "avx512bw")]
19155    const fn test_mm512_mask_blend_epi16() {
19156        let a = _mm512_set1_epi16(1);
19157        let b = _mm512_set1_epi16(2);
19158        let r = _mm512_mask_blend_epi16(0b11111111_00000000_11111111_00000000, a, b);
19159        #[rustfmt::skip]
19160        let e = _mm512_set_epi16(2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
19161                                 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1);
19162        assert_eq_m512i(r, e);
19163    }
19164
19165    #[simd_test(enable = "avx512bw,avx512vl")]
19166    const fn test_mm256_mask_blend_epi16() {
19167        let a = _mm256_set1_epi16(1);
19168        let b = _mm256_set1_epi16(2);
19169        let r = _mm256_mask_blend_epi16(0b11111111_00000000, a, b);
19170        let e = _mm256_set_epi16(2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1);
19171        assert_eq_m256i(r, e);
19172    }
19173
19174    #[simd_test(enable = "avx512bw,avx512vl")]
19175    const fn test_mm_mask_blend_epi16() {
19176        let a = _mm_set1_epi16(1);
19177        let b = _mm_set1_epi16(2);
19178        let r = _mm_mask_blend_epi16(0b11110000, a, b);
19179        let e = _mm_set_epi16(2, 2, 2, 2, 1, 1, 1, 1);
19180        assert_eq_m128i(r, e);
19181    }
19182
19183    #[simd_test(enable = "avx512bw")]
19184    const fn test_mm512_mask_blend_epi8() {
19185        let a = _mm512_set1_epi8(1);
19186        let b = _mm512_set1_epi8(2);
19187        let r = _mm512_mask_blend_epi8(
19188            0b11111111_00000000_11111111_00000000_11111111_00000000_11111111_00000000,
19189            a,
19190            b,
19191        );
19192        #[rustfmt::skip]
19193        let e = _mm512_set_epi8(2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
19194                                2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
19195                                2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
19196                                2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1);
19197        assert_eq_m512i(r, e);
19198    }
19199
19200    #[simd_test(enable = "avx512bw,avx512vl")]
19201    const fn test_mm256_mask_blend_epi8() {
19202        let a = _mm256_set1_epi8(1);
19203        let b = _mm256_set1_epi8(2);
19204        let r = _mm256_mask_blend_epi8(0b11111111_00000000_11111111_00000000, a, b);
19205        #[rustfmt::skip]
19206        let e = _mm256_set_epi8(2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
19207                                2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1);
19208        assert_eq_m256i(r, e);
19209    }
19210
19211    #[simd_test(enable = "avx512bw,avx512vl")]
19212    const fn test_mm_mask_blend_epi8() {
19213        let a = _mm_set1_epi8(1);
19214        let b = _mm_set1_epi8(2);
19215        let r = _mm_mask_blend_epi8(0b11111111_00000000, a, b);
19216        let e = _mm_set_epi8(2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1);
19217        assert_eq_m128i(r, e);
19218    }
19219
19220    #[simd_test(enable = "avx512bw")]
19221    const fn test_mm512_broadcastw_epi16() {
19222        let a = _mm_set_epi16(17, 18, 19, 20, 21, 22, 23, 24);
19223        let r = _mm512_broadcastw_epi16(a);
19224        let e = _mm512_set1_epi16(24);
19225        assert_eq_m512i(r, e);
19226    }
19227
19228    #[simd_test(enable = "avx512bw")]
19229    const fn test_mm512_mask_broadcastw_epi16() {
19230        let src = _mm512_set1_epi16(1);
19231        let a = _mm_set_epi16(17, 18, 19, 20, 21, 22, 23, 24);
19232        let r = _mm512_mask_broadcastw_epi16(src, 0, a);
19233        assert_eq_m512i(r, src);
19234        let r = _mm512_mask_broadcastw_epi16(src, 0b11111111_11111111_11111111_11111111, a);
19235        let e = _mm512_set1_epi16(24);
19236        assert_eq_m512i(r, e);
19237    }
19238
19239    #[simd_test(enable = "avx512bw")]
19240    const fn test_mm512_maskz_broadcastw_epi16() {
19241        let a = _mm_set_epi16(17, 18, 19, 20, 21, 22, 23, 24);
19242        let r = _mm512_maskz_broadcastw_epi16(0, a);
19243        assert_eq_m512i(r, _mm512_setzero_si512());
19244        let r = _mm512_maskz_broadcastw_epi16(0b11111111_11111111_11111111_11111111, a);
19245        let e = _mm512_set1_epi16(24);
19246        assert_eq_m512i(r, e);
19247    }
19248
19249    #[simd_test(enable = "avx512bw,avx512vl")]
19250    const fn test_mm256_mask_broadcastw_epi16() {
19251        let src = _mm256_set1_epi16(1);
19252        let a = _mm_set_epi16(17, 18, 19, 20, 21, 22, 23, 24);
19253        let r = _mm256_mask_broadcastw_epi16(src, 0, a);
19254        assert_eq_m256i(r, src);
19255        let r = _mm256_mask_broadcastw_epi16(src, 0b11111111_11111111, a);
19256        let e = _mm256_set1_epi16(24);
19257        assert_eq_m256i(r, e);
19258    }
19259
19260    #[simd_test(enable = "avx512bw,avx512vl")]
19261    const fn test_mm256_maskz_broadcastw_epi16() {
19262        let a = _mm_set_epi16(17, 18, 19, 20, 21, 22, 23, 24);
19263        let r = _mm256_maskz_broadcastw_epi16(0, a);
19264        assert_eq_m256i(r, _mm256_setzero_si256());
19265        let r = _mm256_maskz_broadcastw_epi16(0b11111111_11111111, a);
19266        let e = _mm256_set1_epi16(24);
19267        assert_eq_m256i(r, e);
19268    }
19269
19270    #[simd_test(enable = "avx512bw,avx512vl")]
19271    const fn test_mm_mask_broadcastw_epi16() {
19272        let src = _mm_set1_epi16(1);
19273        let a = _mm_set_epi16(17, 18, 19, 20, 21, 22, 23, 24);
19274        let r = _mm_mask_broadcastw_epi16(src, 0, a);
19275        assert_eq_m128i(r, src);
19276        let r = _mm_mask_broadcastw_epi16(src, 0b11111111, a);
19277        let e = _mm_set1_epi16(24);
19278        assert_eq_m128i(r, e);
19279    }
19280
19281    #[simd_test(enable = "avx512bw,avx512vl")]
19282    const fn test_mm_maskz_broadcastw_epi16() {
19283        let a = _mm_set_epi16(17, 18, 19, 20, 21, 22, 23, 24);
19284        let r = _mm_maskz_broadcastw_epi16(0, a);
19285        assert_eq_m128i(r, _mm_setzero_si128());
19286        let r = _mm_maskz_broadcastw_epi16(0b11111111, a);
19287        let e = _mm_set1_epi16(24);
19288        assert_eq_m128i(r, e);
19289    }
19290
19291    #[simd_test(enable = "avx512bw")]
19292    const fn test_mm512_broadcastb_epi8() {
19293        let a = _mm_set_epi8(
19294            17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
19295        );
19296        let r = _mm512_broadcastb_epi8(a);
19297        let e = _mm512_set1_epi8(32);
19298        assert_eq_m512i(r, e);
19299    }
19300
19301    #[simd_test(enable = "avx512bw")]
19302    const fn test_mm512_mask_broadcastb_epi8() {
19303        let src = _mm512_set1_epi8(1);
19304        let a = _mm_set_epi8(
19305            17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
19306        );
19307        let r = _mm512_mask_broadcastb_epi8(src, 0, a);
19308        assert_eq_m512i(r, src);
19309        let r = _mm512_mask_broadcastb_epi8(
19310            src,
19311            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
19312            a,
19313        );
19314        let e = _mm512_set1_epi8(32);
19315        assert_eq_m512i(r, e);
19316    }
19317
19318    #[simd_test(enable = "avx512bw")]
19319    const fn test_mm512_maskz_broadcastb_epi8() {
19320        let a = _mm_set_epi8(
19321            17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
19322        );
19323        let r = _mm512_maskz_broadcastb_epi8(0, a);
19324        assert_eq_m512i(r, _mm512_setzero_si512());
19325        let r = _mm512_maskz_broadcastb_epi8(
19326            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
19327            a,
19328        );
19329        let e = _mm512_set1_epi8(32);
19330        assert_eq_m512i(r, e);
19331    }
19332
19333    #[simd_test(enable = "avx512bw,avx512vl")]
19334    const fn test_mm256_mask_broadcastb_epi8() {
19335        let src = _mm256_set1_epi8(1);
19336        let a = _mm_set_epi8(
19337            17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
19338        );
19339        let r = _mm256_mask_broadcastb_epi8(src, 0, a);
19340        assert_eq_m256i(r, src);
19341        let r = _mm256_mask_broadcastb_epi8(src, 0b11111111_11111111_11111111_11111111, a);
19342        let e = _mm256_set1_epi8(32);
19343        assert_eq_m256i(r, e);
19344    }
19345
19346    #[simd_test(enable = "avx512bw,avx512vl")]
19347    const fn test_mm256_maskz_broadcastb_epi8() {
19348        let a = _mm_set_epi8(
19349            17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
19350        );
19351        let r = _mm256_maskz_broadcastb_epi8(0, a);
19352        assert_eq_m256i(r, _mm256_setzero_si256());
19353        let r = _mm256_maskz_broadcastb_epi8(0b11111111_11111111_11111111_11111111, a);
19354        let e = _mm256_set1_epi8(32);
19355        assert_eq_m256i(r, e);
19356    }
19357
19358    #[simd_test(enable = "avx512bw,avx512vl")]
19359    const fn test_mm_mask_broadcastb_epi8() {
19360        let src = _mm_set1_epi8(1);
19361        let a = _mm_set_epi8(
19362            17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
19363        );
19364        let r = _mm_mask_broadcastb_epi8(src, 0, a);
19365        assert_eq_m128i(r, src);
19366        let r = _mm_mask_broadcastb_epi8(src, 0b11111111_11111111, a);
19367        let e = _mm_set1_epi8(32);
19368        assert_eq_m128i(r, e);
19369    }
19370
19371    #[simd_test(enable = "avx512bw,avx512vl")]
19372    const fn test_mm_maskz_broadcastb_epi8() {
19373        let a = _mm_set_epi8(
19374            17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
19375        );
19376        let r = _mm_maskz_broadcastb_epi8(0, a);
19377        assert_eq_m128i(r, _mm_setzero_si128());
19378        let r = _mm_maskz_broadcastb_epi8(0b11111111_11111111, a);
19379        let e = _mm_set1_epi8(32);
19380        assert_eq_m128i(r, e);
19381    }
19382
19383    #[simd_test(enable = "avx512bw")]
19384    const fn test_mm512_unpackhi_epi16() {
19385        #[rustfmt::skip]
19386        let a = _mm512_set_epi16(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19387                                 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
19388        #[rustfmt::skip]
19389        let b = _mm512_set_epi16(33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19390                                 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
19391        let r = _mm512_unpackhi_epi16(a, b);
19392        #[rustfmt::skip]
19393        let e = _mm512_set_epi16(33, 1,  34, 2,  35, 3,  36, 4,  41, 9,  42, 10, 43, 11, 44, 12,
19394                                 49, 17, 50, 18, 51, 19, 52, 20, 57, 25, 58, 26, 59, 27, 60, 28);
19395        assert_eq_m512i(r, e);
19396    }
19397
19398    #[simd_test(enable = "avx512bw")]
19399    const fn test_mm512_mask_unpackhi_epi16() {
19400        #[rustfmt::skip]
19401        let a = _mm512_set_epi16(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19402                                 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
19403        #[rustfmt::skip]
19404        let b = _mm512_set_epi16(33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19405                                 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
19406        let r = _mm512_mask_unpackhi_epi16(a, 0, a, b);
19407        assert_eq_m512i(r, a);
19408        let r = _mm512_mask_unpackhi_epi16(a, 0b11111111_11111111_11111111_11111111, a, b);
19409        #[rustfmt::skip]
19410        let e = _mm512_set_epi16(33, 1,  34, 2,  35, 3,  36, 4,  41, 9,  42, 10, 43, 11, 44, 12,
19411                                 49, 17, 50, 18, 51, 19, 52, 20, 57, 25, 58, 26, 59, 27, 60, 28);
19412        assert_eq_m512i(r, e);
19413    }
19414
19415    #[simd_test(enable = "avx512bw")]
19416    const fn test_mm512_maskz_unpackhi_epi16() {
19417        #[rustfmt::skip]
19418        let a = _mm512_set_epi16(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19419                                 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
19420        #[rustfmt::skip]
19421        let b = _mm512_set_epi16(33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19422                                 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
19423        let r = _mm512_maskz_unpackhi_epi16(0, a, b);
19424        assert_eq_m512i(r, _mm512_setzero_si512());
19425        let r = _mm512_maskz_unpackhi_epi16(0b11111111_11111111_11111111_11111111, a, b);
19426        #[rustfmt::skip]
19427        let e = _mm512_set_epi16(33, 1,  34, 2,  35, 3,  36, 4,  41, 9,  42, 10, 43, 11, 44, 12,
19428                                 49, 17, 50, 18, 51, 19, 52, 20, 57, 25, 58, 26, 59, 27, 60, 28);
19429        assert_eq_m512i(r, e);
19430    }
19431
19432    #[simd_test(enable = "avx512bw,avx512vl")]
19433    const fn test_mm256_mask_unpackhi_epi16() {
19434        let a = _mm256_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
19435        let b = _mm256_set_epi16(
19436            33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19437        );
19438        let r = _mm256_mask_unpackhi_epi16(a, 0, a, b);
19439        assert_eq_m256i(r, a);
19440        let r = _mm256_mask_unpackhi_epi16(a, 0b11111111_11111111, a, b);
19441        let e = _mm256_set_epi16(33, 1, 34, 2, 35, 3, 36, 4, 41, 9, 42, 10, 43, 11, 44, 12);
19442        assert_eq_m256i(r, e);
19443    }
19444
19445    #[simd_test(enable = "avx512bw,avx512vl")]
19446    const fn test_mm256_maskz_unpackhi_epi16() {
19447        let a = _mm256_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
19448        let b = _mm256_set_epi16(
19449            33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19450        );
19451        let r = _mm256_maskz_unpackhi_epi16(0, a, b);
19452        assert_eq_m256i(r, _mm256_setzero_si256());
19453        let r = _mm256_maskz_unpackhi_epi16(0b11111111_11111111, a, b);
19454        let e = _mm256_set_epi16(33, 1, 34, 2, 35, 3, 36, 4, 41, 9, 42, 10, 43, 11, 44, 12);
19455        assert_eq_m256i(r, e);
19456    }
19457
19458    #[simd_test(enable = "avx512bw,avx512vl")]
19459    const fn test_mm_mask_unpackhi_epi16() {
19460        let a = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8);
19461        let b = _mm_set_epi16(33, 34, 35, 36, 37, 38, 39, 40);
19462        let r = _mm_mask_unpackhi_epi16(a, 0, a, b);
19463        assert_eq_m128i(r, a);
19464        let r = _mm_mask_unpackhi_epi16(a, 0b11111111, a, b);
19465        let e = _mm_set_epi16(33, 1, 34, 2, 35, 3, 36, 4);
19466        assert_eq_m128i(r, e);
19467    }
19468
19469    #[simd_test(enable = "avx512bw,avx512vl")]
19470    const fn test_mm_maskz_unpackhi_epi16() {
19471        let a = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8);
19472        let b = _mm_set_epi16(33, 34, 35, 36, 37, 38, 39, 40);
19473        let r = _mm_maskz_unpackhi_epi16(0, a, b);
19474        assert_eq_m128i(r, _mm_setzero_si128());
19475        let r = _mm_maskz_unpackhi_epi16(0b11111111, a, b);
19476        let e = _mm_set_epi16(33, 1, 34, 2, 35, 3, 36, 4);
19477        assert_eq_m128i(r, e);
19478    }
19479
19480    #[simd_test(enable = "avx512bw")]
19481    const fn test_mm512_unpackhi_epi8() {
19482        #[rustfmt::skip]
19483        let a = _mm512_set_epi8(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19484                                17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
19485                                33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19486                                49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
19487        #[rustfmt::skip]
19488        let b = _mm512_set_epi8(65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,  80,
19489                                81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,  96,
19490                                97,  98,  99,  100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
19491                                113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 0);
19492        let r = _mm512_unpackhi_epi8(a, b);
19493        #[rustfmt::skip]
19494        let e = _mm512_set_epi8(65, 1,  66, 2,  67, 3,  68, 4,  69, 5,  70, 6,  71, 7,  72, 8,
19495                                81, 17, 82, 18, 83, 19, 84, 20, 85, 21, 86, 22, 87, 23, 88, 24,
19496                                97, 33, 98, 34, 99, 35, 100, 36, 101, 37, 102, 38, 103, 39, 104, 40,
19497                                113, 49, 114, 50, 115, 51, 116, 52, 117, 53, 118, 54, 119, 55, 120, 56);
19498        assert_eq_m512i(r, e);
19499    }
19500
19501    #[simd_test(enable = "avx512bw")]
19502    const fn test_mm512_mask_unpackhi_epi8() {
19503        #[rustfmt::skip]
19504        let a = _mm512_set_epi8(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19505                                17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
19506                                33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19507                                49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
19508        #[rustfmt::skip]
19509        let b = _mm512_set_epi8(65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,  80,
19510                                81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,  96,
19511                                97,  98,  99,  100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
19512                                113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 0);
19513        let r = _mm512_mask_unpackhi_epi8(a, 0, a, b);
19514        assert_eq_m512i(r, a);
19515        let r = _mm512_mask_unpackhi_epi8(
19516            a,
19517            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
19518            a,
19519            b,
19520        );
19521        #[rustfmt::skip]
19522        let e = _mm512_set_epi8(65, 1,  66, 2,  67, 3,  68, 4,  69, 5,  70, 6,  71, 7,  72, 8,
19523                                81, 17, 82, 18, 83, 19, 84, 20, 85, 21, 86, 22, 87, 23, 88, 24,
19524                                97, 33, 98, 34, 99, 35, 100, 36, 101, 37, 102, 38, 103, 39, 104, 40,
19525                                113, 49, 114, 50, 115, 51, 116, 52, 117, 53, 118, 54, 119, 55, 120, 56);
19526        assert_eq_m512i(r, e);
19527    }
19528
19529    #[simd_test(enable = "avx512bw")]
19530    const fn test_mm512_maskz_unpackhi_epi8() {
19531        #[rustfmt::skip]
19532        let a = _mm512_set_epi8(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19533                                17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
19534                                33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19535                                49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
19536        #[rustfmt::skip]
19537        let b = _mm512_set_epi8(65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,  80,
19538                                81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,  96,
19539                                97,  98,  99,  100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
19540                                113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 0);
19541        let r = _mm512_maskz_unpackhi_epi8(0, a, b);
19542        assert_eq_m512i(r, _mm512_setzero_si512());
19543        let r = _mm512_maskz_unpackhi_epi8(
19544            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
19545            a,
19546            b,
19547        );
19548        #[rustfmt::skip]
19549        let e = _mm512_set_epi8(65, 1,  66, 2,  67, 3,  68, 4,  69, 5,  70, 6,  71, 7,  72, 8,
19550                                81, 17, 82, 18, 83, 19, 84, 20, 85, 21, 86, 22, 87, 23, 88, 24,
19551                                97, 33, 98, 34, 99, 35, 100, 36, 101, 37, 102, 38, 103, 39, 104, 40,
19552                                113, 49, 114, 50, 115, 51, 116, 52, 117, 53, 118, 54, 119, 55, 120, 56);
19553        assert_eq_m512i(r, e);
19554    }
19555
19556    #[simd_test(enable = "avx512bw,avx512vl")]
19557    const fn test_mm256_mask_unpackhi_epi8() {
19558        #[rustfmt::skip]
19559        let a = _mm256_set_epi8(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19560                                17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
19561        #[rustfmt::skip]
19562        let b = _mm256_set_epi8(65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,  80,
19563                                81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,  96);
19564        let r = _mm256_mask_unpackhi_epi8(a, 0, a, b);
19565        assert_eq_m256i(r, a);
19566        let r = _mm256_mask_unpackhi_epi8(a, 0b11111111_11111111_11111111_11111111, a, b);
19567        #[rustfmt::skip]
19568        let e = _mm256_set_epi8(65, 1,  66, 2,  67, 3,  68, 4,  69, 5,  70, 6,  71, 7,  72, 8,
19569                                81, 17, 82, 18, 83, 19, 84, 20, 85, 21, 86, 22, 87, 23, 88, 24);
19570        assert_eq_m256i(r, e);
19571    }
19572
19573    #[simd_test(enable = "avx512bw,avx512vl")]
19574    const fn test_mm256_maskz_unpackhi_epi8() {
19575        #[rustfmt::skip]
19576        let a = _mm256_set_epi8(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19577                                17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
19578        #[rustfmt::skip]
19579        let b = _mm256_set_epi8(65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,  80,
19580                                81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,  96);
19581        let r = _mm256_maskz_unpackhi_epi8(0, a, b);
19582        assert_eq_m256i(r, _mm256_setzero_si256());
19583        let r = _mm256_maskz_unpackhi_epi8(0b11111111_11111111_11111111_11111111, a, b);
19584        #[rustfmt::skip]
19585        let e = _mm256_set_epi8(65, 1,  66, 2,  67, 3,  68, 4,  69, 5,  70, 6,  71, 7,  72, 8,
19586                                81, 17, 82, 18, 83, 19, 84, 20, 85, 21, 86, 22, 87, 23, 88, 24);
19587        assert_eq_m256i(r, e);
19588    }
19589
19590    #[simd_test(enable = "avx512bw,avx512vl")]
19591    const fn test_mm_mask_unpackhi_epi8() {
19592        let a = _mm_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
19593        let b = _mm_set_epi8(
19594            65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
19595        );
19596        let r = _mm_mask_unpackhi_epi8(a, 0, a, b);
19597        assert_eq_m128i(r, a);
19598        let r = _mm_mask_unpackhi_epi8(a, 0b11111111_11111111, a, b);
19599        let e = _mm_set_epi8(65, 1, 66, 2, 67, 3, 68, 4, 69, 5, 70, 6, 71, 7, 72, 8);
19600        assert_eq_m128i(r, e);
19601    }
19602
19603    #[simd_test(enable = "avx512bw,avx512vl")]
19604    const fn test_mm_maskz_unpackhi_epi8() {
19605        let a = _mm_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
19606        let b = _mm_set_epi8(
19607            65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
19608        );
19609        let r = _mm_maskz_unpackhi_epi8(0, a, b);
19610        assert_eq_m128i(r, _mm_setzero_si128());
19611        let r = _mm_maskz_unpackhi_epi8(0b11111111_11111111, a, b);
19612        let e = _mm_set_epi8(65, 1, 66, 2, 67, 3, 68, 4, 69, 5, 70, 6, 71, 7, 72, 8);
19613        assert_eq_m128i(r, e);
19614    }
19615
19616    #[simd_test(enable = "avx512bw")]
19617    const fn test_mm512_unpacklo_epi16() {
19618        #[rustfmt::skip]
19619        let a = _mm512_set_epi16(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19620                                 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
19621        #[rustfmt::skip]
19622        let b = _mm512_set_epi16(33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19623                                 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
19624        let r = _mm512_unpacklo_epi16(a, b);
19625        #[rustfmt::skip]
19626        let e = _mm512_set_epi16(37, 5,  38, 6,  39, 7,  40, 8,  45, 13, 46, 14, 47, 15, 48, 16,
19627                                 53, 21, 54, 22, 55, 23, 56, 24, 61, 29, 62, 30, 63, 31, 64, 32);
19628        assert_eq_m512i(r, e);
19629    }
19630
19631    #[simd_test(enable = "avx512bw")]
19632    const fn test_mm512_mask_unpacklo_epi16() {
19633        #[rustfmt::skip]
19634        let a = _mm512_set_epi16(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19635                                 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
19636        #[rustfmt::skip]
19637        let b = _mm512_set_epi16(33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19638                                 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
19639        let r = _mm512_mask_unpacklo_epi16(a, 0, a, b);
19640        assert_eq_m512i(r, a);
19641        let r = _mm512_mask_unpacklo_epi16(a, 0b11111111_11111111_11111111_11111111, a, b);
19642        #[rustfmt::skip]
19643        let e = _mm512_set_epi16(37, 5,  38, 6,  39, 7,  40, 8,  45, 13, 46, 14, 47, 15, 48, 16,
19644                                 53, 21, 54, 22, 55, 23, 56, 24, 61, 29, 62, 30, 63, 31, 64, 32);
19645        assert_eq_m512i(r, e);
19646    }
19647
19648    #[simd_test(enable = "avx512bw")]
19649    const fn test_mm512_maskz_unpacklo_epi16() {
19650        #[rustfmt::skip]
19651        let a = _mm512_set_epi16(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19652                                 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
19653        #[rustfmt::skip]
19654        let b = _mm512_set_epi16(33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19655                                 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
19656        let r = _mm512_maskz_unpacklo_epi16(0, a, b);
19657        assert_eq_m512i(r, _mm512_setzero_si512());
19658        let r = _mm512_maskz_unpacklo_epi16(0b11111111_11111111_11111111_11111111, a, b);
19659        #[rustfmt::skip]
19660        let e = _mm512_set_epi16(37, 5,  38, 6,  39, 7,  40, 8,  45, 13, 46, 14, 47, 15, 48, 16,
19661                                 53, 21, 54, 22, 55, 23, 56, 24, 61, 29, 62, 30, 63, 31, 64, 32);
19662        assert_eq_m512i(r, e);
19663    }
19664
19665    #[simd_test(enable = "avx512bw,avx512vl")]
19666    const fn test_mm256_mask_unpacklo_epi16() {
19667        let a = _mm256_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
19668        let b = _mm256_set_epi16(
19669            33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19670        );
19671        let r = _mm256_mask_unpacklo_epi16(a, 0, a, b);
19672        assert_eq_m256i(r, a);
19673        let r = _mm256_mask_unpacklo_epi16(a, 0b11111111_11111111, a, b);
19674        let e = _mm256_set_epi16(37, 5, 38, 6, 39, 7, 40, 8, 45, 13, 46, 14, 47, 15, 48, 16);
19675        assert_eq_m256i(r, e);
19676    }
19677
19678    #[simd_test(enable = "avx512bw,avx512vl")]
19679    const fn test_mm256_maskz_unpacklo_epi16() {
19680        let a = _mm256_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
19681        let b = _mm256_set_epi16(
19682            33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19683        );
19684        let r = _mm256_maskz_unpacklo_epi16(0, a, b);
19685        assert_eq_m256i(r, _mm256_setzero_si256());
19686        let r = _mm256_maskz_unpacklo_epi16(0b11111111_11111111, a, b);
19687        let e = _mm256_set_epi16(37, 5, 38, 6, 39, 7, 40, 8, 45, 13, 46, 14, 47, 15, 48, 16);
19688        assert_eq_m256i(r, e);
19689    }
19690
19691    #[simd_test(enable = "avx512bw,avx512vl")]
19692    const fn test_mm_mask_unpacklo_epi16() {
19693        let a = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8);
19694        let b = _mm_set_epi16(33, 34, 35, 36, 37, 38, 39, 40);
19695        let r = _mm_mask_unpacklo_epi16(a, 0, a, b);
19696        assert_eq_m128i(r, a);
19697        let r = _mm_mask_unpacklo_epi16(a, 0b11111111, a, b);
19698        let e = _mm_set_epi16(37, 5, 38, 6, 39, 7, 40, 8);
19699        assert_eq_m128i(r, e);
19700    }
19701
19702    #[simd_test(enable = "avx512bw,avx512vl")]
19703    const fn test_mm_maskz_unpacklo_epi16() {
19704        let a = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8);
19705        let b = _mm_set_epi16(33, 34, 35, 36, 37, 38, 39, 40);
19706        let r = _mm_maskz_unpacklo_epi16(0, a, b);
19707        assert_eq_m128i(r, _mm_setzero_si128());
19708        let r = _mm_maskz_unpacklo_epi16(0b11111111, a, b);
19709        let e = _mm_set_epi16(37, 5, 38, 6, 39, 7, 40, 8);
19710        assert_eq_m128i(r, e);
19711    }
19712
19713    #[simd_test(enable = "avx512bw")]
19714    const fn test_mm512_unpacklo_epi8() {
19715        #[rustfmt::skip]
19716        let a = _mm512_set_epi8(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19717                                17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
19718                                33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19719                                49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
19720        #[rustfmt::skip]
19721        let b = _mm512_set_epi8(65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,  80,
19722                                81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,  96,
19723                                97,  98,  99,  100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
19724                                113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 0);
19725        let r = _mm512_unpacklo_epi8(a, b);
19726        #[rustfmt::skip]
19727        let e = _mm512_set_epi8(73,  9,  74,  10, 75,  11, 76,  12, 77,  13, 78,  14, 79,  15, 80,  16,
19728                                89,  25, 90,  26, 91,  27, 92,  28, 93,  29, 94,  30, 95,  31, 96,  32,
19729                                105, 41, 106, 42, 107, 43, 108, 44, 109, 45, 110, 46, 111, 47, 112, 48,
19730                                121, 57, 122, 58, 123, 59, 124, 60, 125, 61, 126, 62, 127, 63, 0,   64);
19731        assert_eq_m512i(r, e);
19732    }
19733
19734    #[simd_test(enable = "avx512bw")]
19735    const fn test_mm512_mask_unpacklo_epi8() {
19736        #[rustfmt::skip]
19737        let a = _mm512_set_epi8(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19738                                17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
19739                                33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19740                                49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
19741        #[rustfmt::skip]
19742        let b = _mm512_set_epi8(65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,  80,
19743                                81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,  96,
19744                                97,  98,  99,  100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
19745                                113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 0);
19746        let r = _mm512_mask_unpacklo_epi8(a, 0, a, b);
19747        assert_eq_m512i(r, a);
19748        let r = _mm512_mask_unpacklo_epi8(
19749            a,
19750            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
19751            a,
19752            b,
19753        );
19754        #[rustfmt::skip]
19755        let e = _mm512_set_epi8(73,  9,  74,  10, 75,  11, 76,  12, 77,  13, 78,  14, 79,  15, 80,  16,
19756                                89,  25, 90,  26, 91,  27, 92,  28, 93,  29, 94,  30, 95,  31, 96,  32,
19757                                105, 41, 106, 42, 107, 43, 108, 44, 109, 45, 110, 46, 111, 47, 112, 48,
19758                                121, 57, 122, 58, 123, 59, 124, 60, 125, 61, 126, 62, 127, 63, 0,   64);
19759        assert_eq_m512i(r, e);
19760    }
19761
19762    #[simd_test(enable = "avx512bw")]
19763    const fn test_mm512_maskz_unpacklo_epi8() {
19764        #[rustfmt::skip]
19765        let a = _mm512_set_epi8(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19766                                17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
19767                                33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19768                                49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
19769        #[rustfmt::skip]
19770        let b = _mm512_set_epi8(65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,  80,
19771                                81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,  96,
19772                                97,  98,  99,  100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
19773                                113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 0);
19774        let r = _mm512_maskz_unpacklo_epi8(0, a, b);
19775        assert_eq_m512i(r, _mm512_setzero_si512());
19776        let r = _mm512_maskz_unpacklo_epi8(
19777            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
19778            a,
19779            b,
19780        );
19781        #[rustfmt::skip]
19782        let e = _mm512_set_epi8(73,  9,  74,  10, 75,  11, 76,  12, 77,  13, 78,  14, 79,  15, 80,  16,
19783                                89,  25, 90,  26, 91,  27, 92,  28, 93,  29, 94,  30, 95,  31, 96,  32,
19784                                105, 41, 106, 42, 107, 43, 108, 44, 109, 45, 110, 46, 111, 47, 112, 48,
19785                                121, 57, 122, 58, 123, 59, 124, 60, 125, 61, 126, 62, 127, 63, 0,   64);
19786        assert_eq_m512i(r, e);
19787    }
19788
19789    #[simd_test(enable = "avx512bw,avx512vl")]
19790    const fn test_mm256_mask_unpacklo_epi8() {
19791        #[rustfmt::skip]
19792        let a = _mm256_set_epi8(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19793                                17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
19794        #[rustfmt::skip]
19795        let b = _mm256_set_epi8(65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,  80,
19796                                81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,  96);
19797        let r = _mm256_mask_unpacklo_epi8(a, 0, a, b);
19798        assert_eq_m256i(r, a);
19799        let r = _mm256_mask_unpacklo_epi8(a, 0b11111111_11111111_11111111_11111111, a, b);
19800        #[rustfmt::skip]
19801        let e = _mm256_set_epi8(73,  9,  74,  10, 75,  11, 76,  12, 77,  13, 78,  14, 79,  15, 80,  16,
19802                                89,  25, 90,  26, 91,  27, 92,  28, 93,  29, 94,  30, 95,  31, 96,  32);
19803        assert_eq_m256i(r, e);
19804    }
19805
19806    #[simd_test(enable = "avx512bw,avx512vl")]
19807    const fn test_mm256_maskz_unpacklo_epi8() {
19808        #[rustfmt::skip]
19809        let a = _mm256_set_epi8(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19810                                17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
19811        #[rustfmt::skip]
19812        let b = _mm256_set_epi8(65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,  80,
19813                                81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,  96);
19814        let r = _mm256_maskz_unpacklo_epi8(0, a, b);
19815        assert_eq_m256i(r, _mm256_setzero_si256());
19816        let r = _mm256_maskz_unpacklo_epi8(0b11111111_11111111_11111111_11111111, a, b);
19817        #[rustfmt::skip]
19818        let e = _mm256_set_epi8(73,  9,  74,  10, 75,  11, 76,  12, 77,  13, 78,  14, 79,  15, 80,  16,
19819                                89,  25, 90,  26, 91,  27, 92,  28, 93,  29, 94,  30, 95,  31, 96,  32);
19820        assert_eq_m256i(r, e);
19821    }
19822
19823    #[simd_test(enable = "avx512bw,avx512vl")]
19824    const fn test_mm_mask_unpacklo_epi8() {
19825        let a = _mm_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
19826        let b = _mm_set_epi8(
19827            65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
19828        );
19829        let r = _mm_mask_unpacklo_epi8(a, 0, a, b);
19830        assert_eq_m128i(r, a);
19831        let r = _mm_mask_unpacklo_epi8(a, 0b11111111_11111111, a, b);
19832        let e = _mm_set_epi8(
19833            73, 9, 74, 10, 75, 11, 76, 12, 77, 13, 78, 14, 79, 15, 80, 16,
19834        );
19835        assert_eq_m128i(r, e);
19836    }
19837
19838    #[simd_test(enable = "avx512bw,avx512vl")]
19839    const fn test_mm_maskz_unpacklo_epi8() {
19840        let a = _mm_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
19841        let b = _mm_set_epi8(
19842            65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
19843        );
19844        let r = _mm_maskz_unpacklo_epi8(0, a, b);
19845        assert_eq_m128i(r, _mm_setzero_si128());
19846        let r = _mm_maskz_unpacklo_epi8(0b11111111_11111111, a, b);
19847        let e = _mm_set_epi8(
19848            73, 9, 74, 10, 75, 11, 76, 12, 77, 13, 78, 14, 79, 15, 80, 16,
19849        );
19850        assert_eq_m128i(r, e);
19851    }
19852
19853    #[simd_test(enable = "avx512bw")]
19854    const fn test_mm512_mask_mov_epi16() {
19855        let src = _mm512_set1_epi16(1);
19856        let a = _mm512_set1_epi16(2);
19857        let r = _mm512_mask_mov_epi16(src, 0, a);
19858        assert_eq_m512i(r, src);
19859        let r = _mm512_mask_mov_epi16(src, 0b11111111_11111111_11111111_11111111, a);
19860        assert_eq_m512i(r, a);
19861    }
19862
19863    #[simd_test(enable = "avx512bw")]
19864    const fn test_mm512_maskz_mov_epi16() {
19865        let a = _mm512_set1_epi16(2);
19866        let r = _mm512_maskz_mov_epi16(0, a);
19867        assert_eq_m512i(r, _mm512_setzero_si512());
19868        let r = _mm512_maskz_mov_epi16(0b11111111_11111111_11111111_11111111, a);
19869        assert_eq_m512i(r, a);
19870    }
19871
19872    #[simd_test(enable = "avx512bw,avx512vl")]
19873    const fn test_mm256_mask_mov_epi16() {
19874        let src = _mm256_set1_epi16(1);
19875        let a = _mm256_set1_epi16(2);
19876        let r = _mm256_mask_mov_epi16(src, 0, a);
19877        assert_eq_m256i(r, src);
19878        let r = _mm256_mask_mov_epi16(src, 0b11111111_11111111, a);
19879        assert_eq_m256i(r, a);
19880    }
19881
19882    #[simd_test(enable = "avx512bw,avx512vl")]
19883    const fn test_mm256_maskz_mov_epi16() {
19884        let a = _mm256_set1_epi16(2);
19885        let r = _mm256_maskz_mov_epi16(0, a);
19886        assert_eq_m256i(r, _mm256_setzero_si256());
19887        let r = _mm256_maskz_mov_epi16(0b11111111_11111111, a);
19888        assert_eq_m256i(r, a);
19889    }
19890
19891    #[simd_test(enable = "avx512bw,avx512vl")]
19892    const fn test_mm_mask_mov_epi16() {
19893        let src = _mm_set1_epi16(1);
19894        let a = _mm_set1_epi16(2);
19895        let r = _mm_mask_mov_epi16(src, 0, a);
19896        assert_eq_m128i(r, src);
19897        let r = _mm_mask_mov_epi16(src, 0b11111111, a);
19898        assert_eq_m128i(r, a);
19899    }
19900
19901    #[simd_test(enable = "avx512bw,avx512vl")]
19902    const fn test_mm_maskz_mov_epi16() {
19903        let a = _mm_set1_epi16(2);
19904        let r = _mm_maskz_mov_epi16(0, a);
19905        assert_eq_m128i(r, _mm_setzero_si128());
19906        let r = _mm_maskz_mov_epi16(0b11111111, a);
19907        assert_eq_m128i(r, a);
19908    }
19909
19910    #[simd_test(enable = "avx512bw")]
19911    const fn test_mm512_mask_mov_epi8() {
19912        let src = _mm512_set1_epi8(1);
19913        let a = _mm512_set1_epi8(2);
19914        let r = _mm512_mask_mov_epi8(src, 0, a);
19915        assert_eq_m512i(r, src);
19916        let r = _mm512_mask_mov_epi8(
19917            src,
19918            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
19919            a,
19920        );
19921        assert_eq_m512i(r, a);
19922    }
19923
19924    #[simd_test(enable = "avx512bw")]
19925    const fn test_mm512_maskz_mov_epi8() {
19926        let a = _mm512_set1_epi8(2);
19927        let r = _mm512_maskz_mov_epi8(0, a);
19928        assert_eq_m512i(r, _mm512_setzero_si512());
19929        let r = _mm512_maskz_mov_epi8(
19930            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
19931            a,
19932        );
19933        assert_eq_m512i(r, a);
19934    }
19935
19936    #[simd_test(enable = "avx512bw,avx512vl")]
19937    const fn test_mm256_mask_mov_epi8() {
19938        let src = _mm256_set1_epi8(1);
19939        let a = _mm256_set1_epi8(2);
19940        let r = _mm256_mask_mov_epi8(src, 0, a);
19941        assert_eq_m256i(r, src);
19942        let r = _mm256_mask_mov_epi8(src, 0b11111111_11111111_11111111_11111111, a);
19943        assert_eq_m256i(r, a);
19944    }
19945
19946    #[simd_test(enable = "avx512bw,avx512vl")]
19947    const fn test_mm256_maskz_mov_epi8() {
19948        let a = _mm256_set1_epi8(2);
19949        let r = _mm256_maskz_mov_epi8(0, a);
19950        assert_eq_m256i(r, _mm256_setzero_si256());
19951        let r = _mm256_maskz_mov_epi8(0b11111111_11111111_11111111_11111111, a);
19952        assert_eq_m256i(r, a);
19953    }
19954
19955    #[simd_test(enable = "avx512bw,avx512vl")]
19956    const fn test_mm_mask_mov_epi8() {
19957        let src = _mm_set1_epi8(1);
19958        let a = _mm_set1_epi8(2);
19959        let r = _mm_mask_mov_epi8(src, 0, a);
19960        assert_eq_m128i(r, src);
19961        let r = _mm_mask_mov_epi8(src, 0b11111111_11111111, a);
19962        assert_eq_m128i(r, a);
19963    }
19964
19965    #[simd_test(enable = "avx512bw,avx512vl")]
19966    const fn test_mm_maskz_mov_epi8() {
19967        let a = _mm_set1_epi8(2);
19968        let r = _mm_maskz_mov_epi8(0, a);
19969        assert_eq_m128i(r, _mm_setzero_si128());
19970        let r = _mm_maskz_mov_epi8(0b11111111_11111111, a);
19971        assert_eq_m128i(r, a);
19972    }
19973
19974    #[simd_test(enable = "avx512bw")]
19975    const fn test_mm512_mask_set1_epi16() {
19976        let src = _mm512_set1_epi16(2);
19977        let a: i16 = 11;
19978        let r = _mm512_mask_set1_epi16(src, 0, a);
19979        assert_eq_m512i(r, src);
19980        let r = _mm512_mask_set1_epi16(src, 0b11111111_11111111_11111111_11111111, a);
19981        let e = _mm512_set1_epi16(11);
19982        assert_eq_m512i(r, e);
19983    }
19984
19985    #[simd_test(enable = "avx512bw")]
19986    const fn test_mm512_maskz_set1_epi16() {
19987        let a: i16 = 11;
19988        let r = _mm512_maskz_set1_epi16(0, a);
19989        assert_eq_m512i(r, _mm512_setzero_si512());
19990        let r = _mm512_maskz_set1_epi16(0b11111111_11111111_11111111_11111111, a);
19991        let e = _mm512_set1_epi16(11);
19992        assert_eq_m512i(r, e);
19993    }
19994
19995    #[simd_test(enable = "avx512bw,avx512vl")]
19996    const fn test_mm256_mask_set1_epi16() {
19997        let src = _mm256_set1_epi16(2);
19998        let a: i16 = 11;
19999        let r = _mm256_mask_set1_epi16(src, 0, a);
20000        assert_eq_m256i(r, src);
20001        let r = _mm256_mask_set1_epi16(src, 0b11111111_11111111, a);
20002        let e = _mm256_set1_epi16(11);
20003        assert_eq_m256i(r, e);
20004    }
20005
20006    #[simd_test(enable = "avx512bw,avx512vl")]
20007    const fn test_mm256_maskz_set1_epi16() {
20008        let a: i16 = 11;
20009        let r = _mm256_maskz_set1_epi16(0, a);
20010        assert_eq_m256i(r, _mm256_setzero_si256());
20011        let r = _mm256_maskz_set1_epi16(0b11111111_11111111, a);
20012        let e = _mm256_set1_epi16(11);
20013        assert_eq_m256i(r, e);
20014    }
20015
20016    #[simd_test(enable = "avx512bw,avx512vl")]
20017    const fn test_mm_mask_set1_epi16() {
20018        let src = _mm_set1_epi16(2);
20019        let a: i16 = 11;
20020        let r = _mm_mask_set1_epi16(src, 0, a);
20021        assert_eq_m128i(r, src);
20022        let r = _mm_mask_set1_epi16(src, 0b11111111, a);
20023        let e = _mm_set1_epi16(11);
20024        assert_eq_m128i(r, e);
20025    }
20026
20027    #[simd_test(enable = "avx512bw,avx512vl")]
20028    const fn test_mm_maskz_set1_epi16() {
20029        let a: i16 = 11;
20030        let r = _mm_maskz_set1_epi16(0, a);
20031        assert_eq_m128i(r, _mm_setzero_si128());
20032        let r = _mm_maskz_set1_epi16(0b11111111, a);
20033        let e = _mm_set1_epi16(11);
20034        assert_eq_m128i(r, e);
20035    }
20036
20037    #[simd_test(enable = "avx512bw")]
20038    const fn test_mm512_mask_set1_epi8() {
20039        let src = _mm512_set1_epi8(2);
20040        let a: i8 = 11;
20041        let r = _mm512_mask_set1_epi8(src, 0, a);
20042        assert_eq_m512i(r, src);
20043        let r = _mm512_mask_set1_epi8(
20044            src,
20045            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
20046            a,
20047        );
20048        let e = _mm512_set1_epi8(11);
20049        assert_eq_m512i(r, e);
20050    }
20051
20052    #[simd_test(enable = "avx512bw")]
20053    const fn test_mm512_maskz_set1_epi8() {
20054        let a: i8 = 11;
20055        let r = _mm512_maskz_set1_epi8(0, a);
20056        assert_eq_m512i(r, _mm512_setzero_si512());
20057        let r = _mm512_maskz_set1_epi8(
20058            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
20059            a,
20060        );
20061        let e = _mm512_set1_epi8(11);
20062        assert_eq_m512i(r, e);
20063    }
20064
20065    #[simd_test(enable = "avx512bw,avx512vl")]
20066    const fn test_mm256_mask_set1_epi8() {
20067        let src = _mm256_set1_epi8(2);
20068        let a: i8 = 11;
20069        let r = _mm256_mask_set1_epi8(src, 0, a);
20070        assert_eq_m256i(r, src);
20071        let r = _mm256_mask_set1_epi8(src, 0b11111111_11111111_11111111_11111111, a);
20072        let e = _mm256_set1_epi8(11);
20073        assert_eq_m256i(r, e);
20074    }
20075
20076    #[simd_test(enable = "avx512bw,avx512vl")]
20077    const fn test_mm256_maskz_set1_epi8() {
20078        let a: i8 = 11;
20079        let r = _mm256_maskz_set1_epi8(0, a);
20080        assert_eq_m256i(r, _mm256_setzero_si256());
20081        let r = _mm256_maskz_set1_epi8(0b11111111_11111111_11111111_11111111, a);
20082        let e = _mm256_set1_epi8(11);
20083        assert_eq_m256i(r, e);
20084    }
20085
20086    #[simd_test(enable = "avx512bw,avx512vl")]
20087    const fn test_mm_mask_set1_epi8() {
20088        let src = _mm_set1_epi8(2);
20089        let a: i8 = 11;
20090        let r = _mm_mask_set1_epi8(src, 0, a);
20091        assert_eq_m128i(r, src);
20092        let r = _mm_mask_set1_epi8(src, 0b11111111_11111111, a);
20093        let e = _mm_set1_epi8(11);
20094        assert_eq_m128i(r, e);
20095    }
20096
20097    #[simd_test(enable = "avx512bw,avx512vl")]
20098    const fn test_mm_maskz_set1_epi8() {
20099        let a: i8 = 11;
20100        let r = _mm_maskz_set1_epi8(0, a);
20101        assert_eq_m128i(r, _mm_setzero_si128());
20102        let r = _mm_maskz_set1_epi8(0b11111111_11111111, a);
20103        let e = _mm_set1_epi8(11);
20104        assert_eq_m128i(r, e);
20105    }
20106
20107    #[simd_test(enable = "avx512bw")]
20108    const fn test_mm512_shufflelo_epi16() {
20109        #[rustfmt::skip]
20110        let a = _mm512_set_epi16(
20111            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
20112            16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
20113        );
20114        #[rustfmt::skip]
20115        let e = _mm512_set_epi16(
20116            0, 1, 2, 3, 7, 6, 6, 4, 8, 9, 10, 11, 15, 14, 14, 12,
20117            16, 17, 18, 19, 23, 22, 22, 20, 24, 25, 26, 27, 31, 30, 30, 28,
20118        );
20119        let r = _mm512_shufflelo_epi16::<0b00_01_01_11>(a);
20120        assert_eq_m512i(r, e);
20121    }
20122
20123    #[simd_test(enable = "avx512bw")]
20124    const fn test_mm512_mask_shufflelo_epi16() {
20125        #[rustfmt::skip]
20126        let a = _mm512_set_epi16(
20127            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
20128            16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
20129        );
20130        let r = _mm512_mask_shufflelo_epi16::<0b00_01_01_11>(a, 0, a);
20131        assert_eq_m512i(r, a);
20132        let r = _mm512_mask_shufflelo_epi16::<0b00_01_01_11>(
20133            a,
20134            0b11111111_11111111_11111111_11111111,
20135            a,
20136        );
20137        #[rustfmt::skip]
20138        let e = _mm512_set_epi16(
20139            0, 1, 2, 3, 7, 6, 6, 4, 8, 9, 10, 11, 15, 14, 14, 12,
20140            16, 17, 18, 19, 23, 22, 22, 20, 24, 25, 26, 27, 31, 30, 30, 28,
20141        );
20142        assert_eq_m512i(r, e);
20143    }
20144
20145    #[simd_test(enable = "avx512bw")]
20146    const fn test_mm512_maskz_shufflelo_epi16() {
20147        #[rustfmt::skip]
20148        let a = _mm512_set_epi16(
20149            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
20150            16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
20151        );
20152        let r = _mm512_maskz_shufflelo_epi16::<0b00_01_01_11>(0, a);
20153        assert_eq_m512i(r, _mm512_setzero_si512());
20154        let r =
20155            _mm512_maskz_shufflelo_epi16::<0b00_01_01_11>(0b11111111_11111111_11111111_11111111, a);
20156        #[rustfmt::skip]
20157        let e = _mm512_set_epi16(
20158            0, 1, 2, 3, 7, 6, 6, 4, 8, 9, 10, 11, 15, 14, 14, 12,
20159            16, 17, 18, 19, 23, 22, 22, 20, 24, 25, 26, 27, 31, 30, 30, 28,
20160        );
20161        assert_eq_m512i(r, e);
20162    }
20163
20164    #[simd_test(enable = "avx512bw,avx512vl")]
20165    const fn test_mm256_mask_shufflelo_epi16() {
20166        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
20167        let r = _mm256_mask_shufflelo_epi16::<0b00_01_01_11>(a, 0, a);
20168        assert_eq_m256i(r, a);
20169        let r = _mm256_mask_shufflelo_epi16::<0b00_01_01_11>(a, 0b11111111_11111111, a);
20170        let e = _mm256_set_epi16(0, 1, 2, 3, 7, 6, 6, 4, 8, 9, 10, 11, 15, 14, 14, 12);
20171        assert_eq_m256i(r, e);
20172    }
20173
20174    #[simd_test(enable = "avx512bw,avx512vl")]
20175    const fn test_mm256_maskz_shufflelo_epi16() {
20176        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
20177        let r = _mm256_maskz_shufflelo_epi16::<0b00_01_01_11>(0, a);
20178        assert_eq_m256i(r, _mm256_setzero_si256());
20179        let r = _mm256_maskz_shufflelo_epi16::<0b00_01_01_11>(0b11111111_11111111, a);
20180        let e = _mm256_set_epi16(0, 1, 2, 3, 7, 6, 6, 4, 8, 9, 10, 11, 15, 14, 14, 12);
20181        assert_eq_m256i(r, e);
20182    }
20183
20184    #[simd_test(enable = "avx512bw,avx512vl")]
20185    const fn test_mm_mask_shufflelo_epi16() {
20186        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
20187        let r = _mm_mask_shufflelo_epi16::<0b00_01_01_11>(a, 0, a);
20188        assert_eq_m128i(r, a);
20189        let r = _mm_mask_shufflelo_epi16::<0b00_01_01_11>(a, 0b11111111, a);
20190        let e = _mm_set_epi16(0, 1, 2, 3, 7, 6, 6, 4);
20191        assert_eq_m128i(r, e);
20192    }
20193
20194    #[simd_test(enable = "avx512bw,avx512vl")]
20195    const fn test_mm_maskz_shufflelo_epi16() {
20196        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
20197        let r = _mm_maskz_shufflelo_epi16::<0b00_01_01_11>(0, a);
20198        assert_eq_m128i(r, _mm_setzero_si128());
20199        let r = _mm_maskz_shufflelo_epi16::<0b00_01_01_11>(0b11111111, a);
20200        let e = _mm_set_epi16(0, 1, 2, 3, 7, 6, 6, 4);
20201        assert_eq_m128i(r, e);
20202    }
20203
20204    #[simd_test(enable = "avx512bw")]
20205    const fn test_mm512_shufflehi_epi16() {
20206        #[rustfmt::skip]
20207        let a = _mm512_set_epi16(
20208            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
20209            16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
20210        );
20211        #[rustfmt::skip]
20212        let e = _mm512_set_epi16(
20213            3, 2, 2, 0, 4, 5, 6, 7, 11, 10, 10, 8, 12, 13, 14, 15,
20214            19, 18, 18, 16, 20, 21, 22, 23, 27, 26, 26, 24, 28, 29, 30, 31,
20215        );
20216        let r = _mm512_shufflehi_epi16::<0b00_01_01_11>(a);
20217        assert_eq_m512i(r, e);
20218    }
20219
20220    #[simd_test(enable = "avx512bw")]
20221    const fn test_mm512_mask_shufflehi_epi16() {
20222        #[rustfmt::skip]
20223        let a = _mm512_set_epi16(
20224            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
20225            16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
20226        );
20227        let r = _mm512_mask_shufflehi_epi16::<0b00_01_01_11>(a, 0, a);
20228        assert_eq_m512i(r, a);
20229        let r = _mm512_mask_shufflehi_epi16::<0b00_01_01_11>(
20230            a,
20231            0b11111111_11111111_11111111_11111111,
20232            a,
20233        );
20234        #[rustfmt::skip]
20235        let e = _mm512_set_epi16(
20236            3, 2, 2, 0, 4, 5, 6, 7, 11, 10, 10, 8, 12, 13, 14, 15,
20237            19, 18, 18, 16, 20, 21, 22, 23, 27, 26, 26, 24, 28, 29, 30, 31,
20238        );
20239        assert_eq_m512i(r, e);
20240    }
20241
20242    #[simd_test(enable = "avx512bw")]
20243    const fn test_mm512_maskz_shufflehi_epi16() {
20244        #[rustfmt::skip]
20245        let a = _mm512_set_epi16(
20246            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
20247            16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
20248        );
20249        let r = _mm512_maskz_shufflehi_epi16::<0b00_01_01_11>(0, a);
20250        assert_eq_m512i(r, _mm512_setzero_si512());
20251        let r =
20252            _mm512_maskz_shufflehi_epi16::<0b00_01_01_11>(0b11111111_11111111_11111111_11111111, a);
20253        #[rustfmt::skip]
20254        let e = _mm512_set_epi16(
20255            3, 2, 2, 0, 4, 5, 6, 7, 11, 10, 10, 8, 12, 13, 14, 15,
20256            19, 18, 18, 16, 20, 21, 22, 23, 27, 26, 26, 24, 28, 29, 30, 31,
20257        );
20258        assert_eq_m512i(r, e);
20259    }
20260
20261    #[simd_test(enable = "avx512bw,avx512vl")]
20262    const fn test_mm256_mask_shufflehi_epi16() {
20263        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
20264        let r = _mm256_mask_shufflehi_epi16::<0b00_01_01_11>(a, 0, a);
20265        assert_eq_m256i(r, a);
20266        let r = _mm256_mask_shufflehi_epi16::<0b00_01_01_11>(a, 0b11111111_11111111, a);
20267        let e = _mm256_set_epi16(3, 2, 2, 0, 4, 5, 6, 7, 11, 10, 10, 8, 12, 13, 14, 15);
20268        assert_eq_m256i(r, e);
20269    }
20270
20271    #[simd_test(enable = "avx512bw,avx512vl")]
20272    const fn test_mm256_maskz_shufflehi_epi16() {
20273        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
20274        let r = _mm256_maskz_shufflehi_epi16::<0b00_01_01_11>(0, a);
20275        assert_eq_m256i(r, _mm256_setzero_si256());
20276        let r = _mm256_maskz_shufflehi_epi16::<0b00_01_01_11>(0b11111111_11111111, a);
20277        let e = _mm256_set_epi16(3, 2, 2, 0, 4, 5, 6, 7, 11, 10, 10, 8, 12, 13, 14, 15);
20278        assert_eq_m256i(r, e);
20279    }
20280
20281    #[simd_test(enable = "avx512bw,avx512vl")]
20282    const fn test_mm_mask_shufflehi_epi16() {
20283        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
20284        let r = _mm_mask_shufflehi_epi16::<0b00_01_01_11>(a, 0, a);
20285        assert_eq_m128i(r, a);
20286        let r = _mm_mask_shufflehi_epi16::<0b00_01_01_11>(a, 0b11111111, a);
20287        let e = _mm_set_epi16(3, 2, 2, 0, 4, 5, 6, 7);
20288        assert_eq_m128i(r, e);
20289    }
20290
20291    #[simd_test(enable = "avx512bw,avx512vl")]
20292    const fn test_mm_maskz_shufflehi_epi16() {
20293        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
20294        let r = _mm_maskz_shufflehi_epi16::<0b00_01_01_11>(0, a);
20295        assert_eq_m128i(r, _mm_setzero_si128());
20296        let r = _mm_maskz_shufflehi_epi16::<0b00_01_01_11>(0b11111111, a);
20297        let e = _mm_set_epi16(3, 2, 2, 0, 4, 5, 6, 7);
20298        assert_eq_m128i(r, e);
20299    }
20300
20301    #[simd_test(enable = "avx512bw")]
20302    fn test_mm512_shuffle_epi8() {
20303        #[rustfmt::skip]
20304        let a = _mm512_set_epi8(0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,
20305                                16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
20306                                32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
20307                                48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63);
20308        let b = _mm512_set1_epi8(1);
20309        let r = _mm512_shuffle_epi8(a, b);
20310        #[rustfmt::skip]
20311        let e = _mm512_set_epi8(14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
20312                                30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
20313                                46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
20314                                62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62);
20315        assert_eq_m512i(r, e);
20316    }
20317
20318    #[simd_test(enable = "avx512bw")]
20319    fn test_mm512_mask_shuffle_epi8() {
20320        #[rustfmt::skip]
20321        let a = _mm512_set_epi8(0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,
20322                                16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
20323                                32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
20324                                48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63);
20325        let b = _mm512_set1_epi8(1);
20326        let r = _mm512_mask_shuffle_epi8(a, 0, a, b);
20327        assert_eq_m512i(r, a);
20328        let r = _mm512_mask_shuffle_epi8(
20329            a,
20330            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
20331            a,
20332            b,
20333        );
20334        #[rustfmt::skip]
20335        let e = _mm512_set_epi8(14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
20336                                30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
20337                                46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
20338                                62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62);
20339        assert_eq_m512i(r, e);
20340    }
20341
20342    #[simd_test(enable = "avx512bw")]
20343    fn test_mm512_maskz_shuffle_epi8() {
20344        #[rustfmt::skip]
20345        let a = _mm512_set_epi8(0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,
20346                                16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
20347                                32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
20348                                48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63);
20349        let b = _mm512_set1_epi8(1);
20350        let r = _mm512_maskz_shuffle_epi8(0, a, b);
20351        assert_eq_m512i(r, _mm512_setzero_si512());
20352        let r = _mm512_maskz_shuffle_epi8(
20353            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
20354            a,
20355            b,
20356        );
20357        #[rustfmt::skip]
20358        let e = _mm512_set_epi8(14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
20359                                30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
20360                                46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
20361                                62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62);
20362        assert_eq_m512i(r, e);
20363    }
20364
20365    #[simd_test(enable = "avx512bw,avx512vl")]
20366    fn test_mm256_mask_shuffle_epi8() {
20367        #[rustfmt::skip]
20368        let a = _mm256_set_epi8(0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,
20369                                16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
20370        let b = _mm256_set1_epi8(1);
20371        let r = _mm256_mask_shuffle_epi8(a, 0, a, b);
20372        assert_eq_m256i(r, a);
20373        let r = _mm256_mask_shuffle_epi8(a, 0b11111111_11111111_11111111_11111111, a, b);
20374        #[rustfmt::skip]
20375        let e = _mm256_set_epi8(14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
20376                                30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30);
20377        assert_eq_m256i(r, e);
20378    }
20379
20380    #[simd_test(enable = "avx512bw,avx512vl")]
20381    fn test_mm256_maskz_shuffle_epi8() {
20382        #[rustfmt::skip]
20383        let a = _mm256_set_epi8(0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,
20384                                16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
20385        let b = _mm256_set1_epi8(1);
20386        let r = _mm256_maskz_shuffle_epi8(0, a, b);
20387        assert_eq_m256i(r, _mm256_setzero_si256());
20388        let r = _mm256_maskz_shuffle_epi8(0b11111111_11111111_11111111_11111111, a, b);
20389        #[rustfmt::skip]
20390        let e = _mm256_set_epi8(14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
20391                                30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30);
20392        assert_eq_m256i(r, e);
20393    }
20394
20395    #[simd_test(enable = "avx512bw,avx512vl")]
20396    fn test_mm_mask_shuffle_epi8() {
20397        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
20398        let b = _mm_set1_epi8(1);
20399        let r = _mm_mask_shuffle_epi8(a, 0, a, b);
20400        assert_eq_m128i(r, a);
20401        let r = _mm_mask_shuffle_epi8(a, 0b11111111_11111111, a, b);
20402        let e = _mm_set_epi8(
20403            14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
20404        );
20405        assert_eq_m128i(r, e);
20406    }
20407
20408    #[simd_test(enable = "avx512bw,avx512vl")]
20409    fn test_mm_maskz_shuffle_epi8() {
20410        #[rustfmt::skip]
20411        let a = _mm_set_epi8(0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15);
20412        let b = _mm_set1_epi8(1);
20413        let r = _mm_maskz_shuffle_epi8(0, a, b);
20414        assert_eq_m128i(r, _mm_setzero_si128());
20415        let r = _mm_maskz_shuffle_epi8(0b11111111_11111111, a, b);
20416        let e = _mm_set_epi8(
20417            14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
20418        );
20419        assert_eq_m128i(r, e);
20420    }
20421
20422    #[simd_test(enable = "avx512bw")]
20423    const fn test_mm512_test_epi16_mask() {
20424        let a = _mm512_set1_epi16(1 << 0);
20425        let b = _mm512_set1_epi16(1 << 0 | 1 << 1);
20426        let r = _mm512_test_epi16_mask(a, b);
20427        let e: __mmask32 = 0b11111111_11111111_11111111_11111111;
20428        assert_eq!(r, e);
20429    }
20430
20431    #[simd_test(enable = "avx512bw")]
20432    const fn test_mm512_mask_test_epi16_mask() {
20433        let a = _mm512_set1_epi16(1 << 0);
20434        let b = _mm512_set1_epi16(1 << 0 | 1 << 1);
20435        let r = _mm512_mask_test_epi16_mask(0, a, b);
20436        assert_eq!(r, 0);
20437        let r = _mm512_mask_test_epi16_mask(0b11111111_11111111_11111111_11111111, a, b);
20438        let e: __mmask32 = 0b11111111_11111111_11111111_11111111;
20439        assert_eq!(r, e);
20440    }
20441
20442    #[simd_test(enable = "avx512bw,avx512vl")]
20443    const fn test_mm256_test_epi16_mask() {
20444        let a = _mm256_set1_epi16(1 << 0);
20445        let b = _mm256_set1_epi16(1 << 0 | 1 << 1);
20446        let r = _mm256_test_epi16_mask(a, b);
20447        let e: __mmask16 = 0b11111111_11111111;
20448        assert_eq!(r, e);
20449    }
20450
20451    #[simd_test(enable = "avx512bw,avx512vl")]
20452    const fn test_mm256_mask_test_epi16_mask() {
20453        let a = _mm256_set1_epi16(1 << 0);
20454        let b = _mm256_set1_epi16(1 << 0 | 1 << 1);
20455        let r = _mm256_mask_test_epi16_mask(0, a, b);
20456        assert_eq!(r, 0);
20457        let r = _mm256_mask_test_epi16_mask(0b11111111_11111111, a, b);
20458        let e: __mmask16 = 0b11111111_11111111;
20459        assert_eq!(r, e);
20460    }
20461
20462    #[simd_test(enable = "avx512bw,avx512vl")]
20463    const fn test_mm_test_epi16_mask() {
20464        let a = _mm_set1_epi16(1 << 0);
20465        let b = _mm_set1_epi16(1 << 0 | 1 << 1);
20466        let r = _mm_test_epi16_mask(a, b);
20467        let e: __mmask8 = 0b11111111;
20468        assert_eq!(r, e);
20469    }
20470
20471    #[simd_test(enable = "avx512bw,avx512vl")]
20472    const fn test_mm_mask_test_epi16_mask() {
20473        let a = _mm_set1_epi16(1 << 0);
20474        let b = _mm_set1_epi16(1 << 0 | 1 << 1);
20475        let r = _mm_mask_test_epi16_mask(0, a, b);
20476        assert_eq!(r, 0);
20477        let r = _mm_mask_test_epi16_mask(0b11111111, a, b);
20478        let e: __mmask8 = 0b11111111;
20479        assert_eq!(r, e);
20480    }
20481
20482    #[simd_test(enable = "avx512bw")]
20483    const fn test_mm512_test_epi8_mask() {
20484        let a = _mm512_set1_epi8(1 << 0);
20485        let b = _mm512_set1_epi8(1 << 0 | 1 << 1);
20486        let r = _mm512_test_epi8_mask(a, b);
20487        let e: __mmask64 =
20488            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111;
20489        assert_eq!(r, e);
20490    }
20491
20492    #[simd_test(enable = "avx512bw")]
20493    const fn test_mm512_mask_test_epi8_mask() {
20494        let a = _mm512_set1_epi8(1 << 0);
20495        let b = _mm512_set1_epi8(1 << 0 | 1 << 1);
20496        let r = _mm512_mask_test_epi8_mask(0, a, b);
20497        assert_eq!(r, 0);
20498        let r = _mm512_mask_test_epi8_mask(
20499            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
20500            a,
20501            b,
20502        );
20503        let e: __mmask64 =
20504            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111;
20505        assert_eq!(r, e);
20506    }
20507
20508    #[simd_test(enable = "avx512bw,avx512vl")]
20509    const fn test_mm256_test_epi8_mask() {
20510        let a = _mm256_set1_epi8(1 << 0);
20511        let b = _mm256_set1_epi8(1 << 0 | 1 << 1);
20512        let r = _mm256_test_epi8_mask(a, b);
20513        let e: __mmask32 = 0b11111111_11111111_11111111_11111111;
20514        assert_eq!(r, e);
20515    }
20516
20517    #[simd_test(enable = "avx512bw,avx512vl")]
20518    const fn test_mm256_mask_test_epi8_mask() {
20519        let a = _mm256_set1_epi8(1 << 0);
20520        let b = _mm256_set1_epi8(1 << 0 | 1 << 1);
20521        let r = _mm256_mask_test_epi8_mask(0, a, b);
20522        assert_eq!(r, 0);
20523        let r = _mm256_mask_test_epi8_mask(0b11111111_11111111_11111111_11111111, a, b);
20524        let e: __mmask32 = 0b11111111_11111111_11111111_11111111;
20525        assert_eq!(r, e);
20526    }
20527
20528    #[simd_test(enable = "avx512bw,avx512vl")]
20529    const fn test_mm_test_epi8_mask() {
20530        let a = _mm_set1_epi8(1 << 0);
20531        let b = _mm_set1_epi8(1 << 0 | 1 << 1);
20532        let r = _mm_test_epi8_mask(a, b);
20533        let e: __mmask16 = 0b11111111_11111111;
20534        assert_eq!(r, e);
20535    }
20536
20537    #[simd_test(enable = "avx512bw,avx512vl")]
20538    const fn test_mm_mask_test_epi8_mask() {
20539        let a = _mm_set1_epi8(1 << 0);
20540        let b = _mm_set1_epi8(1 << 0 | 1 << 1);
20541        let r = _mm_mask_test_epi8_mask(0, a, b);
20542        assert_eq!(r, 0);
20543        let r = _mm_mask_test_epi8_mask(0b11111111_11111111, a, b);
20544        let e: __mmask16 = 0b11111111_11111111;
20545        assert_eq!(r, e);
20546    }
20547
20548    #[simd_test(enable = "avx512bw")]
20549    const fn test_mm512_testn_epi16_mask() {
20550        let a = _mm512_set1_epi16(1 << 0);
20551        let b = _mm512_set1_epi16(1 << 0 | 1 << 1);
20552        let r = _mm512_testn_epi16_mask(a, b);
20553        let e: __mmask32 = 0b00000000_00000000_00000000_00000000;
20554        assert_eq!(r, e);
20555    }
20556
20557    #[simd_test(enable = "avx512bw")]
20558    const fn test_mm512_mask_testn_epi16_mask() {
20559        let a = _mm512_set1_epi16(1 << 0);
20560        let b = _mm512_set1_epi16(1 << 0 | 1 << 1);
20561        let r = _mm512_mask_testn_epi16_mask(0, a, b);
20562        assert_eq!(r, 0);
20563        let r = _mm512_mask_testn_epi16_mask(0b11111111_11111111_11111111_11111111, a, b);
20564        let e: __mmask32 = 0b00000000_00000000_00000000_00000000;
20565        assert_eq!(r, e);
20566    }
20567
20568    #[simd_test(enable = "avx512bw,avx512vl")]
20569    const fn test_mm256_testn_epi16_mask() {
20570        let a = _mm256_set1_epi16(1 << 0);
20571        let b = _mm256_set1_epi16(1 << 0 | 1 << 1);
20572        let r = _mm256_testn_epi16_mask(a, b);
20573        let e: __mmask16 = 0b00000000_00000000;
20574        assert_eq!(r, e);
20575    }
20576
20577    #[simd_test(enable = "avx512bw,avx512vl")]
20578    const fn test_mm256_mask_testn_epi16_mask() {
20579        let a = _mm256_set1_epi16(1 << 0);
20580        let b = _mm256_set1_epi16(1 << 0 | 1 << 1);
20581        let r = _mm256_mask_testn_epi16_mask(0, a, b);
20582        assert_eq!(r, 0);
20583        let r = _mm256_mask_testn_epi16_mask(0b11111111_11111111, a, b);
20584        let e: __mmask16 = 0b00000000_00000000;
20585        assert_eq!(r, e);
20586    }
20587
20588    #[simd_test(enable = "avx512bw,avx512vl")]
20589    const fn test_mm_testn_epi16_mask() {
20590        let a = _mm_set1_epi16(1 << 0);
20591        let b = _mm_set1_epi16(1 << 0 | 1 << 1);
20592        let r = _mm_testn_epi16_mask(a, b);
20593        let e: __mmask8 = 0b00000000;
20594        assert_eq!(r, e);
20595    }
20596
20597    #[simd_test(enable = "avx512bw,avx512vl")]
20598    const fn test_mm_mask_testn_epi16_mask() {
20599        let a = _mm_set1_epi16(1 << 0);
20600        let b = _mm_set1_epi16(1 << 0 | 1 << 1);
20601        let r = _mm_mask_testn_epi16_mask(0, a, b);
20602        assert_eq!(r, 0);
20603        let r = _mm_mask_testn_epi16_mask(0b11111111, a, b);
20604        let e: __mmask8 = 0b00000000;
20605        assert_eq!(r, e);
20606    }
20607
20608    #[simd_test(enable = "avx512bw")]
20609    const fn test_mm512_testn_epi8_mask() {
20610        let a = _mm512_set1_epi8(1 << 0);
20611        let b = _mm512_set1_epi8(1 << 0 | 1 << 1);
20612        let r = _mm512_testn_epi8_mask(a, b);
20613        let e: __mmask64 =
20614            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000;
20615        assert_eq!(r, e);
20616    }
20617
20618    #[simd_test(enable = "avx512bw")]
20619    const fn test_mm512_mask_testn_epi8_mask() {
20620        let a = _mm512_set1_epi8(1 << 0);
20621        let b = _mm512_set1_epi8(1 << 0 | 1 << 1);
20622        let r = _mm512_mask_testn_epi8_mask(0, a, b);
20623        assert_eq!(r, 0);
20624        let r = _mm512_mask_testn_epi8_mask(
20625            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
20626            a,
20627            b,
20628        );
20629        let e: __mmask64 =
20630            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000;
20631        assert_eq!(r, e);
20632    }
20633
20634    #[simd_test(enable = "avx512bw,avx512vl")]
20635    const fn test_mm256_testn_epi8_mask() {
20636        let a = _mm256_set1_epi8(1 << 0);
20637        let b = _mm256_set1_epi8(1 << 0 | 1 << 1);
20638        let r = _mm256_testn_epi8_mask(a, b);
20639        let e: __mmask32 = 0b00000000_00000000_00000000_00000000;
20640        assert_eq!(r, e);
20641    }
20642
20643    #[simd_test(enable = "avx512bw,avx512vl")]
20644    const fn test_mm256_mask_testn_epi8_mask() {
20645        let a = _mm256_set1_epi8(1 << 0);
20646        let b = _mm256_set1_epi8(1 << 0 | 1 << 1);
20647        let r = _mm256_mask_testn_epi8_mask(0, a, b);
20648        assert_eq!(r, 0);
20649        let r = _mm256_mask_testn_epi8_mask(0b11111111_11111111_11111111_11111111, a, b);
20650        let e: __mmask32 = 0b00000000_00000000_00000000_00000000;
20651        assert_eq!(r, e);
20652    }
20653
20654    #[simd_test(enable = "avx512bw,avx512vl")]
20655    const fn test_mm_testn_epi8_mask() {
20656        let a = _mm_set1_epi8(1 << 0);
20657        let b = _mm_set1_epi8(1 << 0 | 1 << 1);
20658        let r = _mm_testn_epi8_mask(a, b);
20659        let e: __mmask16 = 0b00000000_00000000;
20660        assert_eq!(r, e);
20661    }
20662
20663    #[simd_test(enable = "avx512bw,avx512vl")]
20664    const fn test_mm_mask_testn_epi8_mask() {
20665        let a = _mm_set1_epi8(1 << 0);
20666        let b = _mm_set1_epi8(1 << 0 | 1 << 1);
20667        let r = _mm_mask_testn_epi8_mask(0, a, b);
20668        assert_eq!(r, 0);
20669        let r = _mm_mask_testn_epi8_mask(0b11111111_11111111, a, b);
20670        let e: __mmask16 = 0b00000000_00000000;
20671        assert_eq!(r, e);
20672    }
20673
20674    #[simd_test(enable = "avx512bw")]
20675    const fn test_store_mask64() {
20676        let a: __mmask64 =
20677            0b11111111_00000000_11111111_00000000_11111111_00000000_11111111_00000000;
20678        let mut r = 0;
20679        unsafe {
20680            _store_mask64(&mut r, a);
20681        }
20682        assert_eq!(r, a);
20683    }
20684
20685    #[simd_test(enable = "avx512bw")]
20686    const fn test_store_mask32() {
20687        let a: __mmask32 = 0b11111111_00000000_11111111_00000000;
20688        let mut r = 0;
20689        unsafe {
20690            _store_mask32(&mut r, a);
20691        }
20692        assert_eq!(r, a);
20693    }
20694
20695    #[simd_test(enable = "avx512bw")]
20696    const fn test_load_mask64() {
20697        let p: __mmask64 =
20698            0b11111111_00000000_11111111_00000000_11111111_00000000_11111111_00000000;
20699        let r = unsafe { _load_mask64(&p) };
20700        let e: __mmask64 =
20701            0b11111111_00000000_11111111_00000000_11111111_00000000_11111111_00000000;
20702        assert_eq!(r, e);
20703    }
20704
20705    #[simd_test(enable = "avx512bw")]
20706    const fn test_load_mask32() {
20707        let p: __mmask32 = 0b11111111_00000000_11111111_00000000;
20708        let r = unsafe { _load_mask32(&p) };
20709        let e: __mmask32 = 0b11111111_00000000_11111111_00000000;
20710        assert_eq!(r, e);
20711    }
20712
20713    #[simd_test(enable = "avx512bw")]
20714    fn test_mm512_sad_epu8() {
20715        let a = _mm512_set1_epi8(2);
20716        let b = _mm512_set1_epi8(4);
20717        let r = _mm512_sad_epu8(a, b);
20718        let e = _mm512_set1_epi64(16);
20719        assert_eq_m512i(r, e);
20720    }
20721
20722    #[simd_test(enable = "avx512bw")]
20723    fn test_mm512_dbsad_epu8() {
20724        let a = _mm512_set1_epi8(2);
20725        let b = _mm512_set1_epi8(4);
20726        let r = _mm512_dbsad_epu8::<0>(a, b);
20727        let e = _mm512_set1_epi16(8);
20728        assert_eq_m512i(r, e);
20729    }
20730
20731    #[simd_test(enable = "avx512bw")]
20732    fn test_mm512_mask_dbsad_epu8() {
20733        let src = _mm512_set1_epi16(1);
20734        let a = _mm512_set1_epi8(2);
20735        let b = _mm512_set1_epi8(4);
20736        let r = _mm512_mask_dbsad_epu8::<0>(src, 0, a, b);
20737        assert_eq_m512i(r, src);
20738        let r = _mm512_mask_dbsad_epu8::<0>(src, 0b11111111_11111111_11111111_11111111, a, b);
20739        let e = _mm512_set1_epi16(8);
20740        assert_eq_m512i(r, e);
20741    }
20742
20743    #[simd_test(enable = "avx512bw")]
20744    fn test_mm512_maskz_dbsad_epu8() {
20745        let a = _mm512_set1_epi8(2);
20746        let b = _mm512_set1_epi8(4);
20747        let r = _mm512_maskz_dbsad_epu8::<0>(0, a, b);
20748        assert_eq_m512i(r, _mm512_setzero_si512());
20749        let r = _mm512_maskz_dbsad_epu8::<0>(0b11111111_11111111_11111111_11111111, a, b);
20750        let e = _mm512_set1_epi16(8);
20751        assert_eq_m512i(r, e);
20752    }
20753
20754    #[simd_test(enable = "avx512bw,avx512vl")]
20755    fn test_mm256_dbsad_epu8() {
20756        let a = _mm256_set1_epi8(2);
20757        let b = _mm256_set1_epi8(4);
20758        let r = _mm256_dbsad_epu8::<0>(a, b);
20759        let e = _mm256_set1_epi16(8);
20760        assert_eq_m256i(r, e);
20761    }
20762
20763    #[simd_test(enable = "avx512bw,avx512vl")]
20764    fn test_mm256_mask_dbsad_epu8() {
20765        let src = _mm256_set1_epi16(1);
20766        let a = _mm256_set1_epi8(2);
20767        let b = _mm256_set1_epi8(4);
20768        let r = _mm256_mask_dbsad_epu8::<0>(src, 0, a, b);
20769        assert_eq_m256i(r, src);
20770        let r = _mm256_mask_dbsad_epu8::<0>(src, 0b11111111_11111111, a, b);
20771        let e = _mm256_set1_epi16(8);
20772        assert_eq_m256i(r, e);
20773    }
20774
20775    #[simd_test(enable = "avx512bw,avx512vl")]
20776    fn test_mm256_maskz_dbsad_epu8() {
20777        let a = _mm256_set1_epi8(2);
20778        let b = _mm256_set1_epi8(4);
20779        let r = _mm256_maskz_dbsad_epu8::<0>(0, a, b);
20780        assert_eq_m256i(r, _mm256_setzero_si256());
20781        let r = _mm256_maskz_dbsad_epu8::<0>(0b11111111_11111111, a, b);
20782        let e = _mm256_set1_epi16(8);
20783        assert_eq_m256i(r, e);
20784    }
20785
20786    #[simd_test(enable = "avx512bw,avx512vl")]
20787    fn test_mm_dbsad_epu8() {
20788        let a = _mm_set1_epi8(2);
20789        let b = _mm_set1_epi8(4);
20790        let r = _mm_dbsad_epu8::<0>(a, b);
20791        let e = _mm_set1_epi16(8);
20792        assert_eq_m128i(r, e);
20793    }
20794
20795    #[simd_test(enable = "avx512bw,avx512vl")]
20796    fn test_mm_mask_dbsad_epu8() {
20797        let src = _mm_set1_epi16(1);
20798        let a = _mm_set1_epi8(2);
20799        let b = _mm_set1_epi8(4);
20800        let r = _mm_mask_dbsad_epu8::<0>(src, 0, a, b);
20801        assert_eq_m128i(r, src);
20802        let r = _mm_mask_dbsad_epu8::<0>(src, 0b11111111, a, b);
20803        let e = _mm_set1_epi16(8);
20804        assert_eq_m128i(r, e);
20805    }
20806
20807    #[simd_test(enable = "avx512bw,avx512vl")]
20808    fn test_mm_maskz_dbsad_epu8() {
20809        let a = _mm_set1_epi8(2);
20810        let b = _mm_set1_epi8(4);
20811        let r = _mm_maskz_dbsad_epu8::<0>(0, a, b);
20812        assert_eq_m128i(r, _mm_setzero_si128());
20813        let r = _mm_maskz_dbsad_epu8::<0>(0b11111111, a, b);
20814        let e = _mm_set1_epi16(8);
20815        assert_eq_m128i(r, e);
20816    }
20817
20818    #[simd_test(enable = "avx512bw")]
20819    const fn test_mm512_movepi16_mask() {
20820        let a = _mm512_set1_epi16(1 << 15);
20821        let r = _mm512_movepi16_mask(a);
20822        let e: __mmask32 = 0b11111111_11111111_11111111_11111111;
20823        assert_eq!(r, e);
20824    }
20825
20826    #[simd_test(enable = "avx512bw,avx512vl")]
20827    const fn test_mm256_movepi16_mask() {
20828        let a = _mm256_set1_epi16(1 << 15);
20829        let r = _mm256_movepi16_mask(a);
20830        let e: __mmask16 = 0b11111111_11111111;
20831        assert_eq!(r, e);
20832    }
20833
20834    #[simd_test(enable = "avx512bw,avx512vl")]
20835    const fn test_mm_movepi16_mask() {
20836        let a = _mm_set1_epi16(1 << 15);
20837        let r = _mm_movepi16_mask(a);
20838        let e: __mmask8 = 0b11111111;
20839        assert_eq!(r, e);
20840    }
20841
20842    #[simd_test(enable = "avx512bw")]
20843    const fn test_mm512_movepi8_mask() {
20844        let a = _mm512_set1_epi8(1 << 7);
20845        let r = _mm512_movepi8_mask(a);
20846        let e: __mmask64 =
20847            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111;
20848        assert_eq!(r, e);
20849    }
20850
20851    #[simd_test(enable = "avx512bw,avx512vl")]
20852    const fn test_mm256_movepi8_mask() {
20853        let a = _mm256_set1_epi8(1 << 7);
20854        let r = _mm256_movepi8_mask(a);
20855        let e: __mmask32 = 0b11111111_11111111_11111111_11111111;
20856        assert_eq!(r, e);
20857    }
20858
20859    #[simd_test(enable = "avx512bw,avx512vl")]
20860    const fn test_mm_movepi8_mask() {
20861        let a = _mm_set1_epi8(1 << 7);
20862        let r = _mm_movepi8_mask(a);
20863        let e: __mmask16 = 0b11111111_11111111;
20864        assert_eq!(r, e);
20865    }
20866
20867    #[simd_test(enable = "avx512bw")]
20868    const fn test_mm512_movm_epi16() {
20869        let a: __mmask32 = 0b11111111_11111111_11111111_11111111;
20870        let r = _mm512_movm_epi16(a);
20871        let e = _mm512_set1_epi16(
20872            1 << 15
20873                | 1 << 14
20874                | 1 << 13
20875                | 1 << 12
20876                | 1 << 11
20877                | 1 << 10
20878                | 1 << 9
20879                | 1 << 8
20880                | 1 << 7
20881                | 1 << 6
20882                | 1 << 5
20883                | 1 << 4
20884                | 1 << 3
20885                | 1 << 2
20886                | 1 << 1
20887                | 1 << 0,
20888        );
20889        assert_eq_m512i(r, e);
20890    }
20891
20892    #[simd_test(enable = "avx512bw,avx512vl")]
20893    const fn test_mm256_movm_epi16() {
20894        let a: __mmask16 = 0b11111111_11111111;
20895        let r = _mm256_movm_epi16(a);
20896        let e = _mm256_set1_epi16(
20897            1 << 15
20898                | 1 << 14
20899                | 1 << 13
20900                | 1 << 12
20901                | 1 << 11
20902                | 1 << 10
20903                | 1 << 9
20904                | 1 << 8
20905                | 1 << 7
20906                | 1 << 6
20907                | 1 << 5
20908                | 1 << 4
20909                | 1 << 3
20910                | 1 << 2
20911                | 1 << 1
20912                | 1 << 0,
20913        );
20914        assert_eq_m256i(r, e);
20915    }
20916
20917    #[simd_test(enable = "avx512bw,avx512vl")]
20918    const fn test_mm_movm_epi16() {
20919        let a: __mmask8 = 0b11111111;
20920        let r = _mm_movm_epi16(a);
20921        let e = _mm_set1_epi16(
20922            1 << 15
20923                | 1 << 14
20924                | 1 << 13
20925                | 1 << 12
20926                | 1 << 11
20927                | 1 << 10
20928                | 1 << 9
20929                | 1 << 8
20930                | 1 << 7
20931                | 1 << 6
20932                | 1 << 5
20933                | 1 << 4
20934                | 1 << 3
20935                | 1 << 2
20936                | 1 << 1
20937                | 1 << 0,
20938        );
20939        assert_eq_m128i(r, e);
20940    }
20941
20942    #[simd_test(enable = "avx512bw")]
20943    const fn test_mm512_movm_epi8() {
20944        let a: __mmask64 =
20945            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111;
20946        let r = _mm512_movm_epi8(a);
20947        let e =
20948            _mm512_set1_epi8(1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0);
20949        assert_eq_m512i(r, e);
20950    }
20951
20952    #[simd_test(enable = "avx512bw,avx512vl")]
20953    const fn test_mm256_movm_epi8() {
20954        let a: __mmask32 = 0b11111111_11111111_11111111_11111111;
20955        let r = _mm256_movm_epi8(a);
20956        let e =
20957            _mm256_set1_epi8(1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0);
20958        assert_eq_m256i(r, e);
20959    }
20960
20961    #[simd_test(enable = "avx512bw,avx512vl")]
20962    const fn test_mm_movm_epi8() {
20963        let a: __mmask16 = 0b11111111_11111111;
20964        let r = _mm_movm_epi8(a);
20965        let e =
20966            _mm_set1_epi8(1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0);
20967        assert_eq_m128i(r, e);
20968    }
20969
20970    #[simd_test(enable = "avx512bw")]
20971    const fn test_cvtmask32_u32() {
20972        let a: __mmask32 = 0b11001100_00110011_01100110_10011001;
20973        let r = _cvtmask32_u32(a);
20974        let e: u32 = 0b11001100_00110011_01100110_10011001;
20975        assert_eq!(r, e);
20976    }
20977
20978    #[simd_test(enable = "avx512bw")]
20979    const fn test_cvtu32_mask32() {
20980        let a: u32 = 0b11001100_00110011_01100110_10011001;
20981        let r = _cvtu32_mask32(a);
20982        let e: __mmask32 = 0b11001100_00110011_01100110_10011001;
20983        assert_eq!(r, e);
20984    }
20985
20986    #[simd_test(enable = "avx512bw")]
20987    const fn test_kadd_mask32() {
20988        let a: __mmask32 = 11;
20989        let b: __mmask32 = 22;
20990        let r = _kadd_mask32(a, b);
20991        let e: __mmask32 = 33;
20992        assert_eq!(r, e);
20993    }
20994
20995    #[simd_test(enable = "avx512bw")]
20996    const fn test_kadd_mask64() {
20997        let a: __mmask64 = 11;
20998        let b: __mmask64 = 22;
20999        let r = _kadd_mask64(a, b);
21000        let e: __mmask64 = 33;
21001        assert_eq!(r, e);
21002    }
21003
21004    #[simd_test(enable = "avx512bw")]
21005    const fn test_kand_mask32() {
21006        let a: __mmask32 = 0b11001100_00110011_11001100_00110011;
21007        let b: __mmask32 = 0b11001100_00110011_11001100_00110011;
21008        let r = _kand_mask32(a, b);
21009        let e: __mmask32 = 0b11001100_00110011_11001100_00110011;
21010        assert_eq!(r, e);
21011    }
21012
21013    #[simd_test(enable = "avx512bw")]
21014    const fn test_kand_mask64() {
21015        let a: __mmask64 =
21016            0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011;
21017        let b: __mmask64 =
21018            0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011;
21019        let r = _kand_mask64(a, b);
21020        let e: __mmask64 =
21021            0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011;
21022        assert_eq!(r, e);
21023    }
21024
21025    #[simd_test(enable = "avx512bw")]
21026    const fn test_knot_mask32() {
21027        let a: __mmask32 = 0b11001100_00110011_11001100_00110011;
21028        let r = _knot_mask32(a);
21029        let e: __mmask32 = 0b00110011_11001100_00110011_11001100;
21030        assert_eq!(r, e);
21031    }
21032
21033    #[simd_test(enable = "avx512bw")]
21034    const fn test_knot_mask64() {
21035        let a: __mmask64 =
21036            0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011;
21037        let r = _knot_mask64(a);
21038        let e: __mmask64 =
21039            0b00110011_11001100_00110011_11001100_00110011_11001100_00110011_11001100;
21040        assert_eq!(r, e);
21041    }
21042
21043    #[simd_test(enable = "avx512bw")]
21044    const fn test_kandn_mask32() {
21045        let a: __mmask32 = 0b11001100_00110011_11001100_00110011;
21046        let b: __mmask32 = 0b11001100_00110011_11001100_00110011;
21047        let r = _kandn_mask32(a, b);
21048        let e: __mmask32 = 0b00000000_00000000_00000000_00000000;
21049        assert_eq!(r, e);
21050    }
21051
21052    #[simd_test(enable = "avx512bw")]
21053    const fn test_kandn_mask64() {
21054        let a: __mmask64 =
21055            0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011;
21056        let b: __mmask64 =
21057            0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011;
21058        let r = _kandn_mask64(a, b);
21059        let e: __mmask64 =
21060            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000;
21061        assert_eq!(r, e);
21062    }
21063
21064    #[simd_test(enable = "avx512bw")]
21065    const fn test_kor_mask32() {
21066        let a: __mmask32 = 0b00110011_11001100_00110011_11001100;
21067        let b: __mmask32 = 0b11001100_00110011_11001100_00110011;
21068        let r = _kor_mask32(a, b);
21069        let e: __mmask32 = 0b11111111_11111111_11111111_11111111;
21070        assert_eq!(r, e);
21071    }
21072
21073    #[simd_test(enable = "avx512bw")]
21074    const fn test_kor_mask64() {
21075        let a: __mmask64 =
21076            0b00110011_11001100_00110011_11001100_00110011_11001100_00110011_11001100;
21077        let b: __mmask64 =
21078            0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011;
21079        let r = _kor_mask64(a, b);
21080        let e: __mmask64 =
21081            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111;
21082        assert_eq!(r, e);
21083    }
21084
21085    #[simd_test(enable = "avx512bw")]
21086    const fn test_kxor_mask32() {
21087        let a: __mmask32 = 0b00110011_11001100_00110011_11001100;
21088        let b: __mmask32 = 0b11001100_00110011_11001100_00110011;
21089        let r = _kxor_mask32(a, b);
21090        let e: __mmask32 = 0b11111111_11111111_11111111_11111111;
21091        assert_eq!(r, e);
21092    }
21093
21094    #[simd_test(enable = "avx512bw")]
21095    const fn test_kxor_mask64() {
21096        let a: __mmask64 =
21097            0b00110011_11001100_00110011_11001100_00110011_11001100_00110011_11001100;
21098        let b: __mmask64 =
21099            0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011;
21100        let r = _kxor_mask64(a, b);
21101        let e: __mmask64 =
21102            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111;
21103        assert_eq!(r, e);
21104    }
21105
21106    #[simd_test(enable = "avx512bw")]
21107    const fn test_kxnor_mask32() {
21108        let a: __mmask32 = 0b00110011_11001100_00110011_11001100;
21109        let b: __mmask32 = 0b11001100_00110011_11001100_00110011;
21110        let r = _kxnor_mask32(a, b);
21111        let e: __mmask32 = 0b00000000_00000000_00000000_00000000;
21112        assert_eq!(r, e);
21113    }
21114
21115    #[simd_test(enable = "avx512bw")]
21116    const fn test_kxnor_mask64() {
21117        let a: __mmask64 =
21118            0b00110011_11001100_00110011_11001100_00110011_11001100_00110011_11001100;
21119        let b: __mmask64 =
21120            0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011;
21121        let r = _kxnor_mask64(a, b);
21122        let e: __mmask64 =
21123            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000;
21124        assert_eq!(r, e);
21125    }
21126
21127    #[simd_test(enable = "avx512bw")]
21128    const fn test_kortest_mask32_u8() {
21129        let a: __mmask32 = 0b0110100101101001_0110100101101001;
21130        let b: __mmask32 = 0b1011011010110110_1011011010110110;
21131        let mut all_ones: u8 = 0;
21132        let r = unsafe { _kortest_mask32_u8(a, b, &mut all_ones) };
21133        assert_eq!(r, 0);
21134        assert_eq!(all_ones, 1);
21135    }
21136
21137    #[simd_test(enable = "avx512bw")]
21138    const fn test_kortest_mask64_u8() {
21139        let a: __mmask64 = 0b0110100101101001_0110100101101001;
21140        let b: __mmask64 = 0b1011011010110110_1011011010110110;
21141        let mut all_ones: u8 = 0;
21142        let r = unsafe { _kortest_mask64_u8(a, b, &mut all_ones) };
21143        assert_eq!(r, 0);
21144        assert_eq!(all_ones, 0);
21145    }
21146
21147    #[simd_test(enable = "avx512bw")]
21148    const fn test_kortestc_mask32_u8() {
21149        let a: __mmask32 = 0b0110100101101001_0110100101101001;
21150        let b: __mmask32 = 0b1011011010110110_1011011010110110;
21151        let r = _kortestc_mask32_u8(a, b);
21152        assert_eq!(r, 1);
21153    }
21154
21155    #[simd_test(enable = "avx512bw")]
21156    const fn test_kortestc_mask64_u8() {
21157        let a: __mmask64 = 0b0110100101101001_0110100101101001;
21158        let b: __mmask64 = 0b1011011010110110_1011011010110110;
21159        let r = _kortestc_mask64_u8(a, b);
21160        assert_eq!(r, 0);
21161    }
21162
21163    #[simd_test(enable = "avx512bw")]
21164    const fn test_kortestz_mask32_u8() {
21165        let a: __mmask32 = 0b0110100101101001_0110100101101001;
21166        let b: __mmask32 = 0b1011011010110110_1011011010110110;
21167        let r = _kortestz_mask32_u8(a, b);
21168        assert_eq!(r, 0);
21169    }
21170
21171    #[simd_test(enable = "avx512bw")]
21172    const fn test_kortestz_mask64_u8() {
21173        let a: __mmask64 = 0b0110100101101001_0110100101101001;
21174        let b: __mmask64 = 0b1011011010110110_1011011010110110;
21175        let r = _kortestz_mask64_u8(a, b);
21176        assert_eq!(r, 0);
21177    }
21178
21179    #[simd_test(enable = "avx512bw")]
21180    const fn test_kshiftli_mask32() {
21181        let a: __mmask32 = 0b0110100101101001_0110100101101001;
21182        let r = _kshiftli_mask32::<3>(a);
21183        let e: __mmask32 = 0b0100101101001011_0100101101001000;
21184        assert_eq!(r, e);
21185
21186        let r = _kshiftli_mask32::<31>(a);
21187        let e: __mmask32 = 0b1000000000000000_0000000000000000;
21188        assert_eq!(r, e);
21189
21190        let r = _kshiftli_mask32::<32>(a);
21191        let e: __mmask32 = 0b0000000000000000_0000000000000000;
21192        assert_eq!(r, e);
21193
21194        let r = _kshiftli_mask32::<33>(a);
21195        let e: __mmask32 = 0b0000000000000000_0000000000000000;
21196        assert_eq!(r, e);
21197    }
21198
21199    #[simd_test(enable = "avx512bw")]
21200    const fn test_kshiftli_mask64() {
21201        let a: __mmask64 = 0b0110100101101001_0110100101101001;
21202        let r = _kshiftli_mask64::<3>(a);
21203        let e: __mmask64 = 0b0110100101101001011_0100101101001000;
21204        assert_eq!(r, e);
21205
21206        let r = _kshiftli_mask64::<63>(a);
21207        let e: __mmask64 = 0b1000000000000000_0000000000000000_0000000000000000_0000000000000000;
21208        assert_eq!(r, e);
21209
21210        let r = _kshiftli_mask64::<64>(a);
21211        let e: __mmask64 = 0b0000000000000000_0000000000000000_0000000000000000_0000000000000000;
21212        assert_eq!(r, e);
21213
21214        let r = _kshiftli_mask64::<65>(a);
21215        let e: __mmask64 = 0b0000000000000000_0000000000000000_0000000000000000_0000000000000000;
21216        assert_eq!(r, e);
21217    }
21218
21219    #[simd_test(enable = "avx512bw")]
21220    const fn test_kshiftri_mask32() {
21221        let a: __mmask32 = 0b1010100101101001_0110100101101001;
21222        let r = _kshiftri_mask32::<3>(a);
21223        let e: __mmask32 = 0b0001010100101101_0010110100101101;
21224        assert_eq!(r, e);
21225
21226        let r = _kshiftri_mask32::<31>(a);
21227        let e: __mmask32 = 0b0000000000000000_0000000000000001;
21228        assert_eq!(r, e);
21229
21230        let r = _kshiftri_mask32::<32>(a);
21231        let e: __mmask32 = 0b0000000000000000_0000000000000000;
21232        assert_eq!(r, e);
21233
21234        let r = _kshiftri_mask32::<33>(a);
21235        let e: __mmask32 = 0b0000000000000000_0000000000000000;
21236        assert_eq!(r, e);
21237    }
21238
21239    #[simd_test(enable = "avx512bw")]
21240    const fn test_kshiftri_mask64() {
21241        let a: __mmask64 = 0b1010100101101001011_0100101101001000;
21242        let r = _kshiftri_mask64::<3>(a);
21243        let e: __mmask64 = 0b1010100101101001_0110100101101001;
21244        assert_eq!(r, e);
21245
21246        let r = _kshiftri_mask64::<34>(a);
21247        let e: __mmask64 = 0b0000000000000000_0000000000000000_0000000000000000_0000000000000001;
21248        assert_eq!(r, e);
21249
21250        let r = _kshiftri_mask64::<35>(a);
21251        let e: __mmask64 = 0b0000000000000000_0000000000000000_0000000000000000_0000000000000000;
21252        assert_eq!(r, e);
21253
21254        let r = _kshiftri_mask64::<64>(a);
21255        let e: __mmask64 = 0b0000000000000000_0000000000000000_0000000000000000_0000000000000000;
21256        assert_eq!(r, e);
21257
21258        let r = _kshiftri_mask64::<65>(a);
21259        let e: __mmask64 = 0b0000000000000000_0000000000000000_0000000000000000_0000000000000000;
21260        assert_eq!(r, e);
21261    }
21262
21263    #[simd_test(enable = "avx512bw")]
21264    const fn test_ktest_mask32_u8() {
21265        let a: __mmask32 = 0b0110100100111100_0110100100111100;
21266        let b: __mmask32 = 0b1001011011000011_1001011011000011;
21267        let mut and_not: u8 = 0;
21268        let r = unsafe { _ktest_mask32_u8(a, b, &mut and_not) };
21269        assert_eq!(r, 1);
21270        assert_eq!(and_not, 0);
21271    }
21272
21273    #[simd_test(enable = "avx512bw")]
21274    const fn test_ktestc_mask32_u8() {
21275        let a: __mmask32 = 0b0110100100111100_0110100100111100;
21276        let b: __mmask32 = 0b1001011011000011_1001011011000011;
21277        let r = _ktestc_mask32_u8(a, b);
21278        assert_eq!(r, 0);
21279    }
21280
21281    #[simd_test(enable = "avx512bw")]
21282    const fn test_ktestz_mask32_u8() {
21283        let a: __mmask32 = 0b0110100100111100_0110100100111100;
21284        let b: __mmask32 = 0b1001011011000011_1001011011000011;
21285        let r = _ktestz_mask32_u8(a, b);
21286        assert_eq!(r, 1);
21287    }
21288
21289    #[simd_test(enable = "avx512bw")]
21290    const fn test_ktest_mask64_u8() {
21291        let a: __mmask64 = 0b0110100100111100_0110100100111100;
21292        let b: __mmask64 = 0b1001011011000011_1001011011000011;
21293        let mut and_not: u8 = 0;
21294        let r = unsafe { _ktest_mask64_u8(a, b, &mut and_not) };
21295        assert_eq!(r, 1);
21296        assert_eq!(and_not, 0);
21297    }
21298
21299    #[simd_test(enable = "avx512bw")]
21300    const fn test_ktestc_mask64_u8() {
21301        let a: __mmask64 = 0b0110100100111100_0110100100111100;
21302        let b: __mmask64 = 0b1001011011000011_1001011011000011;
21303        let r = _ktestc_mask64_u8(a, b);
21304        assert_eq!(r, 0);
21305    }
21306
21307    #[simd_test(enable = "avx512bw")]
21308    const fn test_ktestz_mask64_u8() {
21309        let a: __mmask64 = 0b0110100100111100_0110100100111100;
21310        let b: __mmask64 = 0b1001011011000011_1001011011000011;
21311        let r = _ktestz_mask64_u8(a, b);
21312        assert_eq!(r, 1);
21313    }
21314
21315    #[simd_test(enable = "avx512bw")]
21316    const fn test_mm512_kunpackw() {
21317        let a: u32 = 0x00110011;
21318        let b: u32 = 0x00001011;
21319        let r = _mm512_kunpackw(a, b);
21320        let e: u32 = 0x00111011;
21321        assert_eq!(r, e);
21322    }
21323
21324    #[simd_test(enable = "avx512bw")]
21325    const fn test_mm512_kunpackd() {
21326        let a: u64 = 0x11001100_00110011;
21327        let b: u64 = 0x00101110_00001011;
21328        let r = _mm512_kunpackd(a, b);
21329        let e: u64 = 0x00110011_00001011;
21330        assert_eq!(r, e);
21331    }
21332
21333    #[simd_test(enable = "avx512bw")]
21334    const fn test_mm512_cvtepi16_epi8() {
21335        let a = _mm512_set1_epi16(2);
21336        let r = _mm512_cvtepi16_epi8(a);
21337        let e = _mm256_set1_epi8(2);
21338        assert_eq_m256i(r, e);
21339    }
21340
21341    #[simd_test(enable = "avx512bw")]
21342    const fn test_mm512_mask_cvtepi16_epi8() {
21343        let src = _mm256_set1_epi8(1);
21344        let a = _mm512_set1_epi16(2);
21345        let r = _mm512_mask_cvtepi16_epi8(src, 0, a);
21346        assert_eq_m256i(r, src);
21347        let r = _mm512_mask_cvtepi16_epi8(src, 0b11111111_11111111_11111111_11111111, a);
21348        let e = _mm256_set1_epi8(2);
21349        assert_eq_m256i(r, e);
21350    }
21351
21352    #[simd_test(enable = "avx512bw")]
21353    const fn test_mm512_maskz_cvtepi16_epi8() {
21354        let a = _mm512_set1_epi16(2);
21355        let r = _mm512_maskz_cvtepi16_epi8(0, a);
21356        assert_eq_m256i(r, _mm256_setzero_si256());
21357        let r = _mm512_maskz_cvtepi16_epi8(0b11111111_11111111_11111111_11111111, a);
21358        let e = _mm256_set1_epi8(2);
21359        assert_eq_m256i(r, e);
21360    }
21361
21362    #[simd_test(enable = "avx512bw,avx512vl")]
21363    const fn test_mm256_cvtepi16_epi8() {
21364        let a = _mm256_set1_epi16(2);
21365        let r = _mm256_cvtepi16_epi8(a);
21366        let e = _mm_set1_epi8(2);
21367        assert_eq_m128i(r, e);
21368    }
21369
21370    #[simd_test(enable = "avx512bw,avx512vl")]
21371    const fn test_mm256_mask_cvtepi16_epi8() {
21372        let src = _mm_set1_epi8(1);
21373        let a = _mm256_set1_epi16(2);
21374        let r = _mm256_mask_cvtepi16_epi8(src, 0, a);
21375        assert_eq_m128i(r, src);
21376        let r = _mm256_mask_cvtepi16_epi8(src, 0b11111111_11111111, a);
21377        let e = _mm_set1_epi8(2);
21378        assert_eq_m128i(r, e);
21379    }
21380
21381    #[simd_test(enable = "avx512bw,avx512vl")]
21382    const fn test_mm256_maskz_cvtepi16_epi8() {
21383        let a = _mm256_set1_epi16(2);
21384        let r = _mm256_maskz_cvtepi16_epi8(0, a);
21385        assert_eq_m128i(r, _mm_setzero_si128());
21386        let r = _mm256_maskz_cvtepi16_epi8(0b11111111_11111111, a);
21387        let e = _mm_set1_epi8(2);
21388        assert_eq_m128i(r, e);
21389    }
21390
21391    #[simd_test(enable = "avx512bw,avx512vl")]
21392    const fn test_mm_cvtepi16_epi8() {
21393        let a = _mm_set1_epi16(2);
21394        let r = _mm_cvtepi16_epi8(a);
21395        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2);
21396        assert_eq_m128i(r, e);
21397    }
21398
21399    #[simd_test(enable = "avx512bw,avx512vl")]
21400    const fn test_mm_mask_cvtepi16_epi8() {
21401        let src = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
21402        let a = _mm_set1_epi16(2);
21403        let r = _mm_mask_cvtepi16_epi8(src, 0, a);
21404        assert_eq_m128i(r, src);
21405        let r = _mm_mask_cvtepi16_epi8(src, 0b11111111, a);
21406        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2);
21407        assert_eq_m128i(r, e);
21408    }
21409
21410    #[simd_test(enable = "avx512bw,avx512vl")]
21411    const fn test_mm_maskz_cvtepi16_epi8() {
21412        let a = _mm_set1_epi16(2);
21413        let r = _mm_maskz_cvtepi16_epi8(0, a);
21414        assert_eq_m128i(r, _mm_setzero_si128());
21415        let r = _mm_maskz_cvtepi16_epi8(0b11111111, a);
21416        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2);
21417        assert_eq_m128i(r, e);
21418    }
21419
21420    #[simd_test(enable = "avx512bw")]
21421    fn test_mm512_cvtsepi16_epi8() {
21422        let a = _mm512_set1_epi16(i16::MAX);
21423        let r = _mm512_cvtsepi16_epi8(a);
21424        let e = _mm256_set1_epi8(i8::MAX);
21425        assert_eq_m256i(r, e);
21426    }
21427
21428    #[simd_test(enable = "avx512bw")]
21429    fn test_mm512_mask_cvtsepi16_epi8() {
21430        let src = _mm256_set1_epi8(1);
21431        let a = _mm512_set1_epi16(i16::MAX);
21432        let r = _mm512_mask_cvtsepi16_epi8(src, 0, a);
21433        assert_eq_m256i(r, src);
21434        let r = _mm512_mask_cvtsepi16_epi8(src, 0b11111111_11111111_11111111_11111111, a);
21435        let e = _mm256_set1_epi8(i8::MAX);
21436        assert_eq_m256i(r, e);
21437    }
21438
21439    #[simd_test(enable = "avx512bw,avx512vl")]
21440    fn test_mm256_cvtsepi16_epi8() {
21441        let a = _mm256_set1_epi16(i16::MAX);
21442        let r = _mm256_cvtsepi16_epi8(a);
21443        let e = _mm_set1_epi8(i8::MAX);
21444        assert_eq_m128i(r, e);
21445    }
21446
21447    #[simd_test(enable = "avx512bw,avx512vl")]
21448    fn test_mm256_mask_cvtsepi16_epi8() {
21449        let src = _mm_set1_epi8(1);
21450        let a = _mm256_set1_epi16(i16::MAX);
21451        let r = _mm256_mask_cvtsepi16_epi8(src, 0, a);
21452        assert_eq_m128i(r, src);
21453        let r = _mm256_mask_cvtsepi16_epi8(src, 0b11111111_11111111, a);
21454        let e = _mm_set1_epi8(i8::MAX);
21455        assert_eq_m128i(r, e);
21456    }
21457
21458    #[simd_test(enable = "avx512bw,avx512vl")]
21459    fn test_mm256_maskz_cvtsepi16_epi8() {
21460        let a = _mm256_set1_epi16(i16::MAX);
21461        let r = _mm256_maskz_cvtsepi16_epi8(0, a);
21462        assert_eq_m128i(r, _mm_setzero_si128());
21463        let r = _mm256_maskz_cvtsepi16_epi8(0b11111111_11111111, a);
21464        let e = _mm_set1_epi8(i8::MAX);
21465        assert_eq_m128i(r, e);
21466    }
21467
21468    #[simd_test(enable = "avx512bw,avx512vl")]
21469    fn test_mm_cvtsepi16_epi8() {
21470        let a = _mm_set1_epi16(i16::MAX);
21471        let r = _mm_cvtsepi16_epi8(a);
21472        #[rustfmt::skip]
21473        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
21474        assert_eq_m128i(r, e);
21475    }
21476
21477    #[simd_test(enable = "avx512bw,avx512vl")]
21478    fn test_mm_mask_cvtsepi16_epi8() {
21479        let src = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
21480        let a = _mm_set1_epi16(i16::MAX);
21481        let r = _mm_mask_cvtsepi16_epi8(src, 0, a);
21482        assert_eq_m128i(r, src);
21483        let r = _mm_mask_cvtsepi16_epi8(src, 0b11111111, a);
21484        #[rustfmt::skip]
21485        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
21486        assert_eq_m128i(r, e);
21487    }
21488
21489    #[simd_test(enable = "avx512bw,avx512vl")]
21490    fn test_mm_maskz_cvtsepi16_epi8() {
21491        let a = _mm_set1_epi16(i16::MAX);
21492        let r = _mm_maskz_cvtsepi16_epi8(0, a);
21493        assert_eq_m128i(r, _mm_setzero_si128());
21494        let r = _mm_maskz_cvtsepi16_epi8(0b11111111, a);
21495        #[rustfmt::skip]
21496        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
21497        assert_eq_m128i(r, e);
21498    }
21499
21500    #[simd_test(enable = "avx512bw")]
21501    fn test_mm512_maskz_cvtsepi16_epi8() {
21502        let a = _mm512_set1_epi16(i16::MAX);
21503        let r = _mm512_maskz_cvtsepi16_epi8(0, a);
21504        assert_eq_m256i(r, _mm256_setzero_si256());
21505        let r = _mm512_maskz_cvtsepi16_epi8(0b11111111_11111111_11111111_11111111, a);
21506        let e = _mm256_set1_epi8(i8::MAX);
21507        assert_eq_m256i(r, e);
21508    }
21509
21510    #[simd_test(enable = "avx512bw")]
21511    fn test_mm512_cvtusepi16_epi8() {
21512        let a = _mm512_set1_epi16(i16::MIN);
21513        let r = _mm512_cvtusepi16_epi8(a);
21514        let e = _mm256_set1_epi8(-1);
21515        assert_eq_m256i(r, e);
21516    }
21517
21518    #[simd_test(enable = "avx512bw")]
21519    fn test_mm512_mask_cvtusepi16_epi8() {
21520        let src = _mm256_set1_epi8(1);
21521        let a = _mm512_set1_epi16(i16::MIN);
21522        let r = _mm512_mask_cvtusepi16_epi8(src, 0, a);
21523        assert_eq_m256i(r, src);
21524        let r = _mm512_mask_cvtusepi16_epi8(src, 0b11111111_11111111_11111111_11111111, a);
21525        let e = _mm256_set1_epi8(-1);
21526        assert_eq_m256i(r, e);
21527    }
21528
21529    #[simd_test(enable = "avx512bw")]
21530    fn test_mm512_maskz_cvtusepi16_epi8() {
21531        let a = _mm512_set1_epi16(i16::MIN);
21532        let r = _mm512_maskz_cvtusepi16_epi8(0, a);
21533        assert_eq_m256i(r, _mm256_setzero_si256());
21534        let r = _mm512_maskz_cvtusepi16_epi8(0b11111111_11111111_11111111_11111111, a);
21535        let e = _mm256_set1_epi8(-1);
21536        assert_eq_m256i(r, e);
21537    }
21538
21539    #[simd_test(enable = "avx512bw,avx512vl")]
21540    fn test_mm256_cvtusepi16_epi8() {
21541        let a = _mm256_set1_epi16(i16::MIN);
21542        let r = _mm256_cvtusepi16_epi8(a);
21543        let e = _mm_set1_epi8(-1);
21544        assert_eq_m128i(r, e);
21545    }
21546
21547    #[simd_test(enable = "avx512bw,avx512vl")]
21548    fn test_mm256_mask_cvtusepi16_epi8() {
21549        let src = _mm_set1_epi8(1);
21550        let a = _mm256_set1_epi16(i16::MIN);
21551        let r = _mm256_mask_cvtusepi16_epi8(src, 0, a);
21552        assert_eq_m128i(r, src);
21553        let r = _mm256_mask_cvtusepi16_epi8(src, 0b11111111_11111111, a);
21554        let e = _mm_set1_epi8(-1);
21555        assert_eq_m128i(r, e);
21556    }
21557
21558    #[simd_test(enable = "avx512bw,avx512vl")]
21559    fn test_mm256_maskz_cvtusepi16_epi8() {
21560        let a = _mm256_set1_epi16(i16::MIN);
21561        let r = _mm256_maskz_cvtusepi16_epi8(0, a);
21562        assert_eq_m128i(r, _mm_setzero_si128());
21563        let r = _mm256_maskz_cvtusepi16_epi8(0b11111111_11111111, a);
21564        let e = _mm_set1_epi8(-1);
21565        assert_eq_m128i(r, e);
21566    }
21567
21568    #[simd_test(enable = "avx512bw,avx512vl")]
21569    fn test_mm_cvtusepi16_epi8() {
21570        let a = _mm_set1_epi16(i16::MIN);
21571        let r = _mm_cvtusepi16_epi8(a);
21572        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
21573        assert_eq_m128i(r, e);
21574    }
21575
21576    #[simd_test(enable = "avx512bw,avx512vl")]
21577    fn test_mm_mask_cvtusepi16_epi8() {
21578        let src = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
21579        let a = _mm_set1_epi16(i16::MIN);
21580        let r = _mm_mask_cvtusepi16_epi8(src, 0, a);
21581        assert_eq_m128i(r, src);
21582        let r = _mm_mask_cvtusepi16_epi8(src, 0b11111111, a);
21583        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
21584        assert_eq_m128i(r, e);
21585    }
21586
21587    #[simd_test(enable = "avx512bw,avx512vl")]
21588    fn test_mm_maskz_cvtusepi16_epi8() {
21589        let a = _mm_set1_epi16(i16::MIN);
21590        let r = _mm_maskz_cvtusepi16_epi8(0, a);
21591        assert_eq_m128i(r, _mm_setzero_si128());
21592        let r = _mm_maskz_cvtusepi16_epi8(0b11111111, a);
21593        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
21594        assert_eq_m128i(r, e);
21595    }
21596
21597    #[simd_test(enable = "avx512bw")]
21598    const fn test_mm512_cvtepi8_epi16() {
21599        let a = _mm256_set1_epi8(2);
21600        let r = _mm512_cvtepi8_epi16(a);
21601        let e = _mm512_set1_epi16(2);
21602        assert_eq_m512i(r, e);
21603    }
21604
21605    #[simd_test(enable = "avx512bw")]
21606    const fn test_mm512_mask_cvtepi8_epi16() {
21607        let src = _mm512_set1_epi16(1);
21608        let a = _mm256_set1_epi8(2);
21609        let r = _mm512_mask_cvtepi8_epi16(src, 0, a);
21610        assert_eq_m512i(r, src);
21611        let r = _mm512_mask_cvtepi8_epi16(src, 0b11111111_11111111_11111111_11111111, a);
21612        let e = _mm512_set1_epi16(2);
21613        assert_eq_m512i(r, e);
21614    }
21615
21616    #[simd_test(enable = "avx512bw")]
21617    const fn test_mm512_maskz_cvtepi8_epi16() {
21618        let a = _mm256_set1_epi8(2);
21619        let r = _mm512_maskz_cvtepi8_epi16(0, a);
21620        assert_eq_m512i(r, _mm512_setzero_si512());
21621        let r = _mm512_maskz_cvtepi8_epi16(0b11111111_11111111_11111111_11111111, a);
21622        let e = _mm512_set1_epi16(2);
21623        assert_eq_m512i(r, e);
21624    }
21625
21626    #[simd_test(enable = "avx512bw,avx512vl")]
21627    const fn test_mm256_mask_cvtepi8_epi16() {
21628        let src = _mm256_set1_epi16(1);
21629        let a = _mm_set1_epi8(2);
21630        let r = _mm256_mask_cvtepi8_epi16(src, 0, a);
21631        assert_eq_m256i(r, src);
21632        let r = _mm256_mask_cvtepi8_epi16(src, 0b11111111_11111111, a);
21633        let e = _mm256_set1_epi16(2);
21634        assert_eq_m256i(r, e);
21635    }
21636
21637    #[simd_test(enable = "avx512bw,avx512vl")]
21638    const fn test_mm256_maskz_cvtepi8_epi16() {
21639        let a = _mm_set1_epi8(2);
21640        let r = _mm256_maskz_cvtepi8_epi16(0, a);
21641        assert_eq_m256i(r, _mm256_setzero_si256());
21642        let r = _mm256_maskz_cvtepi8_epi16(0b11111111_11111111, a);
21643        let e = _mm256_set1_epi16(2);
21644        assert_eq_m256i(r, e);
21645    }
21646
21647    #[simd_test(enable = "avx512bw,avx512vl")]
21648    const fn test_mm_mask_cvtepi8_epi16() {
21649        let src = _mm_set1_epi16(1);
21650        let a = _mm_set1_epi8(2);
21651        let r = _mm_mask_cvtepi8_epi16(src, 0, a);
21652        assert_eq_m128i(r, src);
21653        let r = _mm_mask_cvtepi8_epi16(src, 0b11111111, a);
21654        let e = _mm_set1_epi16(2);
21655        assert_eq_m128i(r, e);
21656    }
21657
21658    #[simd_test(enable = "avx512bw,avx512vl")]
21659    const fn test_mm_maskz_cvtepi8_epi16() {
21660        let a = _mm_set1_epi8(2);
21661        let r = _mm_maskz_cvtepi8_epi16(0, a);
21662        assert_eq_m128i(r, _mm_setzero_si128());
21663        let r = _mm_maskz_cvtepi8_epi16(0b11111111, a);
21664        let e = _mm_set1_epi16(2);
21665        assert_eq_m128i(r, e);
21666    }
21667
21668    #[simd_test(enable = "avx512bw")]
21669    const fn test_mm512_cvtepu8_epi16() {
21670        let a = _mm256_set1_epi8(2);
21671        let r = _mm512_cvtepu8_epi16(a);
21672        let e = _mm512_set1_epi16(2);
21673        assert_eq_m512i(r, e);
21674    }
21675
21676    #[simd_test(enable = "avx512bw")]
21677    const fn test_mm512_mask_cvtepu8_epi16() {
21678        let src = _mm512_set1_epi16(1);
21679        let a = _mm256_set1_epi8(2);
21680        let r = _mm512_mask_cvtepu8_epi16(src, 0, a);
21681        assert_eq_m512i(r, src);
21682        let r = _mm512_mask_cvtepu8_epi16(src, 0b11111111_11111111_11111111_11111111, a);
21683        let e = _mm512_set1_epi16(2);
21684        assert_eq_m512i(r, e);
21685    }
21686
21687    #[simd_test(enable = "avx512bw")]
21688    const fn test_mm512_maskz_cvtepu8_epi16() {
21689        let a = _mm256_set1_epi8(2);
21690        let r = _mm512_maskz_cvtepu8_epi16(0, a);
21691        assert_eq_m512i(r, _mm512_setzero_si512());
21692        let r = _mm512_maskz_cvtepu8_epi16(0b11111111_11111111_11111111_11111111, a);
21693        let e = _mm512_set1_epi16(2);
21694        assert_eq_m512i(r, e);
21695    }
21696
21697    #[simd_test(enable = "avx512bw,avx512vl")]
21698    const fn test_mm256_mask_cvtepu8_epi16() {
21699        let src = _mm256_set1_epi16(1);
21700        let a = _mm_set1_epi8(2);
21701        let r = _mm256_mask_cvtepu8_epi16(src, 0, a);
21702        assert_eq_m256i(r, src);
21703        let r = _mm256_mask_cvtepu8_epi16(src, 0b11111111_11111111, a);
21704        let e = _mm256_set1_epi16(2);
21705        assert_eq_m256i(r, e);
21706    }
21707
21708    #[simd_test(enable = "avx512bw,avx512vl")]
21709    const fn test_mm256_maskz_cvtepu8_epi16() {
21710        let a = _mm_set1_epi8(2);
21711        let r = _mm256_maskz_cvtepu8_epi16(0, a);
21712        assert_eq_m256i(r, _mm256_setzero_si256());
21713        let r = _mm256_maskz_cvtepu8_epi16(0b11111111_11111111, a);
21714        let e = _mm256_set1_epi16(2);
21715        assert_eq_m256i(r, e);
21716    }
21717
21718    #[simd_test(enable = "avx512bw,avx512vl")]
21719    const fn test_mm_mask_cvtepu8_epi16() {
21720        let src = _mm_set1_epi16(1);
21721        let a = _mm_set1_epi8(2);
21722        let r = _mm_mask_cvtepu8_epi16(src, 0, a);
21723        assert_eq_m128i(r, src);
21724        let r = _mm_mask_cvtepu8_epi16(src, 0b11111111, a);
21725        let e = _mm_set1_epi16(2);
21726        assert_eq_m128i(r, e);
21727    }
21728
21729    #[simd_test(enable = "avx512bw,avx512vl")]
21730    const fn test_mm_maskz_cvtepu8_epi16() {
21731        let a = _mm_set1_epi8(2);
21732        let r = _mm_maskz_cvtepu8_epi16(0, a);
21733        assert_eq_m128i(r, _mm_setzero_si128());
21734        let r = _mm_maskz_cvtepu8_epi16(0b11111111, a);
21735        let e = _mm_set1_epi16(2);
21736        assert_eq_m128i(r, e);
21737    }
21738
21739    #[simd_test(enable = "avx512bw")]
21740    const fn test_mm512_bslli_epi128() {
21741        #[rustfmt::skip]
21742        let a = _mm512_set_epi8(
21743            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21744            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21745            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21746            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21747        );
21748        let r = _mm512_bslli_epi128::<9>(a);
21749        #[rustfmt::skip]
21750        let e = _mm512_set_epi8(
21751            0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
21752            0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
21753            0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
21754            0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
21755        );
21756        assert_eq_m512i(r, e);
21757    }
21758
21759    #[simd_test(enable = "avx512bw")]
21760    const fn test_mm512_bsrli_epi128() {
21761        #[rustfmt::skip]
21762        let a = _mm512_set_epi8(
21763            1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
21764            17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
21765            33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
21766            49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
21767        );
21768        let r = _mm512_bsrli_epi128::<3>(a);
21769        #[rustfmt::skip]
21770        let e = _mm512_set_epi8(
21771            0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
21772            0, 0, 0, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
21773            0, 0, 0, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
21774            0, 0, 0, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
21775        );
21776        assert_eq_m512i(r, e);
21777    }
21778
21779    #[simd_test(enable = "avx512bw")]
21780    const fn test_mm512_alignr_epi8() {
21781        #[rustfmt::skip]
21782        let a = _mm512_set_epi8(
21783            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21784            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21785            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21786            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21787        );
21788        let b = _mm512_set1_epi8(1);
21789        let r = _mm512_alignr_epi8::<14>(a, b);
21790        #[rustfmt::skip]
21791        let e = _mm512_set_epi8(
21792            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21793            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21794            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21795            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21796        );
21797        assert_eq_m512i(r, e);
21798    }
21799
21800    #[simd_test(enable = "avx512bw")]
21801    const fn test_mm512_mask_alignr_epi8() {
21802        #[rustfmt::skip]
21803        let a = _mm512_set_epi8(
21804            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21805            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21806            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21807            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21808        );
21809        let b = _mm512_set1_epi8(1);
21810        let r = _mm512_mask_alignr_epi8::<14>(a, 0, a, b);
21811        assert_eq_m512i(r, a);
21812        let r = _mm512_mask_alignr_epi8::<14>(
21813            a,
21814            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
21815            a,
21816            b,
21817        );
21818        #[rustfmt::skip]
21819        let e = _mm512_set_epi8(
21820            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21821            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21822            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21823            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21824        );
21825        assert_eq_m512i(r, e);
21826    }
21827
21828    #[simd_test(enable = "avx512bw")]
21829    const fn test_mm512_maskz_alignr_epi8() {
21830        #[rustfmt::skip]
21831        let a = _mm512_set_epi8(
21832            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21833            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21834            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21835            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21836        );
21837        let b = _mm512_set1_epi8(1);
21838        let r = _mm512_maskz_alignr_epi8::<14>(0, a, b);
21839        assert_eq_m512i(r, _mm512_setzero_si512());
21840        let r = _mm512_maskz_alignr_epi8::<14>(
21841            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
21842            a,
21843            b,
21844        );
21845        #[rustfmt::skip]
21846        let e = _mm512_set_epi8(
21847            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21848            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21849            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21850            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21851        );
21852        assert_eq_m512i(r, e);
21853    }
21854
21855    #[simd_test(enable = "avx512bw,avx512vl")]
21856    const fn test_mm256_mask_alignr_epi8() {
21857        #[rustfmt::skip]
21858        let a = _mm256_set_epi8(
21859            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21860            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21861        );
21862        let b = _mm256_set1_epi8(1);
21863        let r = _mm256_mask_alignr_epi8::<14>(a, 0, a, b);
21864        assert_eq_m256i(r, a);
21865        let r = _mm256_mask_alignr_epi8::<14>(a, 0b11111111_11111111_11111111_11111111, a, b);
21866        #[rustfmt::skip]
21867        let e = _mm256_set_epi8(
21868            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21869            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21870        );
21871        assert_eq_m256i(r, e);
21872    }
21873
21874    #[simd_test(enable = "avx512bw,avx512vl")]
21875    const fn test_mm256_maskz_alignr_epi8() {
21876        #[rustfmt::skip]
21877        let a = _mm256_set_epi8(
21878            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21879            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21880        );
21881        let b = _mm256_set1_epi8(1);
21882        let r = _mm256_maskz_alignr_epi8::<14>(0, a, b);
21883        assert_eq_m256i(r, _mm256_setzero_si256());
21884        let r = _mm256_maskz_alignr_epi8::<14>(0b11111111_11111111_11111111_11111111, a, b);
21885        #[rustfmt::skip]
21886        let e = _mm256_set_epi8(
21887            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21888            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21889        );
21890        assert_eq_m256i(r, e);
21891    }
21892
21893    #[simd_test(enable = "avx512bw,avx512vl")]
21894    const fn test_mm_mask_alignr_epi8() {
21895        let a = _mm_set_epi8(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0);
21896        let b = _mm_set1_epi8(1);
21897        let r = _mm_mask_alignr_epi8::<14>(a, 0, a, b);
21898        assert_eq_m128i(r, a);
21899        let r = _mm_mask_alignr_epi8::<14>(a, 0b11111111_11111111, a, b);
21900        let e = _mm_set_epi8(0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1);
21901        assert_eq_m128i(r, e);
21902    }
21903
21904    #[simd_test(enable = "avx512bw,avx512vl")]
21905    const fn test_mm_maskz_alignr_epi8() {
21906        let a = _mm_set_epi8(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0);
21907        let b = _mm_set1_epi8(1);
21908        let r = _mm_maskz_alignr_epi8::<14>(0, a, b);
21909        assert_eq_m128i(r, _mm_setzero_si128());
21910        let r = _mm_maskz_alignr_epi8::<14>(0b11111111_11111111, a, b);
21911        let e = _mm_set_epi8(0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1);
21912        assert_eq_m128i(r, e);
21913    }
21914
21915    #[simd_test(enable = "avx512bw")]
21916    fn test_mm512_mask_cvtsepi16_storeu_epi8() {
21917        let a = _mm512_set1_epi16(i16::MAX);
21918        let mut r = _mm256_undefined_si256();
21919        unsafe {
21920            _mm512_mask_cvtsepi16_storeu_epi8(
21921                &mut r as *mut _ as *mut i8,
21922                0b11111111_11111111_11111111_11111111,
21923                a,
21924            );
21925        }
21926        let e = _mm256_set1_epi8(i8::MAX);
21927        assert_eq_m256i(r, e);
21928    }
21929
21930    #[simd_test(enable = "avx512bw,avx512vl")]
21931    fn test_mm256_mask_cvtsepi16_storeu_epi8() {
21932        let a = _mm256_set1_epi16(i16::MAX);
21933        let mut r = _mm_undefined_si128();
21934        unsafe {
21935            _mm256_mask_cvtsepi16_storeu_epi8(&mut r as *mut _ as *mut i8, 0b11111111_11111111, a);
21936        }
21937        let e = _mm_set1_epi8(i8::MAX);
21938        assert_eq_m128i(r, e);
21939    }
21940
21941    #[simd_test(enable = "avx512bw,avx512vl")]
21942    fn test_mm_mask_cvtsepi16_storeu_epi8() {
21943        let a = _mm_set1_epi16(i16::MAX);
21944        let mut r = _mm_set1_epi8(0);
21945        unsafe {
21946            _mm_mask_cvtsepi16_storeu_epi8(&mut r as *mut _ as *mut i8, 0b11111111, a);
21947        }
21948        #[rustfmt::skip]
21949        let e = _mm_set_epi8(
21950            0, 0, 0, 0, 0, 0, 0, 0,
21951            i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX,
21952        );
21953        assert_eq_m128i(r, e);
21954    }
21955
21956    #[simd_test(enable = "avx512bw")]
21957    fn test_mm512_mask_cvtepi16_storeu_epi8() {
21958        let a = _mm512_set1_epi16(8);
21959        let mut r = _mm256_undefined_si256();
21960        unsafe {
21961            _mm512_mask_cvtepi16_storeu_epi8(
21962                &mut r as *mut _ as *mut i8,
21963                0b11111111_11111111_11111111_11111111,
21964                a,
21965            );
21966        }
21967        let e = _mm256_set1_epi8(8);
21968        assert_eq_m256i(r, e);
21969    }
21970
21971    #[simd_test(enable = "avx512bw,avx512vl")]
21972    fn test_mm256_mask_cvtepi16_storeu_epi8() {
21973        let a = _mm256_set1_epi16(8);
21974        let mut r = _mm_undefined_si128();
21975        unsafe {
21976            _mm256_mask_cvtepi16_storeu_epi8(&mut r as *mut _ as *mut i8, 0b11111111_11111111, a);
21977        }
21978        let e = _mm_set1_epi8(8);
21979        assert_eq_m128i(r, e);
21980    }
21981
21982    #[simd_test(enable = "avx512bw,avx512vl")]
21983    fn test_mm_mask_cvtepi16_storeu_epi8() {
21984        let a = _mm_set1_epi16(8);
21985        let mut r = _mm_set1_epi8(0);
21986        unsafe {
21987            _mm_mask_cvtepi16_storeu_epi8(&mut r as *mut _ as *mut i8, 0b11111111, a);
21988        }
21989        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8);
21990        assert_eq_m128i(r, e);
21991    }
21992
21993    #[simd_test(enable = "avx512bw")]
21994    fn test_mm512_mask_cvtusepi16_storeu_epi8() {
21995        let a = _mm512_set1_epi16(i16::MAX);
21996        let mut r = _mm256_undefined_si256();
21997        unsafe {
21998            _mm512_mask_cvtusepi16_storeu_epi8(
21999                &mut r as *mut _ as *mut i8,
22000                0b11111111_11111111_11111111_11111111,
22001                a,
22002            );
22003        }
22004        let e = _mm256_set1_epi8(u8::MAX as i8);
22005        assert_eq_m256i(r, e);
22006    }
22007
22008    #[simd_test(enable = "avx512bw,avx512vl")]
22009    fn test_mm256_mask_cvtusepi16_storeu_epi8() {
22010        let a = _mm256_set1_epi16(i16::MAX);
22011        let mut r = _mm_undefined_si128();
22012        unsafe {
22013            _mm256_mask_cvtusepi16_storeu_epi8(&mut r as *mut _ as *mut i8, 0b11111111_11111111, a);
22014        }
22015        let e = _mm_set1_epi8(u8::MAX as i8);
22016        assert_eq_m128i(r, e);
22017    }
22018
22019    #[simd_test(enable = "avx512bw,avx512vl")]
22020    fn test_mm_mask_cvtusepi16_storeu_epi8() {
22021        let a = _mm_set1_epi16(i16::MAX);
22022        let mut r = _mm_set1_epi8(0);
22023        unsafe {
22024            _mm_mask_cvtusepi16_storeu_epi8(&mut r as *mut _ as *mut i8, 0b11111111, a);
22025        }
22026        #[rustfmt::skip]
22027        let e = _mm_set_epi8(
22028            0, 0, 0, 0,
22029            0, 0, 0, 0,
22030            u8::MAX as i8, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8,
22031            u8::MAX as i8, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8,
22032        );
22033        assert_eq_m128i(r, e);
22034    }
22035}