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))]
1453pub fn _mm512_mulhi_epu16(a: __m512i, b: __m512i) -> __m512i {
1454    unsafe { transmute(vpmulhuw(a.as_u16x32(), b.as_u16x32())) }
1455}
1456
1457/// 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).
1458///
1459/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_mulhi_epu16&expand=3971)
1460#[inline]
1461#[target_feature(enable = "avx512bw")]
1462#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1463#[cfg_attr(test, assert_instr(vpmulhuw))]
1464pub fn _mm512_mask_mulhi_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
1465    unsafe {
1466        let mul = _mm512_mulhi_epu16(a, b).as_u16x32();
1467        transmute(simd_select_bitmask(k, mul, src.as_u16x32()))
1468    }
1469}
1470
1471/// 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).
1472///
1473/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_mulhi_epu16&expand=3972)
1474#[inline]
1475#[target_feature(enable = "avx512bw")]
1476#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1477#[cfg_attr(test, assert_instr(vpmulhuw))]
1478pub fn _mm512_maskz_mulhi_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
1479    unsafe {
1480        let mul = _mm512_mulhi_epu16(a, b).as_u16x32();
1481        transmute(simd_select_bitmask(k, mul, u16x32::ZERO))
1482    }
1483}
1484
1485/// 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).
1486///
1487/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_mulhi_epu16&expand=3968)
1488#[inline]
1489#[target_feature(enable = "avx512bw,avx512vl")]
1490#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1491#[cfg_attr(test, assert_instr(vpmulhuw))]
1492pub fn _mm256_mask_mulhi_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
1493    unsafe {
1494        let mul = _mm256_mulhi_epu16(a, b).as_u16x16();
1495        transmute(simd_select_bitmask(k, mul, src.as_u16x16()))
1496    }
1497}
1498
1499/// 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).
1500///
1501/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_mulhi_epu16&expand=3969)
1502#[inline]
1503#[target_feature(enable = "avx512bw,avx512vl")]
1504#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1505#[cfg_attr(test, assert_instr(vpmulhuw))]
1506pub fn _mm256_maskz_mulhi_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
1507    unsafe {
1508        let mul = _mm256_mulhi_epu16(a, b).as_u16x16();
1509        transmute(simd_select_bitmask(k, mul, u16x16::ZERO))
1510    }
1511}
1512
1513/// 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).
1514///
1515/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_mulhi_epu16&expand=3965)
1516#[inline]
1517#[target_feature(enable = "avx512bw,avx512vl")]
1518#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1519#[cfg_attr(test, assert_instr(vpmulhuw))]
1520pub fn _mm_mask_mulhi_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
1521    unsafe {
1522        let mul = _mm_mulhi_epu16(a, b).as_u16x8();
1523        transmute(simd_select_bitmask(k, mul, src.as_u16x8()))
1524    }
1525}
1526
1527/// 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).
1528///
1529/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_mulhi_epu16&expand=3966)
1530#[inline]
1531#[target_feature(enable = "avx512bw,avx512vl")]
1532#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1533#[cfg_attr(test, assert_instr(vpmulhuw))]
1534pub fn _mm_maskz_mulhi_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
1535    unsafe {
1536        let mul = _mm_mulhi_epu16(a, b).as_u16x8();
1537        transmute(simd_select_bitmask(k, mul, u16x8::ZERO))
1538    }
1539}
1540
1541/// 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.
1542///
1543/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mulhi_epi16&expand=3962)
1544#[inline]
1545#[target_feature(enable = "avx512bw")]
1546#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1547#[cfg_attr(test, assert_instr(vpmulhw))]
1548pub fn _mm512_mulhi_epi16(a: __m512i, b: __m512i) -> __m512i {
1549    unsafe { transmute(vpmulhw(a.as_i16x32(), b.as_i16x32())) }
1550}
1551
1552/// 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).
1553///
1554/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_mulhi_epi16&expand=3960)
1555#[inline]
1556#[target_feature(enable = "avx512bw")]
1557#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1558#[cfg_attr(test, assert_instr(vpmulhw))]
1559pub fn _mm512_mask_mulhi_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
1560    unsafe {
1561        let mul = _mm512_mulhi_epi16(a, b).as_i16x32();
1562        transmute(simd_select_bitmask(k, mul, src.as_i16x32()))
1563    }
1564}
1565
1566/// 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).
1567///
1568/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_mulhi_epi16&expand=3961)
1569#[inline]
1570#[target_feature(enable = "avx512bw")]
1571#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1572#[cfg_attr(test, assert_instr(vpmulhw))]
1573pub fn _mm512_maskz_mulhi_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
1574    unsafe {
1575        let mul = _mm512_mulhi_epi16(a, b).as_i16x32();
1576        transmute(simd_select_bitmask(k, mul, i16x32::ZERO))
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=_mm256_mask_mulhi_epi16&expand=3957)
1583#[inline]
1584#[target_feature(enable = "avx512bw,avx512vl")]
1585#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1586#[cfg_attr(test, assert_instr(vpmulhw))]
1587pub fn _mm256_mask_mulhi_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
1588    unsafe {
1589        let mul = _mm256_mulhi_epi16(a, b).as_i16x16();
1590        transmute(simd_select_bitmask(k, mul, src.as_i16x16()))
1591    }
1592}
1593
1594/// 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).
1595///
1596/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_mulhi_epi16&expand=3958)
1597#[inline]
1598#[target_feature(enable = "avx512bw,avx512vl")]
1599#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1600#[cfg_attr(test, assert_instr(vpmulhw))]
1601pub fn _mm256_maskz_mulhi_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
1602    unsafe {
1603        let mul = _mm256_mulhi_epi16(a, b).as_i16x16();
1604        transmute(simd_select_bitmask(k, mul, i16x16::ZERO))
1605    }
1606}
1607
1608/// 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).
1609///
1610/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_mulhi_epi16&expand=3954)
1611#[inline]
1612#[target_feature(enable = "avx512bw,avx512vl")]
1613#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1614#[cfg_attr(test, assert_instr(vpmulhw))]
1615pub fn _mm_mask_mulhi_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
1616    unsafe {
1617        let mul = _mm_mulhi_epi16(a, b).as_i16x8();
1618        transmute(simd_select_bitmask(k, mul, src.as_i16x8()))
1619    }
1620}
1621
1622/// 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).
1623///
1624/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_mulhi_epi16&expand=3955)
1625#[inline]
1626#[target_feature(enable = "avx512bw,avx512vl")]
1627#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1628#[cfg_attr(test, assert_instr(vpmulhw))]
1629pub fn _mm_maskz_mulhi_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
1630    unsafe {
1631        let mul = _mm_mulhi_epi16(a, b).as_i16x8();
1632        transmute(simd_select_bitmask(k, mul, i16x8::ZERO))
1633    }
1634}
1635
1636/// 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.
1637///
1638/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mulhrs_epi16&expand=3986)
1639#[inline]
1640#[target_feature(enable = "avx512bw")]
1641#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1642#[cfg_attr(test, assert_instr(vpmulhrsw))]
1643pub fn _mm512_mulhrs_epi16(a: __m512i, b: __m512i) -> __m512i {
1644    unsafe { transmute(vpmulhrsw(a.as_i16x32(), b.as_i16x32())) }
1645}
1646
1647/// 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).
1648///
1649/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_mulhrs_epi16&expand=3984)
1650#[inline]
1651#[target_feature(enable = "avx512bw")]
1652#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1653#[cfg_attr(test, assert_instr(vpmulhrsw))]
1654pub fn _mm512_mask_mulhrs_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
1655    unsafe {
1656        let mul = _mm512_mulhrs_epi16(a, b).as_i16x32();
1657        transmute(simd_select_bitmask(k, mul, src.as_i16x32()))
1658    }
1659}
1660
1661/// 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).
1662///
1663/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_mulhrs_epi16&expand=3985)
1664#[inline]
1665#[target_feature(enable = "avx512bw")]
1666#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1667#[cfg_attr(test, assert_instr(vpmulhrsw))]
1668pub fn _mm512_maskz_mulhrs_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
1669    unsafe {
1670        let mul = _mm512_mulhrs_epi16(a, b).as_i16x32();
1671        transmute(simd_select_bitmask(k, mul, i16x32::ZERO))
1672    }
1673}
1674
1675/// 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).
1676///
1677/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_mulhrs_epi16&expand=3981)
1678#[inline]
1679#[target_feature(enable = "avx512bw,avx512vl")]
1680#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1681#[cfg_attr(test, assert_instr(vpmulhrsw))]
1682pub fn _mm256_mask_mulhrs_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
1683    unsafe {
1684        let mul = _mm256_mulhrs_epi16(a, b).as_i16x16();
1685        transmute(simd_select_bitmask(k, mul, src.as_i16x16()))
1686    }
1687}
1688
1689/// 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).
1690///
1691/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_mulhrs_epi16&expand=3982)
1692#[inline]
1693#[target_feature(enable = "avx512bw,avx512vl")]
1694#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1695#[cfg_attr(test, assert_instr(vpmulhrsw))]
1696pub fn _mm256_maskz_mulhrs_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
1697    unsafe {
1698        let mul = _mm256_mulhrs_epi16(a, b).as_i16x16();
1699        transmute(simd_select_bitmask(k, mul, i16x16::ZERO))
1700    }
1701}
1702
1703/// 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).
1704///
1705/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_mulhrs_epi16&expand=3978)
1706#[inline]
1707#[target_feature(enable = "avx512bw,avx512vl")]
1708#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1709#[cfg_attr(test, assert_instr(vpmulhrsw))]
1710pub fn _mm_mask_mulhrs_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
1711    unsafe {
1712        let mul = _mm_mulhrs_epi16(a, b).as_i16x8();
1713        transmute(simd_select_bitmask(k, mul, src.as_i16x8()))
1714    }
1715}
1716
1717/// 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).
1718///
1719/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_mulhrs_epi16&expand=3979)
1720#[inline]
1721#[target_feature(enable = "avx512bw,avx512vl")]
1722#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1723#[cfg_attr(test, assert_instr(vpmulhrsw))]
1724pub fn _mm_maskz_mulhrs_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
1725    unsafe {
1726        let mul = _mm_mulhrs_epi16(a, b).as_i16x8();
1727        transmute(simd_select_bitmask(k, mul, i16x8::ZERO))
1728    }
1729}
1730
1731/// 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.
1732///
1733/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mullo_epi16&expand=3996)
1734#[inline]
1735#[target_feature(enable = "avx512bw")]
1736#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1737#[cfg_attr(test, assert_instr(vpmullw))]
1738#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1739pub const fn _mm512_mullo_epi16(a: __m512i, b: __m512i) -> __m512i {
1740    unsafe { transmute(simd_mul(a.as_i16x32(), b.as_i16x32())) }
1741}
1742
1743/// 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).
1744///
1745/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_mullo_epi16&expand=3994)
1746#[inline]
1747#[target_feature(enable = "avx512bw")]
1748#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1749#[cfg_attr(test, assert_instr(vpmullw))]
1750#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1751pub const fn _mm512_mask_mullo_epi16(
1752    src: __m512i,
1753    k: __mmask32,
1754    a: __m512i,
1755    b: __m512i,
1756) -> __m512i {
1757    unsafe {
1758        let mul = _mm512_mullo_epi16(a, b).as_i16x32();
1759        transmute(simd_select_bitmask(k, mul, src.as_i16x32()))
1760    }
1761}
1762
1763/// 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).
1764///
1765/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_mullo_epi16&expand=3995)
1766#[inline]
1767#[target_feature(enable = "avx512bw")]
1768#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1769#[cfg_attr(test, assert_instr(vpmullw))]
1770#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1771pub const fn _mm512_maskz_mullo_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
1772    unsafe {
1773        let mul = _mm512_mullo_epi16(a, b).as_i16x32();
1774        transmute(simd_select_bitmask(k, mul, i16x32::ZERO))
1775    }
1776}
1777
1778/// 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).
1779///
1780/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_mullo_epi16&expand=3991)
1781#[inline]
1782#[target_feature(enable = "avx512bw,avx512vl")]
1783#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1784#[cfg_attr(test, assert_instr(vpmullw))]
1785#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1786pub const fn _mm256_mask_mullo_epi16(
1787    src: __m256i,
1788    k: __mmask16,
1789    a: __m256i,
1790    b: __m256i,
1791) -> __m256i {
1792    unsafe {
1793        let mul = _mm256_mullo_epi16(a, b).as_i16x16();
1794        transmute(simd_select_bitmask(k, mul, src.as_i16x16()))
1795    }
1796}
1797
1798/// 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).
1799///
1800/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_mullo_epi16&expand=3992)
1801#[inline]
1802#[target_feature(enable = "avx512bw,avx512vl")]
1803#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1804#[cfg_attr(test, assert_instr(vpmullw))]
1805#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1806pub const fn _mm256_maskz_mullo_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
1807    unsafe {
1808        let mul = _mm256_mullo_epi16(a, b).as_i16x16();
1809        transmute(simd_select_bitmask(k, mul, i16x16::ZERO))
1810    }
1811}
1812
1813/// 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).
1814///
1815/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_mullo_epi16&expand=3988)
1816#[inline]
1817#[target_feature(enable = "avx512bw,avx512vl")]
1818#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1819#[cfg_attr(test, assert_instr(vpmullw))]
1820#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1821pub const fn _mm_mask_mullo_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
1822    unsafe {
1823        let mul = _mm_mullo_epi16(a, b).as_i16x8();
1824        transmute(simd_select_bitmask(k, mul, src.as_i16x8()))
1825    }
1826}
1827
1828/// 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).
1829///
1830/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_mullo_epi16&expand=3989)
1831#[inline]
1832#[target_feature(enable = "avx512bw,avx512vl")]
1833#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1834#[cfg_attr(test, assert_instr(vpmullw))]
1835#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1836pub const fn _mm_maskz_mullo_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
1837    unsafe {
1838        let mul = _mm_mullo_epi16(a, b).as_i16x8();
1839        transmute(simd_select_bitmask(k, mul, i16x8::ZERO))
1840    }
1841}
1842
1843/// Compare packed unsigned 16-bit integers in a and b, and store packed maximum values in dst.
1844///
1845/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_max_epu16&expand=3609)
1846#[inline]
1847#[target_feature(enable = "avx512bw")]
1848#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1849#[cfg_attr(test, assert_instr(vpmaxuw))]
1850#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1851pub const fn _mm512_max_epu16(a: __m512i, b: __m512i) -> __m512i {
1852    unsafe { simd_imax(a.as_u16x32(), b.as_u16x32()).as_m512i() }
1853}
1854
1855/// 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).
1856///
1857/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_max_epu16&expand=3607)
1858#[inline]
1859#[target_feature(enable = "avx512bw")]
1860#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1861#[cfg_attr(test, assert_instr(vpmaxuw))]
1862#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1863pub const fn _mm512_mask_max_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
1864    unsafe {
1865        let max = _mm512_max_epu16(a, b).as_u16x32();
1866        transmute(simd_select_bitmask(k, max, src.as_u16x32()))
1867    }
1868}
1869
1870/// 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).
1871///
1872/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_max_epu16&expand=3608)
1873#[inline]
1874#[target_feature(enable = "avx512bw")]
1875#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1876#[cfg_attr(test, assert_instr(vpmaxuw))]
1877#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1878pub const fn _mm512_maskz_max_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
1879    unsafe {
1880        let max = _mm512_max_epu16(a, b).as_u16x32();
1881        transmute(simd_select_bitmask(k, max, u16x32::ZERO))
1882    }
1883}
1884
1885/// 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).
1886///
1887/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_max_epu16&expand=3604)
1888#[inline]
1889#[target_feature(enable = "avx512bw,avx512vl")]
1890#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1891#[cfg_attr(test, assert_instr(vpmaxuw))]
1892#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1893pub const fn _mm256_mask_max_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
1894    unsafe {
1895        let max = _mm256_max_epu16(a, b).as_u16x16();
1896        transmute(simd_select_bitmask(k, max, src.as_u16x16()))
1897    }
1898}
1899
1900/// 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).
1901///
1902/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_max_epu16&expand=3605)
1903#[inline]
1904#[target_feature(enable = "avx512bw,avx512vl")]
1905#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1906#[cfg_attr(test, assert_instr(vpmaxuw))]
1907#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1908pub const fn _mm256_maskz_max_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
1909    unsafe {
1910        let max = _mm256_max_epu16(a, b).as_u16x16();
1911        transmute(simd_select_bitmask(k, max, u16x16::ZERO))
1912    }
1913}
1914
1915/// 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).
1916///
1917/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_max_epu16&expand=3601)
1918#[inline]
1919#[target_feature(enable = "avx512bw,avx512vl")]
1920#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1921#[cfg_attr(test, assert_instr(vpmaxuw))]
1922#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1923pub const fn _mm_mask_max_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
1924    unsafe {
1925        let max = _mm_max_epu16(a, b).as_u16x8();
1926        transmute(simd_select_bitmask(k, max, src.as_u16x8()))
1927    }
1928}
1929
1930/// 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).
1931///
1932/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_max_epu16&expand=3602)
1933#[inline]
1934#[target_feature(enable = "avx512bw,avx512vl")]
1935#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1936#[cfg_attr(test, assert_instr(vpmaxuw))]
1937#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1938pub const fn _mm_maskz_max_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
1939    unsafe {
1940        let max = _mm_max_epu16(a, b).as_u16x8();
1941        transmute(simd_select_bitmask(k, max, u16x8::ZERO))
1942    }
1943}
1944
1945/// Compare packed unsigned 8-bit integers in a and b, and store packed maximum values in dst.
1946///
1947/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_max_epu8&expand=3636)
1948#[inline]
1949#[target_feature(enable = "avx512bw")]
1950#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1951#[cfg_attr(test, assert_instr(vpmaxub))]
1952#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1953pub const fn _mm512_max_epu8(a: __m512i, b: __m512i) -> __m512i {
1954    unsafe { simd_imax(a.as_u8x64(), b.as_u8x64()).as_m512i() }
1955}
1956
1957/// 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).
1958///
1959/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_max_epu8&expand=3634)
1960#[inline]
1961#[target_feature(enable = "avx512bw")]
1962#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1963#[cfg_attr(test, assert_instr(vpmaxub))]
1964#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1965pub const fn _mm512_mask_max_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
1966    unsafe {
1967        let max = _mm512_max_epu8(a, b).as_u8x64();
1968        transmute(simd_select_bitmask(k, max, src.as_u8x64()))
1969    }
1970}
1971
1972/// 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).
1973///
1974/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_max_epu8&expand=3635)
1975#[inline]
1976#[target_feature(enable = "avx512bw")]
1977#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1978#[cfg_attr(test, assert_instr(vpmaxub))]
1979#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1980pub const fn _mm512_maskz_max_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
1981    unsafe {
1982        let max = _mm512_max_epu8(a, b).as_u8x64();
1983        transmute(simd_select_bitmask(k, max, u8x64::ZERO))
1984    }
1985}
1986
1987/// 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).
1988///
1989/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_max_epu8&expand=3631)
1990#[inline]
1991#[target_feature(enable = "avx512bw,avx512vl")]
1992#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
1993#[cfg_attr(test, assert_instr(vpmaxub))]
1994#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
1995pub const fn _mm256_mask_max_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
1996    unsafe {
1997        let max = _mm256_max_epu8(a, b).as_u8x32();
1998        transmute(simd_select_bitmask(k, max, src.as_u8x32()))
1999    }
2000}
2001
2002/// 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).
2003///
2004/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_max_epu8&expand=3632)
2005#[inline]
2006#[target_feature(enable = "avx512bw,avx512vl")]
2007#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2008#[cfg_attr(test, assert_instr(vpmaxub))]
2009#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2010pub const fn _mm256_maskz_max_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
2011    unsafe {
2012        let max = _mm256_max_epu8(a, b).as_u8x32();
2013        transmute(simd_select_bitmask(k, max, u8x32::ZERO))
2014    }
2015}
2016
2017/// 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).
2018///
2019/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_max_epu8&expand=3628)
2020#[inline]
2021#[target_feature(enable = "avx512bw,avx512vl")]
2022#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2023#[cfg_attr(test, assert_instr(vpmaxub))]
2024#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2025pub const fn _mm_mask_max_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
2026    unsafe {
2027        let max = _mm_max_epu8(a, b).as_u8x16();
2028        transmute(simd_select_bitmask(k, max, src.as_u8x16()))
2029    }
2030}
2031
2032/// 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).
2033///
2034/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_max_epu8&expand=3629)
2035#[inline]
2036#[target_feature(enable = "avx512bw,avx512vl")]
2037#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2038#[cfg_attr(test, assert_instr(vpmaxub))]
2039#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2040pub const fn _mm_maskz_max_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
2041    unsafe {
2042        let max = _mm_max_epu8(a, b).as_u8x16();
2043        transmute(simd_select_bitmask(k, max, u8x16::ZERO))
2044    }
2045}
2046
2047/// Compare packed signed 16-bit integers in a and b, and store packed maximum values in dst.
2048///
2049/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_max_epi16&expand=3573)
2050#[inline]
2051#[target_feature(enable = "avx512bw")]
2052#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2053#[cfg_attr(test, assert_instr(vpmaxsw))]
2054#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2055pub const fn _mm512_max_epi16(a: __m512i, b: __m512i) -> __m512i {
2056    unsafe { simd_imax(a.as_i16x32(), b.as_i16x32()).as_m512i() }
2057}
2058
2059/// 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).
2060///
2061/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_max_epi16&expand=3571)
2062#[inline]
2063#[target_feature(enable = "avx512bw")]
2064#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2065#[cfg_attr(test, assert_instr(vpmaxsw))]
2066#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2067pub const fn _mm512_mask_max_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
2068    unsafe {
2069        let max = _mm512_max_epi16(a, b).as_i16x32();
2070        transmute(simd_select_bitmask(k, max, src.as_i16x32()))
2071    }
2072}
2073
2074/// 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).
2075///
2076/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_max_epi16&expand=3572)
2077#[inline]
2078#[target_feature(enable = "avx512bw")]
2079#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2080#[cfg_attr(test, assert_instr(vpmaxsw))]
2081#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2082pub const fn _mm512_maskz_max_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
2083    unsafe {
2084        let max = _mm512_max_epi16(a, b).as_i16x32();
2085        transmute(simd_select_bitmask(k, max, i16x32::ZERO))
2086    }
2087}
2088
2089/// 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).
2090///
2091/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_max_epi16&expand=3568)
2092#[inline]
2093#[target_feature(enable = "avx512bw,avx512vl")]
2094#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2095#[cfg_attr(test, assert_instr(vpmaxsw))]
2096#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2097pub const fn _mm256_mask_max_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
2098    unsafe {
2099        let max = _mm256_max_epi16(a, b).as_i16x16();
2100        transmute(simd_select_bitmask(k, max, src.as_i16x16()))
2101    }
2102}
2103
2104/// 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).
2105///
2106/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_max_epi16&expand=3569)
2107#[inline]
2108#[target_feature(enable = "avx512bw,avx512vl")]
2109#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2110#[cfg_attr(test, assert_instr(vpmaxsw))]
2111#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2112pub const fn _mm256_maskz_max_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
2113    unsafe {
2114        let max = _mm256_max_epi16(a, b).as_i16x16();
2115        transmute(simd_select_bitmask(k, max, i16x16::ZERO))
2116    }
2117}
2118
2119/// 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).
2120///
2121/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_max_epi16&expand=3565)
2122#[inline]
2123#[target_feature(enable = "avx512bw,avx512vl")]
2124#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2125#[cfg_attr(test, assert_instr(vpmaxsw))]
2126#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2127pub const fn _mm_mask_max_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
2128    unsafe {
2129        let max = _mm_max_epi16(a, b).as_i16x8();
2130        transmute(simd_select_bitmask(k, max, src.as_i16x8()))
2131    }
2132}
2133
2134/// 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).
2135///
2136/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_max_epi16&expand=3566)
2137#[inline]
2138#[target_feature(enable = "avx512bw,avx512vl")]
2139#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2140#[cfg_attr(test, assert_instr(vpmaxsw))]
2141#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2142pub const fn _mm_maskz_max_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
2143    unsafe {
2144        let max = _mm_max_epi16(a, b).as_i16x8();
2145        transmute(simd_select_bitmask(k, max, i16x8::ZERO))
2146    }
2147}
2148
2149/// Compare packed signed 8-bit integers in a and b, and store packed maximum values in dst.
2150///
2151/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_max_epi8&expand=3600)
2152#[inline]
2153#[target_feature(enable = "avx512bw")]
2154#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2155#[cfg_attr(test, assert_instr(vpmaxsb))]
2156#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2157pub const fn _mm512_max_epi8(a: __m512i, b: __m512i) -> __m512i {
2158    unsafe { simd_imax(a.as_i8x64(), b.as_i8x64()).as_m512i() }
2159}
2160
2161/// 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).
2162///
2163/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_max_epi8&expand=3598)
2164#[inline]
2165#[target_feature(enable = "avx512bw")]
2166#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2167#[cfg_attr(test, assert_instr(vpmaxsb))]
2168#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2169pub const fn _mm512_mask_max_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
2170    unsafe {
2171        let max = _mm512_max_epi8(a, b).as_i8x64();
2172        transmute(simd_select_bitmask(k, max, src.as_i8x64()))
2173    }
2174}
2175
2176/// 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).
2177///
2178/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_max_epi8&expand=3599)
2179#[inline]
2180#[target_feature(enable = "avx512bw")]
2181#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2182#[cfg_attr(test, assert_instr(vpmaxsb))]
2183#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2184pub const fn _mm512_maskz_max_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
2185    unsafe {
2186        let max = _mm512_max_epi8(a, b).as_i8x64();
2187        transmute(simd_select_bitmask(k, max, i8x64::ZERO))
2188    }
2189}
2190
2191/// 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).
2192///
2193/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_max_epi8&expand=3595)
2194#[inline]
2195#[target_feature(enable = "avx512bw,avx512vl")]
2196#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2197#[cfg_attr(test, assert_instr(vpmaxsb))]
2198#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2199pub const fn _mm256_mask_max_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
2200    unsafe {
2201        let max = _mm256_max_epi8(a, b).as_i8x32();
2202        transmute(simd_select_bitmask(k, max, src.as_i8x32()))
2203    }
2204}
2205
2206/// 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).
2207///
2208/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_max_epi8&expand=3596)
2209#[inline]
2210#[target_feature(enable = "avx512bw,avx512vl")]
2211#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2212#[cfg_attr(test, assert_instr(vpmaxsb))]
2213#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2214pub const fn _mm256_maskz_max_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
2215    unsafe {
2216        let max = _mm256_max_epi8(a, b).as_i8x32();
2217        transmute(simd_select_bitmask(k, max, i8x32::ZERO))
2218    }
2219}
2220
2221/// 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).
2222///
2223/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_max_epi8&expand=3592)
2224#[inline]
2225#[target_feature(enable = "avx512bw,avx512vl")]
2226#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2227#[cfg_attr(test, assert_instr(vpmaxsb))]
2228#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2229pub const fn _mm_mask_max_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
2230    unsafe {
2231        let max = _mm_max_epi8(a, b).as_i8x16();
2232        transmute(simd_select_bitmask(k, max, src.as_i8x16()))
2233    }
2234}
2235
2236/// 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).
2237///
2238/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_max_epi8&expand=3593)
2239#[inline]
2240#[target_feature(enable = "avx512bw,avx512vl")]
2241#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2242#[cfg_attr(test, assert_instr(vpmaxsb))]
2243#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2244pub const fn _mm_maskz_max_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
2245    unsafe {
2246        let max = _mm_max_epi8(a, b).as_i8x16();
2247        transmute(simd_select_bitmask(k, max, i8x16::ZERO))
2248    }
2249}
2250
2251/// Compare packed unsigned 16-bit integers in a and b, and store packed minimum values in dst.
2252///
2253/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_min_epu16&expand=3723)
2254#[inline]
2255#[target_feature(enable = "avx512bw")]
2256#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2257#[cfg_attr(test, assert_instr(vpminuw))]
2258#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2259pub const fn _mm512_min_epu16(a: __m512i, b: __m512i) -> __m512i {
2260    unsafe { simd_imin(a.as_u16x32(), b.as_u16x32()).as_m512i() }
2261}
2262
2263/// 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).
2264///
2265/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_min_epu16&expand=3721)
2266#[inline]
2267#[target_feature(enable = "avx512bw")]
2268#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2269#[cfg_attr(test, assert_instr(vpminuw))]
2270#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2271pub const fn _mm512_mask_min_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
2272    unsafe {
2273        let min = _mm512_min_epu16(a, b).as_u16x32();
2274        transmute(simd_select_bitmask(k, min, src.as_u16x32()))
2275    }
2276}
2277
2278/// 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).
2279///
2280/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_min_epu16&expand=3722)
2281#[inline]
2282#[target_feature(enable = "avx512bw")]
2283#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2284#[cfg_attr(test, assert_instr(vpminuw))]
2285#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2286pub const fn _mm512_maskz_min_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
2287    unsafe {
2288        let min = _mm512_min_epu16(a, b).as_u16x32();
2289        transmute(simd_select_bitmask(k, min, u16x32::ZERO))
2290    }
2291}
2292
2293/// 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).
2294///
2295/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_min_epu16&expand=3718)
2296#[inline]
2297#[target_feature(enable = "avx512bw,avx512vl")]
2298#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2299#[cfg_attr(test, assert_instr(vpminuw))]
2300#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2301pub const fn _mm256_mask_min_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
2302    unsafe {
2303        let min = _mm256_min_epu16(a, b).as_u16x16();
2304        transmute(simd_select_bitmask(k, min, src.as_u16x16()))
2305    }
2306}
2307
2308/// 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).
2309///
2310/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_min_epu16&expand=3719)
2311#[inline]
2312#[target_feature(enable = "avx512bw,avx512vl")]
2313#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2314#[cfg_attr(test, assert_instr(vpminuw))]
2315#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2316pub const fn _mm256_maskz_min_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
2317    unsafe {
2318        let min = _mm256_min_epu16(a, b).as_u16x16();
2319        transmute(simd_select_bitmask(k, min, u16x16::ZERO))
2320    }
2321}
2322
2323/// 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).
2324///
2325/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_min_epu16&expand=3715)
2326#[inline]
2327#[target_feature(enable = "avx512bw,avx512vl")]
2328#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2329#[cfg_attr(test, assert_instr(vpminuw))]
2330#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2331pub const fn _mm_mask_min_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
2332    unsafe {
2333        let min = _mm_min_epu16(a, b).as_u16x8();
2334        transmute(simd_select_bitmask(k, min, src.as_u16x8()))
2335    }
2336}
2337
2338/// 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).
2339///
2340/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_min_epu16&expand=3716)
2341#[inline]
2342#[target_feature(enable = "avx512bw,avx512vl")]
2343#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2344#[cfg_attr(test, assert_instr(vpminuw))]
2345#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2346pub const fn _mm_maskz_min_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
2347    unsafe {
2348        let min = _mm_min_epu16(a, b).as_u16x8();
2349        transmute(simd_select_bitmask(k, min, u16x8::ZERO))
2350    }
2351}
2352
2353/// Compare packed unsigned 8-bit integers in a and b, and store packed minimum values in dst.
2354///
2355/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_min_epu8&expand=3750)
2356#[inline]
2357#[target_feature(enable = "avx512bw")]
2358#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2359#[cfg_attr(test, assert_instr(vpminub))]
2360#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2361pub const fn _mm512_min_epu8(a: __m512i, b: __m512i) -> __m512i {
2362    unsafe { simd_imin(a.as_u8x64(), b.as_u8x64()).as_m512i() }
2363}
2364
2365/// 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).
2366///
2367/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_min_epu8&expand=3748)
2368#[inline]
2369#[target_feature(enable = "avx512bw")]
2370#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2371#[cfg_attr(test, assert_instr(vpminub))]
2372#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2373pub const fn _mm512_mask_min_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
2374    unsafe {
2375        let min = _mm512_min_epu8(a, b).as_u8x64();
2376        transmute(simd_select_bitmask(k, min, src.as_u8x64()))
2377    }
2378}
2379
2380/// 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).
2381///
2382/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_min_epu8&expand=3749)
2383#[inline]
2384#[target_feature(enable = "avx512bw")]
2385#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2386#[cfg_attr(test, assert_instr(vpminub))]
2387#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2388pub const fn _mm512_maskz_min_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
2389    unsafe {
2390        let min = _mm512_min_epu8(a, b).as_u8x64();
2391        transmute(simd_select_bitmask(k, min, u8x64::ZERO))
2392    }
2393}
2394
2395/// 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).
2396///
2397/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_min_epu8&expand=3745)
2398#[inline]
2399#[target_feature(enable = "avx512bw,avx512vl")]
2400#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2401#[cfg_attr(test, assert_instr(vpminub))]
2402#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2403pub const fn _mm256_mask_min_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
2404    unsafe {
2405        let min = _mm256_min_epu8(a, b).as_u8x32();
2406        transmute(simd_select_bitmask(k, min, src.as_u8x32()))
2407    }
2408}
2409
2410/// 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).
2411///
2412/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_min_epu8&expand=3746)
2413#[inline]
2414#[target_feature(enable = "avx512bw,avx512vl")]
2415#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2416#[cfg_attr(test, assert_instr(vpminub))]
2417#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2418pub const fn _mm256_maskz_min_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
2419    unsafe {
2420        let min = _mm256_min_epu8(a, b).as_u8x32();
2421        transmute(simd_select_bitmask(k, min, u8x32::ZERO))
2422    }
2423}
2424
2425/// 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).
2426///
2427/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_min_epu8&expand=3742)
2428#[inline]
2429#[target_feature(enable = "avx512bw,avx512vl")]
2430#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2431#[cfg_attr(test, assert_instr(vpminub))]
2432#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2433pub const fn _mm_mask_min_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
2434    unsafe {
2435        let min = _mm_min_epu8(a, b).as_u8x16();
2436        transmute(simd_select_bitmask(k, min, src.as_u8x16()))
2437    }
2438}
2439
2440/// 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).
2441///
2442/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_min_epu8&expand=3743)
2443#[inline]
2444#[target_feature(enable = "avx512bw,avx512vl")]
2445#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2446#[cfg_attr(test, assert_instr(vpminub))]
2447#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2448pub const fn _mm_maskz_min_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
2449    unsafe {
2450        let min = _mm_min_epu8(a, b).as_u8x16();
2451        transmute(simd_select_bitmask(k, min, u8x16::ZERO))
2452    }
2453}
2454
2455/// Compare packed signed 16-bit integers in a and b, and store packed minimum values in dst.
2456///
2457/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_min_epi16&expand=3687)
2458#[inline]
2459#[target_feature(enable = "avx512bw")]
2460#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2461#[cfg_attr(test, assert_instr(vpminsw))]
2462#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2463pub const fn _mm512_min_epi16(a: __m512i, b: __m512i) -> __m512i {
2464    unsafe { simd_imin(a.as_i16x32(), b.as_i16x32()).as_m512i() }
2465}
2466
2467/// 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).
2468///
2469/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_min_epi16&expand=3685)
2470#[inline]
2471#[target_feature(enable = "avx512bw")]
2472#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2473#[cfg_attr(test, assert_instr(vpminsw))]
2474#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2475pub const fn _mm512_mask_min_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
2476    unsafe {
2477        let min = _mm512_min_epi16(a, b).as_i16x32();
2478        transmute(simd_select_bitmask(k, min, src.as_i16x32()))
2479    }
2480}
2481
2482/// 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).
2483///
2484/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_min_epi16&expand=3686)
2485#[inline]
2486#[target_feature(enable = "avx512bw")]
2487#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2488#[cfg_attr(test, assert_instr(vpminsw))]
2489#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2490pub const fn _mm512_maskz_min_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
2491    unsafe {
2492        let min = _mm512_min_epi16(a, b).as_i16x32();
2493        transmute(simd_select_bitmask(k, min, i16x32::ZERO))
2494    }
2495}
2496
2497/// 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).
2498///
2499/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_min_epi16&expand=3682)
2500#[inline]
2501#[target_feature(enable = "avx512bw,avx512vl")]
2502#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2503#[cfg_attr(test, assert_instr(vpminsw))]
2504#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2505pub const fn _mm256_mask_min_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
2506    unsafe {
2507        let min = _mm256_min_epi16(a, b).as_i16x16();
2508        transmute(simd_select_bitmask(k, min, src.as_i16x16()))
2509    }
2510}
2511
2512/// 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).
2513///
2514/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_min_epi16&expand=3683)
2515#[inline]
2516#[target_feature(enable = "avx512bw,avx512vl")]
2517#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2518#[cfg_attr(test, assert_instr(vpminsw))]
2519#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2520pub const fn _mm256_maskz_min_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
2521    unsafe {
2522        let min = _mm256_min_epi16(a, b).as_i16x16();
2523        transmute(simd_select_bitmask(k, min, i16x16::ZERO))
2524    }
2525}
2526
2527/// 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).
2528///
2529/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_min_epi16&expand=3679)
2530#[inline]
2531#[target_feature(enable = "avx512bw,avx512vl")]
2532#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2533#[cfg_attr(test, assert_instr(vpminsw))]
2534#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2535pub const fn _mm_mask_min_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
2536    unsafe {
2537        let min = _mm_min_epi16(a, b).as_i16x8();
2538        transmute(simd_select_bitmask(k, min, src.as_i16x8()))
2539    }
2540}
2541
2542/// 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).
2543///
2544/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_min_epi16&expand=3680)
2545#[inline]
2546#[target_feature(enable = "avx512bw,avx512vl")]
2547#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2548#[cfg_attr(test, assert_instr(vpminsw))]
2549#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2550pub const fn _mm_maskz_min_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
2551    unsafe {
2552        let min = _mm_min_epi16(a, b).as_i16x8();
2553        transmute(simd_select_bitmask(k, min, i16x8::ZERO))
2554    }
2555}
2556
2557/// Compare packed signed 8-bit integers in a and b, and store packed minimum values in dst.
2558///
2559/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_min_epi8&expand=3714)
2560#[inline]
2561#[target_feature(enable = "avx512bw")]
2562#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2563#[cfg_attr(test, assert_instr(vpminsb))]
2564#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2565pub const fn _mm512_min_epi8(a: __m512i, b: __m512i) -> __m512i {
2566    unsafe { simd_imin(a.as_i8x64(), b.as_i8x64()).as_m512i() }
2567}
2568
2569/// 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).
2570///
2571/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_min_epi8&expand=3712)
2572#[inline]
2573#[target_feature(enable = "avx512bw")]
2574#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2575#[cfg_attr(test, assert_instr(vpminsb))]
2576#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2577pub const fn _mm512_mask_min_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
2578    unsafe {
2579        let min = _mm512_min_epi8(a, b).as_i8x64();
2580        transmute(simd_select_bitmask(k, min, src.as_i8x64()))
2581    }
2582}
2583
2584/// 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).
2585///
2586/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_min_epi8&expand=3713)
2587#[inline]
2588#[target_feature(enable = "avx512bw")]
2589#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2590#[cfg_attr(test, assert_instr(vpminsb))]
2591#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2592pub const fn _mm512_maskz_min_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
2593    unsafe {
2594        let min = _mm512_min_epi8(a, b).as_i8x64();
2595        transmute(simd_select_bitmask(k, min, i8x64::ZERO))
2596    }
2597}
2598
2599/// 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).
2600///
2601/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_min_epi8&expand=3709)
2602#[inline]
2603#[target_feature(enable = "avx512bw,avx512vl")]
2604#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2605#[cfg_attr(test, assert_instr(vpminsb))]
2606#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2607pub const fn _mm256_mask_min_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
2608    unsafe {
2609        let min = _mm256_min_epi8(a, b).as_i8x32();
2610        transmute(simd_select_bitmask(k, min, src.as_i8x32()))
2611    }
2612}
2613
2614/// 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).
2615///
2616/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_min_epi8&expand=3710)
2617#[inline]
2618#[target_feature(enable = "avx512bw,avx512vl")]
2619#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2620#[cfg_attr(test, assert_instr(vpminsb))]
2621#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2622pub const fn _mm256_maskz_min_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
2623    unsafe {
2624        let min = _mm256_min_epi8(a, b).as_i8x32();
2625        transmute(simd_select_bitmask(k, min, i8x32::ZERO))
2626    }
2627}
2628
2629/// 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).
2630///
2631/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_min_epi8&expand=3706)
2632#[inline]
2633#[target_feature(enable = "avx512bw,avx512vl")]
2634#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2635#[cfg_attr(test, assert_instr(vpminsb))]
2636#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2637pub const fn _mm_mask_min_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
2638    unsafe {
2639        let min = _mm_min_epi8(a, b).as_i8x16();
2640        transmute(simd_select_bitmask(k, min, src.as_i8x16()))
2641    }
2642}
2643
2644/// 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).
2645///
2646/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_min_epi8&expand=3707)
2647#[inline]
2648#[target_feature(enable = "avx512bw,avx512vl")]
2649#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2650#[cfg_attr(test, assert_instr(vpminsb))]
2651#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2652pub const fn _mm_maskz_min_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
2653    unsafe {
2654        let min = _mm_min_epi8(a, b).as_i8x16();
2655        transmute(simd_select_bitmask(k, min, i8x16::ZERO))
2656    }
2657}
2658
2659/// Compare packed unsigned 16-bit integers in a and b for less-than, and store the results in mask vector k.
2660///
2661/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmplt_epu16_mask&expand=1050)
2662#[inline]
2663#[target_feature(enable = "avx512bw")]
2664#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2665#[cfg_attr(test, assert_instr(vpcmp))]
2666#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2667pub const fn _mm512_cmplt_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 {
2668    unsafe { simd_bitmask::<u16x32, _>(simd_lt(a.as_u16x32(), b.as_u16x32())) }
2669}
2670
2671/// 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).
2672///
2673/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmplt_epu16_mask&expand=1051)
2674#[inline]
2675#[target_feature(enable = "avx512bw")]
2676#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2677#[cfg_attr(test, assert_instr(vpcmp))]
2678#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2679pub const fn _mm512_mask_cmplt_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
2680    _mm512_mask_cmp_epu16_mask::<_MM_CMPINT_LT>(k1, a, b)
2681}
2682
2683/// Compare packed unsigned 16-bit integers in a and b for less-than, and store the results in mask vector k.
2684///
2685/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmplt_epu16_mask&expand=1050)
2686#[inline]
2687#[target_feature(enable = "avx512bw,avx512vl")]
2688#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2689#[cfg_attr(test, assert_instr(vpcmp))]
2690#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2691pub const fn _mm256_cmplt_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 {
2692    unsafe { simd_bitmask::<u16x16, _>(simd_lt(a.as_u16x16(), b.as_u16x16())) }
2693}
2694
2695/// 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).
2696///
2697/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmplt_epu16_mask&expand=1049)
2698#[inline]
2699#[target_feature(enable = "avx512bw,avx512vl")]
2700#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2701#[cfg_attr(test, assert_instr(vpcmp))]
2702#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2703pub const fn _mm256_mask_cmplt_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
2704    _mm256_mask_cmp_epu16_mask::<_MM_CMPINT_LT>(k1, a, b)
2705}
2706
2707/// Compare packed unsigned 16-bit integers in a and b for less-than, and store the results in mask vector k.
2708///
2709/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmplt_epu16_mask&expand=1018)
2710#[inline]
2711#[target_feature(enable = "avx512bw,avx512vl")]
2712#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2713#[cfg_attr(test, assert_instr(vpcmp))]
2714#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2715pub const fn _mm_cmplt_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 {
2716    unsafe { simd_bitmask::<u16x8, _>(simd_lt(a.as_u16x8(), b.as_u16x8())) }
2717}
2718
2719/// 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).
2720///
2721/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmplt_epu16_mask&expand=1019)
2722#[inline]
2723#[target_feature(enable = "avx512bw,avx512vl")]
2724#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2725#[cfg_attr(test, assert_instr(vpcmp))]
2726#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2727pub const fn _mm_mask_cmplt_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
2728    _mm_mask_cmp_epu16_mask::<_MM_CMPINT_LT>(k1, a, b)
2729}
2730
2731/// Compare packed unsigned 8-bit integers in a and b for less-than, and store the results in mask vector k.
2732///
2733/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=mm512_cmplt_epu8_mask&expand=1068)
2734#[inline]
2735#[target_feature(enable = "avx512bw")]
2736#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2737#[cfg_attr(test, assert_instr(vpcmp))]
2738#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2739pub const fn _mm512_cmplt_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 {
2740    unsafe { simd_bitmask::<u8x64, _>(simd_lt(a.as_u8x64(), b.as_u8x64())) }
2741}
2742
2743/// 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).
2744///
2745/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmplt_epu8_mask&expand=1069)
2746#[inline]
2747#[target_feature(enable = "avx512bw")]
2748#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2749#[cfg_attr(test, assert_instr(vpcmp))]
2750#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2751pub const fn _mm512_mask_cmplt_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
2752    _mm512_mask_cmp_epu8_mask::<_MM_CMPINT_LT>(k1, a, b)
2753}
2754
2755/// Compare packed unsigned 8-bit integers in a and b for less-than, and store the results in mask vector k.
2756///
2757/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmplt_epu8_mask&expand=1066)
2758#[inline]
2759#[target_feature(enable = "avx512bw,avx512vl")]
2760#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2761#[cfg_attr(test, assert_instr(vpcmp))]
2762#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2763pub const fn _mm256_cmplt_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 {
2764    unsafe { simd_bitmask::<u8x32, _>(simd_lt(a.as_u8x32(), b.as_u8x32())) }
2765}
2766
2767/// 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).
2768///
2769/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmplt_epu8_mask&expand=1067)
2770#[inline]
2771#[target_feature(enable = "avx512bw,avx512vl")]
2772#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2773#[cfg_attr(test, assert_instr(vpcmp))]
2774#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2775pub const fn _mm256_mask_cmplt_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
2776    _mm256_mask_cmp_epu8_mask::<_MM_CMPINT_LT>(k1, a, b)
2777}
2778
2779/// Compare packed unsigned 8-bit integers in a and b for less-than, and store the results in mask vector k.
2780///
2781/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmplt_epu8_mask&expand=1064)
2782#[inline]
2783#[target_feature(enable = "avx512bw,avx512vl")]
2784#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2785#[cfg_attr(test, assert_instr(vpcmp))]
2786#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2787pub const fn _mm_cmplt_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 {
2788    unsafe { simd_bitmask::<u8x16, _>(simd_lt(a.as_u8x16(), b.as_u8x16())) }
2789}
2790
2791/// 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).
2792///
2793/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmplt_epu8_mask&expand=1065)
2794#[inline]
2795#[target_feature(enable = "avx512bw,avx512vl")]
2796#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2797#[cfg_attr(test, assert_instr(vpcmp))]
2798#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2799pub const fn _mm_mask_cmplt_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
2800    _mm_mask_cmp_epu8_mask::<_MM_CMPINT_LT>(k1, a, b)
2801}
2802
2803/// Compare packed signed 16-bit integers in a and b for less-than, and store the results in mask vector k.
2804///
2805/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmplt_epi16_mask&expand=1022)
2806#[inline]
2807#[target_feature(enable = "avx512bw")]
2808#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2809#[cfg_attr(test, assert_instr(vpcmp))]
2810#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2811pub const fn _mm512_cmplt_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 {
2812    unsafe { simd_bitmask::<i16x32, _>(simd_lt(a.as_i16x32(), b.as_i16x32())) }
2813}
2814
2815/// 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).
2816///
2817/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmplt_epi16_mask&expand=1023)
2818#[inline]
2819#[target_feature(enable = "avx512bw")]
2820#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2821#[cfg_attr(test, assert_instr(vpcmp))]
2822#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2823pub const fn _mm512_mask_cmplt_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
2824    _mm512_mask_cmp_epi16_mask::<_MM_CMPINT_LT>(k1, a, b)
2825}
2826
2827/// Compare packed signed 16-bit integers in a and b for less-than, and store the results in mask vector k.
2828///
2829/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmplt_epi16_mask&expand=1020)
2830#[inline]
2831#[target_feature(enable = "avx512bw,avx512vl")]
2832#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2833#[cfg_attr(test, assert_instr(vpcmp))]
2834#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2835pub const fn _mm256_cmplt_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 {
2836    unsafe { simd_bitmask::<i16x16, _>(simd_lt(a.as_i16x16(), b.as_i16x16())) }
2837}
2838
2839/// 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).
2840///
2841/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmplt_epi16_mask&expand=1021)
2842#[inline]
2843#[target_feature(enable = "avx512bw,avx512vl")]
2844#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2845#[cfg_attr(test, assert_instr(vpcmp))]
2846#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2847pub const fn _mm256_mask_cmplt_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
2848    _mm256_mask_cmp_epi16_mask::<_MM_CMPINT_LT>(k1, a, b)
2849}
2850
2851/// Compare packed signed 16-bit integers in a and b for less-than, and store the results in mask vector k.
2852///
2853/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmplt_epi16_mask&expand=1018)
2854#[inline]
2855#[target_feature(enable = "avx512bw,avx512vl")]
2856#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2857#[cfg_attr(test, assert_instr(vpcmp))]
2858#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2859pub const fn _mm_cmplt_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 {
2860    unsafe { simd_bitmask::<i16x8, _>(simd_lt(a.as_i16x8(), b.as_i16x8())) }
2861}
2862
2863/// 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).
2864///
2865/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmplt_epi16_mask&expand=1019)
2866#[inline]
2867#[target_feature(enable = "avx512bw,avx512vl")]
2868#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2869#[cfg_attr(test, assert_instr(vpcmp))]
2870#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2871pub const fn _mm_mask_cmplt_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
2872    _mm_mask_cmp_epi16_mask::<_MM_CMPINT_LT>(k1, a, b)
2873}
2874
2875/// Compare packed signed 8-bit integers in a and b for less-than, and store the results in mask vector k.
2876///
2877/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmplt_epi8_mask&expand=1044)
2878#[inline]
2879#[target_feature(enable = "avx512bw")]
2880#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2881#[cfg_attr(test, assert_instr(vpcmp))]
2882#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2883pub const fn _mm512_cmplt_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 {
2884    unsafe { simd_bitmask::<i8x64, _>(simd_lt(a.as_i8x64(), b.as_i8x64())) }
2885}
2886
2887/// 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).
2888///
2889/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmplt_epi8_mask&expand=1045)
2890#[inline]
2891#[target_feature(enable = "avx512bw")]
2892#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2893#[cfg_attr(test, assert_instr(vpcmp))]
2894#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2895pub const fn _mm512_mask_cmplt_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
2896    _mm512_mask_cmp_epi8_mask::<_MM_CMPINT_LT>(k1, a, b)
2897}
2898
2899/// Compare packed signed 8-bit integers in a and b for less-than, and store the results in mask vector k.
2900///
2901/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmplt_epi8_mask&expand=1042)
2902#[inline]
2903#[target_feature(enable = "avx512bw,avx512vl")]
2904#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2905#[cfg_attr(test, assert_instr(vpcmp))]
2906#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2907pub const fn _mm256_cmplt_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 {
2908    unsafe { simd_bitmask::<i8x32, _>(simd_lt(a.as_i8x32(), b.as_i8x32())) }
2909}
2910
2911/// 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).
2912///
2913/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmplt_epi8_mask&expand=1043)
2914#[inline]
2915#[target_feature(enable = "avx512bw,avx512vl")]
2916#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2917#[cfg_attr(test, assert_instr(vpcmp))]
2918#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2919pub const fn _mm256_mask_cmplt_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
2920    _mm256_mask_cmp_epi8_mask::<_MM_CMPINT_LT>(k1, a, b)
2921}
2922
2923/// Compare packed signed 8-bit integers in a and b for less-than, and store the results in mask vector k.
2924///
2925/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmplt_epi8_mask&expand=1040)
2926#[inline]
2927#[target_feature(enable = "avx512bw,avx512vl")]
2928#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2929#[cfg_attr(test, assert_instr(vpcmp))]
2930#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2931pub const fn _mm_cmplt_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 {
2932    unsafe { simd_bitmask::<i8x16, _>(simd_lt(a.as_i8x16(), b.as_i8x16())) }
2933}
2934
2935/// 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).
2936///
2937/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmplt_epi8_mask&expand=1041)
2938#[inline]
2939#[target_feature(enable = "avx512bw,avx512vl")]
2940#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2941#[cfg_attr(test, assert_instr(vpcmp))]
2942#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2943pub const fn _mm_mask_cmplt_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
2944    _mm_mask_cmp_epi8_mask::<_MM_CMPINT_LT>(k1, a, b)
2945}
2946
2947/// Compare packed unsigned 16-bit integers in a and b for greater-than, and store the results in mask vector k.
2948///
2949/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpgt_epu16_mask&expand=927)
2950#[inline]
2951#[target_feature(enable = "avx512bw")]
2952#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2953#[cfg_attr(test, assert_instr(vpcmp))]
2954#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2955pub const fn _mm512_cmpgt_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 {
2956    unsafe { simd_bitmask::<u16x32, _>(simd_gt(a.as_u16x32(), b.as_u16x32())) }
2957}
2958
2959/// 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).
2960///
2961/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpgt_epu16_mask&expand=928)
2962#[inline]
2963#[target_feature(enable = "avx512bw")]
2964#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2965#[cfg_attr(test, assert_instr(vpcmp))]
2966#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2967pub const fn _mm512_mask_cmpgt_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
2968    _mm512_mask_cmp_epu16_mask::<_MM_CMPINT_NLE>(k1, a, b)
2969}
2970
2971/// Compare packed unsigned 16-bit integers in a and b for greater-than, and store the results in mask vector k.
2972///
2973/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpgt_epu16_mask&expand=925)
2974#[inline]
2975#[target_feature(enable = "avx512bw,avx512vl")]
2976#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2977#[cfg_attr(test, assert_instr(vpcmp))]
2978#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2979pub const fn _mm256_cmpgt_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 {
2980    unsafe { simd_bitmask::<u16x16, _>(simd_gt(a.as_u16x16(), b.as_u16x16())) }
2981}
2982
2983/// 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).
2984///
2985/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpgt_epu16_mask&expand=926)
2986#[inline]
2987#[target_feature(enable = "avx512bw,avx512vl")]
2988#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2989#[cfg_attr(test, assert_instr(vpcmp))]
2990#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
2991pub const fn _mm256_mask_cmpgt_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
2992    _mm256_mask_cmp_epu16_mask::<_MM_CMPINT_NLE>(k1, a, b)
2993}
2994
2995/// Compare packed unsigned 16-bit integers in a and b for greater-than, and store the results in mask vector k.
2996///
2997/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpgt_epu16_mask&expand=923)
2998#[inline]
2999#[target_feature(enable = "avx512bw,avx512vl")]
3000#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3001#[cfg_attr(test, assert_instr(vpcmp))]
3002#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3003pub const fn _mm_cmpgt_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 {
3004    unsafe { simd_bitmask::<u16x8, _>(simd_gt(a.as_u16x8(), b.as_u16x8())) }
3005}
3006
3007/// 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).
3008///
3009/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpgt_epu16_mask&expand=924)
3010#[inline]
3011#[target_feature(enable = "avx512bw,avx512vl")]
3012#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3013#[cfg_attr(test, assert_instr(vpcmp))]
3014#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3015pub const fn _mm_mask_cmpgt_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
3016    _mm_mask_cmp_epu16_mask::<_MM_CMPINT_NLE>(k1, a, b)
3017}
3018
3019/// Compare packed unsigned 8-bit integers in a and b for greater-than, and store the results in mask vector k.
3020///
3021/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpgt_epu8_mask&expand=945)
3022#[inline]
3023#[target_feature(enable = "avx512bw")]
3024#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3025#[cfg_attr(test, assert_instr(vpcmp))]
3026#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3027pub const fn _mm512_cmpgt_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 {
3028    unsafe { simd_bitmask::<u8x64, _>(simd_gt(a.as_u8x64(), b.as_u8x64())) }
3029}
3030
3031/// 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).
3032///
3033/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpgt_epu8_mask&expand=946)
3034#[inline]
3035#[target_feature(enable = "avx512bw")]
3036#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3037#[cfg_attr(test, assert_instr(vpcmp))]
3038#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3039pub const fn _mm512_mask_cmpgt_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
3040    _mm512_mask_cmp_epu8_mask::<_MM_CMPINT_NLE>(k1, a, b)
3041}
3042
3043/// Compare packed unsigned 8-bit integers in a and b for greater-than, and store the results in mask vector k.
3044///
3045/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpgt_epu8_mask&expand=943)
3046#[inline]
3047#[target_feature(enable = "avx512bw,avx512vl")]
3048#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3049#[cfg_attr(test, assert_instr(vpcmp))]
3050#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3051pub const fn _mm256_cmpgt_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 {
3052    unsafe { simd_bitmask::<u8x32, _>(simd_gt(a.as_u8x32(), b.as_u8x32())) }
3053}
3054
3055/// 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).
3056///
3057/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpgt_epu8_mask&expand=944)
3058#[inline]
3059#[target_feature(enable = "avx512bw,avx512vl")]
3060#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3061#[cfg_attr(test, assert_instr(vpcmp))]
3062#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3063pub const fn _mm256_mask_cmpgt_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
3064    _mm256_mask_cmp_epu8_mask::<_MM_CMPINT_NLE>(k1, a, b)
3065}
3066
3067/// Compare packed unsigned 8-bit integers in a and b for greater-than, and store the results in mask vector k.
3068///
3069/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpgt_epu8_mask&expand=941)
3070#[inline]
3071#[target_feature(enable = "avx512bw,avx512vl")]
3072#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3073#[cfg_attr(test, assert_instr(vpcmp))]
3074#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3075pub const fn _mm_cmpgt_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 {
3076    unsafe { simd_bitmask::<u8x16, _>(simd_gt(a.as_u8x16(), b.as_u8x16())) }
3077}
3078
3079/// 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).
3080///
3081/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpgt_epu8_mask&expand=942)
3082#[inline]
3083#[target_feature(enable = "avx512bw,avx512vl")]
3084#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3085#[cfg_attr(test, assert_instr(vpcmp))]
3086#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3087pub const fn _mm_mask_cmpgt_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
3088    _mm_mask_cmp_epu8_mask::<_MM_CMPINT_NLE>(k1, a, b)
3089}
3090
3091/// Compare packed signed 16-bit integers in a and b for greater-than, and store the results in mask vector k.
3092///
3093/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpgt_epi16_mask&expand=897)
3094#[inline]
3095#[target_feature(enable = "avx512bw")]
3096#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3097#[cfg_attr(test, assert_instr(vpcmp))]
3098#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3099pub const fn _mm512_cmpgt_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 {
3100    unsafe { simd_bitmask::<i16x32, _>(simd_gt(a.as_i16x32(), b.as_i16x32())) }
3101}
3102
3103/// 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).
3104///
3105/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpgt_epi16_mask&expand=898)
3106#[inline]
3107#[target_feature(enable = "avx512bw")]
3108#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3109#[cfg_attr(test, assert_instr(vpcmp))]
3110#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3111pub const fn _mm512_mask_cmpgt_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
3112    _mm512_mask_cmp_epi16_mask::<_MM_CMPINT_NLE>(k1, a, b)
3113}
3114
3115/// Compare packed signed 16-bit integers in a and b for greater-than, and store the results in mask vector k.
3116///
3117/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpgt_epi16_mask&expand=895)
3118#[inline]
3119#[target_feature(enable = "avx512bw,avx512vl")]
3120#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3121#[cfg_attr(test, assert_instr(vpcmp))]
3122#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3123pub const fn _mm256_cmpgt_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 {
3124    unsafe { simd_bitmask::<i16x16, _>(simd_gt(a.as_i16x16(), b.as_i16x16())) }
3125}
3126
3127/// 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).
3128///
3129/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpgt_epi16_mask&expand=896)
3130#[inline]
3131#[target_feature(enable = "avx512bw,avx512vl")]
3132#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3133#[cfg_attr(test, assert_instr(vpcmp))]
3134#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3135pub const fn _mm256_mask_cmpgt_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
3136    _mm256_mask_cmp_epi16_mask::<_MM_CMPINT_NLE>(k1, a, b)
3137}
3138
3139/// Compare packed signed 16-bit integers in a and b for greater-than, and store the results in mask vector k.
3140///
3141/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpgt_epi16_mask&expand=893)
3142#[inline]
3143#[target_feature(enable = "avx512bw,avx512vl")]
3144#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3145#[cfg_attr(test, assert_instr(vpcmp))]
3146#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3147pub const fn _mm_cmpgt_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 {
3148    unsafe { simd_bitmask::<i16x8, _>(simd_gt(a.as_i16x8(), b.as_i16x8())) }
3149}
3150
3151/// 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).
3152///
3153/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpgt_epi16_mask&expand=894)
3154#[inline]
3155#[target_feature(enable = "avx512bw,avx512vl")]
3156#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3157#[cfg_attr(test, assert_instr(vpcmp))]
3158#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3159pub const fn _mm_mask_cmpgt_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
3160    _mm_mask_cmp_epi16_mask::<_MM_CMPINT_NLE>(k1, a, b)
3161}
3162
3163/// Compare packed signed 8-bit integers in a and b for greater-than, and store the results in mask vector k.
3164///
3165/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpgt_epi8_mask&expand=921)
3166#[inline]
3167#[target_feature(enable = "avx512bw")]
3168#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3169#[cfg_attr(test, assert_instr(vpcmp))]
3170#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3171pub const fn _mm512_cmpgt_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 {
3172    unsafe { simd_bitmask::<i8x64, _>(simd_gt(a.as_i8x64(), b.as_i8x64())) }
3173}
3174
3175/// 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).
3176///
3177/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpgt_epi8_mask&expand=922)
3178#[inline]
3179#[target_feature(enable = "avx512bw")]
3180#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3181#[cfg_attr(test, assert_instr(vpcmp))]
3182#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3183pub const fn _mm512_mask_cmpgt_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
3184    _mm512_mask_cmp_epi8_mask::<_MM_CMPINT_NLE>(k1, a, b)
3185}
3186
3187/// Compare packed signed 8-bit integers in a and b for greater-than, and store the results in mask vector k.
3188///
3189/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpgt_epi8_mask&expand=919)
3190#[inline]
3191#[target_feature(enable = "avx512bw,avx512vl")]
3192#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3193#[cfg_attr(test, assert_instr(vpcmp))]
3194#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3195pub const fn _mm256_cmpgt_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 {
3196    unsafe { simd_bitmask::<i8x32, _>(simd_gt(a.as_i8x32(), b.as_i8x32())) }
3197}
3198
3199/// 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).
3200///
3201/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpgt_epi8_mask&expand=920)
3202#[inline]
3203#[target_feature(enable = "avx512bw,avx512vl")]
3204#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3205#[cfg_attr(test, assert_instr(vpcmp))]
3206#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3207pub const fn _mm256_mask_cmpgt_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
3208    _mm256_mask_cmp_epi8_mask::<_MM_CMPINT_NLE>(k1, a, b)
3209}
3210
3211/// Compare packed signed 8-bit integers in a and b for greater-than, and store the results in mask vector k.
3212///
3213/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpgt_epi8_mask&expand=917)
3214#[inline]
3215#[target_feature(enable = "avx512bw,avx512vl")]
3216#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3217#[cfg_attr(test, assert_instr(vpcmp))]
3218#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3219pub const fn _mm_cmpgt_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 {
3220    unsafe { simd_bitmask::<i8x16, _>(simd_gt(a.as_i8x16(), b.as_i8x16())) }
3221}
3222
3223/// 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).
3224///
3225/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpgt_epi8_mask&expand=918)
3226#[inline]
3227#[target_feature(enable = "avx512bw,avx512vl")]
3228#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3229#[cfg_attr(test, assert_instr(vpcmp))]
3230#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3231pub const fn _mm_mask_cmpgt_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
3232    _mm_mask_cmp_epi8_mask::<_MM_CMPINT_NLE>(k1, a, b)
3233}
3234
3235/// Compare packed unsigned 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
3236///
3237/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmple_epu16_mask&expand=989)
3238#[inline]
3239#[target_feature(enable = "avx512bw")]
3240#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3241#[cfg_attr(test, assert_instr(vpcmp))]
3242#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3243pub const fn _mm512_cmple_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 {
3244    unsafe { simd_bitmask::<u16x32, _>(simd_le(a.as_u16x32(), b.as_u16x32())) }
3245}
3246
3247/// 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).
3248///
3249/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmple_epu16_mask&expand=990)
3250#[inline]
3251#[target_feature(enable = "avx512bw")]
3252#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3253#[cfg_attr(test, assert_instr(vpcmp))]
3254#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3255pub const fn _mm512_mask_cmple_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
3256    _mm512_mask_cmp_epu16_mask::<_MM_CMPINT_LE>(k1, a, b)
3257}
3258
3259/// Compare packed unsigned 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
3260///
3261/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmple_epu16_mask&expand=987)
3262#[inline]
3263#[target_feature(enable = "avx512bw,avx512vl")]
3264#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3265#[cfg_attr(test, assert_instr(vpcmp))]
3266#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3267pub const fn _mm256_cmple_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 {
3268    unsafe { simd_bitmask::<u16x16, _>(simd_le(a.as_u16x16(), b.as_u16x16())) }
3269}
3270
3271/// 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).
3272///
3273/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmple_epu16_mask&expand=988)
3274#[inline]
3275#[target_feature(enable = "avx512bw,avx512vl")]
3276#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3277#[cfg_attr(test, assert_instr(vpcmp))]
3278#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3279pub const fn _mm256_mask_cmple_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
3280    _mm256_mask_cmp_epu16_mask::<_MM_CMPINT_LE>(k1, a, b)
3281}
3282
3283/// Compare packed unsigned 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
3284///
3285/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmple_epu16_mask&expand=985)
3286#[inline]
3287#[target_feature(enable = "avx512bw,avx512vl")]
3288#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3289#[cfg_attr(test, assert_instr(vpcmp))]
3290#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3291pub const fn _mm_cmple_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 {
3292    unsafe { simd_bitmask::<u16x8, _>(simd_le(a.as_u16x8(), b.as_u16x8())) }
3293}
3294
3295/// 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).
3296///
3297/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmple_epu16_mask&expand=986)
3298#[inline]
3299#[target_feature(enable = "avx512bw,avx512vl")]
3300#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3301#[cfg_attr(test, assert_instr(vpcmp))]
3302#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3303pub const fn _mm_mask_cmple_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
3304    _mm_mask_cmp_epu16_mask::<_MM_CMPINT_LE>(k1, a, b)
3305}
3306
3307/// Compare packed unsigned 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
3308///
3309/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmple_epu8_mask&expand=1007)
3310#[inline]
3311#[target_feature(enable = "avx512bw")]
3312#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3313#[cfg_attr(test, assert_instr(vpcmp))]
3314#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3315pub const fn _mm512_cmple_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 {
3316    unsafe { simd_bitmask::<u8x64, _>(simd_le(a.as_u8x64(), b.as_u8x64())) }
3317}
3318
3319/// 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).
3320///
3321/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmple_epu8_mask&expand=1008)
3322#[inline]
3323#[target_feature(enable = "avx512bw")]
3324#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3325#[cfg_attr(test, assert_instr(vpcmp))]
3326#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3327pub const fn _mm512_mask_cmple_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
3328    _mm512_mask_cmp_epu8_mask::<_MM_CMPINT_LE>(k1, a, b)
3329}
3330
3331/// Compare packed unsigned 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
3332///
3333/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmple_epu8_mask&expand=1005)
3334#[inline]
3335#[target_feature(enable = "avx512bw,avx512vl")]
3336#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3337#[cfg_attr(test, assert_instr(vpcmp))]
3338#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3339pub const fn _mm256_cmple_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 {
3340    unsafe { simd_bitmask::<u8x32, _>(simd_le(a.as_u8x32(), b.as_u8x32())) }
3341}
3342
3343/// 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).
3344///
3345/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmple_epu8_mask&expand=1006)
3346#[inline]
3347#[target_feature(enable = "avx512bw,avx512vl")]
3348#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3349#[cfg_attr(test, assert_instr(vpcmp))]
3350#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3351pub const fn _mm256_mask_cmple_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
3352    _mm256_mask_cmp_epu8_mask::<_MM_CMPINT_LE>(k1, a, b)
3353}
3354
3355/// Compare packed unsigned 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
3356///
3357/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmple_epu8_mask&expand=1003)
3358#[inline]
3359#[target_feature(enable = "avx512bw,avx512vl")]
3360#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3361#[cfg_attr(test, assert_instr(vpcmp))]
3362#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3363pub const fn _mm_cmple_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 {
3364    unsafe { simd_bitmask::<u8x16, _>(simd_le(a.as_u8x16(), b.as_u8x16())) }
3365}
3366
3367/// 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).
3368///
3369/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmple_epu8_mask&expand=1004)
3370#[inline]
3371#[target_feature(enable = "avx512bw,avx512vl")]
3372#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3373#[cfg_attr(test, assert_instr(vpcmp))]
3374#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3375pub const fn _mm_mask_cmple_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
3376    _mm_mask_cmp_epu8_mask::<_MM_CMPINT_LE>(k1, a, b)
3377}
3378
3379/// Compare packed signed 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
3380///
3381/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmple_epi16_mask&expand=965)
3382#[inline]
3383#[target_feature(enable = "avx512bw")]
3384#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3385#[cfg_attr(test, assert_instr(vpcmp))]
3386#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3387pub const fn _mm512_cmple_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 {
3388    unsafe { simd_bitmask::<i16x32, _>(simd_le(a.as_i16x32(), b.as_i16x32())) }
3389}
3390
3391/// 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).
3392///
3393/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmple_epi16_mask&expand=966)
3394#[inline]
3395#[target_feature(enable = "avx512bw")]
3396#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3397#[cfg_attr(test, assert_instr(vpcmp))]
3398#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3399pub const fn _mm512_mask_cmple_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
3400    _mm512_mask_cmp_epi16_mask::<_MM_CMPINT_LE>(k1, a, b)
3401}
3402
3403/// Compare packed signed 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
3404///
3405/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmple_epi16_mask&expand=963)
3406#[inline]
3407#[target_feature(enable = "avx512bw,avx512vl")]
3408#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3409#[cfg_attr(test, assert_instr(vpcmp))]
3410#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3411pub const fn _mm256_cmple_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 {
3412    unsafe { simd_bitmask::<i16x16, _>(simd_le(a.as_i16x16(), b.as_i16x16())) }
3413}
3414
3415/// 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).
3416///
3417/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmple_epi16_mask&expand=964)
3418#[inline]
3419#[target_feature(enable = "avx512bw,avx512vl")]
3420#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3421#[cfg_attr(test, assert_instr(vpcmp))]
3422#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3423pub const fn _mm256_mask_cmple_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
3424    _mm256_mask_cmp_epi16_mask::<_MM_CMPINT_LE>(k1, a, b)
3425}
3426
3427/// Compare packed signed 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
3428///
3429/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmple_epi16_mask&expand=961)
3430#[inline]
3431#[target_feature(enable = "avx512bw,avx512vl")]
3432#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3433#[cfg_attr(test, assert_instr(vpcmp))]
3434#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3435pub const fn _mm_cmple_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 {
3436    unsafe { simd_bitmask::<i16x8, _>(simd_le(a.as_i16x8(), b.as_i16x8())) }
3437}
3438
3439/// 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).
3440///
3441/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmple_epi16_mask&expand=962)
3442#[inline]
3443#[target_feature(enable = "avx512bw,avx512vl")]
3444#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3445#[cfg_attr(test, assert_instr(vpcmp))]
3446#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3447pub const fn _mm_mask_cmple_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
3448    _mm_mask_cmp_epi16_mask::<_MM_CMPINT_LE>(k1, a, b)
3449}
3450
3451/// Compare packed signed 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
3452///
3453/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmple_epi8_mask&expand=983)
3454#[inline]
3455#[target_feature(enable = "avx512bw")]
3456#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3457#[cfg_attr(test, assert_instr(vpcmp))]
3458#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3459pub const fn _mm512_cmple_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 {
3460    unsafe { simd_bitmask::<i8x64, _>(simd_le(a.as_i8x64(), b.as_i8x64())) }
3461}
3462
3463/// 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).
3464///
3465/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmple_epi8_mask&expand=984)
3466#[inline]
3467#[target_feature(enable = "avx512bw")]
3468#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3469#[cfg_attr(test, assert_instr(vpcmp))]
3470#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3471pub const fn _mm512_mask_cmple_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
3472    _mm512_mask_cmp_epi8_mask::<_MM_CMPINT_LE>(k1, a, b)
3473}
3474
3475/// Compare packed signed 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
3476///
3477/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmple_epi8_mask&expand=981)
3478#[inline]
3479#[target_feature(enable = "avx512bw,avx512vl")]
3480#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3481#[cfg_attr(test, assert_instr(vpcmp))]
3482#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3483pub const fn _mm256_cmple_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 {
3484    unsafe { simd_bitmask::<i8x32, _>(simd_le(a.as_i8x32(), b.as_i8x32())) }
3485}
3486
3487/// 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).
3488///
3489/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmple_epi8_mask&expand=982)
3490#[inline]
3491#[target_feature(enable = "avx512bw,avx512vl")]
3492#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3493#[cfg_attr(test, assert_instr(vpcmp))]
3494#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3495pub const fn _mm256_mask_cmple_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
3496    _mm256_mask_cmp_epi8_mask::<_MM_CMPINT_LE>(k1, a, b)
3497}
3498
3499/// Compare packed signed 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
3500///
3501/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmple_epi8_mask&expand=979)
3502#[inline]
3503#[target_feature(enable = "avx512bw,avx512vl")]
3504#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3505#[cfg_attr(test, assert_instr(vpcmp))]
3506#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3507pub const fn _mm_cmple_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 {
3508    unsafe { simd_bitmask::<i8x16, _>(simd_le(a.as_i8x16(), b.as_i8x16())) }
3509}
3510
3511/// 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).
3512///
3513/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmple_epi8_mask&expand=980)
3514#[inline]
3515#[target_feature(enable = "avx512bw,avx512vl")]
3516#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3517#[cfg_attr(test, assert_instr(vpcmp))]
3518#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3519pub const fn _mm_mask_cmple_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
3520    _mm_mask_cmp_epi8_mask::<_MM_CMPINT_LE>(k1, a, b)
3521}
3522
3523/// Compare packed unsigned 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
3524///
3525/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpge_epu16_mask&expand=867)
3526#[inline]
3527#[target_feature(enable = "avx512bw")]
3528#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3529#[cfg_attr(test, assert_instr(vpcmp))]
3530#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3531pub const fn _mm512_cmpge_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 {
3532    unsafe { simd_bitmask::<u16x32, _>(simd_ge(a.as_u16x32(), b.as_u16x32())) }
3533}
3534
3535/// 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).
3536///
3537/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpge_epu16_mask&expand=868)
3538#[inline]
3539#[target_feature(enable = "avx512bw")]
3540#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3541#[cfg_attr(test, assert_instr(vpcmp))]
3542#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3543pub const fn _mm512_mask_cmpge_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
3544    _mm512_mask_cmp_epu16_mask::<_MM_CMPINT_NLT>(k1, a, b)
3545}
3546
3547/// Compare packed unsigned 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
3548///
3549/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpge_epu16_mask&expand=865)
3550#[inline]
3551#[target_feature(enable = "avx512bw,avx512vl")]
3552#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3553#[cfg_attr(test, assert_instr(vpcmp))]
3554#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3555pub const fn _mm256_cmpge_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 {
3556    unsafe { simd_bitmask::<u16x16, _>(simd_ge(a.as_u16x16(), b.as_u16x16())) }
3557}
3558
3559/// 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).
3560///
3561/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpge_epu16_mask&expand=866)
3562#[inline]
3563#[target_feature(enable = "avx512bw,avx512vl")]
3564#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3565#[cfg_attr(test, assert_instr(vpcmp))]
3566#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3567pub const fn _mm256_mask_cmpge_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
3568    _mm256_mask_cmp_epu16_mask::<_MM_CMPINT_NLT>(k1, a, b)
3569}
3570
3571/// Compare packed unsigned 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
3572///
3573/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpge_epu16_mask&expand=863)
3574#[inline]
3575#[target_feature(enable = "avx512bw,avx512vl")]
3576#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3577#[cfg_attr(test, assert_instr(vpcmp))]
3578#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3579pub const fn _mm_cmpge_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 {
3580    unsafe { simd_bitmask::<u16x8, _>(simd_ge(a.as_u16x8(), b.as_u16x8())) }
3581}
3582
3583/// 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).
3584///
3585/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpge_epu16_mask&expand=864)
3586#[inline]
3587#[target_feature(enable = "avx512bw,avx512vl")]
3588#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3589#[cfg_attr(test, assert_instr(vpcmp))]
3590#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3591pub const fn _mm_mask_cmpge_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
3592    _mm_mask_cmp_epu16_mask::<_MM_CMPINT_NLT>(k1, a, b)
3593}
3594
3595/// Compare packed unsigned 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
3596///
3597/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpge_epu8_mask&expand=885)
3598#[inline]
3599#[target_feature(enable = "avx512bw")]
3600#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3601#[cfg_attr(test, assert_instr(vpcmp))]
3602#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3603pub const fn _mm512_cmpge_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 {
3604    unsafe { simd_bitmask::<u8x64, _>(simd_ge(a.as_u8x64(), b.as_u8x64())) }
3605}
3606
3607/// 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).
3608///
3609/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpge_epu8_mask&expand=886)
3610#[inline]
3611#[target_feature(enable = "avx512bw")]
3612#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3613#[cfg_attr(test, assert_instr(vpcmp))]
3614#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3615pub const fn _mm512_mask_cmpge_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
3616    _mm512_mask_cmp_epu8_mask::<_MM_CMPINT_NLT>(k1, a, b)
3617}
3618
3619/// Compare packed unsigned 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
3620///
3621/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpge_epu8_mask&expand=883)
3622#[inline]
3623#[target_feature(enable = "avx512bw,avx512vl")]
3624#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3625#[cfg_attr(test, assert_instr(vpcmp))]
3626#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3627pub const fn _mm256_cmpge_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 {
3628    unsafe { simd_bitmask::<u8x32, _>(simd_ge(a.as_u8x32(), b.as_u8x32())) }
3629}
3630
3631/// 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).
3632///
3633/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpge_epu8_mask&expand=884)
3634#[inline]
3635#[target_feature(enable = "avx512bw,avx512vl")]
3636#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3637#[cfg_attr(test, assert_instr(vpcmp))]
3638#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3639pub const fn _mm256_mask_cmpge_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
3640    _mm256_mask_cmp_epu8_mask::<_MM_CMPINT_NLT>(k1, a, b)
3641}
3642
3643/// Compare packed unsigned 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
3644///
3645/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpge_epu8_mask&expand=881)
3646#[inline]
3647#[target_feature(enable = "avx512bw,avx512vl")]
3648#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3649#[cfg_attr(test, assert_instr(vpcmp))]
3650#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3651pub const fn _mm_cmpge_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 {
3652    unsafe { simd_bitmask::<u8x16, _>(simd_ge(a.as_u8x16(), b.as_u8x16())) }
3653}
3654
3655/// 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).
3656///
3657/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpge_epu8_mask&expand=882)
3658#[inline]
3659#[target_feature(enable = "avx512bw,avx512vl")]
3660#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3661#[cfg_attr(test, assert_instr(vpcmp))]
3662#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3663pub const fn _mm_mask_cmpge_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
3664    _mm_mask_cmp_epu8_mask::<_MM_CMPINT_NLT>(k1, a, b)
3665}
3666
3667/// Compare packed signed 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
3668///
3669/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpge_epi16_mask&expand=843)
3670#[inline]
3671#[target_feature(enable = "avx512bw")]
3672#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3673#[cfg_attr(test, assert_instr(vpcmp))]
3674#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3675pub const fn _mm512_cmpge_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 {
3676    unsafe { simd_bitmask::<i16x32, _>(simd_ge(a.as_i16x32(), b.as_i16x32())) }
3677}
3678
3679/// 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).
3680///
3681/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpge_epi16_mask&expand=844)
3682#[inline]
3683#[target_feature(enable = "avx512bw")]
3684#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3685#[cfg_attr(test, assert_instr(vpcmp))]
3686#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3687pub const fn _mm512_mask_cmpge_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
3688    _mm512_mask_cmp_epi16_mask::<_MM_CMPINT_NLT>(k1, a, b)
3689}
3690
3691/// Compare packed signed 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
3692///
3693/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpge_epi16_mask&expand=841)
3694#[inline]
3695#[target_feature(enable = "avx512bw,avx512vl")]
3696#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3697#[cfg_attr(test, assert_instr(vpcmp))]
3698#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3699pub const fn _mm256_cmpge_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 {
3700    unsafe { simd_bitmask::<i16x16, _>(simd_ge(a.as_i16x16(), b.as_i16x16())) }
3701}
3702
3703/// 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).
3704///
3705/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpge_epi16_mask&expand=842)
3706#[inline]
3707#[target_feature(enable = "avx512bw,avx512vl")]
3708#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3709#[cfg_attr(test, assert_instr(vpcmp))]
3710#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3711pub const fn _mm256_mask_cmpge_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
3712    _mm256_mask_cmp_epi16_mask::<_MM_CMPINT_NLT>(k1, a, b)
3713}
3714
3715/// Compare packed signed 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
3716///
3717/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpge_epi16_mask&expand=839)
3718#[inline]
3719#[target_feature(enable = "avx512bw,avx512vl")]
3720#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3721#[cfg_attr(test, assert_instr(vpcmp))]
3722#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3723pub const fn _mm_cmpge_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 {
3724    unsafe { simd_bitmask::<i16x8, _>(simd_ge(a.as_i16x8(), b.as_i16x8())) }
3725}
3726
3727/// 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).
3728///
3729/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpge_epi16_mask&expand=840)
3730#[inline]
3731#[target_feature(enable = "avx512bw,avx512vl")]
3732#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3733#[cfg_attr(test, assert_instr(vpcmp))]
3734#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3735pub const fn _mm_mask_cmpge_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
3736    _mm_mask_cmp_epi16_mask::<_MM_CMPINT_NLT>(k1, a, b)
3737}
3738
3739/// Compare packed signed 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
3740///
3741/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpge_epi8_mask&expand=861)
3742#[inline]
3743#[target_feature(enable = "avx512bw")]
3744#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3745#[cfg_attr(test, assert_instr(vpcmp))]
3746#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3747pub const fn _mm512_cmpge_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 {
3748    unsafe { simd_bitmask::<i8x64, _>(simd_ge(a.as_i8x64(), b.as_i8x64())) }
3749}
3750
3751/// 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).
3752///
3753/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpge_epi8_mask&expand=862)
3754#[inline]
3755#[target_feature(enable = "avx512bw")]
3756#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3757#[cfg_attr(test, assert_instr(vpcmp))]
3758#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3759pub const fn _mm512_mask_cmpge_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
3760    _mm512_mask_cmp_epi8_mask::<_MM_CMPINT_NLT>(k1, a, b)
3761}
3762
3763/// Compare packed signed 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
3764///
3765/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpge_epi8_mask&expand=859)
3766#[inline]
3767#[target_feature(enable = "avx512bw,avx512vl")]
3768#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3769#[cfg_attr(test, assert_instr(vpcmp))]
3770#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3771pub const fn _mm256_cmpge_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 {
3772    unsafe { simd_bitmask::<i8x32, _>(simd_ge(a.as_i8x32(), b.as_i8x32())) }
3773}
3774
3775/// 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).
3776///
3777/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpge_epi8_mask&expand=860)
3778#[inline]
3779#[target_feature(enable = "avx512bw,avx512vl")]
3780#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3781#[cfg_attr(test, assert_instr(vpcmp))]
3782#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3783pub const fn _mm256_mask_cmpge_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
3784    _mm256_mask_cmp_epi8_mask::<_MM_CMPINT_NLT>(k1, a, b)
3785}
3786
3787/// Compare packed signed 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
3788///
3789/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpge_epi8_mask&expand=857)
3790#[inline]
3791#[target_feature(enable = "avx512bw,avx512vl")]
3792#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3793#[cfg_attr(test, assert_instr(vpcmp))]
3794#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3795pub const fn _mm_cmpge_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 {
3796    unsafe { simd_bitmask::<i8x16, _>(simd_ge(a.as_i8x16(), b.as_i8x16())) }
3797}
3798
3799/// 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).
3800///
3801/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpge_epi8_mask&expand=858)
3802#[inline]
3803#[target_feature(enable = "avx512bw,avx512vl")]
3804#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3805#[cfg_attr(test, assert_instr(vpcmp))]
3806#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3807pub const fn _mm_mask_cmpge_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
3808    _mm_mask_cmp_epi8_mask::<_MM_CMPINT_NLT>(k1, a, b)
3809}
3810
3811/// Compare packed unsigned 16-bit integers in a and b for equality, and store the results in mask vector k.
3812///
3813/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpeq_epu16_mask&expand=801)
3814#[inline]
3815#[target_feature(enable = "avx512bw")]
3816#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3817#[cfg_attr(test, assert_instr(vpcmp))]
3818#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3819pub const fn _mm512_cmpeq_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 {
3820    unsafe { simd_bitmask::<u16x32, _>(simd_eq(a.as_u16x32(), b.as_u16x32())) }
3821}
3822
3823/// 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).
3824///
3825/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpeq_epu16_mask&expand=802)
3826#[inline]
3827#[target_feature(enable = "avx512bw")]
3828#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3829#[cfg_attr(test, assert_instr(vpcmp))]
3830#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3831pub const fn _mm512_mask_cmpeq_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
3832    _mm512_mask_cmp_epu16_mask::<_MM_CMPINT_EQ>(k1, a, b)
3833}
3834
3835/// Compare packed unsigned 16-bit integers in a and b for equality, and store the results in mask vector k.
3836///
3837/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpeq_epu16_mask&expand=799)
3838#[inline]
3839#[target_feature(enable = "avx512bw,avx512vl")]
3840#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3841#[cfg_attr(test, assert_instr(vpcmp))]
3842#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3843pub const fn _mm256_cmpeq_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 {
3844    unsafe { simd_bitmask::<u16x16, _>(simd_eq(a.as_u16x16(), b.as_u16x16())) }
3845}
3846
3847/// 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).
3848///
3849/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpeq_epu16_mask&expand=800)
3850#[inline]
3851#[target_feature(enable = "avx512bw,avx512vl")]
3852#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3853#[cfg_attr(test, assert_instr(vpcmp))]
3854#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3855pub const fn _mm256_mask_cmpeq_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
3856    _mm256_mask_cmp_epu16_mask::<_MM_CMPINT_EQ>(k1, a, b)
3857}
3858
3859/// Compare packed unsigned 16-bit integers in a and b for equality, and store the results in mask vector k.
3860///
3861/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpeq_epu16_mask&expand=797)
3862#[inline]
3863#[target_feature(enable = "avx512bw,avx512vl")]
3864#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3865#[cfg_attr(test, assert_instr(vpcmp))]
3866#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3867pub const fn _mm_cmpeq_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 {
3868    unsafe { simd_bitmask::<u16x8, _>(simd_eq(a.as_u16x8(), b.as_u16x8())) }
3869}
3870
3871/// 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).
3872///
3873/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpeq_epu16_mask&expand=798)
3874#[inline]
3875#[target_feature(enable = "avx512bw,avx512vl")]
3876#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3877#[cfg_attr(test, assert_instr(vpcmp))]
3878#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3879pub const fn _mm_mask_cmpeq_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
3880    _mm_mask_cmp_epu16_mask::<_MM_CMPINT_EQ>(k1, a, b)
3881}
3882
3883/// Compare packed unsigned 8-bit integers in a and b for equality, and store the results in mask vector k.
3884///
3885/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpeq_epu8_mask&expand=819)
3886#[inline]
3887#[target_feature(enable = "avx512bw")]
3888#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3889#[cfg_attr(test, assert_instr(vpcmp))]
3890#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3891pub const fn _mm512_cmpeq_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 {
3892    unsafe { simd_bitmask::<u8x64, _>(simd_eq(a.as_u8x64(), b.as_u8x64())) }
3893}
3894
3895/// 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).
3896///
3897/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpeq_epu8_mask&expand=820)
3898#[inline]
3899#[target_feature(enable = "avx512bw")]
3900#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3901#[cfg_attr(test, assert_instr(vpcmp))]
3902#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3903pub const fn _mm512_mask_cmpeq_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
3904    _mm512_mask_cmp_epu8_mask::<_MM_CMPINT_EQ>(k1, a, b)
3905}
3906
3907/// Compare packed unsigned 8-bit integers in a and b for equality, and store the results in mask vector k.
3908///
3909/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpeq_epu8_mask&expand=817)
3910#[inline]
3911#[target_feature(enable = "avx512bw,avx512vl")]
3912#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3913#[cfg_attr(test, assert_instr(vpcmp))]
3914#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3915pub const fn _mm256_cmpeq_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 {
3916    unsafe { simd_bitmask::<u8x32, _>(simd_eq(a.as_u8x32(), b.as_u8x32())) }
3917}
3918
3919/// 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).
3920///
3921/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpeq_epu8_mask&expand=818)
3922#[inline]
3923#[target_feature(enable = "avx512bw,avx512vl")]
3924#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3925#[cfg_attr(test, assert_instr(vpcmp))]
3926#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3927pub const fn _mm256_mask_cmpeq_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
3928    _mm256_mask_cmp_epu8_mask::<_MM_CMPINT_EQ>(k1, a, b)
3929}
3930
3931/// Compare packed unsigned 8-bit integers in a and b for equality, and store the results in mask vector k.
3932///
3933/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpeq_epu8_mask&expand=815)
3934#[inline]
3935#[target_feature(enable = "avx512bw,avx512vl")]
3936#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3937#[cfg_attr(test, assert_instr(vpcmp))]
3938#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3939pub const fn _mm_cmpeq_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 {
3940    unsafe { simd_bitmask::<u8x16, _>(simd_eq(a.as_u8x16(), b.as_u8x16())) }
3941}
3942
3943/// 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).
3944///
3945/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpeq_epu8_mask&expand=816)
3946#[inline]
3947#[target_feature(enable = "avx512bw,avx512vl")]
3948#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3949#[cfg_attr(test, assert_instr(vpcmp))]
3950#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3951pub const fn _mm_mask_cmpeq_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
3952    _mm_mask_cmp_epu8_mask::<_MM_CMPINT_EQ>(k1, a, b)
3953}
3954
3955/// Compare packed signed 16-bit integers in a and b for equality, and store the results in mask vector k.
3956///
3957/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpeq_epi16_mask&expand=771)
3958#[inline]
3959#[target_feature(enable = "avx512bw")]
3960#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3961#[cfg_attr(test, assert_instr(vpcmp))]
3962#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3963pub const fn _mm512_cmpeq_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 {
3964    unsafe { simd_bitmask::<i16x32, _>(simd_eq(a.as_i16x32(), b.as_i16x32())) }
3965}
3966
3967/// 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).
3968///
3969/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpeq_epi16_mask&expand=772)
3970#[inline]
3971#[target_feature(enable = "avx512bw")]
3972#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3973#[cfg_attr(test, assert_instr(vpcmp))]
3974#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3975pub const fn _mm512_mask_cmpeq_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
3976    _mm512_mask_cmp_epi16_mask::<_MM_CMPINT_EQ>(k1, a, b)
3977}
3978
3979/// Compare packed signed 16-bit integers in a and b for equality, and store the results in mask vector k.
3980///
3981/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpeq_epi16_mask&expand=769)
3982#[inline]
3983#[target_feature(enable = "avx512bw,avx512vl")]
3984#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3985#[cfg_attr(test, assert_instr(vpcmp))]
3986#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3987pub const fn _mm256_cmpeq_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 {
3988    unsafe { simd_bitmask::<i16x16, _>(simd_eq(a.as_i16x16(), b.as_i16x16())) }
3989}
3990
3991/// 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).
3992///
3993/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpeq_epi16_mask&expand=770)
3994#[inline]
3995#[target_feature(enable = "avx512bw,avx512vl")]
3996#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
3997#[cfg_attr(test, assert_instr(vpcmp))]
3998#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
3999pub const fn _mm256_mask_cmpeq_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
4000    _mm256_mask_cmp_epi16_mask::<_MM_CMPINT_EQ>(k1, a, b)
4001}
4002
4003/// Compare packed signed 16-bit integers in a and b for equality, and store the results in mask vector k.
4004///
4005/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpeq_epi16_mask&expand=767)
4006#[inline]
4007#[target_feature(enable = "avx512bw,avx512vl")]
4008#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4009#[cfg_attr(test, assert_instr(vpcmp))]
4010#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4011pub const fn _mm_cmpeq_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 {
4012    unsafe { simd_bitmask::<i16x8, _>(simd_eq(a.as_i16x8(), b.as_i16x8())) }
4013}
4014
4015/// 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).
4016///
4017/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpeq_epi16_mask&expand=768)
4018#[inline]
4019#[target_feature(enable = "avx512bw,avx512vl")]
4020#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4021#[cfg_attr(test, assert_instr(vpcmp))]
4022#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4023pub const fn _mm_mask_cmpeq_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
4024    _mm_mask_cmp_epi16_mask::<_MM_CMPINT_EQ>(k1, a, b)
4025}
4026
4027/// Compare packed signed 8-bit integers in a and b for equality, and store the results in mask vector k.
4028///
4029/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpeq_epi8_mask&expand=795)
4030#[inline]
4031#[target_feature(enable = "avx512bw")]
4032#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4033#[cfg_attr(test, assert_instr(vpcmp))]
4034#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4035pub const fn _mm512_cmpeq_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 {
4036    unsafe { simd_bitmask::<i8x64, _>(simd_eq(a.as_i8x64(), b.as_i8x64())) }
4037}
4038
4039/// 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).
4040///
4041/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpeq_epi8_mask&expand=796)
4042#[inline]
4043#[target_feature(enable = "avx512bw")]
4044#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4045#[cfg_attr(test, assert_instr(vpcmp))]
4046#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4047pub const fn _mm512_mask_cmpeq_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
4048    _mm512_mask_cmp_epi8_mask::<_MM_CMPINT_EQ>(k1, a, b)
4049}
4050
4051/// Compare packed signed 8-bit integers in a and b for equality, and store the results in mask vector k.
4052///
4053/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpeq_epi8_mask&expand=793)
4054#[inline]
4055#[target_feature(enable = "avx512bw,avx512vl")]
4056#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4057#[cfg_attr(test, assert_instr(vpcmp))]
4058#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4059pub const fn _mm256_cmpeq_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 {
4060    unsafe { simd_bitmask::<i8x32, _>(simd_eq(a.as_i8x32(), b.as_i8x32())) }
4061}
4062
4063/// 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).
4064///
4065/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpeq_epi8_mask&expand=794)
4066#[inline]
4067#[target_feature(enable = "avx512bw,avx512vl")]
4068#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4069#[cfg_attr(test, assert_instr(vpcmp))]
4070#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4071pub const fn _mm256_mask_cmpeq_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
4072    _mm256_mask_cmp_epi8_mask::<_MM_CMPINT_EQ>(k1, a, b)
4073}
4074
4075/// Compare packed signed 8-bit integers in a and b for equality, and store the results in mask vector k.
4076///
4077/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpeq_epi8_mask&expand=791)
4078#[inline]
4079#[target_feature(enable = "avx512bw,avx512vl")]
4080#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4081#[cfg_attr(test, assert_instr(vpcmp))]
4082#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4083pub const fn _mm_cmpeq_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 {
4084    unsafe { simd_bitmask::<i8x16, _>(simd_eq(a.as_i8x16(), b.as_i8x16())) }
4085}
4086
4087/// 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).
4088///
4089/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpeq_epi8_mask&expand=792)
4090#[inline]
4091#[target_feature(enable = "avx512bw,avx512vl")]
4092#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4093#[cfg_attr(test, assert_instr(vpcmp))]
4094#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4095pub const fn _mm_mask_cmpeq_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
4096    _mm_mask_cmp_epi8_mask::<_MM_CMPINT_EQ>(k1, a, b)
4097}
4098
4099/// Compare packed unsigned 16-bit integers in a and b for not-equal, and store the results in mask vector k.
4100///
4101/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpneq_epu16_mask&expand=1106)
4102#[inline]
4103#[target_feature(enable = "avx512bw")]
4104#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4105#[cfg_attr(test, assert_instr(vpcmp))]
4106#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4107pub const fn _mm512_cmpneq_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 {
4108    unsafe { simd_bitmask::<u16x32, _>(simd_ne(a.as_u16x32(), b.as_u16x32())) }
4109}
4110
4111/// 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).
4112///
4113/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpneq_epu16_mask&expand=1107)
4114#[inline]
4115#[target_feature(enable = "avx512bw")]
4116#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4117#[cfg_attr(test, assert_instr(vpcmp))]
4118#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4119pub const fn _mm512_mask_cmpneq_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
4120    _mm512_mask_cmp_epu16_mask::<_MM_CMPINT_NE>(k1, a, b)
4121}
4122
4123/// Compare packed unsigned 16-bit integers in a and b for not-equal, and store the results in mask vector k.
4124///
4125/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpneq_epu16_mask&expand=1104)
4126#[inline]
4127#[target_feature(enable = "avx512bw,avx512vl")]
4128#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4129#[cfg_attr(test, assert_instr(vpcmp))]
4130#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4131pub const fn _mm256_cmpneq_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 {
4132    unsafe { simd_bitmask::<u16x16, _>(simd_ne(a.as_u16x16(), b.as_u16x16())) }
4133}
4134
4135/// 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).
4136///
4137/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpneq_epu16_mask&expand=1105)
4138#[inline]
4139#[target_feature(enable = "avx512bw,avx512vl")]
4140#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4141#[cfg_attr(test, assert_instr(vpcmp))]
4142#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4143pub const fn _mm256_mask_cmpneq_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
4144    _mm256_mask_cmp_epu16_mask::<_MM_CMPINT_NE>(k1, a, b)
4145}
4146
4147/// Compare packed unsigned 16-bit integers in a and b for not-equal, and store the results in mask vector k.
4148///
4149/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpneq_epu16_mask&expand=1102)
4150#[inline]
4151#[target_feature(enable = "avx512bw,avx512vl")]
4152#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4153#[cfg_attr(test, assert_instr(vpcmp))]
4154#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4155pub const fn _mm_cmpneq_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 {
4156    unsafe { simd_bitmask::<u16x8, _>(simd_ne(a.as_u16x8(), b.as_u16x8())) }
4157}
4158
4159/// 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).
4160///
4161/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpneq_epu16_mask&expand=1103)
4162#[inline]
4163#[target_feature(enable = "avx512bw,avx512vl")]
4164#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4165#[cfg_attr(test, assert_instr(vpcmp))]
4166#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4167pub const fn _mm_mask_cmpneq_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
4168    _mm_mask_cmp_epu16_mask::<_MM_CMPINT_NE>(k1, a, b)
4169}
4170
4171/// Compare packed unsigned 8-bit integers in a and b for not-equal, and store the results in mask vector k.
4172///
4173/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpneq_epu8_mask&expand=1124)
4174#[inline]
4175#[target_feature(enable = "avx512bw")]
4176#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4177#[cfg_attr(test, assert_instr(vpcmp))]
4178#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4179pub const fn _mm512_cmpneq_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 {
4180    unsafe { simd_bitmask::<u8x64, _>(simd_ne(a.as_u8x64(), b.as_u8x64())) }
4181}
4182
4183/// 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).
4184///
4185/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpneq_epu8_mask&expand=1125)
4186#[inline]
4187#[target_feature(enable = "avx512bw")]
4188#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4189#[cfg_attr(test, assert_instr(vpcmp))]
4190#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4191pub const fn _mm512_mask_cmpneq_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
4192    _mm512_mask_cmp_epu8_mask::<_MM_CMPINT_NE>(k1, a, b)
4193}
4194
4195/// Compare packed unsigned 8-bit integers in a and b for not-equal, and store the results in mask vector k.
4196///
4197/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpneq_epu8_mask&expand=1122)
4198#[inline]
4199#[target_feature(enable = "avx512bw,avx512vl")]
4200#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4201#[cfg_attr(test, assert_instr(vpcmp))]
4202#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4203pub const fn _mm256_cmpneq_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 {
4204    unsafe { simd_bitmask::<u8x32, _>(simd_ne(a.as_u8x32(), b.as_u8x32())) }
4205}
4206
4207/// 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).
4208///
4209/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpneq_epu8_mask&expand=1123)
4210#[inline]
4211#[target_feature(enable = "avx512bw,avx512vl")]
4212#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4213#[cfg_attr(test, assert_instr(vpcmp))]
4214#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4215pub const fn _mm256_mask_cmpneq_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
4216    _mm256_mask_cmp_epu8_mask::<_MM_CMPINT_NE>(k1, a, b)
4217}
4218
4219/// Compare packed unsigned 8-bit integers in a and b for not-equal, and store the results in mask vector k.
4220///
4221/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpneq_epu8_mask&expand=1120)
4222#[inline]
4223#[target_feature(enable = "avx512bw,avx512vl")]
4224#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4225#[cfg_attr(test, assert_instr(vpcmp))]
4226#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4227pub const fn _mm_cmpneq_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 {
4228    unsafe { simd_bitmask::<u8x16, _>(simd_ne(a.as_u8x16(), b.as_u8x16())) }
4229}
4230
4231/// 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).
4232///
4233/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpneq_epu8_mask&expand=1121)
4234#[inline]
4235#[target_feature(enable = "avx512bw,avx512vl")]
4236#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4237#[cfg_attr(test, assert_instr(vpcmp))]
4238#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4239pub const fn _mm_mask_cmpneq_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
4240    _mm_mask_cmp_epu8_mask::<_MM_CMPINT_NE>(k1, a, b)
4241}
4242
4243/// Compare packed signed 16-bit integers in a and b for not-equal, and store the results in mask vector k.
4244///
4245/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpneq_epi16_mask&expand=1082)
4246#[inline]
4247#[target_feature(enable = "avx512bw")]
4248#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4249#[cfg_attr(test, assert_instr(vpcmp))]
4250#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4251pub const fn _mm512_cmpneq_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 {
4252    unsafe { simd_bitmask::<i16x32, _>(simd_ne(a.as_i16x32(), b.as_i16x32())) }
4253}
4254
4255/// 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).
4256///
4257/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpneq_epi16_mask&expand=1083)
4258#[inline]
4259#[target_feature(enable = "avx512bw")]
4260#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4261#[cfg_attr(test, assert_instr(vpcmp))]
4262#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4263pub const fn _mm512_mask_cmpneq_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
4264    _mm512_mask_cmp_epi16_mask::<_MM_CMPINT_NE>(k1, a, b)
4265}
4266
4267/// Compare packed signed 16-bit integers in a and b for not-equal, and store the results in mask vector k.
4268///
4269/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpneq_epi16_mask&expand=1080)
4270#[inline]
4271#[target_feature(enable = "avx512bw,avx512vl")]
4272#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4273#[cfg_attr(test, assert_instr(vpcmp))]
4274#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4275pub const fn _mm256_cmpneq_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 {
4276    unsafe { simd_bitmask::<i16x16, _>(simd_ne(a.as_i16x16(), b.as_i16x16())) }
4277}
4278
4279/// 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).
4280///
4281/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpneq_epi16_mask&expand=1081)
4282#[inline]
4283#[target_feature(enable = "avx512bw,avx512vl")]
4284#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4285#[cfg_attr(test, assert_instr(vpcmp))]
4286#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4287pub const fn _mm256_mask_cmpneq_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
4288    _mm256_mask_cmp_epi16_mask::<_MM_CMPINT_NE>(k1, a, b)
4289}
4290
4291/// Compare packed signed 16-bit integers in a and b for not-equal, and store the results in mask vector k.
4292///
4293/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpneq_epi16_mask&expand=1078)
4294#[inline]
4295#[target_feature(enable = "avx512bw,avx512vl")]
4296#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4297#[cfg_attr(test, assert_instr(vpcmp))]
4298#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4299pub const fn _mm_cmpneq_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 {
4300    unsafe { simd_bitmask::<i16x8, _>(simd_ne(a.as_i16x8(), b.as_i16x8())) }
4301}
4302
4303/// 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).
4304///
4305/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpneq_epi16_mask&expand=1079)
4306#[inline]
4307#[target_feature(enable = "avx512bw,avx512vl")]
4308#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4309#[cfg_attr(test, assert_instr(vpcmp))]
4310#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4311pub const fn _mm_mask_cmpneq_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
4312    _mm_mask_cmp_epi16_mask::<_MM_CMPINT_NE>(k1, a, b)
4313}
4314
4315/// Compare packed signed 8-bit integers in a and b for not-equal, and store the results in mask vector k.
4316///
4317/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmpneq_epi8_mask&expand=1100)
4318#[inline]
4319#[target_feature(enable = "avx512bw")]
4320#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4321#[cfg_attr(test, assert_instr(vpcmp))]
4322#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4323pub const fn _mm512_cmpneq_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 {
4324    unsafe { simd_bitmask::<i8x64, _>(simd_ne(a.as_i8x64(), b.as_i8x64())) }
4325}
4326
4327/// 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).
4328///
4329/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmpneq_epi8_mask&expand=1101)
4330#[inline]
4331#[target_feature(enable = "avx512bw")]
4332#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4333#[cfg_attr(test, assert_instr(vpcmp))]
4334#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4335pub const fn _mm512_mask_cmpneq_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
4336    _mm512_mask_cmp_epi8_mask::<_MM_CMPINT_NE>(k1, a, b)
4337}
4338
4339/// Compare packed signed 8-bit integers in a and b for not-equal, and store the results in mask vector k.
4340///
4341/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmpneq_epi8_mask&expand=1098)
4342#[inline]
4343#[target_feature(enable = "avx512bw,avx512vl")]
4344#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4345#[cfg_attr(test, assert_instr(vpcmp))]
4346#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4347pub const fn _mm256_cmpneq_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 {
4348    unsafe { simd_bitmask::<i8x32, _>(simd_ne(a.as_i8x32(), b.as_i8x32())) }
4349}
4350
4351/// 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).
4352///
4353/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmpneq_epi8_mask&expand=1099)
4354#[inline]
4355#[target_feature(enable = "avx512bw,avx512vl")]
4356#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4357#[cfg_attr(test, assert_instr(vpcmp))]
4358#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4359pub const fn _mm256_mask_cmpneq_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
4360    _mm256_mask_cmp_epi8_mask::<_MM_CMPINT_NE>(k1, a, b)
4361}
4362
4363/// Compare packed signed 8-bit integers in a and b for not-equal, and store the results in mask vector k.
4364///
4365/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpneq_epi8_mask&expand=1096)
4366#[inline]
4367#[target_feature(enable = "avx512bw,avx512vl")]
4368#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4369#[cfg_attr(test, assert_instr(vpcmp))]
4370#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4371pub const fn _mm_cmpneq_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 {
4372    unsafe { simd_bitmask::<i8x16, _>(simd_ne(a.as_i8x16(), b.as_i8x16())) }
4373}
4374
4375/// 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).
4376///
4377/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmpneq_epi8_mask&expand=1097)
4378#[inline]
4379#[target_feature(enable = "avx512bw,avx512vl")]
4380#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4381#[cfg_attr(test, assert_instr(vpcmp))]
4382#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4383pub const fn _mm_mask_cmpneq_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
4384    _mm_mask_cmp_epi8_mask::<_MM_CMPINT_NE>(k1, a, b)
4385}
4386
4387/// 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.
4388///
4389/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmp_epu16_mask&expand=715)
4390#[inline]
4391#[target_feature(enable = "avx512bw")]
4392#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4393#[rustc_legacy_const_generics(2)]
4394#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4395#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4396pub const fn _mm512_cmp_epu16_mask<const IMM8: i32>(a: __m512i, b: __m512i) -> __mmask32 {
4397    unsafe {
4398        static_assert_uimm_bits!(IMM8, 3);
4399        let a = a.as_u16x32();
4400        let b = b.as_u16x32();
4401        let r = match IMM8 {
4402            0 => simd_eq(a, b),
4403            1 => simd_lt(a, b),
4404            2 => simd_le(a, b),
4405            3 => i16x32::ZERO,
4406            4 => simd_ne(a, b),
4407            5 => simd_ge(a, b),
4408            6 => simd_gt(a, b),
4409            _ => i16x32::splat(-1),
4410        };
4411        simd_bitmask(r)
4412    }
4413}
4414
4415/// 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).
4416///
4417/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmp_epu16_mask&expand=716)
4418#[inline]
4419#[target_feature(enable = "avx512bw")]
4420#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4421#[rustc_legacy_const_generics(3)]
4422#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4423#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4424pub const fn _mm512_mask_cmp_epu16_mask<const IMM8: i32>(
4425    k1: __mmask32,
4426    a: __m512i,
4427    b: __m512i,
4428) -> __mmask32 {
4429    unsafe {
4430        static_assert_uimm_bits!(IMM8, 3);
4431        let a = a.as_u16x32();
4432        let b = b.as_u16x32();
4433        let k1 = simd_select_bitmask(k1, i16x32::splat(-1), i16x32::ZERO);
4434        let r = match IMM8 {
4435            0 => simd_and(k1, simd_eq(a, b)),
4436            1 => simd_and(k1, simd_lt(a, b)),
4437            2 => simd_and(k1, simd_le(a, b)),
4438            3 => i16x32::ZERO,
4439            4 => simd_and(k1, simd_ne(a, b)),
4440            5 => simd_and(k1, simd_ge(a, b)),
4441            6 => simd_and(k1, simd_gt(a, b)),
4442            _ => k1,
4443        };
4444        simd_bitmask(r)
4445    }
4446}
4447
4448/// 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.
4449///
4450/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmp_epu16_mask&expand=713)
4451#[inline]
4452#[target_feature(enable = "avx512bw,avx512vl")]
4453#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4454#[rustc_legacy_const_generics(2)]
4455#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4456#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4457pub const fn _mm256_cmp_epu16_mask<const IMM8: i32>(a: __m256i, b: __m256i) -> __mmask16 {
4458    unsafe {
4459        static_assert_uimm_bits!(IMM8, 3);
4460        let a = a.as_u16x16();
4461        let b = b.as_u16x16();
4462        let r = match IMM8 {
4463            0 => simd_eq(a, b),
4464            1 => simd_lt(a, b),
4465            2 => simd_le(a, b),
4466            3 => i16x16::ZERO,
4467            4 => simd_ne(a, b),
4468            5 => simd_ge(a, b),
4469            6 => simd_gt(a, b),
4470            _ => i16x16::splat(-1),
4471        };
4472        simd_bitmask(r)
4473    }
4474}
4475
4476/// 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).
4477///
4478/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmp_epu16_mask&expand=714)
4479#[inline]
4480#[target_feature(enable = "avx512bw,avx512vl")]
4481#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4482#[rustc_legacy_const_generics(3)]
4483#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4484#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4485pub const fn _mm256_mask_cmp_epu16_mask<const IMM8: i32>(
4486    k1: __mmask16,
4487    a: __m256i,
4488    b: __m256i,
4489) -> __mmask16 {
4490    unsafe {
4491        static_assert_uimm_bits!(IMM8, 3);
4492        let a = a.as_u16x16();
4493        let b = b.as_u16x16();
4494        let k1 = simd_select_bitmask(k1, i16x16::splat(-1), i16x16::ZERO);
4495        let r = match IMM8 {
4496            0 => simd_and(k1, simd_eq(a, b)),
4497            1 => simd_and(k1, simd_lt(a, b)),
4498            2 => simd_and(k1, simd_le(a, b)),
4499            3 => i16x16::ZERO,
4500            4 => simd_and(k1, simd_ne(a, b)),
4501            5 => simd_and(k1, simd_ge(a, b)),
4502            6 => simd_and(k1, simd_gt(a, b)),
4503            _ => k1,
4504        };
4505        simd_bitmask(r)
4506    }
4507}
4508
4509/// 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.
4510///
4511/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmp_epu16_mask&expand=711)
4512#[inline]
4513#[target_feature(enable = "avx512bw,avx512vl")]
4514#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4515#[rustc_legacy_const_generics(2)]
4516#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4517#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4518pub const fn _mm_cmp_epu16_mask<const IMM8: i32>(a: __m128i, b: __m128i) -> __mmask8 {
4519    unsafe {
4520        static_assert_uimm_bits!(IMM8, 3);
4521        let a = a.as_u16x8();
4522        let b = b.as_u16x8();
4523        let r = match IMM8 {
4524            0 => simd_eq(a, b),
4525            1 => simd_lt(a, b),
4526            2 => simd_le(a, b),
4527            3 => i16x8::ZERO,
4528            4 => simd_ne(a, b),
4529            5 => simd_ge(a, b),
4530            6 => simd_gt(a, b),
4531            _ => i16x8::splat(-1),
4532        };
4533        simd_bitmask(r)
4534    }
4535}
4536
4537/// 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).
4538///
4539/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmp_epu16_mask&expand=712)
4540#[inline]
4541#[target_feature(enable = "avx512bw,avx512vl")]
4542#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4543#[rustc_legacy_const_generics(3)]
4544#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4545#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4546pub const fn _mm_mask_cmp_epu16_mask<const IMM8: i32>(
4547    k1: __mmask8,
4548    a: __m128i,
4549    b: __m128i,
4550) -> __mmask8 {
4551    unsafe {
4552        static_assert_uimm_bits!(IMM8, 3);
4553        let a = a.as_u16x8();
4554        let b = b.as_u16x8();
4555        let k1 = simd_select_bitmask(k1, i16x8::splat(-1), i16x8::ZERO);
4556        let r = match IMM8 {
4557            0 => simd_and(k1, simd_eq(a, b)),
4558            1 => simd_and(k1, simd_lt(a, b)),
4559            2 => simd_and(k1, simd_le(a, b)),
4560            3 => i16x8::ZERO,
4561            4 => simd_and(k1, simd_ne(a, b)),
4562            5 => simd_and(k1, simd_ge(a, b)),
4563            6 => simd_and(k1, simd_gt(a, b)),
4564            _ => k1,
4565        };
4566        simd_bitmask(r)
4567    }
4568}
4569
4570/// 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.
4571///
4572/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmp_epu8_mask&expand=733)
4573#[inline]
4574#[target_feature(enable = "avx512bw")]
4575#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4576#[rustc_legacy_const_generics(2)]
4577#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4578#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4579pub const fn _mm512_cmp_epu8_mask<const IMM8: i32>(a: __m512i, b: __m512i) -> __mmask64 {
4580    unsafe {
4581        static_assert_uimm_bits!(IMM8, 3);
4582        let a = a.as_u8x64();
4583        let b = b.as_u8x64();
4584        let r = match IMM8 {
4585            0 => simd_eq(a, b),
4586            1 => simd_lt(a, b),
4587            2 => simd_le(a, b),
4588            3 => i8x64::ZERO,
4589            4 => simd_ne(a, b),
4590            5 => simd_ge(a, b),
4591            6 => simd_gt(a, b),
4592            _ => i8x64::splat(-1),
4593        };
4594        simd_bitmask(r)
4595    }
4596}
4597
4598/// 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).
4599///
4600/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmp_epu8_mask&expand=734)
4601#[inline]
4602#[target_feature(enable = "avx512bw")]
4603#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4604#[rustc_legacy_const_generics(3)]
4605#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4606#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4607pub const fn _mm512_mask_cmp_epu8_mask<const IMM8: i32>(
4608    k1: __mmask64,
4609    a: __m512i,
4610    b: __m512i,
4611) -> __mmask64 {
4612    unsafe {
4613        static_assert_uimm_bits!(IMM8, 3);
4614        let a = a.as_u8x64();
4615        let b = b.as_u8x64();
4616        let k1 = simd_select_bitmask(k1, i8x64::splat(-1), i8x64::ZERO);
4617        let r = match IMM8 {
4618            0 => simd_and(k1, simd_eq(a, b)),
4619            1 => simd_and(k1, simd_lt(a, b)),
4620            2 => simd_and(k1, simd_le(a, b)),
4621            3 => i8x64::ZERO,
4622            4 => simd_and(k1, simd_ne(a, b)),
4623            5 => simd_and(k1, simd_ge(a, b)),
4624            6 => simd_and(k1, simd_gt(a, b)),
4625            _ => k1,
4626        };
4627        simd_bitmask(r)
4628    }
4629}
4630
4631/// 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.
4632///
4633/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmp_epu8_mask&expand=731)
4634#[inline]
4635#[target_feature(enable = "avx512bw,avx512vl")]
4636#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4637#[rustc_legacy_const_generics(2)]
4638#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4639#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4640pub const fn _mm256_cmp_epu8_mask<const IMM8: i32>(a: __m256i, b: __m256i) -> __mmask32 {
4641    unsafe {
4642        static_assert_uimm_bits!(IMM8, 3);
4643        let a = a.as_u8x32();
4644        let b = b.as_u8x32();
4645        let r = match IMM8 {
4646            0 => simd_eq(a, b),
4647            1 => simd_lt(a, b),
4648            2 => simd_le(a, b),
4649            3 => i8x32::ZERO,
4650            4 => simd_ne(a, b),
4651            5 => simd_ge(a, b),
4652            6 => simd_gt(a, b),
4653            _ => i8x32::splat(-1),
4654        };
4655        simd_bitmask(r)
4656    }
4657}
4658
4659/// 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).
4660///
4661/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmp_epu8_mask&expand=732)
4662#[inline]
4663#[target_feature(enable = "avx512bw,avx512vl")]
4664#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4665#[rustc_legacy_const_generics(3)]
4666#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4667#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4668pub const fn _mm256_mask_cmp_epu8_mask<const IMM8: i32>(
4669    k1: __mmask32,
4670    a: __m256i,
4671    b: __m256i,
4672) -> __mmask32 {
4673    unsafe {
4674        static_assert_uimm_bits!(IMM8, 3);
4675        let a = a.as_u8x32();
4676        let b = b.as_u8x32();
4677        let k1 = simd_select_bitmask(k1, i8x32::splat(-1), i8x32::ZERO);
4678        let r = match IMM8 {
4679            0 => simd_and(k1, simd_eq(a, b)),
4680            1 => simd_and(k1, simd_lt(a, b)),
4681            2 => simd_and(k1, simd_le(a, b)),
4682            3 => i8x32::ZERO,
4683            4 => simd_and(k1, simd_ne(a, b)),
4684            5 => simd_and(k1, simd_ge(a, b)),
4685            6 => simd_and(k1, simd_gt(a, b)),
4686            _ => k1,
4687        };
4688        simd_bitmask(r)
4689    }
4690}
4691
4692/// 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.
4693///
4694/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmp_epu8_mask&expand=729)
4695#[inline]
4696#[target_feature(enable = "avx512bw,avx512vl")]
4697#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4698#[rustc_legacy_const_generics(2)]
4699#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4700#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4701pub const fn _mm_cmp_epu8_mask<const IMM8: i32>(a: __m128i, b: __m128i) -> __mmask16 {
4702    unsafe {
4703        static_assert_uimm_bits!(IMM8, 3);
4704        let a = a.as_u8x16();
4705        let b = b.as_u8x16();
4706        let r = match IMM8 {
4707            0 => simd_eq(a, b),
4708            1 => simd_lt(a, b),
4709            2 => simd_le(a, b),
4710            3 => i8x16::ZERO,
4711            4 => simd_ne(a, b),
4712            5 => simd_ge(a, b),
4713            6 => simd_gt(a, b),
4714            _ => i8x16::splat(-1),
4715        };
4716        simd_bitmask(r)
4717    }
4718}
4719
4720/// 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).
4721///
4722/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmp_epu8_mask&expand=730)
4723#[inline]
4724#[target_feature(enable = "avx512bw,avx512vl")]
4725#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4726#[rustc_legacy_const_generics(3)]
4727#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4728#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4729pub const fn _mm_mask_cmp_epu8_mask<const IMM8: i32>(
4730    k1: __mmask16,
4731    a: __m128i,
4732    b: __m128i,
4733) -> __mmask16 {
4734    unsafe {
4735        static_assert_uimm_bits!(IMM8, 3);
4736        let a = a.as_u8x16();
4737        let b = b.as_u8x16();
4738        let k1 = simd_select_bitmask(k1, i8x16::splat(-1), i8x16::ZERO);
4739        let r = match IMM8 {
4740            0 => simd_and(k1, simd_eq(a, b)),
4741            1 => simd_and(k1, simd_lt(a, b)),
4742            2 => simd_and(k1, simd_le(a, b)),
4743            3 => i8x16::ZERO,
4744            4 => simd_and(k1, simd_ne(a, b)),
4745            5 => simd_and(k1, simd_ge(a, b)),
4746            6 => simd_and(k1, simd_gt(a, b)),
4747            _ => k1,
4748        };
4749        simd_bitmask(r)
4750    }
4751}
4752
4753/// 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.
4754///
4755/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmp_epi16_mask&expand=691)
4756#[inline]
4757#[target_feature(enable = "avx512bw")]
4758#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4759#[rustc_legacy_const_generics(2)]
4760#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4761#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4762pub const fn _mm512_cmp_epi16_mask<const IMM8: i32>(a: __m512i, b: __m512i) -> __mmask32 {
4763    unsafe {
4764        static_assert_uimm_bits!(IMM8, 3);
4765        let a = a.as_i16x32();
4766        let b = b.as_i16x32();
4767        let r = match IMM8 {
4768            0 => simd_eq(a, b),
4769            1 => simd_lt(a, b),
4770            2 => simd_le(a, b),
4771            3 => i16x32::ZERO,
4772            4 => simd_ne(a, b),
4773            5 => simd_ge(a, b),
4774            6 => simd_gt(a, b),
4775            _ => i16x32::splat(-1),
4776        };
4777        simd_bitmask(r)
4778    }
4779}
4780
4781/// 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).
4782///
4783/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmp_epi16_mask&expand=692)
4784#[inline]
4785#[target_feature(enable = "avx512bw")]
4786#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4787#[rustc_legacy_const_generics(3)]
4788#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4789#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4790pub const fn _mm512_mask_cmp_epi16_mask<const IMM8: i32>(
4791    k1: __mmask32,
4792    a: __m512i,
4793    b: __m512i,
4794) -> __mmask32 {
4795    unsafe {
4796        static_assert_uimm_bits!(IMM8, 3);
4797        let a = a.as_i16x32();
4798        let b = b.as_i16x32();
4799        let k1 = simd_select_bitmask(k1, i16x32::splat(-1), i16x32::ZERO);
4800        let r = match IMM8 {
4801            0 => simd_and(k1, simd_eq(a, b)),
4802            1 => simd_and(k1, simd_lt(a, b)),
4803            2 => simd_and(k1, simd_le(a, b)),
4804            3 => i16x32::ZERO,
4805            4 => simd_and(k1, simd_ne(a, b)),
4806            5 => simd_and(k1, simd_ge(a, b)),
4807            6 => simd_and(k1, simd_gt(a, b)),
4808            _ => k1,
4809        };
4810        simd_bitmask(r)
4811    }
4812}
4813
4814/// 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.
4815///
4816/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmp_epi16_mask&expand=689)
4817#[inline]
4818#[target_feature(enable = "avx512bw,avx512vl")]
4819#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4820#[rustc_legacy_const_generics(2)]
4821#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4822#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4823pub const fn _mm256_cmp_epi16_mask<const IMM8: i32>(a: __m256i, b: __m256i) -> __mmask16 {
4824    unsafe {
4825        static_assert_uimm_bits!(IMM8, 3);
4826        let a = a.as_i16x16();
4827        let b = b.as_i16x16();
4828        let r = match IMM8 {
4829            0 => simd_eq(a, b),
4830            1 => simd_lt(a, b),
4831            2 => simd_le(a, b),
4832            3 => i16x16::ZERO,
4833            4 => simd_ne(a, b),
4834            5 => simd_ge(a, b),
4835            6 => simd_gt(a, b),
4836            _ => i16x16::splat(-1),
4837        };
4838        simd_bitmask(r)
4839    }
4840}
4841
4842/// 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).
4843///
4844/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmp_epi16_mask&expand=690)
4845#[inline]
4846#[target_feature(enable = "avx512bw,avx512vl")]
4847#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4848#[rustc_legacy_const_generics(3)]
4849#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4850#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4851pub const fn _mm256_mask_cmp_epi16_mask<const IMM8: i32>(
4852    k1: __mmask16,
4853    a: __m256i,
4854    b: __m256i,
4855) -> __mmask16 {
4856    unsafe {
4857        static_assert_uimm_bits!(IMM8, 3);
4858        let a = a.as_i16x16();
4859        let b = b.as_i16x16();
4860        let k1 = simd_select_bitmask(k1, i16x16::splat(-1), i16x16::ZERO);
4861        let r = match IMM8 {
4862            0 => simd_and(k1, simd_eq(a, b)),
4863            1 => simd_and(k1, simd_lt(a, b)),
4864            2 => simd_and(k1, simd_le(a, b)),
4865            3 => i16x16::ZERO,
4866            4 => simd_and(k1, simd_ne(a, b)),
4867            5 => simd_and(k1, simd_ge(a, b)),
4868            6 => simd_and(k1, simd_gt(a, b)),
4869            _ => k1,
4870        };
4871        simd_bitmask(r)
4872    }
4873}
4874
4875/// 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.
4876///
4877/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmp_epi16_mask&expand=687)
4878#[inline]
4879#[target_feature(enable = "avx512bw,avx512vl")]
4880#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4881#[rustc_legacy_const_generics(2)]
4882#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4883#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4884pub const fn _mm_cmp_epi16_mask<const IMM8: i32>(a: __m128i, b: __m128i) -> __mmask8 {
4885    unsafe {
4886        static_assert_uimm_bits!(IMM8, 3);
4887        let a = a.as_i16x8();
4888        let b = b.as_i16x8();
4889        let r = match IMM8 {
4890            0 => simd_eq(a, b),
4891            1 => simd_lt(a, b),
4892            2 => simd_le(a, b),
4893            3 => i16x8::ZERO,
4894            4 => simd_ne(a, b),
4895            5 => simd_ge(a, b),
4896            6 => simd_gt(a, b),
4897            _ => i16x8::splat(-1),
4898        };
4899        simd_bitmask(r)
4900    }
4901}
4902
4903/// 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).
4904///
4905/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmp_epi16_mask&expand=688)
4906#[inline]
4907#[target_feature(enable = "avx512bw,avx512vl")]
4908#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4909#[rustc_legacy_const_generics(3)]
4910#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4911#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4912pub const fn _mm_mask_cmp_epi16_mask<const IMM8: i32>(
4913    k1: __mmask8,
4914    a: __m128i,
4915    b: __m128i,
4916) -> __mmask8 {
4917    unsafe {
4918        static_assert_uimm_bits!(IMM8, 3);
4919        let a = a.as_i16x8();
4920        let b = b.as_i16x8();
4921        let k1 = simd_select_bitmask(k1, i16x8::splat(-1), i16x8::ZERO);
4922        let r = match IMM8 {
4923            0 => simd_and(k1, simd_eq(a, b)),
4924            1 => simd_and(k1, simd_lt(a, b)),
4925            2 => simd_and(k1, simd_le(a, b)),
4926            3 => i16x8::ZERO,
4927            4 => simd_and(k1, simd_ne(a, b)),
4928            5 => simd_and(k1, simd_ge(a, b)),
4929            6 => simd_and(k1, simd_gt(a, b)),
4930            _ => k1,
4931        };
4932        simd_bitmask(r)
4933    }
4934}
4935
4936/// 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.
4937///
4938/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cmp_epi8_mask&expand=709)
4939#[inline]
4940#[target_feature(enable = "avx512bw")]
4941#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4942#[rustc_legacy_const_generics(2)]
4943#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4944#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4945pub const fn _mm512_cmp_epi8_mask<const IMM8: i32>(a: __m512i, b: __m512i) -> __mmask64 {
4946    unsafe {
4947        static_assert_uimm_bits!(IMM8, 3);
4948        let a = a.as_i8x64();
4949        let b = b.as_i8x64();
4950        let r = match IMM8 {
4951            0 => simd_eq(a, b),
4952            1 => simd_lt(a, b),
4953            2 => simd_le(a, b),
4954            3 => i8x64::ZERO,
4955            4 => simd_ne(a, b),
4956            5 => simd_ge(a, b),
4957            6 => simd_gt(a, b),
4958            _ => i8x64::splat(-1),
4959        };
4960        simd_bitmask(r)
4961    }
4962}
4963
4964/// 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).
4965///
4966/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cmp_epi8_mask&expand=710)
4967#[inline]
4968#[target_feature(enable = "avx512bw")]
4969#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4970#[rustc_legacy_const_generics(3)]
4971#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
4972#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
4973pub const fn _mm512_mask_cmp_epi8_mask<const IMM8: i32>(
4974    k1: __mmask64,
4975    a: __m512i,
4976    b: __m512i,
4977) -> __mmask64 {
4978    unsafe {
4979        static_assert_uimm_bits!(IMM8, 3);
4980        let a = a.as_i8x64();
4981        let b = b.as_i8x64();
4982        let k1 = simd_select_bitmask(k1, i8x64::splat(-1), i8x64::ZERO);
4983        let r = match IMM8 {
4984            0 => simd_and(k1, simd_eq(a, b)),
4985            1 => simd_and(k1, simd_lt(a, b)),
4986            2 => simd_and(k1, simd_le(a, b)),
4987            3 => i8x64::ZERO,
4988            4 => simd_and(k1, simd_ne(a, b)),
4989            5 => simd_and(k1, simd_ge(a, b)),
4990            6 => simd_and(k1, simd_gt(a, b)),
4991            _ => k1,
4992        };
4993        simd_bitmask(r)
4994    }
4995}
4996
4997/// 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.
4998///
4999/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cmp_epi8_mask&expand=707)
5000#[inline]
5001#[target_feature(enable = "avx512bw,avx512vl")]
5002#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5003#[rustc_legacy_const_generics(2)]
5004#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
5005#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5006pub const fn _mm256_cmp_epi8_mask<const IMM8: i32>(a: __m256i, b: __m256i) -> __mmask32 {
5007    unsafe {
5008        static_assert_uimm_bits!(IMM8, 3);
5009        let a = a.as_i8x32();
5010        let b = b.as_i8x32();
5011        let r = match IMM8 {
5012            0 => simd_eq(a, b),
5013            1 => simd_lt(a, b),
5014            2 => simd_le(a, b),
5015            3 => i8x32::ZERO,
5016            4 => simd_ne(a, b),
5017            5 => simd_ge(a, b),
5018            6 => simd_gt(a, b),
5019            _ => i8x32::splat(-1),
5020        };
5021        simd_bitmask(r)
5022    }
5023}
5024
5025/// 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).
5026///
5027/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cmp_epi8_mask&expand=708)
5028#[inline]
5029#[target_feature(enable = "avx512bw,avx512vl")]
5030#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5031#[rustc_legacy_const_generics(3)]
5032#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
5033#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5034pub const fn _mm256_mask_cmp_epi8_mask<const IMM8: i32>(
5035    k1: __mmask32,
5036    a: __m256i,
5037    b: __m256i,
5038) -> __mmask32 {
5039    unsafe {
5040        static_assert_uimm_bits!(IMM8, 3);
5041        let a = a.as_i8x32();
5042        let b = b.as_i8x32();
5043        let k1 = simd_select_bitmask(k1, i8x32::splat(-1), i8x32::ZERO);
5044        let r = match IMM8 {
5045            0 => simd_and(k1, simd_eq(a, b)),
5046            1 => simd_and(k1, simd_lt(a, b)),
5047            2 => simd_and(k1, simd_le(a, b)),
5048            3 => i8x32::ZERO,
5049            4 => simd_and(k1, simd_ne(a, b)),
5050            5 => simd_and(k1, simd_ge(a, b)),
5051            6 => simd_and(k1, simd_gt(a, b)),
5052            _ => k1,
5053        };
5054        simd_bitmask(r)
5055    }
5056}
5057
5058/// 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.
5059///
5060/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmp_epi8_mask&expand=705)
5061#[inline]
5062#[target_feature(enable = "avx512bw,avx512vl")]
5063#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5064#[rustc_legacy_const_generics(2)]
5065#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
5066#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5067pub const fn _mm_cmp_epi8_mask<const IMM8: i32>(a: __m128i, b: __m128i) -> __mmask16 {
5068    unsafe {
5069        static_assert_uimm_bits!(IMM8, 3);
5070        let a = a.as_i8x16();
5071        let b = b.as_i8x16();
5072        let r = match IMM8 {
5073            0 => simd_eq(a, b),
5074            1 => simd_lt(a, b),
5075            2 => simd_le(a, b),
5076            3 => i8x16::ZERO,
5077            4 => simd_ne(a, b),
5078            5 => simd_ge(a, b),
5079            6 => simd_gt(a, b),
5080            _ => i8x16::splat(-1),
5081        };
5082        simd_bitmask(r)
5083    }
5084}
5085
5086/// 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).
5087///
5088/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cmp_epi8_mask&expand=706)
5089#[inline]
5090#[target_feature(enable = "avx512bw,avx512vl")]
5091#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5092#[rustc_legacy_const_generics(3)]
5093#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
5094#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5095pub const fn _mm_mask_cmp_epi8_mask<const IMM8: i32>(
5096    k1: __mmask16,
5097    a: __m128i,
5098    b: __m128i,
5099) -> __mmask16 {
5100    unsafe {
5101        static_assert_uimm_bits!(IMM8, 3);
5102        let a = a.as_i8x16();
5103        let b = b.as_i8x16();
5104        let k1 = simd_select_bitmask(k1, i8x16::splat(-1), i8x16::ZERO);
5105        let r = match IMM8 {
5106            0 => simd_and(k1, simd_eq(a, b)),
5107            1 => simd_and(k1, simd_lt(a, b)),
5108            2 => simd_and(k1, simd_le(a, b)),
5109            3 => i8x16::ZERO,
5110            4 => simd_and(k1, simd_ne(a, b)),
5111            5 => simd_and(k1, simd_ge(a, b)),
5112            6 => simd_and(k1, simd_gt(a, b)),
5113            _ => k1,
5114        };
5115        simd_bitmask(r)
5116    }
5117}
5118
5119/// Reduce the packed 16-bit integers in a by addition. Returns the sum of all elements in a.
5120///
5121/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_reduce_add_epi16)
5122#[inline]
5123#[target_feature(enable = "avx512bw,avx512vl")]
5124#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5125#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5126pub const fn _mm256_reduce_add_epi16(a: __m256i) -> i16 {
5127    unsafe { simd_reduce_add_ordered(a.as_i16x16(), 0) }
5128}
5129
5130/// Reduce the packed 16-bit integers in a by addition using mask k. Returns the sum of all active elements in a.
5131///
5132/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_reduce_add_epi16)
5133#[inline]
5134#[target_feature(enable = "avx512bw,avx512vl")]
5135#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5136#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5137pub const fn _mm256_mask_reduce_add_epi16(k: __mmask16, a: __m256i) -> i16 {
5138    unsafe { simd_reduce_add_ordered(simd_select_bitmask(k, a.as_i16x16(), i16x16::ZERO), 0) }
5139}
5140
5141/// Reduce the packed 16-bit integers in a by addition. Returns the sum of all elements in a.
5142///
5143/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_reduce_add_epi16)
5144#[inline]
5145#[target_feature(enable = "avx512bw,avx512vl")]
5146#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5147#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5148pub const fn _mm_reduce_add_epi16(a: __m128i) -> i16 {
5149    unsafe { simd_reduce_add_ordered(a.as_i16x8(), 0) }
5150}
5151
5152/// Reduce the packed 16-bit integers in a by addition using mask k. Returns the sum of all active elements in a.
5153///
5154/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_reduce_add_epi16)
5155#[inline]
5156#[target_feature(enable = "avx512bw,avx512vl")]
5157#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5158#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5159pub const fn _mm_mask_reduce_add_epi16(k: __mmask8, a: __m128i) -> i16 {
5160    unsafe { simd_reduce_add_ordered(simd_select_bitmask(k, a.as_i16x8(), i16x8::ZERO), 0) }
5161}
5162
5163/// Reduce the packed 8-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_epi8)
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_epi8(a: __m256i) -> i8 {
5171    unsafe { simd_reduce_add_ordered(a.as_i8x32(), 0) }
5172}
5173
5174/// Reduce the packed 8-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_epi8)
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_epi8(k: __mmask32, a: __m256i) -> i8 {
5182    unsafe { simd_reduce_add_ordered(simd_select_bitmask(k, a.as_i8x32(), i8x32::ZERO), 0) }
5183}
5184
5185/// Reduce the packed 8-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_epi8)
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_epi8(a: __m128i) -> i8 {
5193    unsafe { simd_reduce_add_ordered(a.as_i8x16(), 0) }
5194}
5195
5196/// Reduce the packed 8-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_epi8)
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_epi8(k: __mmask16, a: __m128i) -> i8 {
5204    unsafe { simd_reduce_add_ordered(simd_select_bitmask(k, a.as_i8x16(), i8x16::ZERO), 0) }
5205}
5206
5207/// Reduce the packed 16-bit integers in a by bitwise AND. Returns the bitwise AND 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_and_epi16)
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_and_epi16(a: __m256i) -> i16 {
5215    unsafe { simd_reduce_and(a.as_i16x16()) }
5216}
5217
5218/// Reduce the packed 16-bit integers in a by bitwise AND using mask k. Returns the bitwise AND 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_and_epi16)
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_and_epi16(k: __mmask16, a: __m256i) -> i16 {
5226    unsafe {
5227        simd_reduce_and(simd_select_bitmask(
5228            k,
5229            a.as_i16x16(),
5230            _mm256_set1_epi64x(-1).as_i16x16(),
5231        ))
5232    }
5233}
5234
5235/// Reduce the packed 16-bit integers in a by bitwise AND. Returns the bitwise AND of all elements in a.
5236///
5237/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_reduce_and_epi16)
5238#[inline]
5239#[target_feature(enable = "avx512bw,avx512vl")]
5240#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5241#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5242pub const fn _mm_reduce_and_epi16(a: __m128i) -> i16 {
5243    unsafe { simd_reduce_and(a.as_i16x8()) }
5244}
5245
5246/// Reduce the packed 16-bit integers in a by bitwise AND using mask k. Returns the bitwise AND of all active elements in a.
5247///
5248/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_reduce_and_epi16)
5249#[inline]
5250#[target_feature(enable = "avx512bw,avx512vl")]
5251#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5252#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5253pub const fn _mm_mask_reduce_and_epi16(k: __mmask8, a: __m128i) -> i16 {
5254    unsafe {
5255        simd_reduce_and(simd_select_bitmask(
5256            k,
5257            a.as_i16x8(),
5258            _mm_set1_epi64x(-1).as_i16x8(),
5259        ))
5260    }
5261}
5262
5263/// Reduce the packed 8-bit integers in a by bitwise AND. Returns the bitwise AND of all elements in a.
5264///
5265/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_reduce_and_epi8)
5266#[inline]
5267#[target_feature(enable = "avx512bw,avx512vl")]
5268#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5269#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5270pub const fn _mm256_reduce_and_epi8(a: __m256i) -> i8 {
5271    unsafe { simd_reduce_and(a.as_i8x32()) }
5272}
5273
5274/// Reduce the packed 8-bit integers in a by bitwise AND using mask k. Returns the bitwise AND of all active elements in a.
5275///
5276/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_reduce_and_epi8)
5277#[inline]
5278#[target_feature(enable = "avx512bw,avx512vl")]
5279#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5280#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5281pub const fn _mm256_mask_reduce_and_epi8(k: __mmask32, a: __m256i) -> i8 {
5282    unsafe {
5283        simd_reduce_and(simd_select_bitmask(
5284            k,
5285            a.as_i8x32(),
5286            _mm256_set1_epi64x(-1).as_i8x32(),
5287        ))
5288    }
5289}
5290
5291/// Reduce the packed 8-bit integers in a by bitwise AND. Returns the bitwise AND of all elements in a.
5292///
5293/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_reduce_and_epi8)
5294#[inline]
5295#[target_feature(enable = "avx512bw,avx512vl")]
5296#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5297#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5298pub const fn _mm_reduce_and_epi8(a: __m128i) -> i8 {
5299    unsafe { simd_reduce_and(a.as_i8x16()) }
5300}
5301
5302/// Reduce the packed 8-bit integers in a by bitwise AND using mask k. Returns the bitwise AND of all active elements in a.
5303///
5304/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_reduce_and_epi8)
5305#[inline]
5306#[target_feature(enable = "avx512bw,avx512vl")]
5307#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5308#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5309pub const fn _mm_mask_reduce_and_epi8(k: __mmask16, a: __m128i) -> i8 {
5310    unsafe {
5311        simd_reduce_and(simd_select_bitmask(
5312            k,
5313            a.as_i8x16(),
5314            _mm_set1_epi64x(-1).as_i8x16(),
5315        ))
5316    }
5317}
5318
5319/// Reduce the packed 16-bit integers in a by maximum. Returns the maximum of all elements in a.
5320///
5321/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_reduce_max_epi16)
5322#[inline]
5323#[target_feature(enable = "avx512bw,avx512vl")]
5324#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5325#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5326pub const fn _mm256_reduce_max_epi16(a: __m256i) -> i16 {
5327    unsafe { simd_reduce_max(a.as_i16x16()) }
5328}
5329
5330/// Reduce the packed 16-bit integers in a by maximum using mask k. Returns the maximum of all active elements in a.
5331///
5332/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_reduce_max_epi16)
5333#[inline]
5334#[target_feature(enable = "avx512bw,avx512vl")]
5335#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5336#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5337pub const fn _mm256_mask_reduce_max_epi16(k: __mmask16, a: __m256i) -> i16 {
5338    unsafe { simd_reduce_max(simd_select_bitmask(k, a.as_i16x16(), i16x16::splat(-32768))) }
5339}
5340
5341/// Reduce the packed 16-bit integers in a by maximum. Returns the maximum of all elements in a.
5342///
5343/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_reduce_max_epi16)
5344#[inline]
5345#[target_feature(enable = "avx512bw,avx512vl")]
5346#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5347#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5348pub const fn _mm_reduce_max_epi16(a: __m128i) -> i16 {
5349    unsafe { simd_reduce_max(a.as_i16x8()) }
5350}
5351
5352/// Reduce the packed 16-bit integers in a by maximum using mask k. Returns the maximum of all active elements in a.
5353///
5354/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_reduce_max_epi16)
5355#[inline]
5356#[target_feature(enable = "avx512bw,avx512vl")]
5357#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5358#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5359pub const fn _mm_mask_reduce_max_epi16(k: __mmask8, a: __m128i) -> i16 {
5360    unsafe { simd_reduce_max(simd_select_bitmask(k, a.as_i16x8(), i16x8::splat(-32768))) }
5361}
5362
5363/// Reduce the packed 8-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_epi8)
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_epi8(a: __m256i) -> i8 {
5371    unsafe { simd_reduce_max(a.as_i8x32()) }
5372}
5373
5374/// Reduce the packed 8-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_epi8)
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_epi8(k: __mmask32, a: __m256i) -> i8 {
5382    unsafe { simd_reduce_max(simd_select_bitmask(k, a.as_i8x32(), i8x32::splat(-128))) }
5383}
5384
5385/// Reduce the packed 8-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_epi8)
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_epi8(a: __m128i) -> i8 {
5393    unsafe { simd_reduce_max(a.as_i8x16()) }
5394}
5395
5396/// Reduce the packed 8-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_epi8)
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_epi8(k: __mmask16, a: __m128i) -> i8 {
5404    unsafe { simd_reduce_max(simd_select_bitmask(k, a.as_i8x16(), i8x16::splat(-128))) }
5405}
5406
5407/// Reduce the packed unsigned 16-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_epu16)
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_epu16(a: __m256i) -> u16 {
5415    unsafe { simd_reduce_max(a.as_u16x16()) }
5416}
5417
5418/// Reduce the packed unsigned 16-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_epu16)
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_epu16(k: __mmask16, a: __m256i) -> u16 {
5426    unsafe { simd_reduce_max(simd_select_bitmask(k, a.as_u16x16(), u16x16::ZERO)) }
5427}
5428
5429/// Reduce the packed unsigned 16-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_epu16)
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_epu16(a: __m128i) -> u16 {
5437    unsafe { simd_reduce_max(a.as_u16x8()) }
5438}
5439
5440/// Reduce the packed unsigned 16-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_epu16)
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_epu16(k: __mmask8, a: __m128i) -> u16 {
5448    unsafe { simd_reduce_max(simd_select_bitmask(k, a.as_u16x8(), u16x8::ZERO)) }
5449}
5450
5451/// Reduce the packed unsigned 8-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_epu8)
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_epu8(a: __m256i) -> u8 {
5459    unsafe { simd_reduce_max(a.as_u8x32()) }
5460}
5461
5462/// Reduce the packed unsigned 8-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_epu8)
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_epu8(k: __mmask32, a: __m256i) -> u8 {
5470    unsafe { simd_reduce_max(simd_select_bitmask(k, a.as_u8x32(), u8x32::ZERO)) }
5471}
5472
5473/// Reduce the packed unsigned 8-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_epu8)
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_epu8(a: __m128i) -> u8 {
5481    unsafe { simd_reduce_max(a.as_u8x16()) }
5482}
5483
5484/// Reduce the packed unsigned 8-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_epu8)
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_epu8(k: __mmask16, a: __m128i) -> u8 {
5492    unsafe { simd_reduce_max(simd_select_bitmask(k, a.as_u8x16(), u8x16::ZERO)) }
5493}
5494
5495/// Reduce the packed 16-bit integers in a by minimum. Returns the minimum 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_min_epi16)
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_min_epi16(a: __m256i) -> i16 {
5503    unsafe { simd_reduce_min(a.as_i16x16()) }
5504}
5505
5506/// Reduce the packed 16-bit integers in a by minimum using mask k. Returns the minimum 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_min_epi16)
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_min_epi16(k: __mmask16, a: __m256i) -> i16 {
5514    unsafe { simd_reduce_min(simd_select_bitmask(k, a.as_i16x16(), i16x16::splat(0x7fff))) }
5515}
5516
5517/// Reduce the packed 16-bit integers in a by minimum. Returns the minimum 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_min_epi16)
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_min_epi16(a: __m128i) -> i16 {
5525    unsafe { simd_reduce_min(a.as_i16x8()) }
5526}
5527
5528/// Reduce the packed 16-bit integers in a by minimum using mask k. Returns the minimum 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_min_epi16)
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_min_epi16(k: __mmask8, a: __m128i) -> i16 {
5536    unsafe { simd_reduce_min(simd_select_bitmask(k, a.as_i16x8(), i16x8::splat(0x7fff))) }
5537}
5538
5539/// Reduce the packed 8-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_epi8)
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_epi8(a: __m256i) -> i8 {
5547    unsafe { simd_reduce_min(a.as_i8x32()) }
5548}
5549
5550/// Reduce the packed 8-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_epi8)
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_epi8(k: __mmask32, a: __m256i) -> i8 {
5558    unsafe { simd_reduce_min(simd_select_bitmask(k, a.as_i8x32(), i8x32::splat(0x7f))) }
5559}
5560
5561/// Reduce the packed 8-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_epi8)
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_epi8(a: __m128i) -> i8 {
5569    unsafe { simd_reduce_min(a.as_i8x16()) }
5570}
5571
5572/// Reduce the packed 8-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_epi8)
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_epi8(k: __mmask16, a: __m128i) -> i8 {
5580    unsafe { simd_reduce_min(simd_select_bitmask(k, a.as_i8x16(), i8x16::splat(0x7f))) }
5581}
5582
5583/// Reduce the packed unsigned 16-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_epu16)
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_epu16(a: __m256i) -> u16 {
5591    unsafe { simd_reduce_min(a.as_u16x16()) }
5592}
5593
5594/// Reduce the packed unsigned 16-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_epu16)
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_epu16(k: __mmask16, a: __m256i) -> u16 {
5602    unsafe { simd_reduce_min(simd_select_bitmask(k, a.as_u16x16(), u16x16::splat(0xffff))) }
5603}
5604
5605/// Reduce the packed unsigned 16-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_epu16)
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_epu16(a: __m128i) -> u16 {
5613    unsafe { simd_reduce_min(a.as_u16x8()) }
5614}
5615
5616/// Reduce the packed unsigned 16-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_epu16)
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_epu16(k: __mmask8, a: __m128i) -> u16 {
5624    unsafe { simd_reduce_min(simd_select_bitmask(k, a.as_u16x8(), u16x8::splat(0xffff))) }
5625}
5626
5627/// Reduce the packed unsigned 8-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_epu8)
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_epu8(a: __m256i) -> u8 {
5635    unsafe { simd_reduce_min(a.as_u8x32()) }
5636}
5637
5638/// Reduce the packed unsigned 8-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_epu8)
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_epu8(k: __mmask32, a: __m256i) -> u8 {
5646    unsafe { simd_reduce_min(simd_select_bitmask(k, a.as_u8x32(), u8x32::splat(0xff))) }
5647}
5648
5649/// Reduce the packed unsigned 8-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_epu8)
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_epu8(a: __m128i) -> u8 {
5657    unsafe { simd_reduce_min(a.as_u8x16()) }
5658}
5659
5660/// Reduce the packed unsigned 8-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_epu8)
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_epu8(k: __mmask16, a: __m128i) -> u8 {
5668    unsafe { simd_reduce_min(simd_select_bitmask(k, a.as_u8x16(), u8x16::splat(0xff))) }
5669}
5670
5671/// Reduce the packed 16-bit integers in a by multiplication. Returns the product 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_mul_epi16)
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_mul_epi16(a: __m256i) -> i16 {
5679    unsafe { simd_reduce_mul_ordered(a.as_i16x16(), 1) }
5680}
5681
5682/// Reduce the packed 16-bit integers in a by multiplication using mask k. Returns the product 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_mul_epi16)
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_mul_epi16(k: __mmask16, a: __m256i) -> i16 {
5690    unsafe { simd_reduce_mul_ordered(simd_select_bitmask(k, a.as_i16x16(), i16x16::splat(1)), 1) }
5691}
5692
5693/// Reduce the packed 16-bit integers in a by multiplication. Returns the product 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_mul_epi16)
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_mul_epi16(a: __m128i) -> i16 {
5701    unsafe { simd_reduce_mul_ordered(a.as_i16x8(), 1) }
5702}
5703
5704/// Reduce the packed 16-bit integers in a by multiplication using mask k. Returns the product 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_mul_epi16)
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_mul_epi16(k: __mmask8, a: __m128i) -> i16 {
5712    unsafe { simd_reduce_mul_ordered(simd_select_bitmask(k, a.as_i16x8(), i16x8::splat(1)), 1) }
5713}
5714
5715/// Reduce the packed 8-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_epi8)
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_epi8(a: __m256i) -> i8 {
5723    unsafe { simd_reduce_mul_ordered(a.as_i8x32(), 1) }
5724}
5725
5726/// Reduce the packed 8-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_epi8)
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_epi8(k: __mmask32, a: __m256i) -> i8 {
5734    unsafe { simd_reduce_mul_ordered(simd_select_bitmask(k, a.as_i8x32(), i8x32::splat(1)), 1) }
5735}
5736
5737/// Reduce the packed 8-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_epi8)
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_epi8(a: __m128i) -> i8 {
5745    unsafe { simd_reduce_mul_ordered(a.as_i8x16(), 1) }
5746}
5747
5748/// Reduce the packed 8-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_epi8)
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_epi8(k: __mmask16, a: __m128i) -> i8 {
5756    unsafe { simd_reduce_mul_ordered(simd_select_bitmask(k, a.as_i8x16(), i8x16::splat(1)), 1) }
5757}
5758
5759/// Reduce the packed 16-bit integers in a by bitwise OR. Returns the bitwise OR 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_or_epi16)
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_or_epi16(a: __m256i) -> i16 {
5767    unsafe { simd_reduce_or(a.as_i16x16()) }
5768}
5769
5770/// Reduce the packed 16-bit integers in a by bitwise OR using mask k. Returns the bitwise OR 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_or_epi16)
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_or_epi16(k: __mmask16, a: __m256i) -> i16 {
5778    unsafe { simd_reduce_or(simd_select_bitmask(k, a.as_i16x16(), i16x16::ZERO)) }
5779}
5780
5781/// Reduce the packed 16-bit integers in a by bitwise OR. Returns the bitwise OR 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_or_epi16)
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_or_epi16(a: __m128i) -> i16 {
5789    unsafe { simd_reduce_or(a.as_i16x8()) }
5790}
5791
5792/// Reduce the packed 16-bit integers in a by bitwise OR using mask k. Returns the bitwise OR 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_or_epi16)
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_or_epi16(k: __mmask8, a: __m128i) -> i16 {
5800    unsafe { simd_reduce_or(simd_select_bitmask(k, a.as_i16x8(), i16x8::ZERO)) }
5801}
5802
5803/// Reduce the packed 8-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_epi8)
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_epi8(a: __m256i) -> i8 {
5811    unsafe { simd_reduce_or(a.as_i8x32()) }
5812}
5813
5814/// Reduce the packed 8-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_epi8)
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_epi8(k: __mmask32, a: __m256i) -> i8 {
5822    unsafe { simd_reduce_or(simd_select_bitmask(k, a.as_i8x32(), i8x32::ZERO)) }
5823}
5824
5825/// Reduce the packed 8-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_epi8)
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_epi8(a: __m128i) -> i8 {
5833    unsafe { simd_reduce_or(a.as_i8x16()) }
5834}
5835
5836/// Reduce the packed 8-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_epi8)
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_epi8(k: __mmask16, a: __m128i) -> i8 {
5844    unsafe { simd_reduce_or(simd_select_bitmask(k, a.as_i8x16(), i8x16::ZERO)) }
5845}
5846
5847/// 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.
5848///
5849/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_loadu_epi16&expand=3368)
5850#[inline]
5851#[target_feature(enable = "avx512bw")]
5852#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5853#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu16
5854#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5855pub const unsafe fn _mm512_loadu_epi16(mem_addr: *const i16) -> __m512i {
5856    ptr::read_unaligned(mem_addr as *const __m512i)
5857}
5858
5859/// 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.
5860///
5861/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_loadu_epi16&expand=3365)
5862#[inline]
5863#[target_feature(enable = "avx512bw,avx512vl")]
5864#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5865#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu16
5866#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5867pub const unsafe fn _mm256_loadu_epi16(mem_addr: *const i16) -> __m256i {
5868    ptr::read_unaligned(mem_addr as *const __m256i)
5869}
5870
5871/// 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.
5872///
5873/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_loadu_epi16&expand=3362)
5874#[inline]
5875#[target_feature(enable = "avx512bw,avx512vl")]
5876#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5877#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu16
5878#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5879pub const unsafe fn _mm_loadu_epi16(mem_addr: *const i16) -> __m128i {
5880    ptr::read_unaligned(mem_addr as *const __m128i)
5881}
5882
5883/// 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.
5884///
5885/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_loadu_epi8&expand=3395)
5886#[inline]
5887#[target_feature(enable = "avx512bw")]
5888#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5889#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu8
5890#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5891pub const unsafe fn _mm512_loadu_epi8(mem_addr: *const i8) -> __m512i {
5892    ptr::read_unaligned(mem_addr as *const __m512i)
5893}
5894
5895/// 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.
5896///
5897/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_loadu_epi8&expand=3392)
5898#[inline]
5899#[target_feature(enable = "avx512bw,avx512vl")]
5900#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5901#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu8
5902#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5903pub const unsafe fn _mm256_loadu_epi8(mem_addr: *const i8) -> __m256i {
5904    ptr::read_unaligned(mem_addr as *const __m256i)
5905}
5906
5907/// 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.
5908///
5909/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_loadu_epi8&expand=3389)
5910#[inline]
5911#[target_feature(enable = "avx512bw,avx512vl")]
5912#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5913#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu8
5914#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5915pub const unsafe fn _mm_loadu_epi8(mem_addr: *const i8) -> __m128i {
5916    ptr::read_unaligned(mem_addr as *const __m128i)
5917}
5918
5919/// 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.
5920///
5921/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_storeu_epi16&expand=5622)
5922#[inline]
5923#[target_feature(enable = "avx512bw")]
5924#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5925#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu16
5926#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5927pub const unsafe fn _mm512_storeu_epi16(mem_addr: *mut i16, a: __m512i) {
5928    ptr::write_unaligned(mem_addr as *mut __m512i, a);
5929}
5930
5931/// 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.
5932///
5933/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_storeu_epi16&expand=5620)
5934#[inline]
5935#[target_feature(enable = "avx512bw,avx512vl")]
5936#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5937#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu16
5938#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5939pub const unsafe fn _mm256_storeu_epi16(mem_addr: *mut i16, a: __m256i) {
5940    ptr::write_unaligned(mem_addr as *mut __m256i, a);
5941}
5942
5943/// 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.
5944///
5945/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_storeu_epi16&expand=5618)
5946#[inline]
5947#[target_feature(enable = "avx512bw,avx512vl")]
5948#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5949#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu16
5950#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5951pub const unsafe fn _mm_storeu_epi16(mem_addr: *mut i16, a: __m128i) {
5952    ptr::write_unaligned(mem_addr as *mut __m128i, a);
5953}
5954
5955/// 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.
5956///
5957/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_storeu_epi8&expand=5640)
5958#[inline]
5959#[target_feature(enable = "avx512bw")]
5960#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5961#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu8
5962#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5963pub const unsafe fn _mm512_storeu_epi8(mem_addr: *mut i8, a: __m512i) {
5964    ptr::write_unaligned(mem_addr as *mut __m512i, a);
5965}
5966
5967/// 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.
5968///
5969/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_storeu_epi8&expand=5638)
5970#[inline]
5971#[target_feature(enable = "avx512bw,avx512vl")]
5972#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5973#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu8
5974#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5975pub const unsafe fn _mm256_storeu_epi8(mem_addr: *mut i8, a: __m256i) {
5976    ptr::write_unaligned(mem_addr as *mut __m256i, a);
5977}
5978
5979/// 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.
5980///
5981/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_storeu_epi8&expand=5636)
5982#[inline]
5983#[target_feature(enable = "avx512bw,avx512vl")]
5984#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
5985#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu8
5986#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
5987pub const unsafe fn _mm_storeu_epi8(mem_addr: *mut i8, a: __m128i) {
5988    ptr::write_unaligned(mem_addr as *mut __m128i, a);
5989}
5990
5991/// Load packed 16-bit integers from memory into dst using writemask k
5992/// (elements are copied from src when the corresponding mask bit is not set).
5993/// mem_addr does not need to be aligned on any particular boundary.
5994///
5995/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_loadu_epi16)
5996#[inline]
5997#[target_feature(enable = "avx512bw")]
5998#[cfg_attr(test, assert_instr(vmovdqu16))]
5999#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6000#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6001pub const unsafe fn _mm512_mask_loadu_epi16(
6002    src: __m512i,
6003    k: __mmask32,
6004    mem_addr: *const i16,
6005) -> __m512i {
6006    let mask = simd_select_bitmask(k, i16x32::splat(!0), i16x32::ZERO);
6007    simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_i16x32()).as_m512i()
6008}
6009
6010/// Load packed 16-bit integers from memory into dst using zeromask k
6011/// (elements are zeroed out when the corresponding mask bit is not set).
6012/// mem_addr does not need to be aligned on any particular boundary.
6013///
6014/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_loadu_epi16)
6015#[inline]
6016#[target_feature(enable = "avx512bw")]
6017#[cfg_attr(test, assert_instr(vmovdqu16))]
6018#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6019#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6020pub const unsafe fn _mm512_maskz_loadu_epi16(k: __mmask32, mem_addr: *const i16) -> __m512i {
6021    _mm512_mask_loadu_epi16(_mm512_setzero_si512(), k, mem_addr)
6022}
6023
6024/// Load packed 8-bit integers from memory into dst using writemask k
6025/// (elements are copied from src when the corresponding mask bit is not set).
6026/// mem_addr does not need to be aligned on any particular boundary.
6027///
6028/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_loadu_epi8)
6029#[inline]
6030#[target_feature(enable = "avx512bw")]
6031#[cfg_attr(test, assert_instr(vmovdqu8))]
6032#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6033#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6034pub const unsafe fn _mm512_mask_loadu_epi8(
6035    src: __m512i,
6036    k: __mmask64,
6037    mem_addr: *const i8,
6038) -> __m512i {
6039    let mask = simd_select_bitmask(k, i8x64::splat(!0), i8x64::ZERO);
6040    simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_i8x64()).as_m512i()
6041}
6042
6043/// Load packed 8-bit integers from memory into dst using zeromask k
6044/// (elements are zeroed out when the corresponding mask bit is not set).
6045/// mem_addr does not need to be aligned on any particular boundary.
6046///
6047/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_loadu_epi8)
6048#[inline]
6049#[target_feature(enable = "avx512bw")]
6050#[cfg_attr(test, assert_instr(vmovdqu8))]
6051#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6052#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6053pub const unsafe fn _mm512_maskz_loadu_epi8(k: __mmask64, mem_addr: *const i8) -> __m512i {
6054    _mm512_mask_loadu_epi8(_mm512_setzero_si512(), k, mem_addr)
6055}
6056
6057/// Load packed 16-bit integers from memory into dst using writemask k
6058/// (elements are copied from src when the corresponding mask bit is not set).
6059/// mem_addr does not need to be aligned on any particular boundary.
6060///
6061/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_loadu_epi16)
6062#[inline]
6063#[target_feature(enable = "avx512bw,avx512vl")]
6064#[cfg_attr(test, assert_instr(vmovdqu16))]
6065#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6066#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6067pub const unsafe fn _mm256_mask_loadu_epi16(
6068    src: __m256i,
6069    k: __mmask16,
6070    mem_addr: *const i16,
6071) -> __m256i {
6072    let mask = simd_select_bitmask(k, i16x16::splat(!0), i16x16::ZERO);
6073    simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_i16x16()).as_m256i()
6074}
6075
6076/// Load packed 16-bit integers from memory into dst using zeromask k
6077/// (elements are zeroed out when the corresponding mask bit is not set).
6078/// mem_addr does not need to be aligned on any particular boundary.
6079///
6080/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_loadu_epi16)
6081#[inline]
6082#[target_feature(enable = "avx512bw,avx512vl")]
6083#[cfg_attr(test, assert_instr(vmovdqu16))]
6084#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6085#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6086pub const unsafe fn _mm256_maskz_loadu_epi16(k: __mmask16, mem_addr: *const i16) -> __m256i {
6087    _mm256_mask_loadu_epi16(_mm256_setzero_si256(), k, mem_addr)
6088}
6089
6090/// Load packed 8-bit integers from memory into dst using writemask k
6091/// (elements are copied from src when the corresponding mask bit is not set).
6092/// mem_addr does not need to be aligned on any particular boundary.
6093///
6094/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_loadu_epi8)
6095#[inline]
6096#[target_feature(enable = "avx512bw,avx512vl")]
6097#[cfg_attr(test, assert_instr(vmovdqu8))]
6098#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6099#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6100pub const unsafe fn _mm256_mask_loadu_epi8(
6101    src: __m256i,
6102    k: __mmask32,
6103    mem_addr: *const i8,
6104) -> __m256i {
6105    let mask = simd_select_bitmask(k, i8x32::splat(!0), i8x32::ZERO);
6106    simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_i8x32()).as_m256i()
6107}
6108
6109/// Load packed 8-bit integers from memory into dst using zeromask k
6110/// (elements are zeroed out when the corresponding mask bit is not set).
6111/// mem_addr does not need to be aligned on any particular boundary.
6112///
6113/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_loadu_epi8)
6114#[inline]
6115#[target_feature(enable = "avx512bw,avx512vl")]
6116#[cfg_attr(test, assert_instr(vmovdqu8))]
6117#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6118#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6119pub const unsafe fn _mm256_maskz_loadu_epi8(k: __mmask32, mem_addr: *const i8) -> __m256i {
6120    _mm256_mask_loadu_epi8(_mm256_setzero_si256(), k, mem_addr)
6121}
6122
6123/// Load packed 16-bit integers from memory into dst using writemask k
6124/// (elements are copied from src when the corresponding mask bit is not set).
6125/// mem_addr does not need to be aligned on any particular boundary.
6126///
6127/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_loadu_epi16)
6128#[inline]
6129#[target_feature(enable = "avx512bw,avx512vl")]
6130#[cfg_attr(test, assert_instr(vmovdqu16))]
6131#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6132#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6133pub const unsafe fn _mm_mask_loadu_epi16(
6134    src: __m128i,
6135    k: __mmask8,
6136    mem_addr: *const i16,
6137) -> __m128i {
6138    let mask = simd_select_bitmask(k, i16x8::splat(!0), i16x8::ZERO);
6139    simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_i16x8()).as_m128i()
6140}
6141
6142/// Load packed 16-bit integers from memory into dst using zeromask k
6143/// (elements are zeroed out when the corresponding mask bit is not set).
6144/// mem_addr does not need to be aligned on any particular boundary.
6145///
6146/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_loadu_epi16)
6147#[inline]
6148#[target_feature(enable = "avx512bw,avx512vl")]
6149#[cfg_attr(test, assert_instr(vmovdqu16))]
6150#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6151#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6152pub const unsafe fn _mm_maskz_loadu_epi16(k: __mmask8, mem_addr: *const i16) -> __m128i {
6153    _mm_mask_loadu_epi16(_mm_setzero_si128(), k, mem_addr)
6154}
6155
6156/// Load packed 8-bit integers from memory into dst using writemask k
6157/// (elements are copied from src when the corresponding mask bit is not set).
6158/// mem_addr does not need to be aligned on any particular boundary.
6159///
6160/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_loadu_epi8)
6161#[inline]
6162#[target_feature(enable = "avx512bw,avx512vl")]
6163#[cfg_attr(test, assert_instr(vmovdqu8))]
6164#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6165#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6166pub const unsafe fn _mm_mask_loadu_epi8(
6167    src: __m128i,
6168    k: __mmask16,
6169    mem_addr: *const i8,
6170) -> __m128i {
6171    let mask = simd_select_bitmask(k, i8x16::splat(!0), i8x16::ZERO);
6172    simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_i8x16()).as_m128i()
6173}
6174
6175/// Load packed 8-bit integers from memory into dst using zeromask k
6176/// (elements are zeroed out when the corresponding mask bit is not set).
6177/// mem_addr does not need to be aligned on any particular boundary.
6178///
6179/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_loadu_epi8)
6180#[inline]
6181#[target_feature(enable = "avx512bw,avx512vl")]
6182#[cfg_attr(test, assert_instr(vmovdqu8))]
6183#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6184#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6185pub const unsafe fn _mm_maskz_loadu_epi8(k: __mmask16, mem_addr: *const i8) -> __m128i {
6186    _mm_mask_loadu_epi8(_mm_setzero_si128(), k, mem_addr)
6187}
6188
6189/// Store packed 16-bit integers from a into memory using writemask k.
6190/// mem_addr does not need to be aligned on any particular boundary.
6191///
6192/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_storeu_epi16)
6193#[inline]
6194#[target_feature(enable = "avx512bw")]
6195#[cfg_attr(test, assert_instr(vmovdqu16))]
6196#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6197#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6198pub const unsafe fn _mm512_mask_storeu_epi16(mem_addr: *mut i16, mask: __mmask32, a: __m512i) {
6199    let mask = simd_select_bitmask(mask, i16x32::splat(!0), i16x32::ZERO);
6200    simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_i16x32());
6201}
6202
6203/// Store packed 8-bit integers from a into memory using writemask k.
6204/// mem_addr does not need to be aligned on any particular boundary.
6205///
6206/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_storeu_epi8)
6207#[inline]
6208#[target_feature(enable = "avx512bw")]
6209#[cfg_attr(test, assert_instr(vmovdqu8))]
6210#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6211#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6212pub const unsafe fn _mm512_mask_storeu_epi8(mem_addr: *mut i8, mask: __mmask64, a: __m512i) {
6213    let mask = simd_select_bitmask(mask, i8x64::splat(!0), i8x64::ZERO);
6214    simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_i8x64());
6215}
6216
6217/// Store packed 16-bit integers from a into memory using writemask k.
6218/// mem_addr does not need to be aligned on any particular boundary.
6219///
6220/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_storeu_epi16)
6221#[inline]
6222#[target_feature(enable = "avx512bw,avx512vl")]
6223#[cfg_attr(test, assert_instr(vmovdqu16))]
6224#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6225#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6226pub const unsafe fn _mm256_mask_storeu_epi16(mem_addr: *mut i16, mask: __mmask16, a: __m256i) {
6227    let mask = simd_select_bitmask(mask, i16x16::splat(!0), i16x16::ZERO);
6228    simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_i16x16());
6229}
6230
6231/// Store packed 8-bit integers from a into memory using writemask k.
6232/// mem_addr does not need to be aligned on any particular boundary.
6233///
6234/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_storeu_epi8)
6235#[inline]
6236#[target_feature(enable = "avx512bw,avx512vl")]
6237#[cfg_attr(test, assert_instr(vmovdqu8))]
6238#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6239#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6240pub const unsafe fn _mm256_mask_storeu_epi8(mem_addr: *mut i8, mask: __mmask32, a: __m256i) {
6241    let mask = simd_select_bitmask(mask, i8x32::splat(!0), i8x32::ZERO);
6242    simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_i8x32());
6243}
6244
6245/// Store packed 16-bit integers from a into memory using writemask k.
6246/// mem_addr does not need to be aligned on any particular boundary.
6247///
6248/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_storeu_epi16)
6249#[inline]
6250#[target_feature(enable = "avx512bw,avx512vl")]
6251#[cfg_attr(test, assert_instr(vmovdqu16))]
6252#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6253#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6254pub const unsafe fn _mm_mask_storeu_epi16(mem_addr: *mut i16, mask: __mmask8, a: __m128i) {
6255    let mask = simd_select_bitmask(mask, i16x8::splat(!0), i16x8::ZERO);
6256    simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_i16x8());
6257}
6258
6259/// Store packed 8-bit integers from a into memory using writemask k.
6260/// mem_addr does not need to be aligned on any particular boundary.
6261///
6262/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_storeu_epi8)
6263#[inline]
6264#[target_feature(enable = "avx512bw,avx512vl")]
6265#[cfg_attr(test, assert_instr(vmovdqu8))]
6266#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6267#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
6268pub const unsafe fn _mm_mask_storeu_epi8(mem_addr: *mut i8, mask: __mmask16, a: __m128i) {
6269    let mask = simd_select_bitmask(mask, i8x16::splat(!0), i8x16::ZERO);
6270    simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_i8x16());
6271}
6272
6273/// 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.
6274///
6275/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_madd_epi16&expand=3511)
6276#[inline]
6277#[target_feature(enable = "avx512bw")]
6278#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6279#[cfg_attr(test, assert_instr(vpmaddwd))]
6280pub fn _mm512_madd_epi16(a: __m512i, b: __m512i) -> __m512i {
6281    // It's a trick used in the Adler-32 algorithm to perform a widening addition.
6282    //
6283    // ```rust
6284    // #[target_feature(enable = "avx512bw")]
6285    // unsafe fn widening_add(mad: __m512i) -> __m512i {
6286    //     _mm512_madd_epi16(mad, _mm512_set1_epi16(1))
6287    // }
6288    // ```
6289    //
6290    // If we implement this using generic vector intrinsics, the optimizer
6291    // will eliminate this pattern, and `vpmaddwd` will no longer be emitted.
6292    // For this reason, we use x86 intrinsics.
6293    unsafe { transmute(vpmaddwd(a.as_i16x32(), b.as_i16x32())) }
6294}
6295
6296/// 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).
6297///
6298/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_madd_epi16&expand=3512)
6299#[inline]
6300#[target_feature(enable = "avx512bw")]
6301#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6302#[cfg_attr(test, assert_instr(vpmaddwd))]
6303pub fn _mm512_mask_madd_epi16(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
6304    unsafe {
6305        let madd = _mm512_madd_epi16(a, b).as_i32x16();
6306        transmute(simd_select_bitmask(k, madd, src.as_i32x16()))
6307    }
6308}
6309
6310/// 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).
6311///
6312/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_madd_epi16&expand=3513)
6313#[inline]
6314#[target_feature(enable = "avx512bw")]
6315#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6316#[cfg_attr(test, assert_instr(vpmaddwd))]
6317pub fn _mm512_maskz_madd_epi16(k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
6318    unsafe {
6319        let madd = _mm512_madd_epi16(a, b).as_i32x16();
6320        transmute(simd_select_bitmask(k, madd, i32x16::ZERO))
6321    }
6322}
6323
6324/// 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).
6325///
6326/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_madd_epi16&expand=3509)
6327#[inline]
6328#[target_feature(enable = "avx512bw,avx512vl")]
6329#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6330#[cfg_attr(test, assert_instr(vpmaddwd))]
6331pub fn _mm256_mask_madd_epi16(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
6332    unsafe {
6333        let madd = _mm256_madd_epi16(a, b).as_i32x8();
6334        transmute(simd_select_bitmask(k, madd, src.as_i32x8()))
6335    }
6336}
6337
6338/// 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).
6339///
6340/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_madd_epi16&expand=3510)
6341#[inline]
6342#[target_feature(enable = "avx512bw,avx512vl")]
6343#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6344#[cfg_attr(test, assert_instr(vpmaddwd))]
6345pub fn _mm256_maskz_madd_epi16(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
6346    unsafe {
6347        let madd = _mm256_madd_epi16(a, b).as_i32x8();
6348        transmute(simd_select_bitmask(k, madd, i32x8::ZERO))
6349    }
6350}
6351
6352/// 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).
6353///
6354/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_madd_epi16&expand=3506)
6355#[inline]
6356#[target_feature(enable = "avx512bw,avx512vl")]
6357#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6358#[cfg_attr(test, assert_instr(vpmaddwd))]
6359pub fn _mm_mask_madd_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
6360    unsafe {
6361        let madd = _mm_madd_epi16(a, b).as_i32x4();
6362        transmute(simd_select_bitmask(k, madd, src.as_i32x4()))
6363    }
6364}
6365
6366/// 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).
6367///
6368/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_madd_epi16&expand=3507)
6369#[inline]
6370#[target_feature(enable = "avx512bw,avx512vl")]
6371#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6372#[cfg_attr(test, assert_instr(vpmaddwd))]
6373pub fn _mm_maskz_madd_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
6374    unsafe {
6375        let madd = _mm_madd_epi16(a, b).as_i32x4();
6376        transmute(simd_select_bitmask(k, madd, i32x4::ZERO))
6377    }
6378}
6379
6380/// 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.
6381///
6382/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maddubs_epi16&expand=3539)
6383#[inline]
6384#[target_feature(enable = "avx512bw")]
6385#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6386#[cfg_attr(test, assert_instr(vpmaddubsw))]
6387pub fn _mm512_maddubs_epi16(a: __m512i, b: __m512i) -> __m512i {
6388    unsafe { transmute(vpmaddubsw(a.as_u8x64(), b.as_i8x64())) }
6389}
6390
6391/// 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).
6392///
6393/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_maddubs_epi16&expand=3540)
6394#[inline]
6395#[target_feature(enable = "avx512bw")]
6396#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6397#[cfg_attr(test, assert_instr(vpmaddubsw))]
6398pub fn _mm512_mask_maddubs_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
6399    unsafe {
6400        let madd = _mm512_maddubs_epi16(a, b).as_i16x32();
6401        transmute(simd_select_bitmask(k, madd, src.as_i16x32()))
6402    }
6403}
6404
6405/// 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).
6406///
6407/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_maddubs_epi16&expand=3541)
6408#[inline]
6409#[target_feature(enable = "avx512bw")]
6410#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6411#[cfg_attr(test, assert_instr(vpmaddubsw))]
6412pub fn _mm512_maskz_maddubs_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
6413    unsafe {
6414        let madd = _mm512_maddubs_epi16(a, b).as_i16x32();
6415        transmute(simd_select_bitmask(k, madd, i16x32::ZERO))
6416    }
6417}
6418
6419/// 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).
6420///
6421/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_maddubs_epi16&expand=3537)
6422#[inline]
6423#[target_feature(enable = "avx512bw,avx512vl")]
6424#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6425#[cfg_attr(test, assert_instr(vpmaddubsw))]
6426pub fn _mm256_mask_maddubs_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
6427    unsafe {
6428        let madd = _mm256_maddubs_epi16(a, b).as_i16x16();
6429        transmute(simd_select_bitmask(k, madd, src.as_i16x16()))
6430    }
6431}
6432
6433/// 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).
6434///
6435/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_maddubs_epi16&expand=3538)
6436#[inline]
6437#[target_feature(enable = "avx512bw,avx512vl")]
6438#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6439#[cfg_attr(test, assert_instr(vpmaddubsw))]
6440pub fn _mm256_maskz_maddubs_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
6441    unsafe {
6442        let madd = _mm256_maddubs_epi16(a, b).as_i16x16();
6443        transmute(simd_select_bitmask(k, madd, i16x16::ZERO))
6444    }
6445}
6446
6447/// 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).
6448///
6449/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_maddubs_epi16&expand=3534)
6450#[inline]
6451#[target_feature(enable = "avx512bw,avx512vl")]
6452#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6453#[cfg_attr(test, assert_instr(vpmaddubsw))]
6454pub fn _mm_mask_maddubs_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
6455    unsafe {
6456        let madd = _mm_maddubs_epi16(a, b).as_i16x8();
6457        transmute(simd_select_bitmask(k, madd, src.as_i16x8()))
6458    }
6459}
6460
6461/// 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).
6462///
6463/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_maddubs_epi16&expand=3535)
6464#[inline]
6465#[target_feature(enable = "avx512bw,avx512vl")]
6466#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6467#[cfg_attr(test, assert_instr(vpmaddubsw))]
6468pub fn _mm_maskz_maddubs_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
6469    unsafe {
6470        let madd = _mm_maddubs_epi16(a, b).as_i16x8();
6471        transmute(simd_select_bitmask(k, madd, i16x8::ZERO))
6472    }
6473}
6474
6475/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using signed saturation, and store the results in dst.
6476///
6477/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_packs_epi32&expand=4091)
6478#[inline]
6479#[target_feature(enable = "avx512bw")]
6480#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6481#[cfg_attr(test, assert_instr(vpackssdw))]
6482pub fn _mm512_packs_epi32(a: __m512i, b: __m512i) -> __m512i {
6483    unsafe { transmute(vpackssdw(a.as_i32x16(), b.as_i32x16())) }
6484}
6485
6486/// 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).
6487///
6488/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_packs_epi32&expand=4089)
6489#[inline]
6490#[target_feature(enable = "avx512bw")]
6491#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6492#[cfg_attr(test, assert_instr(vpackssdw))]
6493pub fn _mm512_mask_packs_epi32(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
6494    unsafe {
6495        let pack = _mm512_packs_epi32(a, b).as_i16x32();
6496        transmute(simd_select_bitmask(k, pack, src.as_i16x32()))
6497    }
6498}
6499
6500/// 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).
6501///
6502/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_packs_epi32&expand=4090)
6503#[inline]
6504#[target_feature(enable = "avx512bw")]
6505#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6506#[cfg_attr(test, assert_instr(vpackssdw))]
6507pub fn _mm512_maskz_packs_epi32(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
6508    unsafe {
6509        let pack = _mm512_packs_epi32(a, b).as_i16x32();
6510        transmute(simd_select_bitmask(k, pack, i16x32::ZERO))
6511    }
6512}
6513
6514/// 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).
6515///
6516/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_packs_epi32&expand=4086)
6517#[inline]
6518#[target_feature(enable = "avx512bw,avx512vl")]
6519#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6520#[cfg_attr(test, assert_instr(vpackssdw))]
6521pub fn _mm256_mask_packs_epi32(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
6522    unsafe {
6523        let pack = _mm256_packs_epi32(a, b).as_i16x16();
6524        transmute(simd_select_bitmask(k, pack, src.as_i16x16()))
6525    }
6526}
6527
6528/// 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).
6529///
6530/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_packs_epi32&expand=4087)
6531#[inline]
6532#[target_feature(enable = "avx512bw,avx512vl")]
6533#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6534#[cfg_attr(test, assert_instr(vpackssdw))]
6535pub fn _mm256_maskz_packs_epi32(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
6536    unsafe {
6537        let pack = _mm256_packs_epi32(a, b).as_i16x16();
6538        transmute(simd_select_bitmask(k, pack, i16x16::ZERO))
6539    }
6540}
6541
6542/// 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).
6543///
6544/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_packs_epi32&expand=4083)
6545#[inline]
6546#[target_feature(enable = "avx512bw,avx512vl")]
6547#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6548#[cfg_attr(test, assert_instr(vpackssdw))]
6549pub fn _mm_mask_packs_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
6550    unsafe {
6551        let pack = _mm_packs_epi32(a, b).as_i16x8();
6552        transmute(simd_select_bitmask(k, pack, src.as_i16x8()))
6553    }
6554}
6555
6556/// 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).
6557///
6558/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_packs_epi32&expand=4084)
6559#[inline]
6560#[target_feature(enable = "avx512bw,avx512vl")]
6561#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6562#[cfg_attr(test, assert_instr(vpackssdw))]
6563pub fn _mm_maskz_packs_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
6564    unsafe {
6565        let pack = _mm_packs_epi32(a, b).as_i16x8();
6566        transmute(simd_select_bitmask(k, pack, i16x8::ZERO))
6567    }
6568}
6569
6570/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using signed saturation, and store the results in dst.
6571///
6572/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_packs_epi16&expand=4082)
6573#[inline]
6574#[target_feature(enable = "avx512bw")]
6575#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6576#[cfg_attr(test, assert_instr(vpacksswb))]
6577pub fn _mm512_packs_epi16(a: __m512i, b: __m512i) -> __m512i {
6578    unsafe { transmute(vpacksswb(a.as_i16x32(), b.as_i16x32())) }
6579}
6580
6581/// 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).
6582///
6583/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_packs_epi16&expand=4080)
6584#[inline]
6585#[target_feature(enable = "avx512bw")]
6586#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6587#[cfg_attr(test, assert_instr(vpacksswb))]
6588pub fn _mm512_mask_packs_epi16(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
6589    unsafe {
6590        let pack = _mm512_packs_epi16(a, b).as_i8x64();
6591        transmute(simd_select_bitmask(k, pack, src.as_i8x64()))
6592    }
6593}
6594
6595/// 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).
6596///
6597/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_packs_epi16&expand=4081)
6598#[inline]
6599#[target_feature(enable = "avx512bw")]
6600#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6601#[cfg_attr(test, assert_instr(vpacksswb))]
6602pub fn _mm512_maskz_packs_epi16(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
6603    unsafe {
6604        let pack = _mm512_packs_epi16(a, b).as_i8x64();
6605        transmute(simd_select_bitmask(k, pack, i8x64::ZERO))
6606    }
6607}
6608
6609/// 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).
6610///
6611/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_packs_epi16&expand=4077)
6612#[inline]
6613#[target_feature(enable = "avx512bw,avx512vl")]
6614#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6615#[cfg_attr(test, assert_instr(vpacksswb))]
6616pub fn _mm256_mask_packs_epi16(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
6617    unsafe {
6618        let pack = _mm256_packs_epi16(a, b).as_i8x32();
6619        transmute(simd_select_bitmask(k, pack, src.as_i8x32()))
6620    }
6621}
6622
6623/// 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).
6624///
6625/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=#text=_mm256_maskz_packs_epi16&expand=4078)
6626#[inline]
6627#[target_feature(enable = "avx512bw,avx512vl")]
6628#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6629#[cfg_attr(test, assert_instr(vpacksswb))]
6630pub fn _mm256_maskz_packs_epi16(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
6631    unsafe {
6632        let pack = _mm256_packs_epi16(a, b).as_i8x32();
6633        transmute(simd_select_bitmask(k, pack, i8x32::ZERO))
6634    }
6635}
6636
6637/// 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).
6638///
6639/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_packs_epi16&expand=4074)
6640#[inline]
6641#[target_feature(enable = "avx512bw,avx512vl")]
6642#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6643#[cfg_attr(test, assert_instr(vpacksswb))]
6644pub fn _mm_mask_packs_epi16(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
6645    unsafe {
6646        let pack = _mm_packs_epi16(a, b).as_i8x16();
6647        transmute(simd_select_bitmask(k, pack, src.as_i8x16()))
6648    }
6649}
6650
6651/// 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).
6652///
6653/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_packs_epi16&expand=4075)
6654#[inline]
6655#[target_feature(enable = "avx512bw,avx512vl")]
6656#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6657#[cfg_attr(test, assert_instr(vpacksswb))]
6658pub fn _mm_maskz_packs_epi16(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
6659    unsafe {
6660        let pack = _mm_packs_epi16(a, b).as_i8x16();
6661        transmute(simd_select_bitmask(k, pack, i8x16::ZERO))
6662    }
6663}
6664
6665/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using unsigned saturation, and store the results in dst.
6666///
6667/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_packus_epi32&expand=4130)
6668#[inline]
6669#[target_feature(enable = "avx512bw")]
6670#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6671#[cfg_attr(test, assert_instr(vpackusdw))]
6672pub fn _mm512_packus_epi32(a: __m512i, b: __m512i) -> __m512i {
6673    unsafe { transmute(vpackusdw(a.as_i32x16(), b.as_i32x16())) }
6674}
6675
6676/// 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).
6677///
6678/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_packus_epi32&expand=4128)
6679#[inline]
6680#[target_feature(enable = "avx512bw")]
6681#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6682#[cfg_attr(test, assert_instr(vpackusdw))]
6683pub fn _mm512_mask_packus_epi32(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
6684    unsafe {
6685        let pack = _mm512_packus_epi32(a, b).as_i16x32();
6686        transmute(simd_select_bitmask(k, pack, src.as_i16x32()))
6687    }
6688}
6689
6690/// 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).
6691///
6692/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_packus_epi32&expand=4129)
6693#[inline]
6694#[target_feature(enable = "avx512bw")]
6695#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6696#[cfg_attr(test, assert_instr(vpackusdw))]
6697pub fn _mm512_maskz_packus_epi32(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
6698    unsafe {
6699        let pack = _mm512_packus_epi32(a, b).as_i16x32();
6700        transmute(simd_select_bitmask(k, pack, i16x32::ZERO))
6701    }
6702}
6703
6704/// 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).
6705///
6706/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_packus_epi32&expand=4125)
6707#[inline]
6708#[target_feature(enable = "avx512bw,avx512vl")]
6709#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6710#[cfg_attr(test, assert_instr(vpackusdw))]
6711pub fn _mm256_mask_packus_epi32(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
6712    unsafe {
6713        let pack = _mm256_packus_epi32(a, b).as_i16x16();
6714        transmute(simd_select_bitmask(k, pack, src.as_i16x16()))
6715    }
6716}
6717
6718/// 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).
6719///
6720/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_packus_epi32&expand=4126)
6721#[inline]
6722#[target_feature(enable = "avx512bw,avx512vl")]
6723#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6724#[cfg_attr(test, assert_instr(vpackusdw))]
6725pub fn _mm256_maskz_packus_epi32(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
6726    unsafe {
6727        let pack = _mm256_packus_epi32(a, b).as_i16x16();
6728        transmute(simd_select_bitmask(k, pack, i16x16::ZERO))
6729    }
6730}
6731
6732/// 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).
6733///
6734/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_packus_epi32&expand=4122)
6735#[inline]
6736#[target_feature(enable = "avx512bw,avx512vl")]
6737#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6738#[cfg_attr(test, assert_instr(vpackusdw))]
6739pub fn _mm_mask_packus_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
6740    unsafe {
6741        let pack = _mm_packus_epi32(a, b).as_i16x8();
6742        transmute(simd_select_bitmask(k, pack, src.as_i16x8()))
6743    }
6744}
6745
6746/// 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).
6747///
6748/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_packus_epi32&expand=4123)
6749#[inline]
6750#[target_feature(enable = "avx512bw,avx512vl")]
6751#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6752#[cfg_attr(test, assert_instr(vpackusdw))]
6753pub fn _mm_maskz_packus_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
6754    unsafe {
6755        let pack = _mm_packus_epi32(a, b).as_i16x8();
6756        transmute(simd_select_bitmask(k, pack, i16x8::ZERO))
6757    }
6758}
6759
6760/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using unsigned saturation, and store the results in dst.
6761///
6762/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_packus_epi16&expand=4121)
6763#[inline]
6764#[target_feature(enable = "avx512bw")]
6765#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6766#[cfg_attr(test, assert_instr(vpackuswb))]
6767pub fn _mm512_packus_epi16(a: __m512i, b: __m512i) -> __m512i {
6768    unsafe { transmute(vpackuswb(a.as_i16x32(), b.as_i16x32())) }
6769}
6770
6771/// 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).
6772///
6773/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_packus_epi16&expand=4119)
6774#[inline]
6775#[target_feature(enable = "avx512bw")]
6776#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6777#[cfg_attr(test, assert_instr(vpackuswb))]
6778pub fn _mm512_mask_packus_epi16(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
6779    unsafe {
6780        let pack = _mm512_packus_epi16(a, b).as_i8x64();
6781        transmute(simd_select_bitmask(k, pack, src.as_i8x64()))
6782    }
6783}
6784
6785/// 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).
6786///
6787/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_packus_epi16&expand=4120)
6788#[inline]
6789#[target_feature(enable = "avx512bw")]
6790#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6791#[cfg_attr(test, assert_instr(vpackuswb))]
6792pub fn _mm512_maskz_packus_epi16(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
6793    unsafe {
6794        let pack = _mm512_packus_epi16(a, b).as_i8x64();
6795        transmute(simd_select_bitmask(k, pack, i8x64::ZERO))
6796    }
6797}
6798
6799/// 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).
6800///
6801/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_packus_epi16&expand=4116)
6802#[inline]
6803#[target_feature(enable = "avx512bw,avx512vl")]
6804#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6805#[cfg_attr(test, assert_instr(vpackuswb))]
6806pub fn _mm256_mask_packus_epi16(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
6807    unsafe {
6808        let pack = _mm256_packus_epi16(a, b).as_i8x32();
6809        transmute(simd_select_bitmask(k, pack, src.as_i8x32()))
6810    }
6811}
6812
6813/// 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).
6814///
6815/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_packus_epi16&expand=4117)
6816#[inline]
6817#[target_feature(enable = "avx512bw,avx512vl")]
6818#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6819#[cfg_attr(test, assert_instr(vpackuswb))]
6820pub fn _mm256_maskz_packus_epi16(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
6821    unsafe {
6822        let pack = _mm256_packus_epi16(a, b).as_i8x32();
6823        transmute(simd_select_bitmask(k, pack, i8x32::ZERO))
6824    }
6825}
6826
6827/// 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).
6828///
6829/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_packus_epi16&expand=4113)
6830#[inline]
6831#[target_feature(enable = "avx512bw,avx512vl")]
6832#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6833#[cfg_attr(test, assert_instr(vpackuswb))]
6834pub fn _mm_mask_packus_epi16(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
6835    unsafe {
6836        let pack = _mm_packus_epi16(a, b).as_i8x16();
6837        transmute(simd_select_bitmask(k, pack, src.as_i8x16()))
6838    }
6839}
6840
6841/// 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).
6842///
6843/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_packus_epi16&expand=4114)
6844#[inline]
6845#[target_feature(enable = "avx512bw,avx512vl")]
6846#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6847#[cfg_attr(test, assert_instr(vpackuswb))]
6848pub fn _mm_maskz_packus_epi16(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
6849    unsafe {
6850        let pack = _mm_packus_epi16(a, b).as_i8x16();
6851        transmute(simd_select_bitmask(k, pack, i8x16::ZERO))
6852    }
6853}
6854
6855/// Average packed unsigned 16-bit integers in a and b, and store the results in dst.
6856///
6857/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_avg_epu16&expand=388)
6858#[inline]
6859#[target_feature(enable = "avx512bw")]
6860#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6861#[cfg_attr(test, assert_instr(vpavgw))]
6862pub fn _mm512_avg_epu16(a: __m512i, b: __m512i) -> __m512i {
6863    unsafe { transmute(vpavgw(a.as_u16x32(), b.as_u16x32())) }
6864}
6865
6866/// 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).
6867///
6868/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_avg_epu16&expand=389)
6869#[inline]
6870#[target_feature(enable = "avx512bw")]
6871#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6872#[cfg_attr(test, assert_instr(vpavgw))]
6873pub fn _mm512_mask_avg_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
6874    unsafe {
6875        let avg = _mm512_avg_epu16(a, b).as_u16x32();
6876        transmute(simd_select_bitmask(k, avg, src.as_u16x32()))
6877    }
6878}
6879
6880/// 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).
6881///
6882/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_avg_epu16&expand=390)
6883#[inline]
6884#[target_feature(enable = "avx512bw")]
6885#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6886#[cfg_attr(test, assert_instr(vpavgw))]
6887pub fn _mm512_maskz_avg_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
6888    unsafe {
6889        let avg = _mm512_avg_epu16(a, b).as_u16x32();
6890        transmute(simd_select_bitmask(k, avg, u16x32::ZERO))
6891    }
6892}
6893
6894/// 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).
6895///
6896/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_avg_epu16&expand=386)
6897#[inline]
6898#[target_feature(enable = "avx512bw,avx512vl")]
6899#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6900#[cfg_attr(test, assert_instr(vpavgw))]
6901pub fn _mm256_mask_avg_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
6902    unsafe {
6903        let avg = _mm256_avg_epu16(a, b).as_u16x16();
6904        transmute(simd_select_bitmask(k, avg, src.as_u16x16()))
6905    }
6906}
6907
6908/// 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).
6909///
6910/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_avg_epu16&expand=387)
6911#[inline]
6912#[target_feature(enable = "avx512bw,avx512vl")]
6913#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6914#[cfg_attr(test, assert_instr(vpavgw))]
6915pub fn _mm256_maskz_avg_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
6916    unsafe {
6917        let avg = _mm256_avg_epu16(a, b).as_u16x16();
6918        transmute(simd_select_bitmask(k, avg, u16x16::ZERO))
6919    }
6920}
6921
6922/// 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).
6923///
6924/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_avg_epu16&expand=383)
6925#[inline]
6926#[target_feature(enable = "avx512bw,avx512vl")]
6927#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6928#[cfg_attr(test, assert_instr(vpavgw))]
6929pub fn _mm_mask_avg_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
6930    unsafe {
6931        let avg = _mm_avg_epu16(a, b).as_u16x8();
6932        transmute(simd_select_bitmask(k, avg, src.as_u16x8()))
6933    }
6934}
6935
6936/// 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).
6937///
6938/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_avg_epu16&expand=384)
6939#[inline]
6940#[target_feature(enable = "avx512bw,avx512vl")]
6941#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6942#[cfg_attr(test, assert_instr(vpavgw))]
6943pub fn _mm_maskz_avg_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
6944    unsafe {
6945        let avg = _mm_avg_epu16(a, b).as_u16x8();
6946        transmute(simd_select_bitmask(k, avg, u16x8::ZERO))
6947    }
6948}
6949
6950/// Average packed unsigned 8-bit integers in a and b, and store the results in dst.
6951///
6952/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_avg_epu8&expand=397)
6953#[inline]
6954#[target_feature(enable = "avx512bw")]
6955#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6956#[cfg_attr(test, assert_instr(vpavgb))]
6957pub fn _mm512_avg_epu8(a: __m512i, b: __m512i) -> __m512i {
6958    unsafe { transmute(vpavgb(a.as_u8x64(), b.as_u8x64())) }
6959}
6960
6961/// 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).
6962///
6963/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_avg_epu8&expand=398)
6964#[inline]
6965#[target_feature(enable = "avx512bw")]
6966#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6967#[cfg_attr(test, assert_instr(vpavgb))]
6968pub fn _mm512_mask_avg_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
6969    unsafe {
6970        let avg = _mm512_avg_epu8(a, b).as_u8x64();
6971        transmute(simd_select_bitmask(k, avg, src.as_u8x64()))
6972    }
6973}
6974
6975/// 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).
6976///
6977/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_avg_epu8&expand=399)
6978#[inline]
6979#[target_feature(enable = "avx512bw")]
6980#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6981#[cfg_attr(test, assert_instr(vpavgb))]
6982pub fn _mm512_maskz_avg_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
6983    unsafe {
6984        let avg = _mm512_avg_epu8(a, b).as_u8x64();
6985        transmute(simd_select_bitmask(k, avg, u8x64::ZERO))
6986    }
6987}
6988
6989/// 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).
6990///
6991/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_avg_epu8&expand=395)
6992#[inline]
6993#[target_feature(enable = "avx512bw,avx512vl")]
6994#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6995#[cfg_attr(test, assert_instr(vpavgb))]
6996pub fn _mm256_mask_avg_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
6997    unsafe {
6998        let avg = _mm256_avg_epu8(a, b).as_u8x32();
6999        transmute(simd_select_bitmask(k, avg, src.as_u8x32()))
7000    }
7001}
7002
7003/// 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).
7004///
7005/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_avg_epu8&expand=396)
7006#[inline]
7007#[target_feature(enable = "avx512bw,avx512vl")]
7008#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7009#[cfg_attr(test, assert_instr(vpavgb))]
7010pub fn _mm256_maskz_avg_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
7011    unsafe {
7012        let avg = _mm256_avg_epu8(a, b).as_u8x32();
7013        transmute(simd_select_bitmask(k, avg, u8x32::ZERO))
7014    }
7015}
7016
7017/// 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).
7018///
7019/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_avg_epu8&expand=392)
7020#[inline]
7021#[target_feature(enable = "avx512bw,avx512vl")]
7022#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7023#[cfg_attr(test, assert_instr(vpavgb))]
7024pub fn _mm_mask_avg_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
7025    unsafe {
7026        let avg = _mm_avg_epu8(a, b).as_u8x16();
7027        transmute(simd_select_bitmask(k, avg, src.as_u8x16()))
7028    }
7029}
7030
7031/// 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).
7032///
7033/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_avg_epu8&expand=393)
7034#[inline]
7035#[target_feature(enable = "avx512bw,avx512vl")]
7036#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7037#[cfg_attr(test, assert_instr(vpavgb))]
7038pub fn _mm_maskz_avg_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
7039    unsafe {
7040        let avg = _mm_avg_epu8(a, b).as_u8x16();
7041        transmute(simd_select_bitmask(k, avg, u8x16::ZERO))
7042    }
7043}
7044
7045/// Shift packed 16-bit integers in a left by count while shifting in zeros, and store the results in dst.
7046///
7047/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_sll_epi16&expand=5271)
7048#[inline]
7049#[target_feature(enable = "avx512bw")]
7050#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7051#[cfg_attr(test, assert_instr(vpsllw))]
7052pub fn _mm512_sll_epi16(a: __m512i, count: __m128i) -> __m512i {
7053    unsafe { transmute(vpsllw(a.as_i16x32(), count.as_i16x8())) }
7054}
7055
7056/// 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).
7057///
7058/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_sll_epi16&expand=5269)
7059#[inline]
7060#[target_feature(enable = "avx512bw")]
7061#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7062#[cfg_attr(test, assert_instr(vpsllw))]
7063pub fn _mm512_mask_sll_epi16(src: __m512i, k: __mmask32, a: __m512i, count: __m128i) -> __m512i {
7064    unsafe {
7065        let shf = _mm512_sll_epi16(a, count).as_i16x32();
7066        transmute(simd_select_bitmask(k, shf, src.as_i16x32()))
7067    }
7068}
7069
7070/// 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).
7071///
7072/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_sll_epi16&expand=5270)
7073#[inline]
7074#[target_feature(enable = "avx512bw")]
7075#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7076#[cfg_attr(test, assert_instr(vpsllw))]
7077pub fn _mm512_maskz_sll_epi16(k: __mmask32, a: __m512i, count: __m128i) -> __m512i {
7078    unsafe {
7079        let shf = _mm512_sll_epi16(a, count).as_i16x32();
7080        transmute(simd_select_bitmask(k, shf, i16x32::ZERO))
7081    }
7082}
7083
7084/// 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).
7085///
7086/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_sll_epi16&expand=5266)
7087#[inline]
7088#[target_feature(enable = "avx512bw,avx512vl")]
7089#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7090#[cfg_attr(test, assert_instr(vpsllw))]
7091pub fn _mm256_mask_sll_epi16(src: __m256i, k: __mmask16, a: __m256i, count: __m128i) -> __m256i {
7092    unsafe {
7093        let shf = _mm256_sll_epi16(a, count).as_i16x16();
7094        transmute(simd_select_bitmask(k, shf, src.as_i16x16()))
7095    }
7096}
7097
7098/// 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).
7099///
7100/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_sll_epi16&expand=5267)
7101#[inline]
7102#[target_feature(enable = "avx512bw,avx512vl")]
7103#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7104#[cfg_attr(test, assert_instr(vpsllw))]
7105pub fn _mm256_maskz_sll_epi16(k: __mmask16, a: __m256i, count: __m128i) -> __m256i {
7106    unsafe {
7107        let shf = _mm256_sll_epi16(a, count).as_i16x16();
7108        transmute(simd_select_bitmask(k, shf, i16x16::ZERO))
7109    }
7110}
7111
7112/// 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).
7113///
7114/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_sll_epi16&expand=5263)
7115#[inline]
7116#[target_feature(enable = "avx512bw,avx512vl")]
7117#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7118#[cfg_attr(test, assert_instr(vpsllw))]
7119pub fn _mm_mask_sll_epi16(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
7120    unsafe {
7121        let shf = _mm_sll_epi16(a, count).as_i16x8();
7122        transmute(simd_select_bitmask(k, shf, src.as_i16x8()))
7123    }
7124}
7125
7126/// 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).
7127///
7128/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_sll_epi16&expand=5264)
7129#[inline]
7130#[target_feature(enable = "avx512bw,avx512vl")]
7131#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7132#[cfg_attr(test, assert_instr(vpsllw))]
7133pub fn _mm_maskz_sll_epi16(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
7134    unsafe {
7135        let shf = _mm_sll_epi16(a, count).as_i16x8();
7136        transmute(simd_select_bitmask(k, shf, i16x8::ZERO))
7137    }
7138}
7139
7140/// Shift packed 16-bit integers in a left by imm8 while shifting in zeros, and store the results in dst.
7141///
7142/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_slli_epi16&expand=5301)
7143#[inline]
7144#[target_feature(enable = "avx512bw")]
7145#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7146#[cfg_attr(test, assert_instr(vpsllw, IMM8 = 5))]
7147#[rustc_legacy_const_generics(1)]
7148#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7149pub const fn _mm512_slli_epi16<const IMM8: u32>(a: __m512i) -> __m512i {
7150    unsafe {
7151        static_assert_uimm_bits!(IMM8, 8);
7152        if IMM8 >= 16 {
7153            _mm512_setzero_si512()
7154        } else {
7155            transmute(simd_shl(a.as_u16x32(), u16x32::splat(IMM8 as u16)))
7156        }
7157    }
7158}
7159
7160/// 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).
7161///
7162/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_slli_epi16&expand=5299)
7163#[inline]
7164#[target_feature(enable = "avx512bw")]
7165#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7166#[cfg_attr(test, assert_instr(vpsllw, IMM8 = 5))]
7167#[rustc_legacy_const_generics(3)]
7168#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7169pub const fn _mm512_mask_slli_epi16<const IMM8: u32>(
7170    src: __m512i,
7171    k: __mmask32,
7172    a: __m512i,
7173) -> __m512i {
7174    unsafe {
7175        static_assert_uimm_bits!(IMM8, 8);
7176        let shf = if IMM8 >= 16 {
7177            u16x32::ZERO
7178        } else {
7179            simd_shl(a.as_u16x32(), u16x32::splat(IMM8 as u16))
7180        };
7181        transmute(simd_select_bitmask(k, shf, src.as_u16x32()))
7182    }
7183}
7184
7185/// 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).
7186///
7187/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_slli_epi16&expand=5300)
7188#[inline]
7189#[target_feature(enable = "avx512bw")]
7190#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7191#[cfg_attr(test, assert_instr(vpsllw, IMM8 = 5))]
7192#[rustc_legacy_const_generics(2)]
7193#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7194pub const fn _mm512_maskz_slli_epi16<const IMM8: u32>(k: __mmask32, a: __m512i) -> __m512i {
7195    unsafe {
7196        static_assert_uimm_bits!(IMM8, 8);
7197        if IMM8 >= 16 {
7198            _mm512_setzero_si512()
7199        } else {
7200            let shf = simd_shl(a.as_u16x32(), u16x32::splat(IMM8 as u16));
7201            transmute(simd_select_bitmask(k, shf, u16x32::ZERO))
7202        }
7203    }
7204}
7205
7206/// 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).
7207///
7208/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_slli_epi16&expand=5296)
7209#[inline]
7210#[target_feature(enable = "avx512bw,avx512vl")]
7211#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7212#[cfg_attr(test, assert_instr(vpsllw, IMM8 = 5))]
7213#[rustc_legacy_const_generics(3)]
7214#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7215pub const fn _mm256_mask_slli_epi16<const IMM8: u32>(
7216    src: __m256i,
7217    k: __mmask16,
7218    a: __m256i,
7219) -> __m256i {
7220    unsafe {
7221        static_assert_uimm_bits!(IMM8, 8);
7222        let shf = if IMM8 >= 16 {
7223            u16x16::ZERO
7224        } else {
7225            simd_shl(a.as_u16x16(), u16x16::splat(IMM8 as u16))
7226        };
7227        transmute(simd_select_bitmask(k, shf, src.as_u16x16()))
7228    }
7229}
7230
7231/// 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).
7232///
7233/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_slli_epi16&expand=5297)
7234#[inline]
7235#[target_feature(enable = "avx512bw,avx512vl")]
7236#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7237#[cfg_attr(test, assert_instr(vpsllw, IMM8 = 5))]
7238#[rustc_legacy_const_generics(2)]
7239#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7240pub const fn _mm256_maskz_slli_epi16<const IMM8: u32>(k: __mmask16, a: __m256i) -> __m256i {
7241    unsafe {
7242        static_assert_uimm_bits!(IMM8, 8);
7243        if IMM8 >= 16 {
7244            _mm256_setzero_si256()
7245        } else {
7246            let shf = simd_shl(a.as_u16x16(), u16x16::splat(IMM8 as u16));
7247            transmute(simd_select_bitmask(k, shf, u16x16::ZERO))
7248        }
7249    }
7250}
7251
7252/// 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).
7253///
7254/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_slli_epi16&expand=5293)
7255#[inline]
7256#[target_feature(enable = "avx512bw,avx512vl")]
7257#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7258#[cfg_attr(test, assert_instr(vpsllw, IMM8 = 5))]
7259#[rustc_legacy_const_generics(3)]
7260#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7261pub const fn _mm_mask_slli_epi16<const IMM8: u32>(
7262    src: __m128i,
7263    k: __mmask8,
7264    a: __m128i,
7265) -> __m128i {
7266    unsafe {
7267        static_assert_uimm_bits!(IMM8, 8);
7268        let shf = if IMM8 >= 16 {
7269            u16x8::ZERO
7270        } else {
7271            simd_shl(a.as_u16x8(), u16x8::splat(IMM8 as u16))
7272        };
7273        transmute(simd_select_bitmask(k, shf, src.as_u16x8()))
7274    }
7275}
7276
7277/// 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).
7278///
7279/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_slli_epi16&expand=5294)
7280#[inline]
7281#[target_feature(enable = "avx512bw,avx512vl")]
7282#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7283#[cfg_attr(test, assert_instr(vpsllw, IMM8 = 5))]
7284#[rustc_legacy_const_generics(2)]
7285#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7286pub const fn _mm_maskz_slli_epi16<const IMM8: u32>(k: __mmask8, a: __m128i) -> __m128i {
7287    unsafe {
7288        static_assert_uimm_bits!(IMM8, 8);
7289        if IMM8 >= 16 {
7290            _mm_setzero_si128()
7291        } else {
7292            let shf = simd_shl(a.as_u16x8(), u16x8::splat(IMM8 as u16));
7293            transmute(simd_select_bitmask(k, shf, u16x8::ZERO))
7294        }
7295    }
7296}
7297
7298/// 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.
7299///
7300/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_sllv_epi16&expand=5333)
7301#[inline]
7302#[target_feature(enable = "avx512bw")]
7303#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7304#[cfg_attr(test, assert_instr(vpsllvw))]
7305pub fn _mm512_sllv_epi16(a: __m512i, count: __m512i) -> __m512i {
7306    unsafe { transmute(vpsllvw(a.as_i16x32(), count.as_i16x32())) }
7307}
7308
7309/// 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).
7310///
7311/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_sllv_epi16&expand=5331)
7312#[inline]
7313#[target_feature(enable = "avx512bw")]
7314#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7315#[cfg_attr(test, assert_instr(vpsllvw))]
7316pub fn _mm512_mask_sllv_epi16(src: __m512i, k: __mmask32, a: __m512i, count: __m512i) -> __m512i {
7317    unsafe {
7318        let shf = _mm512_sllv_epi16(a, count).as_i16x32();
7319        transmute(simd_select_bitmask(k, shf, src.as_i16x32()))
7320    }
7321}
7322
7323/// 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).
7324///
7325/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_sllv_epi16&expand=5332)
7326#[inline]
7327#[target_feature(enable = "avx512bw")]
7328#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7329#[cfg_attr(test, assert_instr(vpsllvw))]
7330pub fn _mm512_maskz_sllv_epi16(k: __mmask32, a: __m512i, count: __m512i) -> __m512i {
7331    unsafe {
7332        let shf = _mm512_sllv_epi16(a, count).as_i16x32();
7333        transmute(simd_select_bitmask(k, shf, i16x32::ZERO))
7334    }
7335}
7336
7337/// 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.
7338///
7339/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_sllv_epi16&expand=5330)
7340#[inline]
7341#[target_feature(enable = "avx512bw,avx512vl")]
7342#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7343#[cfg_attr(test, assert_instr(vpsllvw))]
7344pub fn _mm256_sllv_epi16(a: __m256i, count: __m256i) -> __m256i {
7345    unsafe { transmute(vpsllvw256(a.as_i16x16(), count.as_i16x16())) }
7346}
7347
7348/// 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).
7349///
7350/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_sllv_epi16&expand=5328)
7351#[inline]
7352#[target_feature(enable = "avx512bw,avx512vl")]
7353#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7354#[cfg_attr(test, assert_instr(vpsllvw))]
7355pub fn _mm256_mask_sllv_epi16(src: __m256i, k: __mmask16, a: __m256i, count: __m256i) -> __m256i {
7356    unsafe {
7357        let shf = _mm256_sllv_epi16(a, count).as_i16x16();
7358        transmute(simd_select_bitmask(k, shf, src.as_i16x16()))
7359    }
7360}
7361
7362/// 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).
7363///
7364/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_sllv_epi16&expand=5329)
7365#[inline]
7366#[target_feature(enable = "avx512bw,avx512vl")]
7367#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7368#[cfg_attr(test, assert_instr(vpsllvw))]
7369pub fn _mm256_maskz_sllv_epi16(k: __mmask16, a: __m256i, count: __m256i) -> __m256i {
7370    unsafe {
7371        let shf = _mm256_sllv_epi16(a, count).as_i16x16();
7372        transmute(simd_select_bitmask(k, shf, i16x16::ZERO))
7373    }
7374}
7375
7376/// 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.
7377///
7378/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_sllv_epi16&expand=5327)
7379#[inline]
7380#[target_feature(enable = "avx512bw,avx512vl")]
7381#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7382#[cfg_attr(test, assert_instr(vpsllvw))]
7383pub fn _mm_sllv_epi16(a: __m128i, count: __m128i) -> __m128i {
7384    unsafe { transmute(vpsllvw128(a.as_i16x8(), count.as_i16x8())) }
7385}
7386
7387/// 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).
7388///
7389/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_sllv_epi16&expand=5325)
7390#[inline]
7391#[target_feature(enable = "avx512bw,avx512vl")]
7392#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7393#[cfg_attr(test, assert_instr(vpsllvw))]
7394pub fn _mm_mask_sllv_epi16(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
7395    unsafe {
7396        let shf = _mm_sllv_epi16(a, count).as_i16x8();
7397        transmute(simd_select_bitmask(k, shf, src.as_i16x8()))
7398    }
7399}
7400
7401/// 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).
7402///
7403/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_sllv_epi16&expand=5326)
7404#[inline]
7405#[target_feature(enable = "avx512bw,avx512vl")]
7406#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7407#[cfg_attr(test, assert_instr(vpsllvw))]
7408pub fn _mm_maskz_sllv_epi16(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
7409    unsafe {
7410        let shf = _mm_sllv_epi16(a, count).as_i16x8();
7411        transmute(simd_select_bitmask(k, shf, i16x8::ZERO))
7412    }
7413}
7414
7415/// Shift packed 16-bit integers in a right by count while shifting in zeros, and store the results in dst.
7416///
7417/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_srl_epi16&expand=5483)
7418#[inline]
7419#[target_feature(enable = "avx512bw")]
7420#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7421#[cfg_attr(test, assert_instr(vpsrlw))]
7422pub fn _mm512_srl_epi16(a: __m512i, count: __m128i) -> __m512i {
7423    unsafe { transmute(vpsrlw(a.as_i16x32(), count.as_i16x8())) }
7424}
7425
7426/// 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).
7427///
7428/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_srl_epi16&expand=5481)
7429#[inline]
7430#[target_feature(enable = "avx512bw")]
7431#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7432#[cfg_attr(test, assert_instr(vpsrlw))]
7433pub fn _mm512_mask_srl_epi16(src: __m512i, k: __mmask32, a: __m512i, count: __m128i) -> __m512i {
7434    unsafe {
7435        let shf = _mm512_srl_epi16(a, count).as_i16x32();
7436        transmute(simd_select_bitmask(k, shf, src.as_i16x32()))
7437    }
7438}
7439
7440/// 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).
7441///
7442/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_srl_epi16&expand=5482)
7443#[inline]
7444#[target_feature(enable = "avx512bw")]
7445#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7446#[cfg_attr(test, assert_instr(vpsrlw))]
7447pub fn _mm512_maskz_srl_epi16(k: __mmask32, a: __m512i, count: __m128i) -> __m512i {
7448    unsafe {
7449        let shf = _mm512_srl_epi16(a, count).as_i16x32();
7450        transmute(simd_select_bitmask(k, shf, i16x32::ZERO))
7451    }
7452}
7453
7454/// 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).
7455///
7456/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_srl_epi16&expand=5478)
7457#[inline]
7458#[target_feature(enable = "avx512bw,avx512vl")]
7459#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7460#[cfg_attr(test, assert_instr(vpsrlw))]
7461pub fn _mm256_mask_srl_epi16(src: __m256i, k: __mmask16, a: __m256i, count: __m128i) -> __m256i {
7462    unsafe {
7463        let shf = _mm256_srl_epi16(a, count).as_i16x16();
7464        transmute(simd_select_bitmask(k, shf, src.as_i16x16()))
7465    }
7466}
7467
7468/// 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).
7469///
7470/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_srl_epi16&expand=5479)
7471#[inline]
7472#[target_feature(enable = "avx512bw,avx512vl")]
7473#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7474#[cfg_attr(test, assert_instr(vpsrlw))]
7475pub fn _mm256_maskz_srl_epi16(k: __mmask16, a: __m256i, count: __m128i) -> __m256i {
7476    unsafe {
7477        let shf = _mm256_srl_epi16(a, count).as_i16x16();
7478        transmute(simd_select_bitmask(k, shf, i16x16::ZERO))
7479    }
7480}
7481
7482/// 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).
7483///
7484/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_srl_epi16&expand=5475)
7485#[inline]
7486#[target_feature(enable = "avx512bw,avx512vl")]
7487#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7488#[cfg_attr(test, assert_instr(vpsrlw))]
7489pub fn _mm_mask_srl_epi16(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
7490    unsafe {
7491        let shf = _mm_srl_epi16(a, count).as_i16x8();
7492        transmute(simd_select_bitmask(k, shf, src.as_i16x8()))
7493    }
7494}
7495
7496/// 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).
7497///
7498/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_srl_epi16&expand=5476)
7499#[inline]
7500#[target_feature(enable = "avx512bw,avx512vl")]
7501#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7502#[cfg_attr(test, assert_instr(vpsrlw))]
7503pub fn _mm_maskz_srl_epi16(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
7504    unsafe {
7505        let shf = _mm_srl_epi16(a, count).as_i16x8();
7506        transmute(simd_select_bitmask(k, shf, i16x8::ZERO))
7507    }
7508}
7509
7510/// Shift packed 16-bit integers in a right by imm8 while shifting in zeros, and store the results in dst.
7511///
7512/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_srli_epi16&expand=5513)
7513#[inline]
7514#[target_feature(enable = "avx512bw")]
7515#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7516#[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 5))]
7517#[rustc_legacy_const_generics(1)]
7518#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7519pub const fn _mm512_srli_epi16<const IMM8: u32>(a: __m512i) -> __m512i {
7520    unsafe {
7521        static_assert_uimm_bits!(IMM8, 8);
7522        if IMM8 >= 16 {
7523            _mm512_setzero_si512()
7524        } else {
7525            transmute(simd_shr(a.as_u16x32(), u16x32::splat(IMM8 as u16)))
7526        }
7527    }
7528}
7529
7530/// 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).
7531///
7532/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_srli_epi16&expand=5511)
7533#[inline]
7534#[target_feature(enable = "avx512bw")]
7535#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7536#[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 5))]
7537#[rustc_legacy_const_generics(3)]
7538#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7539pub const fn _mm512_mask_srli_epi16<const IMM8: u32>(
7540    src: __m512i,
7541    k: __mmask32,
7542    a: __m512i,
7543) -> __m512i {
7544    unsafe {
7545        static_assert_uimm_bits!(IMM8, 8);
7546        let shf = if IMM8 >= 16 {
7547            u16x32::ZERO
7548        } else {
7549            simd_shr(a.as_u16x32(), u16x32::splat(IMM8 as u16))
7550        };
7551        transmute(simd_select_bitmask(k, shf, src.as_u16x32()))
7552    }
7553}
7554
7555/// 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).
7556///
7557/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_srli_epi16&expand=5512)
7558#[inline]
7559#[target_feature(enable = "avx512bw")]
7560#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7561#[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 5))]
7562#[rustc_legacy_const_generics(2)]
7563#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7564pub const fn _mm512_maskz_srli_epi16<const IMM8: i32>(k: __mmask32, a: __m512i) -> __m512i {
7565    unsafe {
7566        static_assert_uimm_bits!(IMM8, 8);
7567        //imm8 should be u32, it seems the document to verify is incorrect
7568        if IMM8 >= 16 {
7569            _mm512_setzero_si512()
7570        } else {
7571            let shf = simd_shr(a.as_u16x32(), u16x32::splat(IMM8 as u16));
7572            transmute(simd_select_bitmask(k, shf, u16x32::ZERO))
7573        }
7574    }
7575}
7576
7577/// 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).
7578///
7579/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_srli_epi16&expand=5508)
7580#[inline]
7581#[target_feature(enable = "avx512bw,avx512vl")]
7582#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7583#[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 5))]
7584#[rustc_legacy_const_generics(3)]
7585#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7586pub const fn _mm256_mask_srli_epi16<const IMM8: i32>(
7587    src: __m256i,
7588    k: __mmask16,
7589    a: __m256i,
7590) -> __m256i {
7591    unsafe {
7592        static_assert_uimm_bits!(IMM8, 8);
7593        let shf = _mm256_srli_epi16::<IMM8>(a);
7594        transmute(simd_select_bitmask(k, shf.as_i16x16(), src.as_i16x16()))
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 zeromask k (elements are zeroed out 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=_mm256_maskz_srli_epi16&expand=5509)
7601#[inline]
7602#[target_feature(enable = "avx512bw,avx512vl")]
7603#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7604#[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 5))]
7605#[rustc_legacy_const_generics(2)]
7606#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7607pub const fn _mm256_maskz_srli_epi16<const IMM8: i32>(k: __mmask16, a: __m256i) -> __m256i {
7608    unsafe {
7609        static_assert_uimm_bits!(IMM8, 8);
7610        let shf = _mm256_srli_epi16::<IMM8>(a);
7611        transmute(simd_select_bitmask(k, shf.as_i16x16(), i16x16::ZERO))
7612    }
7613}
7614
7615/// 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).
7616///
7617/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_srli_epi16&expand=5505)
7618#[inline]
7619#[target_feature(enable = "avx512bw,avx512vl")]
7620#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7621#[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 5))]
7622#[rustc_legacy_const_generics(3)]
7623#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7624pub const fn _mm_mask_srli_epi16<const IMM8: i32>(
7625    src: __m128i,
7626    k: __mmask8,
7627    a: __m128i,
7628) -> __m128i {
7629    unsafe {
7630        static_assert_uimm_bits!(IMM8, 8);
7631        let shf = _mm_srli_epi16::<IMM8>(a);
7632        transmute(simd_select_bitmask(k, shf.as_i16x8(), src.as_i16x8()))
7633    }
7634}
7635
7636/// 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).
7637///
7638/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_srli_epi16&expand=5506)
7639#[inline]
7640#[target_feature(enable = "avx512bw,avx512vl")]
7641#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7642#[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 5))]
7643#[rustc_legacy_const_generics(2)]
7644#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7645pub const fn _mm_maskz_srli_epi16<const IMM8: i32>(k: __mmask8, a: __m128i) -> __m128i {
7646    unsafe {
7647        static_assert_uimm_bits!(IMM8, 8);
7648        let shf = _mm_srli_epi16::<IMM8>(a);
7649        transmute(simd_select_bitmask(k, shf.as_i16x8(), i16x8::ZERO))
7650    }
7651}
7652
7653/// 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.
7654///
7655/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_srlv_epi16&expand=5545)
7656#[inline]
7657#[target_feature(enable = "avx512bw")]
7658#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7659#[cfg_attr(test, assert_instr(vpsrlvw))]
7660pub fn _mm512_srlv_epi16(a: __m512i, count: __m512i) -> __m512i {
7661    unsafe { transmute(vpsrlvw(a.as_i16x32(), count.as_i16x32())) }
7662}
7663
7664/// 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).
7665///
7666/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_srlv_epi16&expand=5543)
7667#[inline]
7668#[target_feature(enable = "avx512bw")]
7669#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7670#[cfg_attr(test, assert_instr(vpsrlvw))]
7671pub fn _mm512_mask_srlv_epi16(src: __m512i, k: __mmask32, a: __m512i, count: __m512i) -> __m512i {
7672    unsafe {
7673        let shf = _mm512_srlv_epi16(a, count).as_i16x32();
7674        transmute(simd_select_bitmask(k, shf, src.as_i16x32()))
7675    }
7676}
7677
7678/// 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).
7679///
7680/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_srlv_epi16&expand=5544)
7681#[inline]
7682#[target_feature(enable = "avx512bw")]
7683#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7684#[cfg_attr(test, assert_instr(vpsrlvw))]
7685pub fn _mm512_maskz_srlv_epi16(k: __mmask32, a: __m512i, count: __m512i) -> __m512i {
7686    unsafe {
7687        let shf = _mm512_srlv_epi16(a, count).as_i16x32();
7688        transmute(simd_select_bitmask(k, shf, i16x32::ZERO))
7689    }
7690}
7691
7692/// 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.
7693///
7694/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_srlv_epi16&expand=5542)
7695#[inline]
7696#[target_feature(enable = "avx512bw,avx512vl")]
7697#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7698#[cfg_attr(test, assert_instr(vpsrlvw))]
7699pub fn _mm256_srlv_epi16(a: __m256i, count: __m256i) -> __m256i {
7700    unsafe { transmute(vpsrlvw256(a.as_i16x16(), count.as_i16x16())) }
7701}
7702
7703/// 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).
7704///
7705/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_srlv_epi16&expand=5540)
7706#[inline]
7707#[target_feature(enable = "avx512bw,avx512vl")]
7708#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7709#[cfg_attr(test, assert_instr(vpsrlvw))]
7710pub fn _mm256_mask_srlv_epi16(src: __m256i, k: __mmask16, a: __m256i, count: __m256i) -> __m256i {
7711    unsafe {
7712        let shf = _mm256_srlv_epi16(a, count).as_i16x16();
7713        transmute(simd_select_bitmask(k, shf, src.as_i16x16()))
7714    }
7715}
7716
7717/// 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).
7718///
7719/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_srlv_epi16&expand=5541)
7720#[inline]
7721#[target_feature(enable = "avx512bw,avx512vl")]
7722#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7723#[cfg_attr(test, assert_instr(vpsrlvw))]
7724pub fn _mm256_maskz_srlv_epi16(k: __mmask16, a: __m256i, count: __m256i) -> __m256i {
7725    unsafe {
7726        let shf = _mm256_srlv_epi16(a, count).as_i16x16();
7727        transmute(simd_select_bitmask(k, shf, i16x16::ZERO))
7728    }
7729}
7730
7731/// 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.
7732///
7733/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_srlv_epi16&expand=5539)
7734#[inline]
7735#[target_feature(enable = "avx512bw,avx512vl")]
7736#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7737#[cfg_attr(test, assert_instr(vpsrlvw))]
7738pub fn _mm_srlv_epi16(a: __m128i, count: __m128i) -> __m128i {
7739    unsafe { transmute(vpsrlvw128(a.as_i16x8(), count.as_i16x8())) }
7740}
7741
7742/// 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).
7743///
7744/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_srlv_epi16&expand=5537)
7745#[inline]
7746#[target_feature(enable = "avx512bw,avx512vl")]
7747#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7748#[cfg_attr(test, assert_instr(vpsrlvw))]
7749pub fn _mm_mask_srlv_epi16(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
7750    unsafe {
7751        let shf = _mm_srlv_epi16(a, count).as_i16x8();
7752        transmute(simd_select_bitmask(k, shf, src.as_i16x8()))
7753    }
7754}
7755
7756/// 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).
7757///
7758/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_srlv_epi16&expand=5538)
7759#[inline]
7760#[target_feature(enable = "avx512bw,avx512vl")]
7761#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7762#[cfg_attr(test, assert_instr(vpsrlvw))]
7763pub fn _mm_maskz_srlv_epi16(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
7764    unsafe {
7765        let shf = _mm_srlv_epi16(a, count).as_i16x8();
7766        transmute(simd_select_bitmask(k, shf, i16x8::ZERO))
7767    }
7768}
7769
7770/// Shift packed 16-bit integers in a right by count while shifting in sign bits, and store the results in dst.
7771///
7772/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_sra_epi16&expand=5398)
7773#[inline]
7774#[target_feature(enable = "avx512bw")]
7775#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7776#[cfg_attr(test, assert_instr(vpsraw))]
7777pub fn _mm512_sra_epi16(a: __m512i, count: __m128i) -> __m512i {
7778    unsafe { transmute(vpsraw(a.as_i16x32(), count.as_i16x8())) }
7779}
7780
7781/// 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).
7782///
7783/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_sra_epi16&expand=5396)
7784#[inline]
7785#[target_feature(enable = "avx512bw")]
7786#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7787#[cfg_attr(test, assert_instr(vpsraw))]
7788pub fn _mm512_mask_sra_epi16(src: __m512i, k: __mmask32, a: __m512i, count: __m128i) -> __m512i {
7789    unsafe {
7790        let shf = _mm512_sra_epi16(a, count).as_i16x32();
7791        transmute(simd_select_bitmask(k, shf, src.as_i16x32()))
7792    }
7793}
7794
7795/// 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).
7796///
7797/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_sra_epi16&expand=5397)
7798#[inline]
7799#[target_feature(enable = "avx512bw")]
7800#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7801#[cfg_attr(test, assert_instr(vpsraw))]
7802pub fn _mm512_maskz_sra_epi16(k: __mmask32, a: __m512i, count: __m128i) -> __m512i {
7803    unsafe {
7804        let shf = _mm512_sra_epi16(a, count).as_i16x32();
7805        transmute(simd_select_bitmask(k, shf, i16x32::ZERO))
7806    }
7807}
7808
7809/// 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).
7810///
7811/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_sra_epi16&expand=5393)
7812#[inline]
7813#[target_feature(enable = "avx512bw,avx512vl")]
7814#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7815#[cfg_attr(test, assert_instr(vpsraw))]
7816pub fn _mm256_mask_sra_epi16(src: __m256i, k: __mmask16, a: __m256i, count: __m128i) -> __m256i {
7817    unsafe {
7818        let shf = _mm256_sra_epi16(a, count).as_i16x16();
7819        transmute(simd_select_bitmask(k, shf, src.as_i16x16()))
7820    }
7821}
7822
7823/// 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).
7824///
7825/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_sra_epi16&expand=5394)
7826#[inline]
7827#[target_feature(enable = "avx512bw,avx512vl")]
7828#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7829#[cfg_attr(test, assert_instr(vpsraw))]
7830pub fn _mm256_maskz_sra_epi16(k: __mmask16, a: __m256i, count: __m128i) -> __m256i {
7831    unsafe {
7832        let shf = _mm256_sra_epi16(a, count).as_i16x16();
7833        transmute(simd_select_bitmask(k, shf, i16x16::ZERO))
7834    }
7835}
7836
7837/// 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).
7838///
7839/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_sra_epi16&expand=5390)
7840#[inline]
7841#[target_feature(enable = "avx512bw,avx512vl")]
7842#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7843#[cfg_attr(test, assert_instr(vpsraw))]
7844pub fn _mm_mask_sra_epi16(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
7845    unsafe {
7846        let shf = _mm_sra_epi16(a, count).as_i16x8();
7847        transmute(simd_select_bitmask(k, shf, src.as_i16x8()))
7848    }
7849}
7850
7851/// 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).
7852///
7853/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_sra_epi16&expand=5391)
7854#[inline]
7855#[target_feature(enable = "avx512bw,avx512vl")]
7856#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7857#[cfg_attr(test, assert_instr(vpsraw))]
7858pub fn _mm_maskz_sra_epi16(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
7859    unsafe {
7860        let shf = _mm_sra_epi16(a, count).as_i16x8();
7861        transmute(simd_select_bitmask(k, shf, i16x8::ZERO))
7862    }
7863}
7864
7865/// Shift packed 16-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst.
7866///
7867/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_srai_epi16&expand=5427)
7868#[inline]
7869#[target_feature(enable = "avx512bw")]
7870#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7871#[cfg_attr(test, assert_instr(vpsraw, IMM8 = 1))]
7872#[rustc_legacy_const_generics(1)]
7873#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7874pub const fn _mm512_srai_epi16<const IMM8: u32>(a: __m512i) -> __m512i {
7875    unsafe {
7876        static_assert_uimm_bits!(IMM8, 8);
7877        transmute(simd_shr(a.as_i16x32(), i16x32::splat(IMM8.min(15) as i16)))
7878    }
7879}
7880
7881/// 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).
7882///
7883/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_srai_epi16&expand=5425)
7884#[inline]
7885#[target_feature(enable = "avx512bw")]
7886#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7887#[cfg_attr(test, assert_instr(vpsraw, IMM8 = 1))]
7888#[rustc_legacy_const_generics(3)]
7889#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7890pub const fn _mm512_mask_srai_epi16<const IMM8: u32>(
7891    src: __m512i,
7892    k: __mmask32,
7893    a: __m512i,
7894) -> __m512i {
7895    unsafe {
7896        static_assert_uimm_bits!(IMM8, 8);
7897        let shf = simd_shr(a.as_i16x32(), i16x32::splat(IMM8.min(15) as i16));
7898        transmute(simd_select_bitmask(k, shf, src.as_i16x32()))
7899    }
7900}
7901
7902/// 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).
7903///
7904/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_srai_epi16&expand=5426)
7905#[inline]
7906#[target_feature(enable = "avx512bw")]
7907#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7908#[cfg_attr(test, assert_instr(vpsraw, IMM8 = 1))]
7909#[rustc_legacy_const_generics(2)]
7910#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7911pub const fn _mm512_maskz_srai_epi16<const IMM8: u32>(k: __mmask32, a: __m512i) -> __m512i {
7912    unsafe {
7913        static_assert_uimm_bits!(IMM8, 8);
7914        let shf = simd_shr(a.as_i16x32(), i16x32::splat(IMM8.min(15) as i16));
7915        transmute(simd_select_bitmask(k, shf, i16x32::ZERO))
7916    }
7917}
7918
7919/// 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).
7920///
7921/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_srai_epi16&expand=5422)
7922#[inline]
7923#[target_feature(enable = "avx512bw,avx512vl")]
7924#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7925#[cfg_attr(test, assert_instr(vpsraw, IMM8 = 1))]
7926#[rustc_legacy_const_generics(3)]
7927#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7928pub const fn _mm256_mask_srai_epi16<const IMM8: u32>(
7929    src: __m256i,
7930    k: __mmask16,
7931    a: __m256i,
7932) -> __m256i {
7933    unsafe {
7934        static_assert_uimm_bits!(IMM8, 8);
7935        let r = simd_shr(a.as_i16x16(), i16x16::splat(IMM8.min(15) as i16));
7936        transmute(simd_select_bitmask(k, r, src.as_i16x16()))
7937    }
7938}
7939
7940/// 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).
7941///
7942/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_srai_epi16&expand=5423)
7943#[inline]
7944#[target_feature(enable = "avx512bw,avx512vl")]
7945#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7946#[cfg_attr(test, assert_instr(vpsraw, IMM8 = 1))]
7947#[rustc_legacy_const_generics(2)]
7948#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7949pub const fn _mm256_maskz_srai_epi16<const IMM8: u32>(k: __mmask16, a: __m256i) -> __m256i {
7950    unsafe {
7951        static_assert_uimm_bits!(IMM8, 8);
7952        let r = simd_shr(a.as_i16x16(), i16x16::splat(IMM8.min(15) as i16));
7953        transmute(simd_select_bitmask(k, r, i16x16::ZERO))
7954    }
7955}
7956
7957/// 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).
7958///
7959/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_srai_epi16&expand=5419)
7960#[inline]
7961#[target_feature(enable = "avx512bw,avx512vl")]
7962#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7963#[cfg_attr(test, assert_instr(vpsraw, IMM8 = 1))]
7964#[rustc_legacy_const_generics(3)]
7965#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7966pub const fn _mm_mask_srai_epi16<const IMM8: u32>(
7967    src: __m128i,
7968    k: __mmask8,
7969    a: __m128i,
7970) -> __m128i {
7971    unsafe {
7972        static_assert_uimm_bits!(IMM8, 8);
7973        let r = simd_shr(a.as_i16x8(), i16x8::splat(IMM8.min(15) as i16));
7974        transmute(simd_select_bitmask(k, r, src.as_i16x8()))
7975    }
7976}
7977
7978/// 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).
7979///
7980/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_srai_epi16&expand=5420)
7981#[inline]
7982#[target_feature(enable = "avx512bw,avx512vl")]
7983#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7984#[cfg_attr(test, assert_instr(vpsraw, IMM8 = 1))]
7985#[rustc_legacy_const_generics(2)]
7986#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
7987pub const fn _mm_maskz_srai_epi16<const IMM8: u32>(k: __mmask8, a: __m128i) -> __m128i {
7988    unsafe {
7989        static_assert_uimm_bits!(IMM8, 8);
7990        let r = simd_shr(a.as_i16x8(), i16x8::splat(IMM8.min(15) as i16));
7991        transmute(simd_select_bitmask(k, r, i16x8::ZERO))
7992    }
7993}
7994
7995/// 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.
7996///
7997/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_srav_epi16&expand=5456)
7998#[inline]
7999#[target_feature(enable = "avx512bw")]
8000#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8001#[cfg_attr(test, assert_instr(vpsravw))]
8002pub fn _mm512_srav_epi16(a: __m512i, count: __m512i) -> __m512i {
8003    unsafe { transmute(vpsravw(a.as_i16x32(), count.as_i16x32())) }
8004}
8005
8006/// 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).
8007///
8008/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_srav_epi16&expand=5454)
8009#[inline]
8010#[target_feature(enable = "avx512bw")]
8011#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8012#[cfg_attr(test, assert_instr(vpsravw))]
8013pub fn _mm512_mask_srav_epi16(src: __m512i, k: __mmask32, a: __m512i, count: __m512i) -> __m512i {
8014    unsafe {
8015        let shf = _mm512_srav_epi16(a, count).as_i16x32();
8016        transmute(simd_select_bitmask(k, shf, src.as_i16x32()))
8017    }
8018}
8019
8020/// 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).
8021///
8022/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_srav_epi16&expand=5455)
8023#[inline]
8024#[target_feature(enable = "avx512bw")]
8025#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8026#[cfg_attr(test, assert_instr(vpsravw))]
8027pub fn _mm512_maskz_srav_epi16(k: __mmask32, a: __m512i, count: __m512i) -> __m512i {
8028    unsafe {
8029        let shf = _mm512_srav_epi16(a, count).as_i16x32();
8030        transmute(simd_select_bitmask(k, shf, i16x32::ZERO))
8031    }
8032}
8033
8034/// 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.
8035///
8036/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_srav_epi16&expand=5453)
8037#[inline]
8038#[target_feature(enable = "avx512bw,avx512vl")]
8039#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8040#[cfg_attr(test, assert_instr(vpsravw))]
8041pub fn _mm256_srav_epi16(a: __m256i, count: __m256i) -> __m256i {
8042    unsafe { transmute(vpsravw256(a.as_i16x16(), count.as_i16x16())) }
8043}
8044
8045/// 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).
8046///
8047/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_srav_epi16&expand=5451)
8048#[inline]
8049#[target_feature(enable = "avx512bw,avx512vl")]
8050#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8051#[cfg_attr(test, assert_instr(vpsravw))]
8052pub fn _mm256_mask_srav_epi16(src: __m256i, k: __mmask16, a: __m256i, count: __m256i) -> __m256i {
8053    unsafe {
8054        let shf = _mm256_srav_epi16(a, count).as_i16x16();
8055        transmute(simd_select_bitmask(k, shf, src.as_i16x16()))
8056    }
8057}
8058
8059/// 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).
8060///
8061/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_srav_epi16&expand=5452)
8062#[inline]
8063#[target_feature(enable = "avx512bw,avx512vl")]
8064#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8065#[cfg_attr(test, assert_instr(vpsravw))]
8066pub fn _mm256_maskz_srav_epi16(k: __mmask16, a: __m256i, count: __m256i) -> __m256i {
8067    unsafe {
8068        let shf = _mm256_srav_epi16(a, count).as_i16x16();
8069        transmute(simd_select_bitmask(k, shf, i16x16::ZERO))
8070    }
8071}
8072
8073/// 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.
8074///
8075/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_srav_epi16&expand=5450)
8076#[inline]
8077#[target_feature(enable = "avx512bw,avx512vl")]
8078#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8079#[cfg_attr(test, assert_instr(vpsravw))]
8080pub fn _mm_srav_epi16(a: __m128i, count: __m128i) -> __m128i {
8081    unsafe { transmute(vpsravw128(a.as_i16x8(), count.as_i16x8())) }
8082}
8083
8084/// 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).
8085///
8086/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_srav_epi16&expand=5448)
8087#[inline]
8088#[target_feature(enable = "avx512bw,avx512vl")]
8089#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8090#[cfg_attr(test, assert_instr(vpsravw))]
8091pub fn _mm_mask_srav_epi16(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
8092    unsafe {
8093        let shf = _mm_srav_epi16(a, count).as_i16x8();
8094        transmute(simd_select_bitmask(k, shf, src.as_i16x8()))
8095    }
8096}
8097
8098/// 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).
8099///
8100/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_srav_epi16&expand=5449)
8101#[inline]
8102#[target_feature(enable = "avx512bw,avx512vl")]
8103#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8104#[cfg_attr(test, assert_instr(vpsravw))]
8105pub fn _mm_maskz_srav_epi16(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
8106    unsafe {
8107        let shf = _mm_srav_epi16(a, count).as_i16x8();
8108        transmute(simd_select_bitmask(k, shf, i16x8::ZERO))
8109    }
8110}
8111
8112/// Shuffle 16-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst.
8113///
8114/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_permutex2var_epi16&expand=4226)
8115#[inline]
8116#[target_feature(enable = "avx512bw")]
8117#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8118#[cfg_attr(test, assert_instr(vperm))] //vpermi2w or vpermt2w
8119pub fn _mm512_permutex2var_epi16(a: __m512i, idx: __m512i, b: __m512i) -> __m512i {
8120    unsafe { transmute(vpermi2w(a.as_i16x32(), idx.as_i16x32(), b.as_i16x32())) }
8121}
8122
8123/// 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).
8124///
8125/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_permutex2var_epi16&expand=4223)
8126#[inline]
8127#[target_feature(enable = "avx512bw")]
8128#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8129#[cfg_attr(test, assert_instr(vpermt2w))]
8130pub fn _mm512_mask_permutex2var_epi16(
8131    a: __m512i,
8132    k: __mmask32,
8133    idx: __m512i,
8134    b: __m512i,
8135) -> __m512i {
8136    unsafe {
8137        let permute = _mm512_permutex2var_epi16(a, idx, b).as_i16x32();
8138        transmute(simd_select_bitmask(k, permute, a.as_i16x32()))
8139    }
8140}
8141
8142/// 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).
8143///
8144/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_permutex2var_epi16&expand=4225)
8145#[inline]
8146#[target_feature(enable = "avx512bw")]
8147#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8148#[cfg_attr(test, assert_instr(vperm))] //vpermi2w or vpermt2w
8149pub fn _mm512_maskz_permutex2var_epi16(
8150    k: __mmask32,
8151    a: __m512i,
8152    idx: __m512i,
8153    b: __m512i,
8154) -> __m512i {
8155    unsafe {
8156        let permute = _mm512_permutex2var_epi16(a, idx, b).as_i16x32();
8157        transmute(simd_select_bitmask(k, permute, i16x32::ZERO))
8158    }
8159}
8160
8161/// 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).
8162///
8163/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask2_permutex2var_epi16&expand=4224)
8164#[inline]
8165#[target_feature(enable = "avx512bw")]
8166#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8167#[cfg_attr(test, assert_instr(vpermi2w))]
8168pub fn _mm512_mask2_permutex2var_epi16(
8169    a: __m512i,
8170    idx: __m512i,
8171    k: __mmask32,
8172    b: __m512i,
8173) -> __m512i {
8174    unsafe {
8175        let permute = _mm512_permutex2var_epi16(a, idx, b).as_i16x32();
8176        transmute(simd_select_bitmask(k, permute, idx.as_i16x32()))
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=_mm256_permutex2var_epi16&expand=4222)
8183#[inline]
8184#[target_feature(enable = "avx512bw,avx512vl")]
8185#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8186#[cfg_attr(test, assert_instr(vperm))] //vpermi2w or vpermt2w
8187pub fn _mm256_permutex2var_epi16(a: __m256i, idx: __m256i, b: __m256i) -> __m256i {
8188    unsafe { transmute(vpermi2w256(a.as_i16x16(), idx.as_i16x16(), b.as_i16x16())) }
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=_mm256_mask_permutex2var_epi16&expand=4219)
8194#[inline]
8195#[target_feature(enable = "avx512bw,avx512vl")]
8196#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8197#[cfg_attr(test, assert_instr(vpermt2w))]
8198pub fn _mm256_mask_permutex2var_epi16(
8199    a: __m256i,
8200    k: __mmask16,
8201    idx: __m256i,
8202    b: __m256i,
8203) -> __m256i {
8204    unsafe {
8205        let permute = _mm256_permutex2var_epi16(a, idx, b).as_i16x16();
8206        transmute(simd_select_bitmask(k, permute, a.as_i16x16()))
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=_mm256_maskz_permutex2var_epi16&expand=4221)
8213#[inline]
8214#[target_feature(enable = "avx512bw,avx512vl")]
8215#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8216#[cfg_attr(test, assert_instr(vperm))] //vpermi2w or vpermt2w
8217pub fn _mm256_maskz_permutex2var_epi16(
8218    k: __mmask16,
8219    a: __m256i,
8220    idx: __m256i,
8221    b: __m256i,
8222) -> __m256i {
8223    unsafe {
8224        let permute = _mm256_permutex2var_epi16(a, idx, b).as_i16x16();
8225        transmute(simd_select_bitmask(k, permute, i16x16::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=_mm256_mask2_permutex2var_epi16&expand=4220)
8232#[inline]
8233#[target_feature(enable = "avx512bw,avx512vl")]
8234#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8235#[cfg_attr(test, assert_instr(vpermi2w))]
8236pub fn _mm256_mask2_permutex2var_epi16(
8237    a: __m256i,
8238    idx: __m256i,
8239    k: __mmask16,
8240    b: __m256i,
8241) -> __m256i {
8242    unsafe {
8243        let permute = _mm256_permutex2var_epi16(a, idx, b).as_i16x16();
8244        transmute(simd_select_bitmask(k, permute, idx.as_i16x16()))
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=_mm_permutex2var_epi16&expand=4218)
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 _mm_permutex2var_epi16(a: __m128i, idx: __m128i, b: __m128i) -> __m128i {
8256    unsafe { transmute(vpermi2w128(a.as_i16x8(), idx.as_i16x8(), b.as_i16x8())) }
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=_mm_mask_permutex2var_epi16&expand=4215)
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 _mm_mask_permutex2var_epi16(a: __m128i, k: __mmask8, idx: __m128i, b: __m128i) -> __m128i {
8267    unsafe {
8268        let permute = _mm_permutex2var_epi16(a, idx, b).as_i16x8();
8269        transmute(simd_select_bitmask(k, permute, a.as_i16x8()))
8270    }
8271}
8272
8273/// 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).
8274///
8275/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_permutex2var_epi16&expand=4217)
8276#[inline]
8277#[target_feature(enable = "avx512bw,avx512vl")]
8278#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8279#[cfg_attr(test, assert_instr(vperm))] //vpermi2w or vpermt2w
8280pub fn _mm_maskz_permutex2var_epi16(k: __mmask8, a: __m128i, idx: __m128i, b: __m128i) -> __m128i {
8281    unsafe {
8282        let permute = _mm_permutex2var_epi16(a, idx, b).as_i16x8();
8283        transmute(simd_select_bitmask(k, permute, i16x8::ZERO))
8284    }
8285}
8286
8287/// 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).
8288///
8289/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask2_permutex2var_epi16&expand=4216)
8290#[inline]
8291#[target_feature(enable = "avx512bw,avx512vl")]
8292#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8293#[cfg_attr(test, assert_instr(vpermi2w))]
8294pub fn _mm_mask2_permutex2var_epi16(a: __m128i, idx: __m128i, k: __mmask8, b: __m128i) -> __m128i {
8295    unsafe {
8296        let permute = _mm_permutex2var_epi16(a, idx, b).as_i16x8();
8297        transmute(simd_select_bitmask(k, permute, idx.as_i16x8()))
8298    }
8299}
8300
8301/// Shuffle 16-bit integers in a across lanes using the corresponding index in idx, and store the results in dst.
8302///
8303/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_permutexvar_epi16&expand=4295)
8304#[inline]
8305#[target_feature(enable = "avx512bw")]
8306#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8307#[cfg_attr(test, assert_instr(vpermw))]
8308pub fn _mm512_permutexvar_epi16(idx: __m512i, a: __m512i) -> __m512i {
8309    unsafe { transmute(vpermw(a.as_i16x32(), idx.as_i16x32())) }
8310}
8311
8312/// 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).
8313///
8314/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_permutexvar_epi16&expand=4293)
8315#[inline]
8316#[target_feature(enable = "avx512bw")]
8317#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8318#[cfg_attr(test, assert_instr(vpermw))]
8319pub fn _mm512_mask_permutexvar_epi16(
8320    src: __m512i,
8321    k: __mmask32,
8322    idx: __m512i,
8323    a: __m512i,
8324) -> __m512i {
8325    unsafe {
8326        let permute = _mm512_permutexvar_epi16(idx, a).as_i16x32();
8327        transmute(simd_select_bitmask(k, permute, src.as_i16x32()))
8328    }
8329}
8330
8331/// 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).
8332///
8333/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_permutexvar_epi16&expand=4294)
8334#[inline]
8335#[target_feature(enable = "avx512bw")]
8336#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8337#[cfg_attr(test, assert_instr(vpermw))]
8338pub fn _mm512_maskz_permutexvar_epi16(k: __mmask32, idx: __m512i, a: __m512i) -> __m512i {
8339    unsafe {
8340        let permute = _mm512_permutexvar_epi16(idx, a).as_i16x32();
8341        transmute(simd_select_bitmask(k, permute, i16x32::ZERO))
8342    }
8343}
8344
8345/// Shuffle 16-bit integers in a across lanes using the corresponding index in idx, and store the results in dst.
8346///
8347/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_permutexvar_epi16&expand=4292)
8348#[inline]
8349#[target_feature(enable = "avx512bw,avx512vl")]
8350#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8351#[cfg_attr(test, assert_instr(vpermw))]
8352pub fn _mm256_permutexvar_epi16(idx: __m256i, a: __m256i) -> __m256i {
8353    unsafe { transmute(vpermw256(a.as_i16x16(), idx.as_i16x16())) }
8354}
8355
8356/// 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).
8357///
8358/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_permutexvar_epi16&expand=4290)
8359#[inline]
8360#[target_feature(enable = "avx512bw,avx512vl")]
8361#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8362#[cfg_attr(test, assert_instr(vpermw))]
8363pub fn _mm256_mask_permutexvar_epi16(
8364    src: __m256i,
8365    k: __mmask16,
8366    idx: __m256i,
8367    a: __m256i,
8368) -> __m256i {
8369    unsafe {
8370        let permute = _mm256_permutexvar_epi16(idx, a).as_i16x16();
8371        transmute(simd_select_bitmask(k, permute, src.as_i16x16()))
8372    }
8373}
8374
8375/// 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).
8376///
8377/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_permutexvar_epi16&expand=4291)
8378#[inline]
8379#[target_feature(enable = "avx512bw,avx512vl")]
8380#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8381#[cfg_attr(test, assert_instr(vpermw))]
8382pub fn _mm256_maskz_permutexvar_epi16(k: __mmask16, idx: __m256i, a: __m256i) -> __m256i {
8383    unsafe {
8384        let permute = _mm256_permutexvar_epi16(idx, a).as_i16x16();
8385        transmute(simd_select_bitmask(k, permute, i16x16::ZERO))
8386    }
8387}
8388
8389/// Shuffle 16-bit integers in a across lanes using the corresponding index in idx, and store the results in dst.
8390///
8391/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_permutexvar_epi16&expand=4289)
8392#[inline]
8393#[target_feature(enable = "avx512bw,avx512vl")]
8394#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8395#[cfg_attr(test, assert_instr(vpermw))]
8396pub fn _mm_permutexvar_epi16(idx: __m128i, a: __m128i) -> __m128i {
8397    unsafe { transmute(vpermw128(a.as_i16x8(), idx.as_i16x8())) }
8398}
8399
8400/// 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).
8401///
8402/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_permutexvar_epi16&expand=4287)
8403#[inline]
8404#[target_feature(enable = "avx512bw,avx512vl")]
8405#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8406#[cfg_attr(test, assert_instr(vpermw))]
8407pub fn _mm_mask_permutexvar_epi16(src: __m128i, k: __mmask8, idx: __m128i, a: __m128i) -> __m128i {
8408    unsafe {
8409        let permute = _mm_permutexvar_epi16(idx, a).as_i16x8();
8410        transmute(simd_select_bitmask(k, permute, src.as_i16x8()))
8411    }
8412}
8413
8414/// 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).
8415///
8416/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_permutexvar_epi16&expand=4288)
8417#[inline]
8418#[target_feature(enable = "avx512bw,avx512vl")]
8419#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8420#[cfg_attr(test, assert_instr(vpermw))]
8421pub fn _mm_maskz_permutexvar_epi16(k: __mmask8, idx: __m128i, a: __m128i) -> __m128i {
8422    unsafe {
8423        let permute = _mm_permutexvar_epi16(idx, a).as_i16x8();
8424        transmute(simd_select_bitmask(k, permute, i16x8::ZERO))
8425    }
8426}
8427
8428/// Blend packed 16-bit integers from a and b using control mask k, and store the results in dst.
8429///
8430/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_blend_epi16&expand=430)
8431#[inline]
8432#[target_feature(enable = "avx512bw")]
8433#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8434#[cfg_attr(test, assert_instr(vmovdqu16))] //should be vpblendmw
8435#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8436pub const fn _mm512_mask_blend_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
8437    unsafe { transmute(simd_select_bitmask(k, b.as_i16x32(), a.as_i16x32())) }
8438}
8439
8440/// Blend packed 16-bit integers from a and b using control mask k, and store the results in dst.
8441///
8442/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_blend_epi16&expand=429)
8443#[inline]
8444#[target_feature(enable = "avx512bw,avx512vl")]
8445#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8446#[cfg_attr(test, assert_instr(vmovdqu16))] //should be vpblendmw
8447#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8448pub const fn _mm256_mask_blend_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
8449    unsafe { transmute(simd_select_bitmask(k, b.as_i16x16(), a.as_i16x16())) }
8450}
8451
8452/// Blend packed 16-bit integers from a and b using control mask k, and store the results in dst.
8453///
8454/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_blend_epi16&expand=427)
8455#[inline]
8456#[target_feature(enable = "avx512bw,avx512vl")]
8457#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8458#[cfg_attr(test, assert_instr(vmovdqu16))] //should be vpblendmw
8459#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8460pub const fn _mm_mask_blend_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
8461    unsafe { transmute(simd_select_bitmask(k, b.as_i16x8(), a.as_i16x8())) }
8462}
8463
8464/// Blend packed 8-bit integers from a and b using control mask k, and store the results in dst.
8465///
8466/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_blend_epi8&expand=441)
8467#[inline]
8468#[target_feature(enable = "avx512bw")]
8469#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8470#[cfg_attr(test, assert_instr(vmovdqu8))] //should be vpblendmb
8471#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8472pub const fn _mm512_mask_blend_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
8473    unsafe { transmute(simd_select_bitmask(k, b.as_i8x64(), a.as_i8x64())) }
8474}
8475
8476/// Blend packed 8-bit integers from a and b using control mask k, and store the results in dst.
8477///
8478/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_blend_epi8&expand=440)
8479#[inline]
8480#[target_feature(enable = "avx512bw,avx512vl")]
8481#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8482#[cfg_attr(test, assert_instr(vmovdqu8))] //should be vpblendmb
8483#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8484pub const fn _mm256_mask_blend_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
8485    unsafe { transmute(simd_select_bitmask(k, b.as_i8x32(), a.as_i8x32())) }
8486}
8487
8488/// Blend packed 8-bit integers from a and b using control mask k, and store the results in dst.
8489///
8490/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_blend_epi8&expand=439)
8491#[inline]
8492#[target_feature(enable = "avx512bw,avx512vl")]
8493#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8494#[cfg_attr(test, assert_instr(vmovdqu8))] //should be vpblendmb
8495#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8496pub const fn _mm_mask_blend_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
8497    unsafe { transmute(simd_select_bitmask(k, b.as_i8x16(), a.as_i8x16())) }
8498}
8499
8500/// Broadcast the low packed 16-bit integer from a to all elements of dst.
8501///
8502/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_broadcastw_epi16&expand=587)
8503#[inline]
8504#[target_feature(enable = "avx512bw")]
8505#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8506#[cfg_attr(test, assert_instr(vpbroadcastw))]
8507#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8508pub const fn _mm512_broadcastw_epi16(a: __m128i) -> __m512i {
8509    unsafe {
8510        let a = _mm512_castsi128_si512(a).as_i16x32();
8511        let ret: i16x32 = simd_shuffle!(
8512            a,
8513            a,
8514            [
8515                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,
8516                0, 0, 0, 0,
8517            ],
8518        );
8519        transmute(ret)
8520    }
8521}
8522
8523/// 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).
8524///
8525/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_broadcastw_epi16&expand=588)
8526#[inline]
8527#[target_feature(enable = "avx512bw")]
8528#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8529#[cfg_attr(test, assert_instr(vpbroadcastw))]
8530#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8531pub const fn _mm512_mask_broadcastw_epi16(src: __m512i, k: __mmask32, a: __m128i) -> __m512i {
8532    unsafe {
8533        let broadcast = _mm512_broadcastw_epi16(a).as_i16x32();
8534        transmute(simd_select_bitmask(k, broadcast, src.as_i16x32()))
8535    }
8536}
8537
8538/// 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).
8539///
8540/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_broadcastw_epi16&expand=589)
8541#[inline]
8542#[target_feature(enable = "avx512bw")]
8543#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8544#[cfg_attr(test, assert_instr(vpbroadcastw))]
8545#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8546pub const fn _mm512_maskz_broadcastw_epi16(k: __mmask32, a: __m128i) -> __m512i {
8547    unsafe {
8548        let broadcast = _mm512_broadcastw_epi16(a).as_i16x32();
8549        transmute(simd_select_bitmask(k, broadcast, i16x32::ZERO))
8550    }
8551}
8552
8553/// 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).
8554///
8555/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_broadcastw_epi16&expand=585)
8556#[inline]
8557#[target_feature(enable = "avx512bw,avx512vl")]
8558#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8559#[cfg_attr(test, assert_instr(vpbroadcastw))]
8560#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8561pub const fn _mm256_mask_broadcastw_epi16(src: __m256i, k: __mmask16, a: __m128i) -> __m256i {
8562    unsafe {
8563        let broadcast = _mm256_broadcastw_epi16(a).as_i16x16();
8564        transmute(simd_select_bitmask(k, broadcast, src.as_i16x16()))
8565    }
8566}
8567
8568/// 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).
8569///
8570/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_broadcastw_epi16&expand=586)
8571#[inline]
8572#[target_feature(enable = "avx512bw,avx512vl")]
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 _mm256_maskz_broadcastw_epi16(k: __mmask16, a: __m128i) -> __m256i {
8577    unsafe {
8578        let broadcast = _mm256_broadcastw_epi16(a).as_i16x16();
8579        transmute(simd_select_bitmask(k, broadcast, i16x16::ZERO))
8580    }
8581}
8582
8583/// 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).
8584///
8585/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_broadcastw_epi16&expand=582)
8586#[inline]
8587#[target_feature(enable = "avx512bw,avx512vl")]
8588#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8589#[cfg_attr(test, assert_instr(vpbroadcastw))]
8590#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8591pub const fn _mm_mask_broadcastw_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
8592    unsafe {
8593        let broadcast = _mm_broadcastw_epi16(a).as_i16x8();
8594        transmute(simd_select_bitmask(k, broadcast, src.as_i16x8()))
8595    }
8596}
8597
8598/// 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).
8599///
8600/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_broadcastw_epi16&expand=583)
8601#[inline]
8602#[target_feature(enable = "avx512bw,avx512vl")]
8603#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8604#[cfg_attr(test, assert_instr(vpbroadcastw))]
8605#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8606pub const fn _mm_maskz_broadcastw_epi16(k: __mmask8, a: __m128i) -> __m128i {
8607    unsafe {
8608        let broadcast = _mm_broadcastw_epi16(a).as_i16x8();
8609        transmute(simd_select_bitmask(k, broadcast, i16x8::ZERO))
8610    }
8611}
8612
8613/// Broadcast the low packed 8-bit integer from a to all elements of dst.
8614///
8615/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_broadcastb_epi8&expand=536)
8616#[inline]
8617#[target_feature(enable = "avx512bw")]
8618#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8619#[cfg_attr(test, assert_instr(vpbroadcastb))]
8620#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8621pub const fn _mm512_broadcastb_epi8(a: __m128i) -> __m512i {
8622    unsafe {
8623        let a = _mm512_castsi128_si512(a).as_i8x64();
8624        let ret: i8x64 = simd_shuffle!(
8625            a,
8626            a,
8627            [
8628                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,
8629                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,
8630                0, 0, 0, 0, 0, 0, 0, 0,
8631            ],
8632        );
8633        transmute(ret)
8634    }
8635}
8636
8637/// 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).
8638///
8639/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_broadcastb_epi8&expand=537)
8640#[inline]
8641#[target_feature(enable = "avx512bw")]
8642#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8643#[cfg_attr(test, assert_instr(vpbroadcastb))]
8644#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8645pub const fn _mm512_mask_broadcastb_epi8(src: __m512i, k: __mmask64, a: __m128i) -> __m512i {
8646    unsafe {
8647        let broadcast = _mm512_broadcastb_epi8(a).as_i8x64();
8648        transmute(simd_select_bitmask(k, broadcast, src.as_i8x64()))
8649    }
8650}
8651
8652/// 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).
8653///
8654/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_broadcastb_epi8&expand=538)
8655#[inline]
8656#[target_feature(enable = "avx512bw")]
8657#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8658#[cfg_attr(test, assert_instr(vpbroadcastb))]
8659#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8660pub const fn _mm512_maskz_broadcastb_epi8(k: __mmask64, a: __m128i) -> __m512i {
8661    unsafe {
8662        let broadcast = _mm512_broadcastb_epi8(a).as_i8x64();
8663        transmute(simd_select_bitmask(k, broadcast, i8x64::ZERO))
8664    }
8665}
8666
8667/// 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).
8668///
8669/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_broadcastb_epi8&expand=534)
8670#[inline]
8671#[target_feature(enable = "avx512bw,avx512vl")]
8672#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8673#[cfg_attr(test, assert_instr(vpbroadcastb))]
8674#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8675pub const fn _mm256_mask_broadcastb_epi8(src: __m256i, k: __mmask32, a: __m128i) -> __m256i {
8676    unsafe {
8677        let broadcast = _mm256_broadcastb_epi8(a).as_i8x32();
8678        transmute(simd_select_bitmask(k, broadcast, src.as_i8x32()))
8679    }
8680}
8681
8682/// 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).
8683///
8684/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_broadcastb_epi8&expand=535)
8685#[inline]
8686#[target_feature(enable = "avx512bw,avx512vl")]
8687#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8688#[cfg_attr(test, assert_instr(vpbroadcastb))]
8689#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8690pub const fn _mm256_maskz_broadcastb_epi8(k: __mmask32, a: __m128i) -> __m256i {
8691    unsafe {
8692        let broadcast = _mm256_broadcastb_epi8(a).as_i8x32();
8693        transmute(simd_select_bitmask(k, broadcast, i8x32::ZERO))
8694    }
8695}
8696
8697/// 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).
8698///
8699/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_broadcastb_epi8&expand=531)
8700#[inline]
8701#[target_feature(enable = "avx512bw,avx512vl")]
8702#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8703#[cfg_attr(test, assert_instr(vpbroadcastb))]
8704#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8705pub const fn _mm_mask_broadcastb_epi8(src: __m128i, k: __mmask16, a: __m128i) -> __m128i {
8706    unsafe {
8707        let broadcast = _mm_broadcastb_epi8(a).as_i8x16();
8708        transmute(simd_select_bitmask(k, broadcast, src.as_i8x16()))
8709    }
8710}
8711
8712/// 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).
8713///
8714/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_broadcastb_epi8&expand=532)
8715#[inline]
8716#[target_feature(enable = "avx512bw,avx512vl")]
8717#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8718#[cfg_attr(test, assert_instr(vpbroadcastb))]
8719#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8720pub const fn _mm_maskz_broadcastb_epi8(k: __mmask16, a: __m128i) -> __m128i {
8721    unsafe {
8722        let broadcast = _mm_broadcastb_epi8(a).as_i8x16();
8723        transmute(simd_select_bitmask(k, broadcast, i8x16::ZERO))
8724    }
8725}
8726
8727/// 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.
8728///
8729/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_unpackhi_epi16&expand=6012)
8730#[inline]
8731#[target_feature(enable = "avx512bw")]
8732#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8733#[cfg_attr(test, assert_instr(vpunpckhwd))]
8734#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8735pub const fn _mm512_unpackhi_epi16(a: __m512i, b: __m512i) -> __m512i {
8736    unsafe {
8737        let a = a.as_i16x32();
8738        let b = b.as_i16x32();
8739        #[rustfmt::skip]
8740        let r: i16x32 = simd_shuffle!(
8741            a,
8742            b,
8743            [
8744                4, 32 + 4, 5, 32 + 5,
8745                6, 32 + 6, 7, 32 + 7,
8746                12, 32 + 12, 13, 32 + 13,
8747                14, 32 + 14, 15, 32 + 15,
8748                20, 32 + 20, 21, 32 + 21,
8749                22, 32 + 22, 23, 32 + 23,
8750                28, 32 + 28, 29, 32 + 29,
8751                30, 32 + 30, 31, 32 + 31,
8752            ],
8753        );
8754        transmute(r)
8755    }
8756}
8757
8758/// 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).
8759///
8760/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_unpackhi_epi16&expand=6010)
8761#[inline]
8762#[target_feature(enable = "avx512bw")]
8763#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8764#[cfg_attr(test, assert_instr(vpunpckhwd))]
8765#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8766pub const fn _mm512_mask_unpackhi_epi16(
8767    src: __m512i,
8768    k: __mmask32,
8769    a: __m512i,
8770    b: __m512i,
8771) -> __m512i {
8772    unsafe {
8773        let unpackhi = _mm512_unpackhi_epi16(a, b).as_i16x32();
8774        transmute(simd_select_bitmask(k, unpackhi, src.as_i16x32()))
8775    }
8776}
8777
8778/// 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).
8779///
8780/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_unpackhi_epi16&expand=6011)
8781#[inline]
8782#[target_feature(enable = "avx512bw")]
8783#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8784#[cfg_attr(test, assert_instr(vpunpckhwd))]
8785#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8786pub const fn _mm512_maskz_unpackhi_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
8787    unsafe {
8788        let unpackhi = _mm512_unpackhi_epi16(a, b).as_i16x32();
8789        transmute(simd_select_bitmask(k, unpackhi, i16x32::ZERO))
8790    }
8791}
8792
8793/// 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).
8794///
8795/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_unpackhi_epi16&expand=6007)
8796#[inline]
8797#[target_feature(enable = "avx512bw,avx512vl")]
8798#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8799#[cfg_attr(test, assert_instr(vpunpckhwd))]
8800#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8801pub const fn _mm256_mask_unpackhi_epi16(
8802    src: __m256i,
8803    k: __mmask16,
8804    a: __m256i,
8805    b: __m256i,
8806) -> __m256i {
8807    unsafe {
8808        let unpackhi = _mm256_unpackhi_epi16(a, b).as_i16x16();
8809        transmute(simd_select_bitmask(k, unpackhi, src.as_i16x16()))
8810    }
8811}
8812
8813/// 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).
8814///
8815/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_unpackhi_epi16&expand=6008)
8816#[inline]
8817#[target_feature(enable = "avx512bw,avx512vl")]
8818#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8819#[cfg_attr(test, assert_instr(vpunpckhwd))]
8820#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8821pub const fn _mm256_maskz_unpackhi_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
8822    unsafe {
8823        let unpackhi = _mm256_unpackhi_epi16(a, b).as_i16x16();
8824        transmute(simd_select_bitmask(k, unpackhi, i16x16::ZERO))
8825    }
8826}
8827
8828/// 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).
8829///
8830/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_unpackhi_epi16&expand=6004)
8831#[inline]
8832#[target_feature(enable = "avx512bw,avx512vl")]
8833#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8834#[cfg_attr(test, assert_instr(vpunpckhwd))]
8835#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8836pub const fn _mm_mask_unpackhi_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
8837    unsafe {
8838        let unpackhi = _mm_unpackhi_epi16(a, b).as_i16x8();
8839        transmute(simd_select_bitmask(k, unpackhi, src.as_i16x8()))
8840    }
8841}
8842
8843/// 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).
8844///
8845/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_unpackhi_epi16&expand=6005)
8846#[inline]
8847#[target_feature(enable = "avx512bw,avx512vl")]
8848#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8849#[cfg_attr(test, assert_instr(vpunpckhwd))]
8850#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8851pub const fn _mm_maskz_unpackhi_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
8852    unsafe {
8853        let unpackhi = _mm_unpackhi_epi16(a, b).as_i16x8();
8854        transmute(simd_select_bitmask(k, unpackhi, i16x8::ZERO))
8855    }
8856}
8857
8858/// 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.
8859///
8860/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_unpackhi_epi8&expand=6039)
8861#[inline]
8862#[target_feature(enable = "avx512bw")]
8863#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8864#[cfg_attr(test, assert_instr(vpunpckhbw))]
8865#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8866pub const fn _mm512_unpackhi_epi8(a: __m512i, b: __m512i) -> __m512i {
8867    unsafe {
8868        let a = a.as_i8x64();
8869        let b = b.as_i8x64();
8870        #[rustfmt::skip]
8871        let r: i8x64 = simd_shuffle!(
8872            a,
8873            b,
8874            [
8875                8, 64 + 8, 9, 64 + 9,
8876                10, 64 + 10, 11, 64 + 11,
8877                12, 64 + 12, 13, 64 + 13,
8878                14, 64 + 14, 15, 64 + 15,
8879                24, 64 + 24, 25, 64 + 25,
8880                26, 64 + 26, 27, 64 + 27,
8881                28, 64 + 28, 29, 64 + 29,
8882                30, 64 + 30, 31, 64 + 31,
8883                40, 64 + 40, 41, 64 + 41,
8884                42, 64 + 42, 43, 64 + 43,
8885                44, 64 + 44, 45, 64 + 45,
8886                46, 64 + 46, 47, 64 + 47,
8887                56, 64 + 56, 57, 64 + 57,
8888                58, 64 + 58, 59, 64 + 59,
8889                60, 64 + 60, 61, 64 + 61,
8890                62, 64 + 62, 63, 64 + 63,
8891            ],
8892        );
8893        transmute(r)
8894    }
8895}
8896
8897/// 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).
8898///
8899/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_unpackhi_epi8&expand=6037)
8900#[inline]
8901#[target_feature(enable = "avx512bw")]
8902#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8903#[cfg_attr(test, assert_instr(vpunpckhbw))]
8904#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8905pub const fn _mm512_mask_unpackhi_epi8(
8906    src: __m512i,
8907    k: __mmask64,
8908    a: __m512i,
8909    b: __m512i,
8910) -> __m512i {
8911    unsafe {
8912        let unpackhi = _mm512_unpackhi_epi8(a, b).as_i8x64();
8913        transmute(simd_select_bitmask(k, unpackhi, src.as_i8x64()))
8914    }
8915}
8916
8917/// 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).
8918///
8919/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_unpackhi_epi8&expand=6038)
8920#[inline]
8921#[target_feature(enable = "avx512bw")]
8922#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8923#[cfg_attr(test, assert_instr(vpunpckhbw))]
8924#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8925pub const fn _mm512_maskz_unpackhi_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
8926    unsafe {
8927        let unpackhi = _mm512_unpackhi_epi8(a, b).as_i8x64();
8928        transmute(simd_select_bitmask(k, unpackhi, i8x64::ZERO))
8929    }
8930}
8931
8932/// 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).
8933///
8934/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_unpackhi_epi8&expand=6034)
8935#[inline]
8936#[target_feature(enable = "avx512bw,avx512vl")]
8937#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8938#[cfg_attr(test, assert_instr(vpunpckhbw))]
8939#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8940pub const fn _mm256_mask_unpackhi_epi8(
8941    src: __m256i,
8942    k: __mmask32,
8943    a: __m256i,
8944    b: __m256i,
8945) -> __m256i {
8946    unsafe {
8947        let unpackhi = _mm256_unpackhi_epi8(a, b).as_i8x32();
8948        transmute(simd_select_bitmask(k, unpackhi, src.as_i8x32()))
8949    }
8950}
8951
8952/// 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).
8953///
8954/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_unpackhi_epi8&expand=6035)
8955#[inline]
8956#[target_feature(enable = "avx512bw,avx512vl")]
8957#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8958#[cfg_attr(test, assert_instr(vpunpckhbw))]
8959#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8960pub const fn _mm256_maskz_unpackhi_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
8961    unsafe {
8962        let unpackhi = _mm256_unpackhi_epi8(a, b).as_i8x32();
8963        transmute(simd_select_bitmask(k, unpackhi, i8x32::ZERO))
8964    }
8965}
8966
8967/// 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).
8968///
8969/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_unpackhi_epi8&expand=6031)
8970#[inline]
8971#[target_feature(enable = "avx512bw,avx512vl")]
8972#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8973#[cfg_attr(test, assert_instr(vpunpckhbw))]
8974#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8975pub const fn _mm_mask_unpackhi_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
8976    unsafe {
8977        let unpackhi = _mm_unpackhi_epi8(a, b).as_i8x16();
8978        transmute(simd_select_bitmask(k, unpackhi, src.as_i8x16()))
8979    }
8980}
8981
8982/// 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).
8983///
8984/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_unpackhi_epi8&expand=6032)
8985#[inline]
8986#[target_feature(enable = "avx512bw,avx512vl")]
8987#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
8988#[cfg_attr(test, assert_instr(vpunpckhbw))]
8989#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
8990pub const fn _mm_maskz_unpackhi_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
8991    unsafe {
8992        let unpackhi = _mm_unpackhi_epi8(a, b).as_i8x16();
8993        transmute(simd_select_bitmask(k, unpackhi, i8x16::ZERO))
8994    }
8995}
8996
8997/// 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.
8998///
8999/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_unpacklo_epi16&expand=6069)
9000#[inline]
9001#[target_feature(enable = "avx512bw")]
9002#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9003#[cfg_attr(test, assert_instr(vpunpcklwd))]
9004#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9005pub const fn _mm512_unpacklo_epi16(a: __m512i, b: __m512i) -> __m512i {
9006    unsafe {
9007        let a = a.as_i16x32();
9008        let b = b.as_i16x32();
9009        #[rustfmt::skip]
9010        let r: i16x32 = simd_shuffle!(
9011            a,
9012            b,
9013            [
9014               0,  32+0,   1, 32+1,
9015               2,  32+2,   3, 32+3,
9016               8,  32+8,   9, 32+9,
9017               10, 32+10, 11, 32+11,
9018               16, 32+16, 17, 32+17,
9019               18, 32+18, 19, 32+19,
9020               24, 32+24, 25, 32+25,
9021               26, 32+26, 27, 32+27
9022            ],
9023        );
9024        transmute(r)
9025    }
9026}
9027
9028/// 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).
9029///
9030/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_unpacklo_epi16&expand=6067)
9031#[inline]
9032#[target_feature(enable = "avx512bw")]
9033#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9034#[cfg_attr(test, assert_instr(vpunpcklwd))]
9035#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9036pub const fn _mm512_mask_unpacklo_epi16(
9037    src: __m512i,
9038    k: __mmask32,
9039    a: __m512i,
9040    b: __m512i,
9041) -> __m512i {
9042    unsafe {
9043        let unpacklo = _mm512_unpacklo_epi16(a, b).as_i16x32();
9044        transmute(simd_select_bitmask(k, unpacklo, src.as_i16x32()))
9045    }
9046}
9047
9048/// 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).
9049///
9050/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_unpacklo_epi16&expand=6068)
9051#[inline]
9052#[target_feature(enable = "avx512bw")]
9053#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9054#[cfg_attr(test, assert_instr(vpunpcklwd))]
9055#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9056pub const fn _mm512_maskz_unpacklo_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
9057    unsafe {
9058        let unpacklo = _mm512_unpacklo_epi16(a, b).as_i16x32();
9059        transmute(simd_select_bitmask(k, unpacklo, i16x32::ZERO))
9060    }
9061}
9062
9063/// 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).
9064///
9065/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_unpacklo_epi16&expand=6064)
9066#[inline]
9067#[target_feature(enable = "avx512bw,avx512vl")]
9068#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9069#[cfg_attr(test, assert_instr(vpunpcklwd))]
9070#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9071pub const fn _mm256_mask_unpacklo_epi16(
9072    src: __m256i,
9073    k: __mmask16,
9074    a: __m256i,
9075    b: __m256i,
9076) -> __m256i {
9077    unsafe {
9078        let unpacklo = _mm256_unpacklo_epi16(a, b).as_i16x16();
9079        transmute(simd_select_bitmask(k, unpacklo, src.as_i16x16()))
9080    }
9081}
9082
9083/// 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).
9084///
9085/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_unpacklo_epi16&expand=6065)
9086#[inline]
9087#[target_feature(enable = "avx512bw,avx512vl")]
9088#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9089#[cfg_attr(test, assert_instr(vpunpcklwd))]
9090#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9091pub const fn _mm256_maskz_unpacklo_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
9092    unsafe {
9093        let unpacklo = _mm256_unpacklo_epi16(a, b).as_i16x16();
9094        transmute(simd_select_bitmask(k, unpacklo, i16x16::ZERO))
9095    }
9096}
9097
9098/// 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).
9099///
9100/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_unpacklo_epi16&expand=6061)
9101#[inline]
9102#[target_feature(enable = "avx512bw,avx512vl")]
9103#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9104#[cfg_attr(test, assert_instr(vpunpcklwd))]
9105#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9106pub const fn _mm_mask_unpacklo_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
9107    unsafe {
9108        let unpacklo = _mm_unpacklo_epi16(a, b).as_i16x8();
9109        transmute(simd_select_bitmask(k, unpacklo, src.as_i16x8()))
9110    }
9111}
9112
9113/// 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).
9114///
9115/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_unpacklo_epi16&expand=6062)
9116#[inline]
9117#[target_feature(enable = "avx512bw,avx512vl")]
9118#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9119#[cfg_attr(test, assert_instr(vpunpcklwd))]
9120#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9121pub const fn _mm_maskz_unpacklo_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
9122    unsafe {
9123        let unpacklo = _mm_unpacklo_epi16(a, b).as_i16x8();
9124        transmute(simd_select_bitmask(k, unpacklo, i16x8::ZERO))
9125    }
9126}
9127
9128/// 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.
9129///
9130/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_unpacklo_epi8&expand=6096)
9131#[inline]
9132#[target_feature(enable = "avx512bw")]
9133#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9134#[cfg_attr(test, assert_instr(vpunpcklbw))]
9135#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9136pub const fn _mm512_unpacklo_epi8(a: __m512i, b: __m512i) -> __m512i {
9137    unsafe {
9138        let a = a.as_i8x64();
9139        let b = b.as_i8x64();
9140        #[rustfmt::skip]
9141        let r: i8x64 = simd_shuffle!(
9142            a,
9143            b,
9144            [
9145                0,  64+0,   1, 64+1,
9146                2,  64+2,   3, 64+3,
9147                4,  64+4,   5, 64+5,
9148                6,  64+6,   7, 64+7,
9149                16, 64+16, 17, 64+17,
9150                18, 64+18, 19, 64+19,
9151                20, 64+20, 21, 64+21,
9152                22, 64+22, 23, 64+23,
9153                32, 64+32, 33, 64+33,
9154                34, 64+34, 35, 64+35,
9155                36, 64+36, 37, 64+37,
9156                38, 64+38, 39, 64+39,
9157                48, 64+48, 49, 64+49,
9158                50, 64+50, 51, 64+51,
9159                52, 64+52, 53, 64+53,
9160                54, 64+54, 55, 64+55,
9161            ],
9162        );
9163        transmute(r)
9164    }
9165}
9166
9167/// 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).
9168///
9169/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_unpacklo_epi8&expand=6094)
9170#[inline]
9171#[target_feature(enable = "avx512bw")]
9172#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9173#[cfg_attr(test, assert_instr(vpunpcklbw))]
9174#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9175pub const fn _mm512_mask_unpacklo_epi8(
9176    src: __m512i,
9177    k: __mmask64,
9178    a: __m512i,
9179    b: __m512i,
9180) -> __m512i {
9181    unsafe {
9182        let unpacklo = _mm512_unpacklo_epi8(a, b).as_i8x64();
9183        transmute(simd_select_bitmask(k, unpacklo, src.as_i8x64()))
9184    }
9185}
9186
9187/// 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).
9188///
9189/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_unpacklo_epi8&expand=6095)
9190#[inline]
9191#[target_feature(enable = "avx512bw")]
9192#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9193#[cfg_attr(test, assert_instr(vpunpcklbw))]
9194#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9195pub const fn _mm512_maskz_unpacklo_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
9196    unsafe {
9197        let unpacklo = _mm512_unpacklo_epi8(a, b).as_i8x64();
9198        transmute(simd_select_bitmask(k, unpacklo, i8x64::ZERO))
9199    }
9200}
9201
9202/// 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).
9203///
9204/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_unpacklo_epi8&expand=6091)
9205#[inline]
9206#[target_feature(enable = "avx512bw,avx512vl")]
9207#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9208#[cfg_attr(test, assert_instr(vpunpcklbw))]
9209#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9210pub const fn _mm256_mask_unpacklo_epi8(
9211    src: __m256i,
9212    k: __mmask32,
9213    a: __m256i,
9214    b: __m256i,
9215) -> __m256i {
9216    unsafe {
9217        let unpacklo = _mm256_unpacklo_epi8(a, b).as_i8x32();
9218        transmute(simd_select_bitmask(k, unpacklo, src.as_i8x32()))
9219    }
9220}
9221
9222/// 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).
9223///
9224/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_unpacklo_epi8&expand=6092)
9225#[inline]
9226#[target_feature(enable = "avx512bw,avx512vl")]
9227#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9228#[cfg_attr(test, assert_instr(vpunpcklbw))]
9229#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9230pub const fn _mm256_maskz_unpacklo_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
9231    unsafe {
9232        let unpacklo = _mm256_unpacklo_epi8(a, b).as_i8x32();
9233        transmute(simd_select_bitmask(k, unpacklo, i8x32::ZERO))
9234    }
9235}
9236
9237/// 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).
9238///
9239/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_unpacklo_epi8&expand=6088)
9240#[inline]
9241#[target_feature(enable = "avx512bw,avx512vl")]
9242#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9243#[cfg_attr(test, assert_instr(vpunpcklbw))]
9244#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9245pub const fn _mm_mask_unpacklo_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
9246    unsafe {
9247        let unpacklo = _mm_unpacklo_epi8(a, b).as_i8x16();
9248        transmute(simd_select_bitmask(k, unpacklo, src.as_i8x16()))
9249    }
9250}
9251
9252/// 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).
9253///
9254/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_unpacklo_epi8&expand=6089)
9255#[inline]
9256#[target_feature(enable = "avx512bw,avx512vl")]
9257#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9258#[cfg_attr(test, assert_instr(vpunpcklbw))]
9259#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9260pub const fn _mm_maskz_unpacklo_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
9261    unsafe {
9262        let unpacklo = _mm_unpacklo_epi8(a, b).as_i8x16();
9263        transmute(simd_select_bitmask(k, unpacklo, i8x16::ZERO))
9264    }
9265}
9266
9267/// 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).
9268///
9269/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_mov_epi16&expand=3795)
9270#[inline]
9271#[target_feature(enable = "avx512bw")]
9272#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9273#[cfg_attr(test, assert_instr(vmovdqu16))]
9274#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9275pub const fn _mm512_mask_mov_epi16(src: __m512i, k: __mmask32, a: __m512i) -> __m512i {
9276    unsafe {
9277        let mov = a.as_i16x32();
9278        transmute(simd_select_bitmask(k, mov, src.as_i16x32()))
9279    }
9280}
9281
9282/// Move packed 16-bit integers from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9283///
9284/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_mov_epi16&expand=3796)
9285#[inline]
9286#[target_feature(enable = "avx512bw")]
9287#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9288#[cfg_attr(test, assert_instr(vmovdqu16))]
9289#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9290pub const fn _mm512_maskz_mov_epi16(k: __mmask32, a: __m512i) -> __m512i {
9291    unsafe {
9292        let mov = a.as_i16x32();
9293        transmute(simd_select_bitmask(k, mov, i16x32::ZERO))
9294    }
9295}
9296
9297/// 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).
9298///
9299/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_mov_epi16&expand=3793)
9300#[inline]
9301#[target_feature(enable = "avx512bw,avx512vl")]
9302#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9303#[cfg_attr(test, assert_instr(vmovdqu16))]
9304#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9305pub const fn _mm256_mask_mov_epi16(src: __m256i, k: __mmask16, a: __m256i) -> __m256i {
9306    unsafe {
9307        let mov = a.as_i16x16();
9308        transmute(simd_select_bitmask(k, mov, src.as_i16x16()))
9309    }
9310}
9311
9312/// Move packed 16-bit integers from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9313///
9314/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_mov_epi16&expand=3794)
9315#[inline]
9316#[target_feature(enable = "avx512bw,avx512vl")]
9317#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9318#[cfg_attr(test, assert_instr(vmovdqu16))]
9319#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9320pub const fn _mm256_maskz_mov_epi16(k: __mmask16, a: __m256i) -> __m256i {
9321    unsafe {
9322        let mov = a.as_i16x16();
9323        transmute(simd_select_bitmask(k, mov, i16x16::ZERO))
9324    }
9325}
9326
9327/// 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).
9328///
9329/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_mov_epi16&expand=3791)
9330#[inline]
9331#[target_feature(enable = "avx512bw,avx512vl")]
9332#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9333#[cfg_attr(test, assert_instr(vmovdqu16))]
9334#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9335pub const fn _mm_mask_mov_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
9336    unsafe {
9337        let mov = a.as_i16x8();
9338        transmute(simd_select_bitmask(k, mov, src.as_i16x8()))
9339    }
9340}
9341
9342/// Move packed 16-bit integers from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9343///
9344/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_mov_epi16&expand=3792)
9345#[inline]
9346#[target_feature(enable = "avx512bw,avx512vl")]
9347#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9348#[cfg_attr(test, assert_instr(vmovdqu16))]
9349#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9350pub const fn _mm_maskz_mov_epi16(k: __mmask8, a: __m128i) -> __m128i {
9351    unsafe {
9352        let mov = a.as_i16x8();
9353        transmute(simd_select_bitmask(k, mov, i16x8::ZERO))
9354    }
9355}
9356
9357/// 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).
9358///
9359/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_mov_epi8&expand=3813)
9360#[inline]
9361#[target_feature(enable = "avx512bw")]
9362#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9363#[cfg_attr(test, assert_instr(vmovdqu8))]
9364#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9365pub const fn _mm512_mask_mov_epi8(src: __m512i, k: __mmask64, a: __m512i) -> __m512i {
9366    unsafe {
9367        let mov = a.as_i8x64();
9368        transmute(simd_select_bitmask(k, mov, src.as_i8x64()))
9369    }
9370}
9371
9372/// Move packed 8-bit integers from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9373///
9374/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_mov_epi8&expand=3814)
9375#[inline]
9376#[target_feature(enable = "avx512bw")]
9377#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9378#[cfg_attr(test, assert_instr(vmovdqu8))]
9379#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9380pub const fn _mm512_maskz_mov_epi8(k: __mmask64, a: __m512i) -> __m512i {
9381    unsafe {
9382        let mov = a.as_i8x64();
9383        transmute(simd_select_bitmask(k, mov, i8x64::ZERO))
9384    }
9385}
9386
9387/// 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).
9388///
9389/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_mov_epi8&expand=3811)
9390#[inline]
9391#[target_feature(enable = "avx512bw,avx512vl")]
9392#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9393#[cfg_attr(test, assert_instr(vmovdqu8))]
9394#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9395pub const fn _mm256_mask_mov_epi8(src: __m256i, k: __mmask32, a: __m256i) -> __m256i {
9396    unsafe {
9397        let mov = a.as_i8x32();
9398        transmute(simd_select_bitmask(k, mov, src.as_i8x32()))
9399    }
9400}
9401
9402/// Move packed 8-bit integers from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9403///
9404/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_mov_epi8&expand=3812)
9405#[inline]
9406#[target_feature(enable = "avx512bw,avx512vl")]
9407#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9408#[cfg_attr(test, assert_instr(vmovdqu8))]
9409#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9410pub const fn _mm256_maskz_mov_epi8(k: __mmask32, a: __m256i) -> __m256i {
9411    unsafe {
9412        let mov = a.as_i8x32();
9413        transmute(simd_select_bitmask(k, mov, i8x32::ZERO))
9414    }
9415}
9416
9417/// 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).
9418///
9419/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_mov_epi8&expand=3809)
9420#[inline]
9421#[target_feature(enable = "avx512bw,avx512vl")]
9422#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9423#[cfg_attr(test, assert_instr(vmovdqu8))]
9424#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9425pub const fn _mm_mask_mov_epi8(src: __m128i, k: __mmask16, a: __m128i) -> __m128i {
9426    unsafe {
9427        let mov = a.as_i8x16();
9428        transmute(simd_select_bitmask(k, mov, src.as_i8x16()))
9429    }
9430}
9431
9432/// Move packed 8-bit integers from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
9433///
9434/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_mov_epi8&expand=3810)
9435#[inline]
9436#[target_feature(enable = "avx512bw,avx512vl")]
9437#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9438#[cfg_attr(test, assert_instr(vmovdqu8))]
9439#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9440pub const fn _mm_maskz_mov_epi8(k: __mmask16, a: __m128i) -> __m128i {
9441    unsafe {
9442        let mov = a.as_i8x16();
9443        transmute(simd_select_bitmask(k, mov, i8x16::ZERO))
9444    }
9445}
9446
9447/// 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).
9448///
9449/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_set1_epi16&expand=4942)
9450#[inline]
9451#[target_feature(enable = "avx512bw")]
9452#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9453#[cfg_attr(test, assert_instr(vpbroadcastw))]
9454#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9455pub const fn _mm512_mask_set1_epi16(src: __m512i, k: __mmask32, a: i16) -> __m512i {
9456    unsafe {
9457        let r = _mm512_set1_epi16(a).as_i16x32();
9458        transmute(simd_select_bitmask(k, r, src.as_i16x32()))
9459    }
9460}
9461
9462/// 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).
9463///
9464/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_set1_epi16&expand=4943)
9465#[inline]
9466#[target_feature(enable = "avx512bw")]
9467#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9468#[cfg_attr(test, assert_instr(vpbroadcastw))]
9469#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9470pub const fn _mm512_maskz_set1_epi16(k: __mmask32, a: i16) -> __m512i {
9471    unsafe {
9472        let r = _mm512_set1_epi16(a).as_i16x32();
9473        transmute(simd_select_bitmask(k, r, i16x32::ZERO))
9474    }
9475}
9476
9477/// 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).
9478///
9479/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_set1_epi16&expand=4939)
9480#[inline]
9481#[target_feature(enable = "avx512bw,avx512vl")]
9482#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9483#[cfg_attr(test, assert_instr(vpbroadcastw))]
9484#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9485pub const fn _mm256_mask_set1_epi16(src: __m256i, k: __mmask16, a: i16) -> __m256i {
9486    unsafe {
9487        let r = _mm256_set1_epi16(a).as_i16x16();
9488        transmute(simd_select_bitmask(k, r, src.as_i16x16()))
9489    }
9490}
9491
9492/// 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).
9493///
9494/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_set1_epi16&expand=4940)
9495#[inline]
9496#[target_feature(enable = "avx512bw,avx512vl")]
9497#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9498#[cfg_attr(test, assert_instr(vpbroadcastw))]
9499#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9500pub const fn _mm256_maskz_set1_epi16(k: __mmask16, a: i16) -> __m256i {
9501    unsafe {
9502        let r = _mm256_set1_epi16(a).as_i16x16();
9503        transmute(simd_select_bitmask(k, r, i16x16::ZERO))
9504    }
9505}
9506
9507/// 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).
9508///
9509/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_set1_epi16&expand=4936)
9510#[inline]
9511#[target_feature(enable = "avx512bw,avx512vl")]
9512#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9513#[cfg_attr(test, assert_instr(vpbroadcastw))]
9514#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9515pub const fn _mm_mask_set1_epi16(src: __m128i, k: __mmask8, a: i16) -> __m128i {
9516    unsafe {
9517        let r = _mm_set1_epi16(a).as_i16x8();
9518        transmute(simd_select_bitmask(k, r, src.as_i16x8()))
9519    }
9520}
9521
9522/// 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).
9523///
9524/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_set1_epi16&expand=4937)
9525#[inline]
9526#[target_feature(enable = "avx512bw,avx512vl")]
9527#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9528#[cfg_attr(test, assert_instr(vpbroadcastw))]
9529#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9530pub const fn _mm_maskz_set1_epi16(k: __mmask8, a: i16) -> __m128i {
9531    unsafe {
9532        let r = _mm_set1_epi16(a).as_i16x8();
9533        transmute(simd_select_bitmask(k, r, i16x8::ZERO))
9534    }
9535}
9536
9537/// 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).
9538///
9539/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_set1_epi8&expand=4970)
9540#[inline]
9541#[target_feature(enable = "avx512bw")]
9542#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9543#[cfg_attr(test, assert_instr(vpbroadcast))]
9544#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9545pub const fn _mm512_mask_set1_epi8(src: __m512i, k: __mmask64, a: i8) -> __m512i {
9546    unsafe {
9547        let r = _mm512_set1_epi8(a).as_i8x64();
9548        transmute(simd_select_bitmask(k, r, src.as_i8x64()))
9549    }
9550}
9551
9552/// 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).
9553///
9554/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_set1_epi8&expand=4971)
9555#[inline]
9556#[target_feature(enable = "avx512bw")]
9557#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9558#[cfg_attr(test, assert_instr(vpbroadcast))]
9559#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9560pub const fn _mm512_maskz_set1_epi8(k: __mmask64, a: i8) -> __m512i {
9561    unsafe {
9562        let r = _mm512_set1_epi8(a).as_i8x64();
9563        transmute(simd_select_bitmask(k, r, i8x64::ZERO))
9564    }
9565}
9566
9567/// 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).
9568///
9569/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_set1_epi8&expand=4967)
9570#[inline]
9571#[target_feature(enable = "avx512bw,avx512vl")]
9572#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9573#[cfg_attr(test, assert_instr(vpbroadcast))]
9574#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9575pub const fn _mm256_mask_set1_epi8(src: __m256i, k: __mmask32, a: i8) -> __m256i {
9576    unsafe {
9577        let r = _mm256_set1_epi8(a).as_i8x32();
9578        transmute(simd_select_bitmask(k, r, src.as_i8x32()))
9579    }
9580}
9581
9582/// 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).
9583///
9584/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_set1_epi8&expand=4968)
9585#[inline]
9586#[target_feature(enable = "avx512bw,avx512vl")]
9587#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9588#[cfg_attr(test, assert_instr(vpbroadcast))]
9589#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9590pub const fn _mm256_maskz_set1_epi8(k: __mmask32, a: i8) -> __m256i {
9591    unsafe {
9592        let r = _mm256_set1_epi8(a).as_i8x32();
9593        transmute(simd_select_bitmask(k, r, i8x32::ZERO))
9594    }
9595}
9596
9597/// 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).
9598///
9599/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_set1_epi8&expand=4964)
9600#[inline]
9601#[target_feature(enable = "avx512bw,avx512vl")]
9602#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9603#[cfg_attr(test, assert_instr(vpbroadcast))]
9604#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9605pub const fn _mm_mask_set1_epi8(src: __m128i, k: __mmask16, a: i8) -> __m128i {
9606    unsafe {
9607        let r = _mm_set1_epi8(a).as_i8x16();
9608        transmute(simd_select_bitmask(k, r, src.as_i8x16()))
9609    }
9610}
9611
9612/// 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).
9613///
9614/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_set1_epi8&expand=4965)
9615#[inline]
9616#[target_feature(enable = "avx512bw,avx512vl")]
9617#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9618#[cfg_attr(test, assert_instr(vpbroadcast))]
9619#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9620pub const fn _mm_maskz_set1_epi8(k: __mmask16, a: i8) -> __m128i {
9621    unsafe {
9622        let r = _mm_set1_epi8(a).as_i8x16();
9623        transmute(simd_select_bitmask(k, r, i8x16::ZERO))
9624    }
9625}
9626
9627/// 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.
9628///
9629/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_shufflelo_epi16&expand=5221)
9630#[inline]
9631#[target_feature(enable = "avx512bw")]
9632#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9633#[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 0))]
9634#[rustc_legacy_const_generics(1)]
9635#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9636pub const fn _mm512_shufflelo_epi16<const IMM8: i32>(a: __m512i) -> __m512i {
9637    unsafe {
9638        static_assert_uimm_bits!(IMM8, 8);
9639        let a = a.as_i16x32();
9640        let r: i16x32 = simd_shuffle!(
9641            a,
9642            a,
9643            [
9644                IMM8 as u32 & 0b11,
9645                (IMM8 as u32 >> 2) & 0b11,
9646                (IMM8 as u32 >> 4) & 0b11,
9647                (IMM8 as u32 >> 6) & 0b11,
9648                4,
9649                5,
9650                6,
9651                7,
9652                (IMM8 as u32 & 0b11) + 8,
9653                ((IMM8 as u32 >> 2) & 0b11) + 8,
9654                ((IMM8 as u32 >> 4) & 0b11) + 8,
9655                ((IMM8 as u32 >> 6) & 0b11) + 8,
9656                12,
9657                13,
9658                14,
9659                15,
9660                (IMM8 as u32 & 0b11) + 16,
9661                ((IMM8 as u32 >> 2) & 0b11) + 16,
9662                ((IMM8 as u32 >> 4) & 0b11) + 16,
9663                ((IMM8 as u32 >> 6) & 0b11) + 16,
9664                20,
9665                21,
9666                22,
9667                23,
9668                (IMM8 as u32 & 0b11) + 24,
9669                ((IMM8 as u32 >> 2) & 0b11) + 24,
9670                ((IMM8 as u32 >> 4) & 0b11) + 24,
9671                ((IMM8 as u32 >> 6) & 0b11) + 24,
9672                28,
9673                29,
9674                30,
9675                31,
9676            ],
9677        );
9678        transmute(r)
9679    }
9680}
9681
9682/// 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).
9683///
9684/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_shufflelo_epi16&expand=5219)
9685#[inline]
9686#[target_feature(enable = "avx512bw")]
9687#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9688#[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 0))]
9689#[rustc_legacy_const_generics(3)]
9690#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9691pub const fn _mm512_mask_shufflelo_epi16<const IMM8: i32>(
9692    src: __m512i,
9693    k: __mmask32,
9694    a: __m512i,
9695) -> __m512i {
9696    unsafe {
9697        static_assert_uimm_bits!(IMM8, 8);
9698        let r = _mm512_shufflelo_epi16::<IMM8>(a);
9699        transmute(simd_select_bitmask(k, r.as_i16x32(), src.as_i16x32()))
9700    }
9701}
9702
9703/// 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).
9704///
9705/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_shufflelo_epi16&expand=5220)
9706#[inline]
9707#[target_feature(enable = "avx512bw")]
9708#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9709#[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 0))]
9710#[rustc_legacy_const_generics(2)]
9711#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9712pub const fn _mm512_maskz_shufflelo_epi16<const IMM8: i32>(k: __mmask32, a: __m512i) -> __m512i {
9713    unsafe {
9714        static_assert_uimm_bits!(IMM8, 8);
9715        let r = _mm512_shufflelo_epi16::<IMM8>(a);
9716        transmute(simd_select_bitmask(k, r.as_i16x32(), i16x32::ZERO))
9717    }
9718}
9719
9720/// 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).
9721///
9722/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_shufflelo_epi16&expand=5216)
9723#[inline]
9724#[target_feature(enable = "avx512bw,avx512vl")]
9725#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9726#[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 5))]
9727#[rustc_legacy_const_generics(3)]
9728#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9729pub const fn _mm256_mask_shufflelo_epi16<const IMM8: i32>(
9730    src: __m256i,
9731    k: __mmask16,
9732    a: __m256i,
9733) -> __m256i {
9734    unsafe {
9735        static_assert_uimm_bits!(IMM8, 8);
9736        let shuffle = _mm256_shufflelo_epi16::<IMM8>(a);
9737        transmute(simd_select_bitmask(k, shuffle.as_i16x16(), src.as_i16x16()))
9738    }
9739}
9740
9741/// 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).
9742///
9743/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_shufflelo_epi16&expand=5217)
9744#[inline]
9745#[target_feature(enable = "avx512bw,avx512vl")]
9746#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9747#[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 5))]
9748#[rustc_legacy_const_generics(2)]
9749#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9750pub const fn _mm256_maskz_shufflelo_epi16<const IMM8: i32>(k: __mmask16, a: __m256i) -> __m256i {
9751    unsafe {
9752        static_assert_uimm_bits!(IMM8, 8);
9753        let shuffle = _mm256_shufflelo_epi16::<IMM8>(a);
9754        transmute(simd_select_bitmask(k, shuffle.as_i16x16(), i16x16::ZERO))
9755    }
9756}
9757
9758/// 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).
9759///
9760/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_shufflelo_epi16&expand=5213)
9761#[inline]
9762#[target_feature(enable = "avx512bw,avx512vl")]
9763#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9764#[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 5))]
9765#[rustc_legacy_const_generics(3)]
9766#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9767pub const fn _mm_mask_shufflelo_epi16<const IMM8: i32>(
9768    src: __m128i,
9769    k: __mmask8,
9770    a: __m128i,
9771) -> __m128i {
9772    unsafe {
9773        static_assert_uimm_bits!(IMM8, 8);
9774        let shuffle = _mm_shufflelo_epi16::<IMM8>(a);
9775        transmute(simd_select_bitmask(k, shuffle.as_i16x8(), src.as_i16x8()))
9776    }
9777}
9778
9779/// 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).
9780///
9781/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_shufflelo_epi16&expand=5214)
9782#[inline]
9783#[target_feature(enable = "avx512bw,avx512vl")]
9784#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9785#[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 5))]
9786#[rustc_legacy_const_generics(2)]
9787#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9788pub const fn _mm_maskz_shufflelo_epi16<const IMM8: i32>(k: __mmask8, a: __m128i) -> __m128i {
9789    unsafe {
9790        static_assert_uimm_bits!(IMM8, 8);
9791        let shuffle = _mm_shufflelo_epi16::<IMM8>(a);
9792        transmute(simd_select_bitmask(k, shuffle.as_i16x8(), i16x8::ZERO))
9793    }
9794}
9795
9796/// 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.
9797///
9798/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_shufflehi_epi16&expand=5212)
9799#[inline]
9800#[target_feature(enable = "avx512bw")]
9801#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9802#[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 0))]
9803#[rustc_legacy_const_generics(1)]
9804#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9805pub const fn _mm512_shufflehi_epi16<const IMM8: i32>(a: __m512i) -> __m512i {
9806    unsafe {
9807        static_assert_uimm_bits!(IMM8, 8);
9808        let a = a.as_i16x32();
9809        let r: i16x32 = simd_shuffle!(
9810            a,
9811            a,
9812            [
9813                0,
9814                1,
9815                2,
9816                3,
9817                (IMM8 as u32 & 0b11) + 4,
9818                ((IMM8 as u32 >> 2) & 0b11) + 4,
9819                ((IMM8 as u32 >> 4) & 0b11) + 4,
9820                ((IMM8 as u32 >> 6) & 0b11) + 4,
9821                8,
9822                9,
9823                10,
9824                11,
9825                (IMM8 as u32 & 0b11) + 12,
9826                ((IMM8 as u32 >> 2) & 0b11) + 12,
9827                ((IMM8 as u32 >> 4) & 0b11) + 12,
9828                ((IMM8 as u32 >> 6) & 0b11) + 12,
9829                16,
9830                17,
9831                18,
9832                19,
9833                (IMM8 as u32 & 0b11) + 20,
9834                ((IMM8 as u32 >> 2) & 0b11) + 20,
9835                ((IMM8 as u32 >> 4) & 0b11) + 20,
9836                ((IMM8 as u32 >> 6) & 0b11) + 20,
9837                24,
9838                25,
9839                26,
9840                27,
9841                (IMM8 as u32 & 0b11) + 28,
9842                ((IMM8 as u32 >> 2) & 0b11) + 28,
9843                ((IMM8 as u32 >> 4) & 0b11) + 28,
9844                ((IMM8 as u32 >> 6) & 0b11) + 28,
9845            ],
9846        );
9847        transmute(r)
9848    }
9849}
9850
9851/// 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).
9852///
9853/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_shufflehi_epi16&expand=5210)
9854#[inline]
9855#[target_feature(enable = "avx512bw")]
9856#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9857#[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 0))]
9858#[rustc_legacy_const_generics(3)]
9859#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9860pub const fn _mm512_mask_shufflehi_epi16<const IMM8: i32>(
9861    src: __m512i,
9862    k: __mmask32,
9863    a: __m512i,
9864) -> __m512i {
9865    unsafe {
9866        static_assert_uimm_bits!(IMM8, 8);
9867        let r = _mm512_shufflehi_epi16::<IMM8>(a);
9868        transmute(simd_select_bitmask(k, r.as_i16x32(), src.as_i16x32()))
9869    }
9870}
9871
9872/// 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).
9873///
9874/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_shufflehi_epi16&expand=5211)
9875#[inline]
9876#[target_feature(enable = "avx512bw")]
9877#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9878#[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 0))]
9879#[rustc_legacy_const_generics(2)]
9880#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9881pub const fn _mm512_maskz_shufflehi_epi16<const IMM8: i32>(k: __mmask32, a: __m512i) -> __m512i {
9882    unsafe {
9883        static_assert_uimm_bits!(IMM8, 8);
9884        let r = _mm512_shufflehi_epi16::<IMM8>(a);
9885        transmute(simd_select_bitmask(k, r.as_i16x32(), i16x32::ZERO))
9886    }
9887}
9888
9889/// 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).
9890///
9891/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_shufflehi_epi16&expand=5207)
9892#[inline]
9893#[target_feature(enable = "avx512bw,avx512vl")]
9894#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9895#[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 5))]
9896#[rustc_legacy_const_generics(3)]
9897#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9898pub const fn _mm256_mask_shufflehi_epi16<const IMM8: i32>(
9899    src: __m256i,
9900    k: __mmask16,
9901    a: __m256i,
9902) -> __m256i {
9903    unsafe {
9904        static_assert_uimm_bits!(IMM8, 8);
9905        let shuffle = _mm256_shufflehi_epi16::<IMM8>(a);
9906        transmute(simd_select_bitmask(k, shuffle.as_i16x16(), src.as_i16x16()))
9907    }
9908}
9909
9910/// 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).
9911///
9912/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_shufflehi_epi16&expand=5208)
9913#[inline]
9914#[target_feature(enable = "avx512bw,avx512vl")]
9915#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9916#[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 5))]
9917#[rustc_legacy_const_generics(2)]
9918#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9919pub const fn _mm256_maskz_shufflehi_epi16<const IMM8: i32>(k: __mmask16, a: __m256i) -> __m256i {
9920    unsafe {
9921        static_assert_uimm_bits!(IMM8, 8);
9922        let shuffle = _mm256_shufflehi_epi16::<IMM8>(a);
9923        transmute(simd_select_bitmask(k, shuffle.as_i16x16(), i16x16::ZERO))
9924    }
9925}
9926
9927/// 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).
9928///
9929/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_shufflehi_epi16&expand=5204)
9930#[inline]
9931#[target_feature(enable = "avx512bw,avx512vl")]
9932#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9933#[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 5))]
9934#[rustc_legacy_const_generics(3)]
9935#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9936pub const fn _mm_mask_shufflehi_epi16<const IMM8: i32>(
9937    src: __m128i,
9938    k: __mmask8,
9939    a: __m128i,
9940) -> __m128i {
9941    unsafe {
9942        static_assert_uimm_bits!(IMM8, 8);
9943        let shuffle = _mm_shufflehi_epi16::<IMM8>(a);
9944        transmute(simd_select_bitmask(k, shuffle.as_i16x8(), src.as_i16x8()))
9945    }
9946}
9947
9948/// 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).
9949///
9950/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_shufflehi_epi16&expand=5205)
9951#[inline]
9952#[target_feature(enable = "avx512bw,avx512vl")]
9953#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9954#[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 5))]
9955#[rustc_legacy_const_generics(2)]
9956#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
9957pub const fn _mm_maskz_shufflehi_epi16<const IMM8: i32>(k: __mmask8, a: __m128i) -> __m128i {
9958    unsafe {
9959        static_assert_uimm_bits!(IMM8, 8);
9960        let shuffle = _mm_shufflehi_epi16::<IMM8>(a);
9961        transmute(simd_select_bitmask(k, shuffle.as_i16x8(), i16x8::ZERO))
9962    }
9963}
9964
9965/// 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.
9966///
9967/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_shuffle_epi8&expand=5159)
9968#[inline]
9969#[target_feature(enable = "avx512bw")]
9970#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9971#[cfg_attr(test, assert_instr(vpshufb))]
9972pub fn _mm512_shuffle_epi8(a: __m512i, b: __m512i) -> __m512i {
9973    unsafe { transmute(vpshufb(a.as_i8x64(), b.as_i8x64())) }
9974}
9975
9976/// 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).
9977///
9978/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_shuffle_epi8&expand=5157)
9979#[inline]
9980#[target_feature(enable = "avx512bw")]
9981#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9982#[cfg_attr(test, assert_instr(vpshufb))]
9983pub fn _mm512_mask_shuffle_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
9984    unsafe {
9985        let shuffle = _mm512_shuffle_epi8(a, b).as_i8x64();
9986        transmute(simd_select_bitmask(k, shuffle, src.as_i8x64()))
9987    }
9988}
9989
9990/// 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).
9991///
9992/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_shuffle_epi8&expand=5158)
9993#[inline]
9994#[target_feature(enable = "avx512bw")]
9995#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9996#[cfg_attr(test, assert_instr(vpshufb))]
9997pub fn _mm512_maskz_shuffle_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
9998    unsafe {
9999        let shuffle = _mm512_shuffle_epi8(a, b).as_i8x64();
10000        transmute(simd_select_bitmask(k, shuffle, i8x64::ZERO))
10001    }
10002}
10003
10004/// 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).
10005///
10006/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_shuffle_epi8&expand=5154)
10007#[inline]
10008#[target_feature(enable = "avx512bw,avx512vl")]
10009#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10010#[cfg_attr(test, assert_instr(vpshufb))]
10011pub fn _mm256_mask_shuffle_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
10012    unsafe {
10013        let shuffle = _mm256_shuffle_epi8(a, b).as_i8x32();
10014        transmute(simd_select_bitmask(k, shuffle, src.as_i8x32()))
10015    }
10016}
10017
10018/// 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).
10019///
10020/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_shuffle_epi8&expand=5155)
10021#[inline]
10022#[target_feature(enable = "avx512bw,avx512vl")]
10023#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10024#[cfg_attr(test, assert_instr(vpshufb))]
10025pub fn _mm256_maskz_shuffle_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
10026    unsafe {
10027        let shuffle = _mm256_shuffle_epi8(a, b).as_i8x32();
10028        transmute(simd_select_bitmask(k, shuffle, i8x32::ZERO))
10029    }
10030}
10031
10032/// 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).
10033///
10034/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_shuffle_epi8&expand=5151)
10035#[inline]
10036#[target_feature(enable = "avx512bw,avx512vl")]
10037#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10038#[cfg_attr(test, assert_instr(vpshufb))]
10039pub fn _mm_mask_shuffle_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
10040    unsafe {
10041        let shuffle = _mm_shuffle_epi8(a, b).as_i8x16();
10042        transmute(simd_select_bitmask(k, shuffle, src.as_i8x16()))
10043    }
10044}
10045
10046/// 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).
10047///
10048/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_shuffle_epi8&expand=5152)
10049#[inline]
10050#[target_feature(enable = "avx512bw,avx512vl")]
10051#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10052#[cfg_attr(test, assert_instr(vpshufb))]
10053pub fn _mm_maskz_shuffle_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
10054    unsafe {
10055        let shuffle = _mm_shuffle_epi8(a, b).as_i8x16();
10056        transmute(simd_select_bitmask(k, shuffle, i8x16::ZERO))
10057    }
10058}
10059
10060/// 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.
10061///
10062/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_test_epi16_mask&expand=5884)
10063#[inline]
10064#[target_feature(enable = "avx512bw")]
10065#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10066#[cfg_attr(test, assert_instr(vptestmw))]
10067#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10068pub const fn _mm512_test_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 {
10069    let and = _mm512_and_si512(a, b);
10070    let zero = _mm512_setzero_si512();
10071    _mm512_cmpneq_epi16_mask(and, zero)
10072}
10073
10074/// 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.
10075///
10076/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_test_epi16_mask&expand=5883)
10077#[inline]
10078#[target_feature(enable = "avx512bw")]
10079#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10080#[cfg_attr(test, assert_instr(vptestmw))]
10081#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10082pub const fn _mm512_mask_test_epi16_mask(k: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
10083    let and = _mm512_and_si512(a, b);
10084    let zero = _mm512_setzero_si512();
10085    _mm512_mask_cmpneq_epi16_mask(k, and, zero)
10086}
10087
10088/// 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.
10089///
10090/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_test_epi16_mask&expand=5882)
10091#[inline]
10092#[target_feature(enable = "avx512bw,avx512vl")]
10093#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10094#[cfg_attr(test, assert_instr(vptestmw))]
10095#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10096pub const fn _mm256_test_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 {
10097    let and = _mm256_and_si256(a, b);
10098    let zero = _mm256_setzero_si256();
10099    _mm256_cmpneq_epi16_mask(and, zero)
10100}
10101
10102/// 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.
10103///
10104/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_test_epi16_mask&expand=5881)
10105#[inline]
10106#[target_feature(enable = "avx512bw,avx512vl")]
10107#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10108#[cfg_attr(test, assert_instr(vptestmw))]
10109#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10110pub const fn _mm256_mask_test_epi16_mask(k: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
10111    let and = _mm256_and_si256(a, b);
10112    let zero = _mm256_setzero_si256();
10113    _mm256_mask_cmpneq_epi16_mask(k, and, zero)
10114}
10115
10116/// 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.
10117///
10118/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_test_epi16_mask&expand=5880)
10119#[inline]
10120#[target_feature(enable = "avx512bw,avx512vl")]
10121#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10122#[cfg_attr(test, assert_instr(vptestmw))]
10123#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10124pub const fn _mm_test_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 {
10125    let and = _mm_and_si128(a, b);
10126    let zero = _mm_setzero_si128();
10127    _mm_cmpneq_epi16_mask(and, zero)
10128}
10129
10130/// 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.
10131///
10132/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_test_epi16_mask&expand=5879)
10133#[inline]
10134#[target_feature(enable = "avx512bw,avx512vl")]
10135#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10136#[cfg_attr(test, assert_instr(vptestmw))]
10137#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10138pub const fn _mm_mask_test_epi16_mask(k: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
10139    let and = _mm_and_si128(a, b);
10140    let zero = _mm_setzero_si128();
10141    _mm_mask_cmpneq_epi16_mask(k, and, zero)
10142}
10143
10144/// 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.
10145///
10146/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_test_epi8_mask&expand=5902)
10147#[inline]
10148#[target_feature(enable = "avx512bw")]
10149#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10150#[cfg_attr(test, assert_instr(vptestmb))]
10151#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10152pub const fn _mm512_test_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 {
10153    let and = _mm512_and_si512(a, b);
10154    let zero = _mm512_setzero_si512();
10155    _mm512_cmpneq_epi8_mask(and, zero)
10156}
10157
10158/// 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.
10159///
10160/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_test_epi8_mask&expand=5901)
10161#[inline]
10162#[target_feature(enable = "avx512bw")]
10163#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10164#[cfg_attr(test, assert_instr(vptestmb))]
10165#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10166pub const fn _mm512_mask_test_epi8_mask(k: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
10167    let and = _mm512_and_si512(a, b);
10168    let zero = _mm512_setzero_si512();
10169    _mm512_mask_cmpneq_epi8_mask(k, and, zero)
10170}
10171
10172/// 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.
10173///
10174/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_test_epi8_mask&expand=5900)
10175#[inline]
10176#[target_feature(enable = "avx512bw,avx512vl")]
10177#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10178#[cfg_attr(test, assert_instr(vptestmb))]
10179#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10180pub const fn _mm256_test_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 {
10181    let and = _mm256_and_si256(a, b);
10182    let zero = _mm256_setzero_si256();
10183    _mm256_cmpneq_epi8_mask(and, zero)
10184}
10185
10186/// 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.
10187///
10188/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_test_epi8_mask&expand=5899)
10189#[inline]
10190#[target_feature(enable = "avx512bw,avx512vl")]
10191#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10192#[cfg_attr(test, assert_instr(vptestmb))]
10193#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10194pub const fn _mm256_mask_test_epi8_mask(k: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
10195    let and = _mm256_and_si256(a, b);
10196    let zero = _mm256_setzero_si256();
10197    _mm256_mask_cmpneq_epi8_mask(k, and, zero)
10198}
10199
10200/// 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.
10201///
10202/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_test_epi8_mask&expand=5898)
10203#[inline]
10204#[target_feature(enable = "avx512bw,avx512vl")]
10205#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10206#[cfg_attr(test, assert_instr(vptestmb))]
10207#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10208pub const fn _mm_test_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 {
10209    let and = _mm_and_si128(a, b);
10210    let zero = _mm_setzero_si128();
10211    _mm_cmpneq_epi8_mask(and, zero)
10212}
10213
10214/// 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.
10215///
10216/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_test_epi8_mask&expand=5897)
10217#[inline]
10218#[target_feature(enable = "avx512bw,avx512vl")]
10219#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10220#[cfg_attr(test, assert_instr(vptestmb))]
10221#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10222pub const fn _mm_mask_test_epi8_mask(k: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
10223    let and = _mm_and_si128(a, b);
10224    let zero = _mm_setzero_si128();
10225    _mm_mask_cmpneq_epi8_mask(k, and, zero)
10226}
10227
10228/// 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.
10229///
10230/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_testn_epi16_mask&expand=5915)
10231#[inline]
10232#[target_feature(enable = "avx512bw")]
10233#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10234#[cfg_attr(test, assert_instr(vptestnmw))]
10235#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10236pub const fn _mm512_testn_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 {
10237    let and = _mm512_and_si512(a, b);
10238    let zero = _mm512_setzero_si512();
10239    _mm512_cmpeq_epi16_mask(and, zero)
10240}
10241
10242/// 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.
10243///
10244/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_testn_epi16_mask&expand=5914)
10245#[inline]
10246#[target_feature(enable = "avx512bw")]
10247#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10248#[cfg_attr(test, assert_instr(vptestnmw))]
10249#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10250pub const fn _mm512_mask_testn_epi16_mask(k: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
10251    let and = _mm512_and_si512(a, b);
10252    let zero = _mm512_setzero_si512();
10253    _mm512_mask_cmpeq_epi16_mask(k, and, zero)
10254}
10255
10256/// 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.
10257///
10258/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_testn_epi16_mask&expand=5913)
10259#[inline]
10260#[target_feature(enable = "avx512bw,avx512vl")]
10261#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10262#[cfg_attr(test, assert_instr(vptestnmw))]
10263#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10264pub const fn _mm256_testn_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 {
10265    let and = _mm256_and_si256(a, b);
10266    let zero = _mm256_setzero_si256();
10267    _mm256_cmpeq_epi16_mask(and, zero)
10268}
10269
10270/// 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.
10271///
10272/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_testn_epi16_mask&expand=5912)
10273#[inline]
10274#[target_feature(enable = "avx512bw,avx512vl")]
10275#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10276#[cfg_attr(test, assert_instr(vptestnmw))]
10277#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10278pub const fn _mm256_mask_testn_epi16_mask(k: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
10279    let and = _mm256_and_si256(a, b);
10280    let zero = _mm256_setzero_si256();
10281    _mm256_mask_cmpeq_epi16_mask(k, and, zero)
10282}
10283
10284/// 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.
10285///
10286/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_testn_epi16_mask&expand=5911)
10287#[inline]
10288#[target_feature(enable = "avx512bw,avx512vl")]
10289#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10290#[cfg_attr(test, assert_instr(vptestnmw))]
10291#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10292pub const fn _mm_testn_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 {
10293    let and = _mm_and_si128(a, b);
10294    let zero = _mm_setzero_si128();
10295    _mm_cmpeq_epi16_mask(and, zero)
10296}
10297
10298/// 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.
10299///
10300/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_testn_epi16_mask&expand=5910)
10301#[inline]
10302#[target_feature(enable = "avx512bw,avx512vl")]
10303#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10304#[cfg_attr(test, assert_instr(vptestnmw))]
10305#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10306pub const fn _mm_mask_testn_epi16_mask(k: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
10307    let and = _mm_and_si128(a, b);
10308    let zero = _mm_setzero_si128();
10309    _mm_mask_cmpeq_epi16_mask(k, and, zero)
10310}
10311
10312/// 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.
10313///
10314/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_testn_epi8_mask&expand=5933)
10315#[inline]
10316#[target_feature(enable = "avx512bw")]
10317#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10318#[cfg_attr(test, assert_instr(vptestnmb))]
10319#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10320pub const fn _mm512_testn_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 {
10321    let and = _mm512_and_si512(a, b);
10322    let zero = _mm512_setzero_si512();
10323    _mm512_cmpeq_epi8_mask(and, zero)
10324}
10325
10326/// 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.
10327///
10328/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_testn_epi8_mask&expand=5932)
10329#[inline]
10330#[target_feature(enable = "avx512bw")]
10331#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10332#[cfg_attr(test, assert_instr(vptestnmb))]
10333#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10334pub const fn _mm512_mask_testn_epi8_mask(k: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
10335    let and = _mm512_and_si512(a, b);
10336    let zero = _mm512_setzero_si512();
10337    _mm512_mask_cmpeq_epi8_mask(k, and, zero)
10338}
10339
10340/// 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.
10341///
10342/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_testn_epi8_mask&expand=5931)
10343#[inline]
10344#[target_feature(enable = "avx512bw,avx512vl")]
10345#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10346#[cfg_attr(test, assert_instr(vptestnmb))]
10347#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10348pub const fn _mm256_testn_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 {
10349    let and = _mm256_and_si256(a, b);
10350    let zero = _mm256_setzero_si256();
10351    _mm256_cmpeq_epi8_mask(and, zero)
10352}
10353
10354/// 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.
10355///
10356/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_testn_epi8_mask&expand=5930)
10357#[inline]
10358#[target_feature(enable = "avx512bw,avx512vl")]
10359#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10360#[cfg_attr(test, assert_instr(vptestnmb))]
10361#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10362pub const fn _mm256_mask_testn_epi8_mask(k: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
10363    let and = _mm256_and_si256(a, b);
10364    let zero = _mm256_setzero_si256();
10365    _mm256_mask_cmpeq_epi8_mask(k, and, zero)
10366}
10367
10368/// 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.
10369///
10370/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_testn_epi8_mask&expand=5929)
10371#[inline]
10372#[target_feature(enable = "avx512bw,avx512vl")]
10373#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10374#[cfg_attr(test, assert_instr(vptestnmb))]
10375#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10376pub const fn _mm_testn_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 {
10377    let and = _mm_and_si128(a, b);
10378    let zero = _mm_setzero_si128();
10379    _mm_cmpeq_epi8_mask(and, zero)
10380}
10381
10382/// 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.
10383///
10384/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_testn_epi8_mask&expand=5928)
10385#[inline]
10386#[target_feature(enable = "avx512bw,avx512vl")]
10387#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10388#[cfg_attr(test, assert_instr(vptestnmb))]
10389#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10390pub const fn _mm_mask_testn_epi8_mask(k: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
10391    let and = _mm_and_si128(a, b);
10392    let zero = _mm_setzero_si128();
10393    _mm_mask_cmpeq_epi8_mask(k, and, zero)
10394}
10395
10396/// Store 64-bit mask from a into memory.
10397///
10398/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_store_mask64&expand=5578)
10399#[inline]
10400#[target_feature(enable = "avx512bw")]
10401#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10402#[cfg_attr(test, assert_instr(mov))] //should be kmovq
10403#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10404pub const unsafe fn _store_mask64(mem_addr: *mut __mmask64, a: __mmask64) {
10405    ptr::write(mem_addr as *mut __mmask64, a);
10406}
10407
10408/// Store 32-bit mask from a into memory.
10409///
10410/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_store_mask32&expand=5577)
10411#[inline]
10412#[target_feature(enable = "avx512bw")]
10413#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10414#[cfg_attr(test, assert_instr(mov))] //should be kmovd
10415#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10416pub const unsafe fn _store_mask32(mem_addr: *mut __mmask32, a: __mmask32) {
10417    ptr::write(mem_addr as *mut __mmask32, a);
10418}
10419
10420/// Load 64-bit mask from memory into k.
10421///
10422/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_load_mask64&expand=3318)
10423#[inline]
10424#[target_feature(enable = "avx512bw")]
10425#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10426#[cfg_attr(test, assert_instr(mov))] //should be kmovq
10427#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10428pub const unsafe fn _load_mask64(mem_addr: *const __mmask64) -> __mmask64 {
10429    ptr::read(mem_addr as *const __mmask64)
10430}
10431
10432/// Load 32-bit mask from memory into k.
10433///
10434/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_load_mask32&expand=3317)
10435#[inline]
10436#[target_feature(enable = "avx512bw")]
10437#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10438#[cfg_attr(test, assert_instr(mov))] //should be kmovd
10439#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10440pub const unsafe fn _load_mask32(mem_addr: *const __mmask32) -> __mmask32 {
10441    ptr::read(mem_addr as *const __mmask32)
10442}
10443
10444/// 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.
10445///
10446/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_sad_epu8&expand=4855)
10447#[inline]
10448#[target_feature(enable = "avx512bw")]
10449#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10450#[cfg_attr(test, assert_instr(vpsadbw))]
10451pub fn _mm512_sad_epu8(a: __m512i, b: __m512i) -> __m512i {
10452    unsafe { transmute(vpsadbw(a.as_u8x64(), b.as_u8x64())) }
10453}
10454
10455/// 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.
10456///
10457/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_dbsad_epu8&expand=2114)
10458#[inline]
10459#[target_feature(enable = "avx512bw")]
10460#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10461#[rustc_legacy_const_generics(2)]
10462#[cfg_attr(test, assert_instr(vdbpsadbw, IMM8 = 0))]
10463pub fn _mm512_dbsad_epu8<const IMM8: i32>(a: __m512i, b: __m512i) -> __m512i {
10464    unsafe {
10465        static_assert_uimm_bits!(IMM8, 8);
10466        let a = a.as_u8x64();
10467        let b = b.as_u8x64();
10468        let r = vdbpsadbw(a, b, IMM8);
10469        transmute(r)
10470    }
10471}
10472
10473/// 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.
10474///
10475/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_dbsad_epu8&expand=2115)
10476#[inline]
10477#[target_feature(enable = "avx512bw")]
10478#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10479#[rustc_legacy_const_generics(4)]
10480#[cfg_attr(test, assert_instr(vdbpsadbw, IMM8 = 0))]
10481pub fn _mm512_mask_dbsad_epu8<const IMM8: i32>(
10482    src: __m512i,
10483    k: __mmask32,
10484    a: __m512i,
10485    b: __m512i,
10486) -> __m512i {
10487    unsafe {
10488        static_assert_uimm_bits!(IMM8, 8);
10489        let a = a.as_u8x64();
10490        let b = b.as_u8x64();
10491        let r = vdbpsadbw(a, b, IMM8);
10492        transmute(simd_select_bitmask(k, r, src.as_u16x32()))
10493    }
10494}
10495
10496/// 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.
10497///
10498/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_dbsad_epu8&expand=2116)
10499#[inline]
10500#[target_feature(enable = "avx512bw")]
10501#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10502#[rustc_legacy_const_generics(3)]
10503#[cfg_attr(test, assert_instr(vdbpsadbw, IMM8 = 0))]
10504pub fn _mm512_maskz_dbsad_epu8<const IMM8: i32>(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
10505    unsafe {
10506        static_assert_uimm_bits!(IMM8, 8);
10507        let a = a.as_u8x64();
10508        let b = b.as_u8x64();
10509        let r = vdbpsadbw(a, b, IMM8);
10510        transmute(simd_select_bitmask(k, r, u16x32::ZERO))
10511    }
10512}
10513
10514/// 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.
10515///
10516/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_dbsad_epu8&expand=2111)
10517#[inline]
10518#[target_feature(enable = "avx512bw,avx512vl")]
10519#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10520#[rustc_legacy_const_generics(2)]
10521#[cfg_attr(test, assert_instr(vdbpsadbw, IMM8 = 0))]
10522pub fn _mm256_dbsad_epu8<const IMM8: i32>(a: __m256i, b: __m256i) -> __m256i {
10523    unsafe {
10524        static_assert_uimm_bits!(IMM8, 8);
10525        let a = a.as_u8x32();
10526        let b = b.as_u8x32();
10527        let r = vdbpsadbw256(a, b, IMM8);
10528        transmute(r)
10529    }
10530}
10531
10532/// 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.
10533///
10534/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_dbsad_epu8&expand=2112)
10535#[inline]
10536#[target_feature(enable = "avx512bw,avx512vl")]
10537#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10538#[rustc_legacy_const_generics(4)]
10539#[cfg_attr(test, assert_instr(vdbpsadbw, IMM8 = 0))]
10540pub fn _mm256_mask_dbsad_epu8<const IMM8: i32>(
10541    src: __m256i,
10542    k: __mmask16,
10543    a: __m256i,
10544    b: __m256i,
10545) -> __m256i {
10546    unsafe {
10547        static_assert_uimm_bits!(IMM8, 8);
10548        let a = a.as_u8x32();
10549        let b = b.as_u8x32();
10550        let r = vdbpsadbw256(a, b, IMM8);
10551        transmute(simd_select_bitmask(k, r, src.as_u16x16()))
10552    }
10553}
10554
10555/// 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.
10556///
10557/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_dbsad_epu8&expand=2113)
10558#[inline]
10559#[target_feature(enable = "avx512bw,avx512vl")]
10560#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10561#[rustc_legacy_const_generics(3)]
10562#[cfg_attr(test, assert_instr(vdbpsadbw, IMM8 = 0))]
10563pub fn _mm256_maskz_dbsad_epu8<const IMM8: i32>(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
10564    unsafe {
10565        static_assert_uimm_bits!(IMM8, 8);
10566        let a = a.as_u8x32();
10567        let b = b.as_u8x32();
10568        let r = vdbpsadbw256(a, b, IMM8);
10569        transmute(simd_select_bitmask(k, r, u16x16::ZERO))
10570    }
10571}
10572
10573/// 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.
10574///
10575/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_dbsad_epu8&expand=2108)
10576#[inline]
10577#[target_feature(enable = "avx512bw,avx512vl")]
10578#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10579#[rustc_legacy_const_generics(2)]
10580#[cfg_attr(test, assert_instr(vdbpsadbw, IMM8 = 0))]
10581pub fn _mm_dbsad_epu8<const IMM8: i32>(a: __m128i, b: __m128i) -> __m128i {
10582    unsafe {
10583        static_assert_uimm_bits!(IMM8, 8);
10584        let a = a.as_u8x16();
10585        let b = b.as_u8x16();
10586        let r = vdbpsadbw128(a, b, IMM8);
10587        transmute(r)
10588    }
10589}
10590
10591/// 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.
10592///
10593/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_dbsad_epu8&expand=2109)
10594#[inline]
10595#[target_feature(enable = "avx512bw,avx512vl")]
10596#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10597#[rustc_legacy_const_generics(4)]
10598#[cfg_attr(test, assert_instr(vdbpsadbw, IMM8 = 0))]
10599pub fn _mm_mask_dbsad_epu8<const IMM8: i32>(
10600    src: __m128i,
10601    k: __mmask8,
10602    a: __m128i,
10603    b: __m128i,
10604) -> __m128i {
10605    unsafe {
10606        static_assert_uimm_bits!(IMM8, 8);
10607        let a = a.as_u8x16();
10608        let b = b.as_u8x16();
10609        let r = vdbpsadbw128(a, b, IMM8);
10610        transmute(simd_select_bitmask(k, r, src.as_u16x8()))
10611    }
10612}
10613
10614/// 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.
10615///
10616/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_dbsad_epu8&expand=2110)
10617#[inline]
10618#[target_feature(enable = "avx512bw,avx512vl")]
10619#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10620#[rustc_legacy_const_generics(3)]
10621#[cfg_attr(test, assert_instr(vdbpsadbw, IMM8 = 0))]
10622pub fn _mm_maskz_dbsad_epu8<const IMM8: i32>(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
10623    unsafe {
10624        static_assert_uimm_bits!(IMM8, 8);
10625        let a = a.as_u8x16();
10626        let b = b.as_u8x16();
10627        let r = vdbpsadbw128(a, b, IMM8);
10628        transmute(simd_select_bitmask(k, r, u16x8::ZERO))
10629    }
10630}
10631
10632/// Set each bit of mask register k based on the most significant bit of the corresponding packed 16-bit integer in a.
10633///
10634/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_movepi16_mask&expand=3873)
10635#[inline]
10636#[target_feature(enable = "avx512bw")]
10637#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10638#[cfg_attr(test, assert_instr(vpmovw2m))]
10639#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10640pub const fn _mm512_movepi16_mask(a: __m512i) -> __mmask32 {
10641    let filter = _mm512_set1_epi16(1 << 15);
10642    let a = _mm512_and_si512(a, filter);
10643    _mm512_cmpeq_epi16_mask(a, filter)
10644}
10645
10646/// Set each bit of mask register k based on the most significant bit of the corresponding packed 16-bit integer in a.
10647///
10648/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_movepi16_mask&expand=3872)
10649#[inline]
10650#[target_feature(enable = "avx512bw,avx512vl")]
10651#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10652#[cfg_attr(test, assert_instr(vpmovw2m))]
10653#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10654pub const fn _mm256_movepi16_mask(a: __m256i) -> __mmask16 {
10655    let filter = _mm256_set1_epi16(1 << 15);
10656    let a = _mm256_and_si256(a, filter);
10657    _mm256_cmpeq_epi16_mask(a, filter)
10658}
10659
10660/// Set each bit of mask register k based on the most significant bit of the corresponding packed 16-bit integer in a.
10661///
10662/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_movepi16_mask&expand=3871)
10663#[inline]
10664#[target_feature(enable = "avx512bw,avx512vl")]
10665#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10666#[cfg_attr(test, assert_instr(vpmovw2m))]
10667#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10668pub const fn _mm_movepi16_mask(a: __m128i) -> __mmask8 {
10669    let filter = _mm_set1_epi16(1 << 15);
10670    let a = _mm_and_si128(a, filter);
10671    _mm_cmpeq_epi16_mask(a, filter)
10672}
10673
10674/// Set each bit of mask register k based on the most significant bit of the corresponding packed 8-bit integer in a.
10675///
10676/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_movepi8_mask&expand=3883)
10677#[inline]
10678#[target_feature(enable = "avx512bw")]
10679#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10680#[cfg_attr(test, assert_instr(vpmovb2m))]
10681#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10682pub const fn _mm512_movepi8_mask(a: __m512i) -> __mmask64 {
10683    let filter = _mm512_set1_epi8(1 << 7);
10684    let a = _mm512_and_si512(a, filter);
10685    _mm512_cmpeq_epi8_mask(a, filter)
10686}
10687
10688/// Set each bit of mask register k based on the most significant bit of the corresponding packed 8-bit integer in a.
10689///
10690/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_movepi8_mask&expand=3882)
10691#[inline]
10692#[target_feature(enable = "avx512bw,avx512vl")]
10693#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10694#[cfg_attr(test, assert_instr(vpmovmskb))]
10695// should be vpmovb2m but compiled to vpmovmskb in the test shim because that takes less cycles than
10696// using vpmovb2m plus converting the mask register to a standard register.
10697#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10698pub const fn _mm256_movepi8_mask(a: __m256i) -> __mmask32 {
10699    let filter = _mm256_set1_epi8(1 << 7);
10700    let a = _mm256_and_si256(a, filter);
10701    _mm256_cmpeq_epi8_mask(a, filter)
10702}
10703
10704/// Set each bit of mask register k based on the most significant bit of the corresponding packed 8-bit integer in a.
10705///
10706/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_movepi8_mask&expand=3881)
10707#[inline]
10708#[target_feature(enable = "avx512bw,avx512vl")]
10709#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10710#[cfg_attr(test, assert_instr(vpmovmskb))]
10711// should be vpmovb2m but compiled to vpmovmskb in the test shim because that takes less cycles than
10712// using vpmovb2m plus converting the mask register to a standard register.
10713#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10714pub const fn _mm_movepi8_mask(a: __m128i) -> __mmask16 {
10715    let filter = _mm_set1_epi8(1 << 7);
10716    let a = _mm_and_si128(a, filter);
10717    _mm_cmpeq_epi8_mask(a, filter)
10718}
10719
10720/// Set each packed 16-bit integer in dst to all ones or all zeros based on the value of the corresponding bit in k.
10721///
10722/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_movm_epi16&expand=3886)
10723#[inline]
10724#[target_feature(enable = "avx512bw")]
10725#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10726#[cfg_attr(test, assert_instr(vpmovm2w))]
10727#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10728pub const fn _mm512_movm_epi16(k: __mmask32) -> __m512i {
10729    unsafe {
10730        let one = _mm512_set1_epi16(
10731            1 << 15
10732                | 1 << 14
10733                | 1 << 13
10734                | 1 << 12
10735                | 1 << 11
10736                | 1 << 10
10737                | 1 << 9
10738                | 1 << 8
10739                | 1 << 7
10740                | 1 << 6
10741                | 1 << 5
10742                | 1 << 4
10743                | 1 << 3
10744                | 1 << 2
10745                | 1 << 1
10746                | 1 << 0,
10747        )
10748        .as_i16x32();
10749        transmute(simd_select_bitmask(k, one, i16x32::ZERO))
10750    }
10751}
10752
10753/// Set each packed 16-bit integer in dst to all ones or all zeros based on the value of the corresponding bit in k.
10754///
10755/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_movm_epi16&expand=3885)
10756#[inline]
10757#[target_feature(enable = "avx512bw,avx512vl")]
10758#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10759#[cfg_attr(test, assert_instr(vpmovm2w))]
10760#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10761pub const fn _mm256_movm_epi16(k: __mmask16) -> __m256i {
10762    unsafe {
10763        let one = _mm256_set1_epi16(
10764            1 << 15
10765                | 1 << 14
10766                | 1 << 13
10767                | 1 << 12
10768                | 1 << 11
10769                | 1 << 10
10770                | 1 << 9
10771                | 1 << 8
10772                | 1 << 7
10773                | 1 << 6
10774                | 1 << 5
10775                | 1 << 4
10776                | 1 << 3
10777                | 1 << 2
10778                | 1 << 1
10779                | 1 << 0,
10780        )
10781        .as_i16x16();
10782        transmute(simd_select_bitmask(k, one, i16x16::ZERO))
10783    }
10784}
10785
10786/// Set each packed 16-bit integer in dst to all ones or all zeros based on the value of the corresponding bit in k.
10787///
10788/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_movm_epi16&expand=3884)
10789#[inline]
10790#[target_feature(enable = "avx512bw,avx512vl")]
10791#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10792#[cfg_attr(test, assert_instr(vpmovm2w))]
10793#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10794pub const fn _mm_movm_epi16(k: __mmask8) -> __m128i {
10795    unsafe {
10796        let one = _mm_set1_epi16(
10797            1 << 15
10798                | 1 << 14
10799                | 1 << 13
10800                | 1 << 12
10801                | 1 << 11
10802                | 1 << 10
10803                | 1 << 9
10804                | 1 << 8
10805                | 1 << 7
10806                | 1 << 6
10807                | 1 << 5
10808                | 1 << 4
10809                | 1 << 3
10810                | 1 << 2
10811                | 1 << 1
10812                | 1 << 0,
10813        )
10814        .as_i16x8();
10815        transmute(simd_select_bitmask(k, one, i16x8::ZERO))
10816    }
10817}
10818
10819/// Set each packed 8-bit integer in dst to all ones or all zeros based on the value of the corresponding bit in k.
10820///
10821/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_movm_epi8&expand=3895)
10822#[inline]
10823#[target_feature(enable = "avx512bw")]
10824#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10825#[cfg_attr(test, assert_instr(vpmovm2b))]
10826#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10827pub const fn _mm512_movm_epi8(k: __mmask64) -> __m512i {
10828    unsafe {
10829        let one =
10830            _mm512_set1_epi8(1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0)
10831                .as_i8x64();
10832        transmute(simd_select_bitmask(k, one, i8x64::ZERO))
10833    }
10834}
10835
10836/// Set each packed 8-bit integer in dst to all ones or all zeros based on the value of the corresponding bit in k.
10837///
10838/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_movm_epi8&expand=3894)
10839#[inline]
10840#[target_feature(enable = "avx512bw,avx512vl")]
10841#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10842#[cfg_attr(test, assert_instr(vpmovm2b))]
10843#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10844pub const fn _mm256_movm_epi8(k: __mmask32) -> __m256i {
10845    unsafe {
10846        let one =
10847            _mm256_set1_epi8(1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0)
10848                .as_i8x32();
10849        transmute(simd_select_bitmask(k, one, i8x32::ZERO))
10850    }
10851}
10852
10853/// Set each packed 8-bit integer in dst to all ones or all zeros based on the value of the corresponding bit in k.
10854///
10855/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_movm_epi8&expand=3893)
10856#[inline]
10857#[target_feature(enable = "avx512bw,avx512vl")]
10858#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10859#[cfg_attr(test, assert_instr(vpmovm2b))]
10860#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10861pub const fn _mm_movm_epi8(k: __mmask16) -> __m128i {
10862    unsafe {
10863        let one =
10864            _mm_set1_epi8(1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0)
10865                .as_i8x16();
10866        transmute(simd_select_bitmask(k, one, i8x16::ZERO))
10867    }
10868}
10869
10870/// Convert 32-bit mask a into an integer value, and store the result in dst.
10871///
10872/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#_cvtmask32_u32)
10873#[inline]
10874#[target_feature(enable = "avx512bw")]
10875#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10876#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10877pub const fn _cvtmask32_u32(a: __mmask32) -> u32 {
10878    a
10879}
10880
10881/// Convert integer value a into an 32-bit mask, and store the result in k.
10882///
10883/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_cvtu32_mask32)
10884#[inline]
10885#[target_feature(enable = "avx512bw")]
10886#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10887#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10888pub const fn _cvtu32_mask32(a: u32) -> __mmask32 {
10889    a
10890}
10891
10892/// Add 32-bit masks in a and b, and store the result in k.
10893///
10894/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kadd_mask32&expand=3207)
10895#[inline]
10896#[target_feature(enable = "avx512bw")]
10897#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10898#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10899pub const fn _kadd_mask32(a: __mmask32, b: __mmask32) -> __mmask32 {
10900    a.wrapping_add(b)
10901}
10902
10903/// Add 64-bit masks in a and b, and store the result in k.
10904///
10905/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kadd_mask64&expand=3208)
10906#[inline]
10907#[target_feature(enable = "avx512bw")]
10908#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10909#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10910pub const fn _kadd_mask64(a: __mmask64, b: __mmask64) -> __mmask64 {
10911    a.wrapping_add(b)
10912}
10913
10914/// Compute the bitwise AND of 32-bit masks a and b, and store the result in k.
10915///
10916/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kand_mask32&expand=3213)
10917#[inline]
10918#[target_feature(enable = "avx512bw")]
10919#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10920#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10921pub const fn _kand_mask32(a: __mmask32, b: __mmask32) -> __mmask32 {
10922    a & b
10923}
10924
10925/// Compute the bitwise AND of 64-bit masks a and b, and store the result in k.
10926///
10927/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kand_mask64&expand=3214)
10928#[inline]
10929#[target_feature(enable = "avx512bw")]
10930#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10931#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10932pub const fn _kand_mask64(a: __mmask64, b: __mmask64) -> __mmask64 {
10933    a & b
10934}
10935
10936/// Compute the bitwise NOT of 32-bit mask a, and store the result in k.
10937///
10938/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_knot_mask32&expand=3234)
10939#[inline]
10940#[target_feature(enable = "avx512bw")]
10941#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10942#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10943pub const fn _knot_mask32(a: __mmask32) -> __mmask32 {
10944    !a
10945}
10946
10947/// Compute the bitwise NOT of 64-bit mask a, and store the result in k.
10948///
10949/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_knot_mask64&expand=3235)
10950#[inline]
10951#[target_feature(enable = "avx512bw")]
10952#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10953#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10954pub const fn _knot_mask64(a: __mmask64) -> __mmask64 {
10955    !a
10956}
10957
10958/// Compute the bitwise NOT of 32-bit masks a and then AND with b, and store the result in k.
10959///
10960/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kandn_mask32&expand=3219)
10961#[inline]
10962#[target_feature(enable = "avx512bw")]
10963#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10964#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10965pub const fn _kandn_mask32(a: __mmask32, b: __mmask32) -> __mmask32 {
10966    _knot_mask32(a) & b
10967}
10968
10969/// Compute the bitwise NOT of 64-bit masks a and then AND with b, and store the result in k.
10970///
10971/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kandn_mask64&expand=3220)
10972#[inline]
10973#[target_feature(enable = "avx512bw")]
10974#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10975#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10976pub const fn _kandn_mask64(a: __mmask64, b: __mmask64) -> __mmask64 {
10977    _knot_mask64(a) & b
10978}
10979
10980/// Compute the bitwise OR of 32-bit masks a and b, and store the result in k.
10981///
10982/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kor_mask32&expand=3240)
10983#[inline]
10984#[target_feature(enable = "avx512bw")]
10985#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10986#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10987pub const fn _kor_mask32(a: __mmask32, b: __mmask32) -> __mmask32 {
10988    a | b
10989}
10990
10991/// Compute the bitwise OR of 64-bit masks a and b, and store the result in k.
10992///
10993/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kor_mask64&expand=3241)
10994#[inline]
10995#[target_feature(enable = "avx512bw")]
10996#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
10997#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
10998pub const fn _kor_mask64(a: __mmask64, b: __mmask64) -> __mmask64 {
10999    a | b
11000}
11001
11002/// Compute the bitwise XOR of 32-bit masks a and b, and store the result in k.
11003///
11004/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kxor_mask32&expand=3292)
11005#[inline]
11006#[target_feature(enable = "avx512bw")]
11007#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11008#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11009pub const fn _kxor_mask32(a: __mmask32, b: __mmask32) -> __mmask32 {
11010    a ^ b
11011}
11012
11013/// Compute the bitwise XOR of 64-bit masks a and b, and store the result in k.
11014///
11015/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kxor_mask64&expand=3293)
11016#[inline]
11017#[target_feature(enable = "avx512bw")]
11018#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11019#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11020pub const fn _kxor_mask64(a: __mmask64, b: __mmask64) -> __mmask64 {
11021    a ^ b
11022}
11023
11024/// Compute the bitwise XNOR of 32-bit masks a and b, and store the result in k.
11025///
11026/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kxnor_mask32&expand=3286)
11027#[inline]
11028#[target_feature(enable = "avx512bw")]
11029#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11030#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11031pub const fn _kxnor_mask32(a: __mmask32, b: __mmask32) -> __mmask32 {
11032    _knot_mask32(a ^ b)
11033}
11034
11035/// Compute the bitwise XNOR of 64-bit masks a and b, and store the result in k.
11036///
11037/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kxnor_mask64&expand=3287)
11038#[inline]
11039#[target_feature(enable = "avx512bw")]
11040#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11041#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11042pub const fn _kxnor_mask64(a: __mmask64, b: __mmask64) -> __mmask64 {
11043    _knot_mask64(a ^ b)
11044}
11045
11046/// Compute the bitwise OR of 32-bit masks a and b. If the result is all zeros, store 1 in dst, otherwise
11047/// store 0 in dst. If the result is all ones, store 1 in all_ones, otherwise store 0 in all_ones.
11048///
11049/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kortest_mask32_u8)
11050#[inline]
11051#[target_feature(enable = "avx512bw")]
11052#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11053#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11054pub const unsafe fn _kortest_mask32_u8(a: __mmask32, b: __mmask32, all_ones: *mut u8) -> u8 {
11055    let tmp = _kor_mask32(a, b);
11056    *all_ones = (tmp == 0xffffffff) as u8;
11057    (tmp == 0) as u8
11058}
11059
11060/// Compute the bitwise OR of 64-bit masks a and b. If the result is all zeros, store 1 in dst, otherwise
11061/// store 0 in dst. If the result is all ones, store 1 in all_ones, otherwise store 0 in all_ones.
11062///
11063/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kortest_mask64_u8)
11064#[inline]
11065#[target_feature(enable = "avx512bw")]
11066#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11067#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11068pub const unsafe fn _kortest_mask64_u8(a: __mmask64, b: __mmask64, all_ones: *mut u8) -> u8 {
11069    let tmp = _kor_mask64(a, b);
11070    *all_ones = (tmp == 0xffffffff_ffffffff) as u8;
11071    (tmp == 0) as u8
11072}
11073
11074/// Compute the bitwise OR of 32-bit masks a and b. If the result is all ones, store 1 in dst, otherwise
11075/// store 0 in dst.
11076///
11077/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kortestc_mask32_u8)
11078#[inline]
11079#[target_feature(enable = "avx512bw")]
11080#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11081#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11082pub const fn _kortestc_mask32_u8(a: __mmask32, b: __mmask32) -> u8 {
11083    (_kor_mask32(a, b) == 0xffffffff) as u8
11084}
11085
11086/// Compute the bitwise OR of 64-bit masks a and b. If the result is all ones, store 1 in dst, otherwise
11087/// store 0 in dst.
11088///
11089/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kortestc_mask64_u8)
11090#[inline]
11091#[target_feature(enable = "avx512bw")]
11092#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11093#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11094pub const fn _kortestc_mask64_u8(a: __mmask64, b: __mmask64) -> u8 {
11095    (_kor_mask64(a, b) == 0xffffffff_ffffffff) as u8
11096}
11097
11098/// Compute the bitwise OR of 32-bit masks a and b. If the result is all zeros, store 1 in dst, otherwise
11099/// store 0 in dst.
11100///
11101/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kortestz_mask32_u8)
11102#[inline]
11103#[target_feature(enable = "avx512bw")]
11104#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11105#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11106pub const fn _kortestz_mask32_u8(a: __mmask32, b: __mmask32) -> u8 {
11107    (_kor_mask32(a, b) == 0) as u8
11108}
11109
11110/// Compute the bitwise OR of 64-bit masks a and b. If the result is all zeros, store 1 in dst, otherwise
11111/// store 0 in dst.
11112///
11113/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kortestz_mask64_u8)
11114#[inline]
11115#[target_feature(enable = "avx512bw")]
11116#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11117#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11118pub const fn _kortestz_mask64_u8(a: __mmask64, b: __mmask64) -> u8 {
11119    (_kor_mask64(a, b) == 0) as u8
11120}
11121
11122/// 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.
11123///
11124/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kshiftli_mask32)
11125#[inline]
11126#[target_feature(enable = "avx512bw")]
11127#[rustc_legacy_const_generics(1)]
11128#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11129#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11130pub const fn _kshiftli_mask32<const COUNT: u32>(a: __mmask32) -> __mmask32 {
11131    a.unbounded_shl(COUNT)
11132}
11133
11134/// 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.
11135///
11136/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kshiftli_mask64)
11137#[inline]
11138#[target_feature(enable = "avx512bw")]
11139#[rustc_legacy_const_generics(1)]
11140#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11141#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11142pub const fn _kshiftli_mask64<const COUNT: u32>(a: __mmask64) -> __mmask64 {
11143    a.unbounded_shl(COUNT)
11144}
11145
11146/// 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.
11147///
11148/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kshiftri_mask32)
11149#[inline]
11150#[target_feature(enable = "avx512bw")]
11151#[rustc_legacy_const_generics(1)]
11152#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11153#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11154pub const fn _kshiftri_mask32<const COUNT: u32>(a: __mmask32) -> __mmask32 {
11155    a.unbounded_shr(COUNT)
11156}
11157
11158/// 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.
11159///
11160/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kshiftri_mask64)
11161#[inline]
11162#[target_feature(enable = "avx512bw")]
11163#[rustc_legacy_const_generics(1)]
11164#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11165#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11166pub const fn _kshiftri_mask64<const COUNT: u32>(a: __mmask64) -> __mmask64 {
11167    a.unbounded_shr(COUNT)
11168}
11169
11170/// Compute the bitwise AND of 32-bit masks a and b, and if the result is all zeros, store 1 in dst,
11171/// otherwise store 0 in dst. Compute the bitwise NOT of a and then AND with b, if the result is all
11172/// zeros, store 1 in and_not, otherwise store 0 in and_not.
11173///
11174/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_ktest_mask32_u8)
11175#[inline]
11176#[target_feature(enable = "avx512bw")]
11177#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11178#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11179pub const unsafe fn _ktest_mask32_u8(a: __mmask32, b: __mmask32, and_not: *mut u8) -> u8 {
11180    *and_not = (_kandn_mask32(a, b) == 0) as u8;
11181    (_kand_mask32(a, b) == 0) as u8
11182}
11183
11184/// Compute the bitwise AND of 64-bit masks a and b, and if the result is all zeros, store 1 in dst,
11185/// otherwise store 0 in dst. Compute the bitwise NOT of a and then AND with b, if the result is all
11186/// zeros, store 1 in and_not, otherwise store 0 in and_not.
11187///
11188/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_ktest_mask64_u8)
11189#[inline]
11190#[target_feature(enable = "avx512bw")]
11191#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11192#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11193pub const unsafe fn _ktest_mask64_u8(a: __mmask64, b: __mmask64, and_not: *mut u8) -> u8 {
11194    *and_not = (_kandn_mask64(a, b) == 0) as u8;
11195    (_kand_mask64(a, b) == 0) as u8
11196}
11197
11198/// Compute the bitwise NOT of 32-bit mask a and then AND with 16-bit mask b, if the result is all
11199/// zeros, store 1 in dst, otherwise store 0 in dst.
11200///
11201/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_ktestc_mask32_u8)
11202#[inline]
11203#[target_feature(enable = "avx512bw")]
11204#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11205#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11206pub const fn _ktestc_mask32_u8(a: __mmask32, b: __mmask32) -> u8 {
11207    (_kandn_mask32(a, b) == 0) as u8
11208}
11209
11210/// Compute the bitwise NOT of 64-bit mask a and then AND with 8-bit mask b, if the result is all
11211/// zeros, store 1 in dst, otherwise store 0 in dst.
11212///
11213/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_ktestc_mask64_u8)
11214#[inline]
11215#[target_feature(enable = "avx512bw")]
11216#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11217#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11218pub const fn _ktestc_mask64_u8(a: __mmask64, b: __mmask64) -> u8 {
11219    (_kandn_mask64(a, b) == 0) as u8
11220}
11221
11222/// Compute the bitwise AND of 32-bit masks a and  b, if the result is all zeros, store 1 in dst, otherwise
11223/// store 0 in dst.
11224///
11225/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_ktestz_mask32_u8)
11226#[inline]
11227#[target_feature(enable = "avx512bw")]
11228#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11229#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11230pub const fn _ktestz_mask32_u8(a: __mmask32, b: __mmask32) -> u8 {
11231    (_kand_mask32(a, b) == 0) as u8
11232}
11233
11234/// Compute the bitwise AND of 64-bit masks a and  b, if the result is all zeros, store 1 in dst, otherwise
11235/// store 0 in dst.
11236///
11237/// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_ktestz_mask64_u8)
11238#[inline]
11239#[target_feature(enable = "avx512bw")]
11240#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11241#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11242pub const fn _ktestz_mask64_u8(a: __mmask64, b: __mmask64) -> u8 {
11243    (_kand_mask64(a, b) == 0) as u8
11244}
11245
11246/// Unpack and interleave 16 bits from masks a and b, and store the 32-bit result in k.
11247///
11248/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_kunpackw)
11249#[inline]
11250#[target_feature(enable = "avx512bw")]
11251#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11252#[cfg_attr(test, assert_instr(mov))] // generate normal and code instead of kunpckwd
11253#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11254pub const fn _mm512_kunpackw(a: __mmask32, b: __mmask32) -> __mmask32 {
11255    ((a & 0xffff) << 16) | (b & 0xffff)
11256}
11257
11258/// Unpack and interleave 32 bits from masks a and b, and store the 64-bit result in k.
11259///
11260/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_kunpackd)
11261#[inline]
11262#[target_feature(enable = "avx512bw")]
11263#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11264#[cfg_attr(test, assert_instr(mov))] // generate normal and code instead of kunpckdq
11265#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11266pub const fn _mm512_kunpackd(a: __mmask64, b: __mmask64) -> __mmask64 {
11267    ((a & 0xffffffff) << 32) | (b & 0xffffffff)
11268}
11269
11270/// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the results in dst.
11271///
11272/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cvtepi16_epi8&expand=1407)
11273#[inline]
11274#[target_feature(enable = "avx512bw")]
11275#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11276#[cfg_attr(test, assert_instr(vpmovwb))]
11277#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11278pub const fn _mm512_cvtepi16_epi8(a: __m512i) -> __m256i {
11279    unsafe {
11280        let a = a.as_i16x32();
11281        transmute::<i8x32, _>(simd_cast(a))
11282    }
11283}
11284
11285/// 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).
11286///
11287/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cvtepi16_epi8&expand=1408)
11288#[inline]
11289#[target_feature(enable = "avx512bw")]
11290#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11291#[cfg_attr(test, assert_instr(vpmovwb))]
11292#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11293pub const fn _mm512_mask_cvtepi16_epi8(src: __m256i, k: __mmask32, a: __m512i) -> __m256i {
11294    unsafe {
11295        let convert = _mm512_cvtepi16_epi8(a).as_i8x32();
11296        transmute(simd_select_bitmask(k, convert, src.as_i8x32()))
11297    }
11298}
11299
11300/// 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).
11301///
11302/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_cvtepi16_epi8&expand=1409)
11303#[inline]
11304#[target_feature(enable = "avx512bw")]
11305#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11306#[cfg_attr(test, assert_instr(vpmovwb))]
11307#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11308pub const fn _mm512_maskz_cvtepi16_epi8(k: __mmask32, a: __m512i) -> __m256i {
11309    unsafe {
11310        let convert = _mm512_cvtepi16_epi8(a).as_i8x32();
11311        transmute(simd_select_bitmask(k, convert, i8x32::ZERO))
11312    }
11313}
11314
11315/// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the results in dst.
11316///
11317/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cvtepi16_epi8&expand=1404)
11318#[inline]
11319#[target_feature(enable = "avx512bw,avx512vl")]
11320#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11321#[cfg_attr(test, assert_instr(vpmovwb))]
11322#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11323pub const fn _mm256_cvtepi16_epi8(a: __m256i) -> __m128i {
11324    unsafe {
11325        let a = a.as_i16x16();
11326        transmute::<i8x16, _>(simd_cast(a))
11327    }
11328}
11329
11330/// 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).
11331///
11332/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cvtepi16_epi8&expand=1405)
11333#[inline]
11334#[target_feature(enable = "avx512bw,avx512vl")]
11335#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11336#[cfg_attr(test, assert_instr(vpmovwb))]
11337#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11338pub const fn _mm256_mask_cvtepi16_epi8(src: __m128i, k: __mmask16, a: __m256i) -> __m128i {
11339    unsafe {
11340        let convert = _mm256_cvtepi16_epi8(a).as_i8x16();
11341        transmute(simd_select_bitmask(k, convert, src.as_i8x16()))
11342    }
11343}
11344
11345/// 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).
11346///
11347/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_cvtepi16_epi8&expand=1406)
11348#[inline]
11349#[target_feature(enable = "avx512bw,avx512vl")]
11350#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11351#[cfg_attr(test, assert_instr(vpmovwb))]
11352#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11353pub const fn _mm256_maskz_cvtepi16_epi8(k: __mmask16, a: __m256i) -> __m128i {
11354    unsafe {
11355        let convert = _mm256_cvtepi16_epi8(a).as_i8x16();
11356        transmute(simd_select_bitmask(k, convert, i8x16::ZERO))
11357    }
11358}
11359
11360/// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the results in dst.
11361///
11362/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cvtepi16_epi8&expand=1401)
11363#[inline]
11364#[target_feature(enable = "avx512bw,avx512vl")]
11365#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11366#[cfg_attr(test, assert_instr(vpmovwb))]
11367#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11368pub const fn _mm_cvtepi16_epi8(a: __m128i) -> __m128i {
11369    unsafe {
11370        let a = a.as_i16x8();
11371        let v256: i16x16 = simd_shuffle!(
11372            a,
11373            i16x8::ZERO,
11374            [0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8]
11375        );
11376        transmute::<i8x16, _>(simd_cast(v256))
11377    }
11378}
11379
11380/// 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).
11381///
11382/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cvtepi16_epi8&expand=1402)
11383#[inline]
11384#[target_feature(enable = "avx512bw,avx512vl")]
11385#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11386#[cfg_attr(test, assert_instr(vpmovwb))]
11387#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11388pub const fn _mm_mask_cvtepi16_epi8(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
11389    unsafe {
11390        let a = _mm_cvtepi16_epi8(a).as_i8x16();
11391        let src = simd_shuffle!(
11392            src.as_i8x16(),
11393            i8x16::ZERO,
11394            [0, 1, 2, 3, 4, 5, 6, 7, 16, 16, 16, 16, 16, 16, 16, 16]
11395        );
11396        simd_select_bitmask(k as u16, a, src).as_m128i()
11397    }
11398}
11399
11400/// 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).
11401///
11402/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_cvtepi16_epi8&expand=1403)
11403#[inline]
11404#[target_feature(enable = "avx512bw,avx512vl")]
11405#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11406#[cfg_attr(test, assert_instr(vpmovwb))]
11407#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11408pub const fn _mm_maskz_cvtepi16_epi8(k: __mmask8, a: __m128i) -> __m128i {
11409    _mm_mask_cvtepi16_epi8(_mm_setzero_si128(), k, a)
11410}
11411
11412/// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst.
11413///
11414/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cvtsepi16_epi8&expand=1807)
11415#[inline]
11416#[target_feature(enable = "avx512bw")]
11417#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11418#[cfg_attr(test, assert_instr(vpmovswb))]
11419#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11420pub const fn _mm512_cvtsepi16_epi8(a: __m512i) -> __m256i {
11421    unsafe {
11422        simd_cast::<_, i8x32>(simd_imax(
11423            simd_imin(a.as_i16x32(), i16x32::splat(i8::MAX as _)),
11424            i16x32::splat(i8::MIN as _),
11425        ))
11426        .as_m256i()
11427    }
11428}
11429
11430/// 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).
11431///
11432/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cvtsepi16_epi8&expand=1808)
11433#[inline]
11434#[target_feature(enable = "avx512bw")]
11435#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11436#[cfg_attr(test, assert_instr(vpmovswb))]
11437#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11438pub const fn _mm512_mask_cvtsepi16_epi8(src: __m256i, k: __mmask32, a: __m512i) -> __m256i {
11439    unsafe {
11440        simd_select_bitmask(k, _mm512_cvtsepi16_epi8(a).as_i8x32(), src.as_i8x32()).as_m256i()
11441    }
11442}
11443
11444/// 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).
11445///
11446/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_cvtsepi16_epi8&expand=1809)
11447#[inline]
11448#[target_feature(enable = "avx512bw")]
11449#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11450#[cfg_attr(test, assert_instr(vpmovswb))]
11451#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11452pub const fn _mm512_maskz_cvtsepi16_epi8(k: __mmask32, a: __m512i) -> __m256i {
11453    unsafe { simd_select_bitmask(k, _mm512_cvtsepi16_epi8(a).as_i8x32(), i8x32::ZERO).as_m256i() }
11454}
11455
11456/// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst.
11457///
11458/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cvtsepi16_epi8&expand=1804)
11459#[inline]
11460#[target_feature(enable = "avx512bw,avx512vl")]
11461#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11462#[cfg_attr(test, assert_instr(vpmovswb))]
11463#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11464pub const fn _mm256_cvtsepi16_epi8(a: __m256i) -> __m128i {
11465    unsafe {
11466        simd_cast::<_, i8x16>(simd_imax(
11467            simd_imin(a.as_i16x16(), i16x16::splat(i8::MAX as _)),
11468            i16x16::splat(i8::MIN as _),
11469        ))
11470        .as_m128i()
11471    }
11472}
11473
11474/// 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).
11475///
11476/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cvtsepi16_epi8&expand=1805)
11477#[inline]
11478#[target_feature(enable = "avx512bw,avx512vl")]
11479#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11480#[cfg_attr(test, assert_instr(vpmovswb))]
11481#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11482pub const fn _mm256_mask_cvtsepi16_epi8(src: __m128i, k: __mmask16, a: __m256i) -> __m128i {
11483    unsafe {
11484        simd_select_bitmask(k, _mm256_cvtsepi16_epi8(a).as_i8x16(), src.as_i8x16()).as_m128i()
11485    }
11486}
11487
11488/// 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).
11489///
11490/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_cvtsepi16_epi8&expand=1806)
11491#[inline]
11492#[target_feature(enable = "avx512bw,avx512vl")]
11493#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11494#[cfg_attr(test, assert_instr(vpmovswb))]
11495#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11496pub const fn _mm256_maskz_cvtsepi16_epi8(k: __mmask16, a: __m256i) -> __m128i {
11497    unsafe { simd_select_bitmask(k, _mm256_cvtsepi16_epi8(a).as_i8x16(), i8x16::ZERO).as_m128i() }
11498}
11499
11500/// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst.
11501///
11502/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cvtsepi16_epi8&expand=1801)
11503#[inline]
11504#[target_feature(enable = "avx512bw,avx512vl")]
11505#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11506#[cfg_attr(test, assert_instr(vpmovswb))]
11507pub fn _mm_cvtsepi16_epi8(a: __m128i) -> __m128i {
11508    unsafe { transmute(vpmovswb128(a.as_i16x8(), i8x16::ZERO, 0b11111111)) }
11509}
11510
11511/// 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).
11512///
11513/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cvtsepi16_epi8&expand=1802)
11514#[inline]
11515#[target_feature(enable = "avx512bw,avx512vl")]
11516#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11517#[cfg_attr(test, assert_instr(vpmovswb))]
11518pub fn _mm_mask_cvtsepi16_epi8(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
11519    unsafe { transmute(vpmovswb128(a.as_i16x8(), src.as_i8x16(), k)) }
11520}
11521
11522/// 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).
11523///
11524/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_cvtsepi16_epi8&expand=1803)
11525#[inline]
11526#[target_feature(enable = "avx512bw,avx512vl")]
11527#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11528#[cfg_attr(test, assert_instr(vpmovswb))]
11529pub fn _mm_maskz_cvtsepi16_epi8(k: __mmask8, a: __m128i) -> __m128i {
11530    unsafe { transmute(vpmovswb128(a.as_i16x8(), i8x16::ZERO, k)) }
11531}
11532
11533/// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst.
11534///
11535/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cvtusepi16_epi8&expand=2042)
11536#[inline]
11537#[target_feature(enable = "avx512bw")]
11538#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11539#[cfg_attr(test, assert_instr(vpmovuswb))]
11540#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11541pub const fn _mm512_cvtusepi16_epi8(a: __m512i) -> __m256i {
11542    unsafe {
11543        simd_cast::<_, u8x32>(simd_imin(a.as_u16x32(), u16x32::splat(u8::MAX as _))).as_m256i()
11544    }
11545}
11546
11547/// 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).
11548///
11549/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cvtusepi16_epi8&expand=2043)
11550#[inline]
11551#[target_feature(enable = "avx512bw")]
11552#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11553#[cfg_attr(test, assert_instr(vpmovuswb))]
11554#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11555pub const fn _mm512_mask_cvtusepi16_epi8(src: __m256i, k: __mmask32, a: __m512i) -> __m256i {
11556    unsafe {
11557        simd_select_bitmask(k, _mm512_cvtusepi16_epi8(a).as_u8x32(), src.as_u8x32()).as_m256i()
11558    }
11559}
11560
11561/// 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).
11562///
11563/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_cvtusepi16_epi8&expand=2044)
11564#[inline]
11565#[target_feature(enable = "avx512bw")]
11566#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11567#[cfg_attr(test, assert_instr(vpmovuswb))]
11568#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11569pub const fn _mm512_maskz_cvtusepi16_epi8(k: __mmask32, a: __m512i) -> __m256i {
11570    unsafe { simd_select_bitmask(k, _mm512_cvtusepi16_epi8(a).as_u8x32(), u8x32::ZERO).as_m256i() }
11571}
11572
11573/// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst.
11574///
11575/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cvtusepi16_epi8&expand=2039)
11576#[inline]
11577#[target_feature(enable = "avx512bw,avx512vl")]
11578#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11579#[cfg_attr(test, assert_instr(vpmovuswb))]
11580#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11581pub const fn _mm256_cvtusepi16_epi8(a: __m256i) -> __m128i {
11582    unsafe {
11583        simd_cast::<_, u8x16>(simd_imin(a.as_u16x16(), u16x16::splat(u8::MAX as _))).as_m128i()
11584    }
11585}
11586
11587/// 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).
11588///
11589/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cvtusepi16_epi8&expand=2040)
11590#[inline]
11591#[target_feature(enable = "avx512bw,avx512vl")]
11592#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11593#[cfg_attr(test, assert_instr(vpmovuswb))]
11594#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11595pub const fn _mm256_mask_cvtusepi16_epi8(src: __m128i, k: __mmask16, a: __m256i) -> __m128i {
11596    unsafe {
11597        simd_select_bitmask(k, _mm256_cvtusepi16_epi8(a).as_u8x16(), src.as_u8x16()).as_m128i()
11598    }
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 using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
11602///
11603/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_cvtusepi16_epi8&expand=2041)
11604#[inline]
11605#[target_feature(enable = "avx512bw,avx512vl")]
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 _mm256_maskz_cvtusepi16_epi8(k: __mmask16, a: __m256i) -> __m128i {
11610    unsafe { simd_select_bitmask(k, _mm256_cvtusepi16_epi8(a).as_u8x16(), u8x16::ZERO).as_m128i() }
11611}
11612
11613/// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst.
11614///
11615/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cvtusepi16_epi8&expand=2036)
11616#[inline]
11617#[target_feature(enable = "avx512bw,avx512vl")]
11618#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11619#[cfg_attr(test, assert_instr(vpmovuswb))]
11620pub fn _mm_cvtusepi16_epi8(a: __m128i) -> __m128i {
11621    unsafe { transmute(vpmovuswb128(a.as_u16x8(), u8x16::ZERO, 0b11111111)) }
11622}
11623
11624/// 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).
11625///
11626/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cvtusepi16_epi8&expand=2037)
11627#[inline]
11628#[target_feature(enable = "avx512bw,avx512vl")]
11629#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11630#[cfg_attr(test, assert_instr(vpmovuswb))]
11631pub fn _mm_mask_cvtusepi16_epi8(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
11632    unsafe { transmute(vpmovuswb128(a.as_u16x8(), src.as_u8x16(), k)) }
11633}
11634
11635/// 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).
11636///
11637/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_cvtusepi16_epi8&expand=2038)
11638#[inline]
11639#[target_feature(enable = "avx512bw,avx512vl")]
11640#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11641#[cfg_attr(test, assert_instr(vpmovuswb))]
11642pub fn _mm_maskz_cvtusepi16_epi8(k: __mmask8, a: __m128i) -> __m128i {
11643    unsafe { transmute(vpmovuswb128(a.as_u16x8(), u8x16::ZERO, k)) }
11644}
11645
11646/// Sign extend packed 8-bit integers in a to packed 16-bit integers, and store the results in dst.
11647///
11648/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cvtepi8_epi16&expand=1526)
11649#[inline]
11650#[target_feature(enable = "avx512bw")]
11651#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11652#[cfg_attr(test, assert_instr(vpmovsxbw))]
11653#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11654pub const fn _mm512_cvtepi8_epi16(a: __m256i) -> __m512i {
11655    unsafe {
11656        let a = a.as_i8x32();
11657        transmute::<i16x32, _>(simd_cast(a))
11658    }
11659}
11660
11661/// 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).
11662///
11663/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cvtepi8_epi16&expand=1527)
11664#[inline]
11665#[target_feature(enable = "avx512bw")]
11666#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11667#[cfg_attr(test, assert_instr(vpmovsxbw))]
11668#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11669pub const fn _mm512_mask_cvtepi8_epi16(src: __m512i, k: __mmask32, a: __m256i) -> __m512i {
11670    unsafe {
11671        let convert = _mm512_cvtepi8_epi16(a).as_i16x32();
11672        transmute(simd_select_bitmask(k, convert, src.as_i16x32()))
11673    }
11674}
11675
11676/// 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).
11677///
11678/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_cvtepi8_epi16&expand=1528)
11679#[inline]
11680#[target_feature(enable = "avx512bw")]
11681#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11682#[cfg_attr(test, assert_instr(vpmovsxbw))]
11683#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11684pub const fn _mm512_maskz_cvtepi8_epi16(k: __mmask32, a: __m256i) -> __m512i {
11685    unsafe {
11686        let convert = _mm512_cvtepi8_epi16(a).as_i16x32();
11687        transmute(simd_select_bitmask(k, convert, i16x32::ZERO))
11688    }
11689}
11690
11691/// 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).
11692///
11693/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cvtepi8_epi16&expand=1524)
11694#[inline]
11695#[target_feature(enable = "avx512bw,avx512vl")]
11696#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11697#[cfg_attr(test, assert_instr(vpmovsxbw))]
11698#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11699pub const fn _mm256_mask_cvtepi8_epi16(src: __m256i, k: __mmask16, a: __m128i) -> __m256i {
11700    unsafe {
11701        let convert = _mm256_cvtepi8_epi16(a).as_i16x16();
11702        transmute(simd_select_bitmask(k, convert, src.as_i16x16()))
11703    }
11704}
11705
11706/// 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).
11707///
11708/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_cvtepi8_epi16&expand=1525)
11709#[inline]
11710#[target_feature(enable = "avx512bw,avx512vl")]
11711#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11712#[cfg_attr(test, assert_instr(vpmovsxbw))]
11713#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11714pub const fn _mm256_maskz_cvtepi8_epi16(k: __mmask16, a: __m128i) -> __m256i {
11715    unsafe {
11716        let convert = _mm256_cvtepi8_epi16(a).as_i16x16();
11717        transmute(simd_select_bitmask(k, convert, i16x16::ZERO))
11718    }
11719}
11720
11721/// 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).
11722///
11723/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cvtepi8_epi16&expand=1521)
11724#[inline]
11725#[target_feature(enable = "avx512bw,avx512vl")]
11726#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11727#[cfg_attr(test, assert_instr(vpmovsxbw))]
11728#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11729pub const fn _mm_mask_cvtepi8_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
11730    unsafe {
11731        let convert = _mm_cvtepi8_epi16(a).as_i16x8();
11732        transmute(simd_select_bitmask(k, convert, src.as_i16x8()))
11733    }
11734}
11735
11736/// 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).
11737///
11738/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_cvtepi8_epi16&expand=1522)
11739#[inline]
11740#[target_feature(enable = "avx512bw,avx512vl")]
11741#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11742#[cfg_attr(test, assert_instr(vpmovsxbw))]
11743#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11744pub const fn _mm_maskz_cvtepi8_epi16(k: __mmask8, a: __m128i) -> __m128i {
11745    unsafe {
11746        let convert = _mm_cvtepi8_epi16(a).as_i16x8();
11747        transmute(simd_select_bitmask(k, convert, i16x8::ZERO))
11748    }
11749}
11750
11751/// Zero extend packed unsigned 8-bit integers in a to packed 16-bit integers, and store the results in dst.
11752///
11753/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cvtepu8_epi16&expand=1612)
11754#[inline]
11755#[target_feature(enable = "avx512bw")]
11756#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11757#[cfg_attr(test, assert_instr(vpmovzxbw))]
11758#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11759pub const fn _mm512_cvtepu8_epi16(a: __m256i) -> __m512i {
11760    unsafe {
11761        let a = a.as_u8x32();
11762        transmute::<i16x32, _>(simd_cast(a))
11763    }
11764}
11765
11766/// 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).
11767///
11768/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cvtepu8_epi16&expand=1613)
11769#[inline]
11770#[target_feature(enable = "avx512bw")]
11771#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11772#[cfg_attr(test, assert_instr(vpmovzxbw))]
11773#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11774pub const fn _mm512_mask_cvtepu8_epi16(src: __m512i, k: __mmask32, a: __m256i) -> __m512i {
11775    unsafe {
11776        let convert = _mm512_cvtepu8_epi16(a).as_i16x32();
11777        transmute(simd_select_bitmask(k, convert, src.as_i16x32()))
11778    }
11779}
11780
11781/// 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).
11782///
11783/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_cvtepu8_epi16&expand=1614)
11784#[inline]
11785#[target_feature(enable = "avx512bw")]
11786#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11787#[cfg_attr(test, assert_instr(vpmovzxbw))]
11788#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11789pub const fn _mm512_maskz_cvtepu8_epi16(k: __mmask32, a: __m256i) -> __m512i {
11790    unsafe {
11791        let convert = _mm512_cvtepu8_epi16(a).as_i16x32();
11792        transmute(simd_select_bitmask(k, convert, i16x32::ZERO))
11793    }
11794}
11795
11796/// 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).
11797///
11798/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cvtepu8_epi16&expand=1610)
11799#[inline]
11800#[target_feature(enable = "avx512bw,avx512vl")]
11801#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11802#[cfg_attr(test, assert_instr(vpmovzxbw))]
11803#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11804pub const fn _mm256_mask_cvtepu8_epi16(src: __m256i, k: __mmask16, a: __m128i) -> __m256i {
11805    unsafe {
11806        let convert = _mm256_cvtepu8_epi16(a).as_i16x16();
11807        transmute(simd_select_bitmask(k, convert, src.as_i16x16()))
11808    }
11809}
11810
11811/// 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).
11812///
11813/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_cvtepu8_epi16&expand=1611)
11814#[inline]
11815#[target_feature(enable = "avx512bw,avx512vl")]
11816#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11817#[cfg_attr(test, assert_instr(vpmovzxbw))]
11818#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11819pub const fn _mm256_maskz_cvtepu8_epi16(k: __mmask16, a: __m128i) -> __m256i {
11820    unsafe {
11821        let convert = _mm256_cvtepu8_epi16(a).as_i16x16();
11822        transmute(simd_select_bitmask(k, convert, i16x16::ZERO))
11823    }
11824}
11825
11826/// 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).
11827///
11828/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cvtepu8_epi16&expand=1607)
11829#[inline]
11830#[target_feature(enable = "avx512bw,avx512vl")]
11831#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11832#[cfg_attr(test, assert_instr(vpmovzxbw))]
11833#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11834pub const fn _mm_mask_cvtepu8_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
11835    unsafe {
11836        let convert = _mm_cvtepu8_epi16(a).as_i16x8();
11837        transmute(simd_select_bitmask(k, convert, src.as_i16x8()))
11838    }
11839}
11840
11841/// 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).
11842///
11843/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_cvtepu8_epi16&expand=1608)
11844#[inline]
11845#[target_feature(enable = "avx512bw,avx512vl")]
11846#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11847#[cfg_attr(test, assert_instr(vpmovzxbw))]
11848#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11849pub const fn _mm_maskz_cvtepu8_epi16(k: __mmask8, a: __m128i) -> __m128i {
11850    unsafe {
11851        let convert = _mm_cvtepu8_epi16(a).as_i16x8();
11852        transmute(simd_select_bitmask(k, convert, i16x8::ZERO))
11853    }
11854}
11855
11856/// Shift 128-bit lanes in a left by imm8 bytes while shifting in zeros, and store the results in dst.
11857///
11858/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_bslli_epi128&expand=591)
11859#[inline]
11860#[target_feature(enable = "avx512bw")]
11861#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11862#[cfg_attr(test, assert_instr(vpslldq, IMM8 = 3))]
11863#[rustc_legacy_const_generics(1)]
11864#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11865pub const fn _mm512_bslli_epi128<const IMM8: i32>(a: __m512i) -> __m512i {
11866    unsafe {
11867        static_assert_uimm_bits!(IMM8, 8);
11868        const fn mask(shift: i32, i: u32) -> u32 {
11869            let shift = shift as u32 & 0xff;
11870            if shift > 15 || i % 16 < shift {
11871                0
11872            } else {
11873                64 + (i - shift)
11874            }
11875        }
11876        let a = a.as_i8x64();
11877        let zero = i8x64::ZERO;
11878        let r: i8x64 = simd_shuffle!(
11879            zero,
11880            a,
11881            [
11882                mask(IMM8, 0),
11883                mask(IMM8, 1),
11884                mask(IMM8, 2),
11885                mask(IMM8, 3),
11886                mask(IMM8, 4),
11887                mask(IMM8, 5),
11888                mask(IMM8, 6),
11889                mask(IMM8, 7),
11890                mask(IMM8, 8),
11891                mask(IMM8, 9),
11892                mask(IMM8, 10),
11893                mask(IMM8, 11),
11894                mask(IMM8, 12),
11895                mask(IMM8, 13),
11896                mask(IMM8, 14),
11897                mask(IMM8, 15),
11898                mask(IMM8, 16),
11899                mask(IMM8, 17),
11900                mask(IMM8, 18),
11901                mask(IMM8, 19),
11902                mask(IMM8, 20),
11903                mask(IMM8, 21),
11904                mask(IMM8, 22),
11905                mask(IMM8, 23),
11906                mask(IMM8, 24),
11907                mask(IMM8, 25),
11908                mask(IMM8, 26),
11909                mask(IMM8, 27),
11910                mask(IMM8, 28),
11911                mask(IMM8, 29),
11912                mask(IMM8, 30),
11913                mask(IMM8, 31),
11914                mask(IMM8, 32),
11915                mask(IMM8, 33),
11916                mask(IMM8, 34),
11917                mask(IMM8, 35),
11918                mask(IMM8, 36),
11919                mask(IMM8, 37),
11920                mask(IMM8, 38),
11921                mask(IMM8, 39),
11922                mask(IMM8, 40),
11923                mask(IMM8, 41),
11924                mask(IMM8, 42),
11925                mask(IMM8, 43),
11926                mask(IMM8, 44),
11927                mask(IMM8, 45),
11928                mask(IMM8, 46),
11929                mask(IMM8, 47),
11930                mask(IMM8, 48),
11931                mask(IMM8, 49),
11932                mask(IMM8, 50),
11933                mask(IMM8, 51),
11934                mask(IMM8, 52),
11935                mask(IMM8, 53),
11936                mask(IMM8, 54),
11937                mask(IMM8, 55),
11938                mask(IMM8, 56),
11939                mask(IMM8, 57),
11940                mask(IMM8, 58),
11941                mask(IMM8, 59),
11942                mask(IMM8, 60),
11943                mask(IMM8, 61),
11944                mask(IMM8, 62),
11945                mask(IMM8, 63),
11946            ],
11947        );
11948        transmute(r)
11949    }
11950}
11951
11952/// Shift 128-bit lanes in a right by imm8 bytes while shifting in zeros, and store the results in dst.
11953///
11954/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_bsrli_epi128&expand=594)
11955#[inline]
11956#[target_feature(enable = "avx512bw")]
11957#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
11958#[cfg_attr(test, assert_instr(vpsrldq, IMM8 = 3))]
11959#[rustc_legacy_const_generics(1)]
11960#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
11961pub const fn _mm512_bsrli_epi128<const IMM8: i32>(a: __m512i) -> __m512i {
11962    unsafe {
11963        static_assert_uimm_bits!(IMM8, 8);
11964        const fn mask(shift: i32, i: u32) -> u32 {
11965            let shift = shift as u32 & 0xff;
11966            if shift > 15 || (15 - (i % 16)) < shift {
11967                0
11968            } else {
11969                64 + (i + shift)
11970            }
11971        }
11972        let a = a.as_i8x64();
11973        let zero = i8x64::ZERO;
11974        let r: i8x64 = simd_shuffle!(
11975            zero,
11976            a,
11977            [
11978                mask(IMM8, 0),
11979                mask(IMM8, 1),
11980                mask(IMM8, 2),
11981                mask(IMM8, 3),
11982                mask(IMM8, 4),
11983                mask(IMM8, 5),
11984                mask(IMM8, 6),
11985                mask(IMM8, 7),
11986                mask(IMM8, 8),
11987                mask(IMM8, 9),
11988                mask(IMM8, 10),
11989                mask(IMM8, 11),
11990                mask(IMM8, 12),
11991                mask(IMM8, 13),
11992                mask(IMM8, 14),
11993                mask(IMM8, 15),
11994                mask(IMM8, 16),
11995                mask(IMM8, 17),
11996                mask(IMM8, 18),
11997                mask(IMM8, 19),
11998                mask(IMM8, 20),
11999                mask(IMM8, 21),
12000                mask(IMM8, 22),
12001                mask(IMM8, 23),
12002                mask(IMM8, 24),
12003                mask(IMM8, 25),
12004                mask(IMM8, 26),
12005                mask(IMM8, 27),
12006                mask(IMM8, 28),
12007                mask(IMM8, 29),
12008                mask(IMM8, 30),
12009                mask(IMM8, 31),
12010                mask(IMM8, 32),
12011                mask(IMM8, 33),
12012                mask(IMM8, 34),
12013                mask(IMM8, 35),
12014                mask(IMM8, 36),
12015                mask(IMM8, 37),
12016                mask(IMM8, 38),
12017                mask(IMM8, 39),
12018                mask(IMM8, 40),
12019                mask(IMM8, 41),
12020                mask(IMM8, 42),
12021                mask(IMM8, 43),
12022                mask(IMM8, 44),
12023                mask(IMM8, 45),
12024                mask(IMM8, 46),
12025                mask(IMM8, 47),
12026                mask(IMM8, 48),
12027                mask(IMM8, 49),
12028                mask(IMM8, 50),
12029                mask(IMM8, 51),
12030                mask(IMM8, 52),
12031                mask(IMM8, 53),
12032                mask(IMM8, 54),
12033                mask(IMM8, 55),
12034                mask(IMM8, 56),
12035                mask(IMM8, 57),
12036                mask(IMM8, 58),
12037                mask(IMM8, 59),
12038                mask(IMM8, 60),
12039                mask(IMM8, 61),
12040                mask(IMM8, 62),
12041                mask(IMM8, 63),
12042            ],
12043        );
12044        transmute(r)
12045    }
12046}
12047
12048/// 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.
12049/// Unlike [`_mm_alignr_epi8`], [`_mm256_alignr_epi8`] functions, where the entire input vectors are concatenated to the temporary result,
12050/// this concatenation happens in 4 steps, where each step builds 32-byte temporary result.
12051///
12052/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_alignr_epi8&expand=263)
12053#[inline]
12054#[target_feature(enable = "avx512bw")]
12055#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12056#[cfg_attr(test, assert_instr(vpalignr, IMM8 = 1))]
12057#[rustc_legacy_const_generics(2)]
12058#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
12059pub const fn _mm512_alignr_epi8<const IMM8: i32>(a: __m512i, b: __m512i) -> __m512i {
12060    const fn mask(shift: u32, i: u32) -> u32 {
12061        let shift = shift % 16;
12062        let mod_i = i % 16;
12063        if mod_i < (16 - shift) {
12064            i + shift
12065        } else {
12066            i + 48 + shift
12067        }
12068    }
12069
12070    // If palignr is shifting the pair of vectors more than the size of two
12071    // lanes, emit zero.
12072    if IMM8 >= 32 {
12073        return _mm512_setzero_si512();
12074    }
12075    // If palignr is shifting the pair of input vectors more than one lane,
12076    // but less than two lanes, convert to shifting in zeroes.
12077    let (a, b) = if IMM8 > 16 {
12078        (_mm512_setzero_si512(), a)
12079    } else {
12080        (a, b)
12081    };
12082    unsafe {
12083        if IMM8 == 16 {
12084            return transmute(a);
12085        }
12086
12087        let r: i8x64 = simd_shuffle!(
12088            b.as_i8x64(),
12089            a.as_i8x64(),
12090            [
12091                mask(IMM8 as u32, 0),
12092                mask(IMM8 as u32, 1),
12093                mask(IMM8 as u32, 2),
12094                mask(IMM8 as u32, 3),
12095                mask(IMM8 as u32, 4),
12096                mask(IMM8 as u32, 5),
12097                mask(IMM8 as u32, 6),
12098                mask(IMM8 as u32, 7),
12099                mask(IMM8 as u32, 8),
12100                mask(IMM8 as u32, 9),
12101                mask(IMM8 as u32, 10),
12102                mask(IMM8 as u32, 11),
12103                mask(IMM8 as u32, 12),
12104                mask(IMM8 as u32, 13),
12105                mask(IMM8 as u32, 14),
12106                mask(IMM8 as u32, 15),
12107                mask(IMM8 as u32, 16),
12108                mask(IMM8 as u32, 17),
12109                mask(IMM8 as u32, 18),
12110                mask(IMM8 as u32, 19),
12111                mask(IMM8 as u32, 20),
12112                mask(IMM8 as u32, 21),
12113                mask(IMM8 as u32, 22),
12114                mask(IMM8 as u32, 23),
12115                mask(IMM8 as u32, 24),
12116                mask(IMM8 as u32, 25),
12117                mask(IMM8 as u32, 26),
12118                mask(IMM8 as u32, 27),
12119                mask(IMM8 as u32, 28),
12120                mask(IMM8 as u32, 29),
12121                mask(IMM8 as u32, 30),
12122                mask(IMM8 as u32, 31),
12123                mask(IMM8 as u32, 32),
12124                mask(IMM8 as u32, 33),
12125                mask(IMM8 as u32, 34),
12126                mask(IMM8 as u32, 35),
12127                mask(IMM8 as u32, 36),
12128                mask(IMM8 as u32, 37),
12129                mask(IMM8 as u32, 38),
12130                mask(IMM8 as u32, 39),
12131                mask(IMM8 as u32, 40),
12132                mask(IMM8 as u32, 41),
12133                mask(IMM8 as u32, 42),
12134                mask(IMM8 as u32, 43),
12135                mask(IMM8 as u32, 44),
12136                mask(IMM8 as u32, 45),
12137                mask(IMM8 as u32, 46),
12138                mask(IMM8 as u32, 47),
12139                mask(IMM8 as u32, 48),
12140                mask(IMM8 as u32, 49),
12141                mask(IMM8 as u32, 50),
12142                mask(IMM8 as u32, 51),
12143                mask(IMM8 as u32, 52),
12144                mask(IMM8 as u32, 53),
12145                mask(IMM8 as u32, 54),
12146                mask(IMM8 as u32, 55),
12147                mask(IMM8 as u32, 56),
12148                mask(IMM8 as u32, 57),
12149                mask(IMM8 as u32, 58),
12150                mask(IMM8 as u32, 59),
12151                mask(IMM8 as u32, 60),
12152                mask(IMM8 as u32, 61),
12153                mask(IMM8 as u32, 62),
12154                mask(IMM8 as u32, 63),
12155            ],
12156        );
12157        transmute(r)
12158    }
12159}
12160
12161/// 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).
12162///
12163/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_alignr_epi8&expand=264)
12164#[inline]
12165#[target_feature(enable = "avx512bw")]
12166#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12167#[cfg_attr(test, assert_instr(vpalignr, IMM8 = 1))]
12168#[rustc_legacy_const_generics(4)]
12169#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
12170pub const fn _mm512_mask_alignr_epi8<const IMM8: i32>(
12171    src: __m512i,
12172    k: __mmask64,
12173    a: __m512i,
12174    b: __m512i,
12175) -> __m512i {
12176    unsafe {
12177        static_assert_uimm_bits!(IMM8, 8);
12178        let r = _mm512_alignr_epi8::<IMM8>(a, b);
12179        transmute(simd_select_bitmask(k, r.as_i8x64(), src.as_i8x64()))
12180    }
12181}
12182
12183/// 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).
12184///
12185/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_maskz_alignr_epi8&expand=265)
12186#[inline]
12187#[target_feature(enable = "avx512bw")]
12188#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12189#[cfg_attr(test, assert_instr(vpalignr, IMM8 = 1))]
12190#[rustc_legacy_const_generics(3)]
12191#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
12192pub const fn _mm512_maskz_alignr_epi8<const IMM8: i32>(
12193    k: __mmask64,
12194    a: __m512i,
12195    b: __m512i,
12196) -> __m512i {
12197    unsafe {
12198        static_assert_uimm_bits!(IMM8, 8);
12199        let r = _mm512_alignr_epi8::<IMM8>(a, b);
12200        transmute(simd_select_bitmask(k, r.as_i8x64(), i8x64::ZERO))
12201    }
12202}
12203
12204/// 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).
12205///
12206/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_alignr_epi8&expand=261)
12207#[inline]
12208#[target_feature(enable = "avx512bw,avx512vl")]
12209#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12210#[rustc_legacy_const_generics(4)]
12211#[cfg_attr(test, assert_instr(vpalignr, IMM8 = 5))]
12212#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
12213pub const fn _mm256_mask_alignr_epi8<const IMM8: i32>(
12214    src: __m256i,
12215    k: __mmask32,
12216    a: __m256i,
12217    b: __m256i,
12218) -> __m256i {
12219    unsafe {
12220        static_assert_uimm_bits!(IMM8, 8);
12221        let r = _mm256_alignr_epi8::<IMM8>(a, b);
12222        transmute(simd_select_bitmask(k, r.as_i8x32(), src.as_i8x32()))
12223    }
12224}
12225
12226/// 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).
12227///
12228/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maskz_alignr_epi8&expand=262)
12229#[inline]
12230#[target_feature(enable = "avx512bw,avx512vl")]
12231#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12232#[rustc_legacy_const_generics(3)]
12233#[cfg_attr(test, assert_instr(vpalignr, IMM8 = 5))]
12234#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
12235pub const fn _mm256_maskz_alignr_epi8<const IMM8: i32>(
12236    k: __mmask32,
12237    a: __m256i,
12238    b: __m256i,
12239) -> __m256i {
12240    unsafe {
12241        static_assert_uimm_bits!(IMM8, 8);
12242        let r = _mm256_alignr_epi8::<IMM8>(a, b);
12243        transmute(simd_select_bitmask(k, r.as_i8x32(), i8x32::ZERO))
12244    }
12245}
12246
12247/// 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).
12248///
12249/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_alignr_epi8&expand=258)
12250#[inline]
12251#[target_feature(enable = "avx512bw,avx512vl")]
12252#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12253#[rustc_legacy_const_generics(4)]
12254#[cfg_attr(test, assert_instr(vpalignr, IMM8 = 5))]
12255#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
12256pub const fn _mm_mask_alignr_epi8<const IMM8: i32>(
12257    src: __m128i,
12258    k: __mmask16,
12259    a: __m128i,
12260    b: __m128i,
12261) -> __m128i {
12262    unsafe {
12263        static_assert_uimm_bits!(IMM8, 8);
12264        let r = _mm_alignr_epi8::<IMM8>(a, b);
12265        transmute(simd_select_bitmask(k, r.as_i8x16(), src.as_i8x16()))
12266    }
12267}
12268
12269/// 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).
12270///
12271/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskz_alignr_epi8&expand=259)
12272#[inline]
12273#[target_feature(enable = "avx512bw,avx512vl")]
12274#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12275#[rustc_legacy_const_generics(3)]
12276#[cfg_attr(test, assert_instr(vpalignr, IMM8 = 5))]
12277#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
12278pub const fn _mm_maskz_alignr_epi8<const IMM8: i32>(
12279    k: __mmask16,
12280    a: __m128i,
12281    b: __m128i,
12282) -> __m128i {
12283    unsafe {
12284        static_assert_uimm_bits!(IMM8, 8);
12285        let r = _mm_alignr_epi8::<IMM8>(a, b);
12286        transmute(simd_select_bitmask(k, r.as_i8x16(), i8x16::ZERO))
12287    }
12288}
12289
12290/// 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.
12291///
12292/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cvtsepi16_storeu_epi8&expand=1812)
12293#[inline]
12294#[target_feature(enable = "avx512bw")]
12295#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12296#[cfg_attr(test, assert_instr(vpmovswb))]
12297pub unsafe fn _mm512_mask_cvtsepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask32, a: __m512i) {
12298    vpmovswbmem(mem_addr, a.as_i16x32(), k);
12299}
12300
12301/// 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.
12302///
12303/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cvtsepi16_storeu_epi8&expand=1811)
12304#[inline]
12305#[target_feature(enable = "avx512bw,avx512vl")]
12306#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12307#[cfg_attr(test, assert_instr(vpmovswb))]
12308pub unsafe fn _mm256_mask_cvtsepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask16, a: __m256i) {
12309    let mask = simd_select_bitmask(k, i16x16::splat(!0), i16x16::ZERO);
12310
12311    let max = simd_splat(i16::from(i8::MAX));
12312    let min = simd_splat(i16::from(i8::MIN));
12313
12314    let v = simd_imax(simd_imin(a.as_i16x16(), max), min);
12315    let truncated: i8x16 = simd_cast(v);
12316    simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, truncated);
12317}
12318
12319/// 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.
12320///
12321/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cvtsepi16_storeu_epi8&expand=1810)
12322#[inline]
12323#[target_feature(enable = "avx512bw,avx512vl")]
12324#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12325#[cfg_attr(test, assert_instr(vpmovswb))]
12326pub unsafe fn _mm_mask_cvtsepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask8, a: __m128i) {
12327    let mask = simd_select_bitmask(k, i16x8::splat(!0), i16x8::ZERO);
12328
12329    let max = simd_splat(i16::from(i8::MAX));
12330    let min = simd_splat(i16::from(i8::MIN));
12331
12332    let v = simd_imax(simd_imin(a.as_i16x8(), max), min);
12333    let truncated: i8x8 = simd_cast(v);
12334    simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, truncated);
12335}
12336
12337/// 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.
12338///
12339/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cvtepi16_storeu_epi8&expand=1412)
12340#[inline]
12341#[target_feature(enable = "avx512bw")]
12342#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12343#[cfg_attr(test, assert_instr(vpmovwb))]
12344#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
12345pub const unsafe fn _mm512_mask_cvtepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask32, a: __m512i) {
12346    let result = _mm512_cvtepi16_epi8(a).as_i8x32();
12347    let mask = simd_select_bitmask(k, i8x32::splat(!0), i8x32::ZERO);
12348    simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, result);
12349}
12350
12351/// 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.
12352///
12353/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cvtepi16_storeu_epi8&expand=1411)
12354#[inline]
12355#[target_feature(enable = "avx512bw,avx512vl")]
12356#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12357#[cfg_attr(test, assert_instr(vpmovwb))]
12358#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
12359pub const unsafe fn _mm256_mask_cvtepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask16, a: __m256i) {
12360    let result = _mm256_cvtepi16_epi8(a).as_i8x16();
12361    let mask = simd_select_bitmask(k, i8x16::splat(!0), i8x16::ZERO);
12362    simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, result);
12363}
12364
12365/// 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.
12366///
12367/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cvtepi16_storeu_epi8&expand=1410)
12368#[inline]
12369#[target_feature(enable = "avx512bw,avx512vl")]
12370#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12371#[cfg_attr(test, assert_instr(vpmovwb))]
12372#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")]
12373pub const unsafe fn _mm_mask_cvtepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask8, a: __m128i) {
12374    let result: i8x8 = simd_shuffle!(
12375        _mm_cvtepi16_epi8(a).as_i8x16(),
12376        i8x16::ZERO,
12377        [0, 1, 2, 3, 4, 5, 6, 7]
12378    );
12379    let mask = simd_select_bitmask(k, i8x8::splat(!0), i8x8::ZERO);
12380    simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, result);
12381}
12382
12383/// 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.
12384///
12385/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cvtusepi16_storeu_epi8&expand=2047)
12386#[inline]
12387#[target_feature(enable = "avx512bw")]
12388#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12389#[cfg_attr(test, assert_instr(vpmovuswb))]
12390pub unsafe fn _mm512_mask_cvtusepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask32, a: __m512i) {
12391    vpmovuswbmem(mem_addr, a.as_i16x32(), k);
12392}
12393
12394/// 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.
12395///
12396/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mask_cvtusepi16_storeu_epi8&expand=2046)
12397#[inline]
12398#[target_feature(enable = "avx512bw,avx512vl")]
12399#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12400#[cfg_attr(test, assert_instr(vpmovuswb))]
12401pub unsafe fn _mm256_mask_cvtusepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask16, a: __m256i) {
12402    let mask = simd_select_bitmask(k, i16x16::splat(!0), i16x16::ZERO);
12403    let mem_addr = mem_addr.cast::<u8>();
12404    let max = simd_splat(u16::from(u8::MAX));
12405
12406    let truncated: u8x16 = simd_cast(simd_imin(a.as_u16x16(), max));
12407    simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, truncated);
12408}
12409
12410/// 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.
12411///
12412/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mask_cvtusepi16_storeu_epi8&expand=2045)
12413#[inline]
12414#[target_feature(enable = "avx512bw,avx512vl")]
12415#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
12416#[cfg_attr(test, assert_instr(vpmovuswb))]
12417pub unsafe fn _mm_mask_cvtusepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask8, a: __m128i) {
12418    let mask = simd_select_bitmask(k, i16x8::splat(!0), i16x8::ZERO);
12419    let mem_addr = mem_addr.cast::<u8>();
12420    let max = simd_splat(u16::from(u8::MAX));
12421
12422    let v = a.as_u16x8();
12423    let v = simd_imin(v, max);
12424
12425    let truncated: u8x8 = simd_cast(v);
12426    simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, truncated);
12427}
12428
12429#[allow(improper_ctypes)]
12430unsafe extern "llvm-intrinsic" {
12431    #[link_name = "llvm.x86.avx512.pmul.hr.sw.512"]
12432    fn vpmulhrsw(a: i16x32, b: i16x32) -> i16x32;
12433
12434    #[link_name = "llvm.x86.avx512.pmulhu.w.512"]
12435    fn vpmulhuw(a: u16x32, b: u16x32) -> u16x32;
12436    #[link_name = "llvm.x86.avx512.pmulh.w.512"]
12437    fn vpmulhw(a: i16x32, b: i16x32) -> i16x32;
12438
12439    #[link_name = "llvm.x86.avx512.pmaddw.d.512"]
12440    fn vpmaddwd(a: i16x32, b: i16x32) -> i32x16;
12441    #[link_name = "llvm.x86.avx512.pmaddubs.w.512"]
12442    fn vpmaddubsw(a: u8x64, b: i8x64) -> i16x32;
12443
12444    #[link_name = "llvm.x86.avx512.packssdw.512"]
12445    fn vpackssdw(a: i32x16, b: i32x16) -> i16x32;
12446    #[link_name = "llvm.x86.avx512.packsswb.512"]
12447    fn vpacksswb(a: i16x32, b: i16x32) -> i8x64;
12448    #[link_name = "llvm.x86.avx512.packusdw.512"]
12449    fn vpackusdw(a: i32x16, b: i32x16) -> u16x32;
12450    #[link_name = "llvm.x86.avx512.packuswb.512"]
12451    fn vpackuswb(a: i16x32, b: i16x32) -> u8x64;
12452
12453    #[link_name = "llvm.x86.avx512.psll.w.512"]
12454    fn vpsllw(a: i16x32, count: i16x8) -> i16x32;
12455
12456    #[link_name = "llvm.x86.avx512.psllv.w.512"]
12457    fn vpsllvw(a: i16x32, b: i16x32) -> i16x32;
12458    #[link_name = "llvm.x86.avx512.psllv.w.256"]
12459    fn vpsllvw256(a: i16x16, b: i16x16) -> i16x16;
12460    #[link_name = "llvm.x86.avx512.psllv.w.128"]
12461    fn vpsllvw128(a: i16x8, b: i16x8) -> i16x8;
12462
12463    #[link_name = "llvm.x86.avx512.psrl.w.512"]
12464    fn vpsrlw(a: i16x32, count: i16x8) -> i16x32;
12465
12466    #[link_name = "llvm.x86.avx512.psrlv.w.512"]
12467    fn vpsrlvw(a: i16x32, b: i16x32) -> i16x32;
12468    #[link_name = "llvm.x86.avx512.psrlv.w.256"]
12469    fn vpsrlvw256(a: i16x16, b: i16x16) -> i16x16;
12470    #[link_name = "llvm.x86.avx512.psrlv.w.128"]
12471    fn vpsrlvw128(a: i16x8, b: i16x8) -> i16x8;
12472
12473    #[link_name = "llvm.x86.avx512.psra.w.512"]
12474    fn vpsraw(a: i16x32, count: i16x8) -> i16x32;
12475
12476    #[link_name = "llvm.x86.avx512.psrav.w.512"]
12477    fn vpsravw(a: i16x32, count: i16x32) -> i16x32;
12478    #[link_name = "llvm.x86.avx512.psrav.w.256"]
12479    fn vpsravw256(a: i16x16, count: i16x16) -> i16x16;
12480    #[link_name = "llvm.x86.avx512.psrav.w.128"]
12481    fn vpsravw128(a: i16x8, count: i16x8) -> i16x8;
12482
12483    #[link_name = "llvm.x86.avx512.vpermi2var.hi.512"]
12484    fn vpermi2w(a: i16x32, idx: i16x32, b: i16x32) -> i16x32;
12485    #[link_name = "llvm.x86.avx512.vpermi2var.hi.256"]
12486    fn vpermi2w256(a: i16x16, idx: i16x16, b: i16x16) -> i16x16;
12487    #[link_name = "llvm.x86.avx512.vpermi2var.hi.128"]
12488    fn vpermi2w128(a: i16x8, idx: i16x8, b: i16x8) -> i16x8;
12489
12490    #[link_name = "llvm.x86.avx512.permvar.hi.512"]
12491    fn vpermw(a: i16x32, idx: i16x32) -> i16x32;
12492    #[link_name = "llvm.x86.avx512.permvar.hi.256"]
12493    fn vpermw256(a: i16x16, idx: i16x16) -> i16x16;
12494    #[link_name = "llvm.x86.avx512.permvar.hi.128"]
12495    fn vpermw128(a: i16x8, idx: i16x8) -> i16x8;
12496
12497    #[link_name = "llvm.x86.avx512.pshuf.b.512"]
12498    fn vpshufb(a: i8x64, b: i8x64) -> i8x64;
12499
12500    #[link_name = "llvm.x86.avx512.psad.bw.512"]
12501    fn vpsadbw(a: u8x64, b: u8x64) -> u64x8;
12502
12503    #[link_name = "llvm.x86.avx512.dbpsadbw.512"]
12504    fn vdbpsadbw(a: u8x64, b: u8x64, imm8: i32) -> u16x32;
12505    #[link_name = "llvm.x86.avx512.dbpsadbw.256"]
12506    fn vdbpsadbw256(a: u8x32, b: u8x32, imm8: i32) -> u16x16;
12507    #[link_name = "llvm.x86.avx512.dbpsadbw.128"]
12508    fn vdbpsadbw128(a: u8x16, b: u8x16, imm8: i32) -> u16x8;
12509
12510    #[link_name = "llvm.x86.avx512.mask.pmovs.wb.128"]
12511    fn vpmovswb128(a: i16x8, src: i8x16, mask: u8) -> i8x16;
12512
12513    #[link_name = "llvm.x86.avx512.mask.pmovus.wb.128"]
12514    fn vpmovuswb128(a: u16x8, src: u8x16, mask: u8) -> u8x16;
12515
12516    #[link_name = "llvm.x86.avx512.mask.pmovs.wb.mem.512"]
12517    fn vpmovswbmem(mem_addr: *mut i8, a: i16x32, mask: u32);
12518
12519    #[link_name = "llvm.x86.avx512.mask.pmovus.wb.mem.512"]
12520    fn vpmovuswbmem(mem_addr: *mut i8, a: i16x32, mask: u32);
12521
12522    #[link_name = "llvm.x86.avx512.pavg.b.512"]
12523    fn vpavgb(a: u8x64, b: u8x64) -> u8x64;
12524    #[link_name = "llvm.x86.avx512.pavg.w.512"]
12525    fn vpavgw(a: u16x32, b: u16x32) -> u16x32;
12526}
12527
12528#[cfg(test)]
12529mod tests {
12530    use crate::core_arch::assert_eq_const as assert_eq;
12531
12532    use stdarch_test::simd_test;
12533
12534    use crate::core_arch::x86::*;
12535    use crate::hint::black_box;
12536    use crate::mem::{self};
12537
12538    #[simd_test(enable = "avx512bw")]
12539    const fn test_mm512_abs_epi16() {
12540        let a = _mm512_set1_epi16(-1);
12541        let r = _mm512_abs_epi16(a);
12542        let e = _mm512_set1_epi16(1);
12543        assert_eq_m512i(r, e);
12544    }
12545
12546    #[simd_test(enable = "avx512bw")]
12547    const fn test_mm512_mask_abs_epi16() {
12548        let a = _mm512_set1_epi16(-1);
12549        let r = _mm512_mask_abs_epi16(a, 0, a);
12550        assert_eq_m512i(r, a);
12551        let r = _mm512_mask_abs_epi16(a, 0b00000000_11111111_00000000_11111111, a);
12552        #[rustfmt::skip]
12553        let e = _mm512_set_epi16(-1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1,
12554                                 -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1);
12555        assert_eq_m512i(r, e);
12556    }
12557
12558    #[simd_test(enable = "avx512bw")]
12559    const fn test_mm512_maskz_abs_epi16() {
12560        let a = _mm512_set1_epi16(-1);
12561        let r = _mm512_maskz_abs_epi16(0, a);
12562        assert_eq_m512i(r, _mm512_setzero_si512());
12563        let r = _mm512_maskz_abs_epi16(0b00000000_11111111_00000000_11111111, a);
12564        #[rustfmt::skip]
12565        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
12566                                  0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
12567        assert_eq_m512i(r, e);
12568    }
12569
12570    #[simd_test(enable = "avx512bw,avx512vl")]
12571    const fn test_mm256_mask_abs_epi16() {
12572        let a = _mm256_set1_epi16(-1);
12573        let r = _mm256_mask_abs_epi16(a, 0, a);
12574        assert_eq_m256i(r, a);
12575        let r = _mm256_mask_abs_epi16(a, 0b00000000_11111111, a);
12576        let e = _mm256_set_epi16(-1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1);
12577        assert_eq_m256i(r, e);
12578    }
12579
12580    #[simd_test(enable = "avx512bw,avx512vl")]
12581    const fn test_mm256_maskz_abs_epi16() {
12582        let a = _mm256_set1_epi16(-1);
12583        let r = _mm256_maskz_abs_epi16(0, a);
12584        assert_eq_m256i(r, _mm256_setzero_si256());
12585        let r = _mm256_maskz_abs_epi16(0b00000000_11111111, a);
12586        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
12587        assert_eq_m256i(r, e);
12588    }
12589
12590    #[simd_test(enable = "avx512bw,avx512vl")]
12591    const fn test_mm_mask_abs_epi16() {
12592        let a = _mm_set1_epi16(-1);
12593        let r = _mm_mask_abs_epi16(a, 0, a);
12594        assert_eq_m128i(r, a);
12595        let r = _mm_mask_abs_epi16(a, 0b00001111, a);
12596        let e = _mm_set_epi16(-1, -1, -1, -1, 1, 1, 1, 1);
12597        assert_eq_m128i(r, e);
12598    }
12599
12600    #[simd_test(enable = "avx512bw,avx512vl")]
12601    const fn test_mm_maskz_abs_epi16() {
12602        let a = _mm_set1_epi16(-1);
12603        let r = _mm_maskz_abs_epi16(0, a);
12604        assert_eq_m128i(r, _mm_setzero_si128());
12605        let r = _mm_maskz_abs_epi16(0b00001111, a);
12606        let e = _mm_set_epi16(0, 0, 0, 0, 1, 1, 1, 1);
12607        assert_eq_m128i(r, e);
12608    }
12609
12610    #[simd_test(enable = "avx512bw")]
12611    const fn test_mm512_abs_epi8() {
12612        let a = _mm512_set1_epi8(-1);
12613        let r = _mm512_abs_epi8(a);
12614        let e = _mm512_set1_epi8(1);
12615        assert_eq_m512i(r, e);
12616    }
12617
12618    #[simd_test(enable = "avx512bw")]
12619    const fn test_mm512_mask_abs_epi8() {
12620        let a = _mm512_set1_epi8(-1);
12621        let r = _mm512_mask_abs_epi8(a, 0, a);
12622        assert_eq_m512i(r, a);
12623        let r = _mm512_mask_abs_epi8(
12624            a,
12625            0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
12626            a,
12627        );
12628        #[rustfmt::skip]
12629        let e = _mm512_set_epi8(-1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1,
12630                                -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1,
12631                                -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1,
12632                                -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1);
12633        assert_eq_m512i(r, e);
12634    }
12635
12636    #[simd_test(enable = "avx512bw")]
12637    const fn test_mm512_maskz_abs_epi8() {
12638        let a = _mm512_set1_epi8(-1);
12639        let r = _mm512_maskz_abs_epi8(0, a);
12640        assert_eq_m512i(r, _mm512_setzero_si512());
12641        let r = _mm512_maskz_abs_epi8(
12642            0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
12643            a,
12644        );
12645        #[rustfmt::skip]
12646        let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
12647                                0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
12648                                0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
12649                                0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
12650        assert_eq_m512i(r, e);
12651    }
12652
12653    #[simd_test(enable = "avx512bw,avx512vl")]
12654    const fn test_mm256_mask_abs_epi8() {
12655        let a = _mm256_set1_epi8(-1);
12656        let r = _mm256_mask_abs_epi8(a, 0, a);
12657        assert_eq_m256i(r, a);
12658        let r = _mm256_mask_abs_epi8(a, 0b00000000_11111111_00000000_11111111, a);
12659        #[rustfmt::skip]
12660        let e = _mm256_set_epi8(-1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1,
12661                                -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1);
12662        assert_eq_m256i(r, e);
12663    }
12664
12665    #[simd_test(enable = "avx512bw,avx512vl")]
12666    const fn test_mm256_maskz_abs_epi8() {
12667        let a = _mm256_set1_epi8(-1);
12668        let r = _mm256_maskz_abs_epi8(0, a);
12669        assert_eq_m256i(r, _mm256_setzero_si256());
12670        let r = _mm256_maskz_abs_epi8(0b00000000_11111111_00000000_11111111, a);
12671        #[rustfmt::skip]
12672        let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
12673                                0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
12674        assert_eq_m256i(r, e);
12675    }
12676
12677    #[simd_test(enable = "avx512bw,avx512vl")]
12678    const fn test_mm_mask_abs_epi8() {
12679        let a = _mm_set1_epi8(-1);
12680        let r = _mm_mask_abs_epi8(a, 0, a);
12681        assert_eq_m128i(r, a);
12682        let r = _mm_mask_abs_epi8(a, 0b00000000_11111111, a);
12683        let e = _mm_set_epi8(-1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1);
12684        assert_eq_m128i(r, e);
12685    }
12686
12687    #[simd_test(enable = "avx512bw,avx512vl")]
12688    const fn test_mm_maskz_abs_epi8() {
12689        let a = _mm_set1_epi8(-1);
12690        let r = _mm_maskz_abs_epi8(0, a);
12691        assert_eq_m128i(r, _mm_setzero_si128());
12692        let r = _mm_maskz_abs_epi8(0b00000000_11111111, a);
12693        #[rustfmt::skip]
12694        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
12695        assert_eq_m128i(r, e);
12696    }
12697
12698    #[simd_test(enable = "avx512bw")]
12699    const fn test_mm512_add_epi16() {
12700        let a = _mm512_set1_epi16(1);
12701        let b = _mm512_set1_epi16(2);
12702        let r = _mm512_add_epi16(a, b);
12703        let e = _mm512_set1_epi16(3);
12704        assert_eq_m512i(r, e);
12705    }
12706
12707    #[simd_test(enable = "avx512bw")]
12708    const fn test_mm512_mask_add_epi16() {
12709        let a = _mm512_set1_epi16(1);
12710        let b = _mm512_set1_epi16(2);
12711        let r = _mm512_mask_add_epi16(a, 0, a, b);
12712        assert_eq_m512i(r, a);
12713        let r = _mm512_mask_add_epi16(a, 0b00000000_11111111_00000000_11111111, a, b);
12714        #[rustfmt::skip]
12715        let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
12716                                 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3);
12717        assert_eq_m512i(r, e);
12718    }
12719
12720    #[simd_test(enable = "avx512bw")]
12721    const fn test_mm512_maskz_add_epi16() {
12722        let a = _mm512_set1_epi16(1);
12723        let b = _mm512_set1_epi16(2);
12724        let r = _mm512_maskz_add_epi16(0, a, b);
12725        assert_eq_m512i(r, _mm512_setzero_si512());
12726        let r = _mm512_maskz_add_epi16(0b00000000_11111111_00000000_11111111, a, b);
12727        #[rustfmt::skip]
12728        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3,
12729                                 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3);
12730        assert_eq_m512i(r, e);
12731    }
12732
12733    #[simd_test(enable = "avx512bw,avx512vl")]
12734    const fn test_mm256_mask_add_epi16() {
12735        let a = _mm256_set1_epi16(1);
12736        let b = _mm256_set1_epi16(2);
12737        let r = _mm256_mask_add_epi16(a, 0, a, b);
12738        assert_eq_m256i(r, a);
12739        let r = _mm256_mask_add_epi16(a, 0b00000000_11111111, a, b);
12740        let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3);
12741        assert_eq_m256i(r, e);
12742    }
12743
12744    #[simd_test(enable = "avx512bw,avx512vl")]
12745    const fn test_mm256_maskz_add_epi16() {
12746        let a = _mm256_set1_epi16(1);
12747        let b = _mm256_set1_epi16(2);
12748        let r = _mm256_maskz_add_epi16(0, a, b);
12749        assert_eq_m256i(r, _mm256_setzero_si256());
12750        let r = _mm256_maskz_add_epi16(0b00000000_11111111, a, b);
12751        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3);
12752        assert_eq_m256i(r, e);
12753    }
12754
12755    #[simd_test(enable = "avx512bw,avx512vl")]
12756    const fn test_mm_mask_add_epi16() {
12757        let a = _mm_set1_epi16(1);
12758        let b = _mm_set1_epi16(2);
12759        let r = _mm_mask_add_epi16(a, 0, a, b);
12760        assert_eq_m128i(r, a);
12761        let r = _mm_mask_add_epi16(a, 0b00001111, a, b);
12762        let e = _mm_set_epi16(1, 1, 1, 1, 3, 3, 3, 3);
12763        assert_eq_m128i(r, e);
12764    }
12765
12766    #[simd_test(enable = "avx512bw,avx512vl")]
12767    const fn test_mm_maskz_add_epi16() {
12768        let a = _mm_set1_epi16(1);
12769        let b = _mm_set1_epi16(2);
12770        let r = _mm_maskz_add_epi16(0, a, b);
12771        assert_eq_m128i(r, _mm_setzero_si128());
12772        let r = _mm_maskz_add_epi16(0b00001111, a, b);
12773        let e = _mm_set_epi16(0, 0, 0, 0, 3, 3, 3, 3);
12774        assert_eq_m128i(r, e);
12775    }
12776
12777    #[simd_test(enable = "avx512bw")]
12778    const fn test_mm512_add_epi8() {
12779        let a = _mm512_set1_epi8(1);
12780        let b = _mm512_set1_epi8(2);
12781        let r = _mm512_add_epi8(a, b);
12782        let e = _mm512_set1_epi8(3);
12783        assert_eq_m512i(r, e);
12784    }
12785
12786    #[simd_test(enable = "avx512bw")]
12787    const fn test_mm512_mask_add_epi8() {
12788        let a = _mm512_set1_epi8(1);
12789        let b = _mm512_set1_epi8(2);
12790        let r = _mm512_mask_add_epi8(a, 0, a, b);
12791        assert_eq_m512i(r, a);
12792        let r = _mm512_mask_add_epi8(
12793            a,
12794            0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
12795            a,
12796            b,
12797        );
12798        #[rustfmt::skip]
12799        let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
12800                                1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
12801                                1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
12802                                1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3);
12803        assert_eq_m512i(r, e);
12804    }
12805
12806    #[simd_test(enable = "avx512bw")]
12807    const fn test_mm512_maskz_add_epi8() {
12808        let a = _mm512_set1_epi8(1);
12809        let b = _mm512_set1_epi8(2);
12810        let r = _mm512_maskz_add_epi8(0, a, b);
12811        assert_eq_m512i(r, _mm512_setzero_si512());
12812        let r = _mm512_maskz_add_epi8(
12813            0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
12814            a,
12815            b,
12816        );
12817        #[rustfmt::skip]
12818        let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3,
12819                                0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3,
12820                                0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3,
12821                                0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3);
12822        assert_eq_m512i(r, e);
12823    }
12824
12825    #[simd_test(enable = "avx512bw,avx512vl")]
12826    const fn test_mm256_mask_add_epi8() {
12827        let a = _mm256_set1_epi8(1);
12828        let b = _mm256_set1_epi8(2);
12829        let r = _mm256_mask_add_epi8(a, 0, a, b);
12830        assert_eq_m256i(r, a);
12831        let r = _mm256_mask_add_epi8(a, 0b00000000_11111111_00000000_11111111, a, b);
12832        #[rustfmt::skip]
12833        let e = _mm256_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
12834                                1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3);
12835        assert_eq_m256i(r, e);
12836    }
12837
12838    #[simd_test(enable = "avx512bw,avx512vl")]
12839    const fn test_mm256_maskz_add_epi8() {
12840        let a = _mm256_set1_epi8(1);
12841        let b = _mm256_set1_epi8(2);
12842        let r = _mm256_maskz_add_epi8(0, a, b);
12843        assert_eq_m256i(r, _mm256_setzero_si256());
12844        let r = _mm256_maskz_add_epi8(0b00000000_11111111_00000000_11111111, a, b);
12845        #[rustfmt::skip]
12846        let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3,
12847                                0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3);
12848        assert_eq_m256i(r, e);
12849    }
12850
12851    #[simd_test(enable = "avx512bw,avx512vl")]
12852    const fn test_mm_mask_add_epi8() {
12853        let a = _mm_set1_epi8(1);
12854        let b = _mm_set1_epi8(2);
12855        let r = _mm_mask_add_epi8(a, 0, a, b);
12856        assert_eq_m128i(r, a);
12857        let r = _mm_mask_add_epi8(a, 0b00000000_11111111, a, b);
12858        let e = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3);
12859        assert_eq_m128i(r, e);
12860    }
12861
12862    #[simd_test(enable = "avx512bw,avx512vl")]
12863    const fn test_mm_maskz_add_epi8() {
12864        let a = _mm_set1_epi8(1);
12865        let b = _mm_set1_epi8(2);
12866        let r = _mm_maskz_add_epi8(0, a, b);
12867        assert_eq_m128i(r, _mm_setzero_si128());
12868        let r = _mm_maskz_add_epi8(0b00000000_11111111, a, b);
12869        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3);
12870        assert_eq_m128i(r, e);
12871    }
12872
12873    #[simd_test(enable = "avx512bw")]
12874    const fn test_mm512_adds_epu16() {
12875        let a = _mm512_set1_epi16(1);
12876        let b = _mm512_set1_epi16(u16::MAX as i16);
12877        let r = _mm512_adds_epu16(a, b);
12878        let e = _mm512_set1_epi16(u16::MAX as i16);
12879        assert_eq_m512i(r, e);
12880    }
12881
12882    #[simd_test(enable = "avx512bw")]
12883    const fn test_mm512_mask_adds_epu16() {
12884        let a = _mm512_set1_epi16(1);
12885        let b = _mm512_set1_epi16(u16::MAX as i16);
12886        let r = _mm512_mask_adds_epu16(a, 0, a, b);
12887        assert_eq_m512i(r, a);
12888        let r = _mm512_mask_adds_epu16(a, 0b00000000_00000000_00000000_00001111, a, b);
12889        #[rustfmt::skip]
12890        let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
12891                                 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);
12892        assert_eq_m512i(r, e);
12893    }
12894
12895    #[simd_test(enable = "avx512bw")]
12896    const fn test_mm512_maskz_adds_epu16() {
12897        let a = _mm512_set1_epi16(1);
12898        let b = _mm512_set1_epi16(u16::MAX as i16);
12899        let r = _mm512_maskz_adds_epu16(0, a, b);
12900        assert_eq_m512i(r, _mm512_setzero_si512());
12901        let r = _mm512_maskz_adds_epu16(0b00000000_00000000_00000000_00001111, a, b);
12902        #[rustfmt::skip]
12903        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
12904                                 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);
12905        assert_eq_m512i(r, e);
12906    }
12907
12908    #[simd_test(enable = "avx512bw,avx512vl")]
12909    const fn test_mm256_mask_adds_epu16() {
12910        let a = _mm256_set1_epi16(1);
12911        let b = _mm256_set1_epi16(u16::MAX as i16);
12912        let r = _mm256_mask_adds_epu16(a, 0, a, b);
12913        assert_eq_m256i(r, a);
12914        let r = _mm256_mask_adds_epu16(a, 0b00000000_00001111, a, b);
12915        #[rustfmt::skip]
12916        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);
12917        assert_eq_m256i(r, e);
12918    }
12919
12920    #[simd_test(enable = "avx512bw,avx512vl")]
12921    const fn test_mm256_maskz_adds_epu16() {
12922        let a = _mm256_set1_epi16(1);
12923        let b = _mm256_set1_epi16(u16::MAX as i16);
12924        let r = _mm256_maskz_adds_epu16(0, a, b);
12925        assert_eq_m256i(r, _mm256_setzero_si256());
12926        let r = _mm256_maskz_adds_epu16(0b00000000_00001111, a, b);
12927        #[rustfmt::skip]
12928        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);
12929        assert_eq_m256i(r, e);
12930    }
12931
12932    #[simd_test(enable = "avx512bw,avx512vl")]
12933    const fn test_mm_mask_adds_epu16() {
12934        let a = _mm_set1_epi16(1);
12935        let b = _mm_set1_epi16(u16::MAX as i16);
12936        let r = _mm_mask_adds_epu16(a, 0, a, b);
12937        assert_eq_m128i(r, a);
12938        let r = _mm_mask_adds_epu16(a, 0b00001111, a, b);
12939        #[rustfmt::skip]
12940        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);
12941        assert_eq_m128i(r, e);
12942    }
12943
12944    #[simd_test(enable = "avx512bw,avx512vl")]
12945    const fn test_mm_maskz_adds_epu16() {
12946        let a = _mm_set1_epi16(1);
12947        let b = _mm_set1_epi16(u16::MAX as i16);
12948        let r = _mm_maskz_adds_epu16(0, a, b);
12949        assert_eq_m128i(r, _mm_setzero_si128());
12950        let r = _mm_maskz_adds_epu16(0b00001111, a, b);
12951        #[rustfmt::skip]
12952        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);
12953        assert_eq_m128i(r, e);
12954    }
12955
12956    #[simd_test(enable = "avx512bw")]
12957    const fn test_mm512_adds_epu8() {
12958        let a = _mm512_set1_epi8(1);
12959        let b = _mm512_set1_epi8(u8::MAX as i8);
12960        let r = _mm512_adds_epu8(a, b);
12961        let e = _mm512_set1_epi8(u8::MAX as i8);
12962        assert_eq_m512i(r, e);
12963    }
12964
12965    #[simd_test(enable = "avx512bw")]
12966    const fn test_mm512_mask_adds_epu8() {
12967        let a = _mm512_set1_epi8(1);
12968        let b = _mm512_set1_epi8(u8::MAX as i8);
12969        let r = _mm512_mask_adds_epu8(a, 0, a, b);
12970        assert_eq_m512i(r, a);
12971        let r = _mm512_mask_adds_epu8(
12972            a,
12973            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
12974            a,
12975            b,
12976        );
12977        #[rustfmt::skip]
12978        let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
12979                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
12980                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
12981                                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);
12982        assert_eq_m512i(r, e);
12983    }
12984
12985    #[simd_test(enable = "avx512bw")]
12986    const fn test_mm512_maskz_adds_epu8() {
12987        let a = _mm512_set1_epi8(1);
12988        let b = _mm512_set1_epi8(u8::MAX as i8);
12989        let r = _mm512_maskz_adds_epu8(0, a, b);
12990        assert_eq_m512i(r, _mm512_setzero_si512());
12991        let r = _mm512_maskz_adds_epu8(
12992            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
12993            a,
12994            b,
12995        );
12996        #[rustfmt::skip]
12997        let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
12998                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
12999                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13000                                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);
13001        assert_eq_m512i(r, e);
13002    }
13003
13004    #[simd_test(enable = "avx512bw,avx512vl")]
13005    const fn test_mm256_mask_adds_epu8() {
13006        let a = _mm256_set1_epi8(1);
13007        let b = _mm256_set1_epi8(u8::MAX as i8);
13008        let r = _mm256_mask_adds_epu8(a, 0, a, b);
13009        assert_eq_m256i(r, a);
13010        let r = _mm256_mask_adds_epu8(a, 0b00000000_00000000_00000000_00001111, a, b);
13011        #[rustfmt::skip]
13012        let e = _mm256_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13013                                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);
13014        assert_eq_m256i(r, e);
13015    }
13016
13017    #[simd_test(enable = "avx512bw,avx512vl")]
13018    const fn test_mm256_maskz_adds_epu8() {
13019        let a = _mm256_set1_epi8(1);
13020        let b = _mm256_set1_epi8(u8::MAX as i8);
13021        let r = _mm256_maskz_adds_epu8(0, a, b);
13022        assert_eq_m256i(r, _mm256_setzero_si256());
13023        let r = _mm256_maskz_adds_epu8(0b00000000_00000000_00000000_00001111, a, b);
13024        #[rustfmt::skip]
13025        let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13026                                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);
13027        assert_eq_m256i(r, e);
13028    }
13029
13030    #[simd_test(enable = "avx512bw,avx512vl")]
13031    const fn test_mm_mask_adds_epu8() {
13032        let a = _mm_set1_epi8(1);
13033        let b = _mm_set1_epi8(u8::MAX as i8);
13034        let r = _mm_mask_adds_epu8(a, 0, a, b);
13035        assert_eq_m128i(r, a);
13036        let r = _mm_mask_adds_epu8(a, 0b00000000_00001111, a, b);
13037        #[rustfmt::skip]
13038        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);
13039        assert_eq_m128i(r, e);
13040    }
13041
13042    #[simd_test(enable = "avx512bw,avx512vl")]
13043    const fn test_mm_maskz_adds_epu8() {
13044        let a = _mm_set1_epi8(1);
13045        let b = _mm_set1_epi8(u8::MAX as i8);
13046        let r = _mm_maskz_adds_epu8(0, a, b);
13047        assert_eq_m128i(r, _mm_setzero_si128());
13048        let r = _mm_maskz_adds_epu8(0b00000000_00001111, a, b);
13049        #[rustfmt::skip]
13050        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);
13051        assert_eq_m128i(r, e);
13052    }
13053
13054    #[simd_test(enable = "avx512bw")]
13055    const fn test_mm512_adds_epi16() {
13056        let a = _mm512_set1_epi16(1);
13057        let b = _mm512_set1_epi16(i16::MAX);
13058        let r = _mm512_adds_epi16(a, b);
13059        let e = _mm512_set1_epi16(i16::MAX);
13060        assert_eq_m512i(r, e);
13061    }
13062
13063    #[simd_test(enable = "avx512bw")]
13064    const fn test_mm512_mask_adds_epi16() {
13065        let a = _mm512_set1_epi16(1);
13066        let b = _mm512_set1_epi16(i16::MAX);
13067        let r = _mm512_mask_adds_epi16(a, 0, a, b);
13068        assert_eq_m512i(r, a);
13069        let r = _mm512_mask_adds_epi16(a, 0b00000000_00000000_00000000_00001111, a, b);
13070        #[rustfmt::skip]
13071        let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13072                                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
13073        assert_eq_m512i(r, e);
13074    }
13075
13076    #[simd_test(enable = "avx512bw")]
13077    const fn test_mm512_maskz_adds_epi16() {
13078        let a = _mm512_set1_epi16(1);
13079        let b = _mm512_set1_epi16(i16::MAX);
13080        let r = _mm512_maskz_adds_epi16(0, a, b);
13081        assert_eq_m512i(r, _mm512_setzero_si512());
13082        let r = _mm512_maskz_adds_epi16(0b00000000_00000000_00000000_00001111, a, b);
13083        #[rustfmt::skip]
13084        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13085                                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
13086        assert_eq_m512i(r, e);
13087    }
13088
13089    #[simd_test(enable = "avx512bw,avx512vl")]
13090    const fn test_mm256_mask_adds_epi16() {
13091        let a = _mm256_set1_epi16(1);
13092        let b = _mm256_set1_epi16(i16::MAX);
13093        let r = _mm256_mask_adds_epi16(a, 0, a, b);
13094        assert_eq_m256i(r, a);
13095        let r = _mm256_mask_adds_epi16(a, 0b00000000_00001111, a, b);
13096        #[rustfmt::skip]
13097        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);
13098        assert_eq_m256i(r, e);
13099    }
13100
13101    #[simd_test(enable = "avx512bw,avx512vl")]
13102    const fn test_mm256_maskz_adds_epi16() {
13103        let a = _mm256_set1_epi16(1);
13104        let b = _mm256_set1_epi16(i16::MAX);
13105        let r = _mm256_maskz_adds_epi16(0, a, b);
13106        assert_eq_m256i(r, _mm256_setzero_si256());
13107        let r = _mm256_maskz_adds_epi16(0b00000000_00001111, a, b);
13108        #[rustfmt::skip]
13109        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);
13110        assert_eq_m256i(r, e);
13111    }
13112
13113    #[simd_test(enable = "avx512bw,avx512vl")]
13114    const fn test_mm_mask_adds_epi16() {
13115        let a = _mm_set1_epi16(1);
13116        let b = _mm_set1_epi16(i16::MAX);
13117        let r = _mm_mask_adds_epi16(a, 0, a, b);
13118        assert_eq_m128i(r, a);
13119        let r = _mm_mask_adds_epi16(a, 0b00001111, a, b);
13120        let e = _mm_set_epi16(1, 1, 1, 1, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
13121        assert_eq_m128i(r, e);
13122    }
13123
13124    #[simd_test(enable = "avx512bw,avx512vl")]
13125    const fn test_mm_maskz_adds_epi16() {
13126        let a = _mm_set1_epi16(1);
13127        let b = _mm_set1_epi16(i16::MAX);
13128        let r = _mm_maskz_adds_epi16(0, a, b);
13129        assert_eq_m128i(r, _mm_setzero_si128());
13130        let r = _mm_maskz_adds_epi16(0b00001111, a, b);
13131        let e = _mm_set_epi16(0, 0, 0, 0, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
13132        assert_eq_m128i(r, e);
13133    }
13134
13135    #[simd_test(enable = "avx512bw")]
13136    const fn test_mm512_adds_epi8() {
13137        let a = _mm512_set1_epi8(1);
13138        let b = _mm512_set1_epi8(i8::MAX);
13139        let r = _mm512_adds_epi8(a, b);
13140        let e = _mm512_set1_epi8(i8::MAX);
13141        assert_eq_m512i(r, e);
13142    }
13143
13144    #[simd_test(enable = "avx512bw")]
13145    const fn test_mm512_mask_adds_epi8() {
13146        let a = _mm512_set1_epi8(1);
13147        let b = _mm512_set1_epi8(i8::MAX);
13148        let r = _mm512_mask_adds_epi8(a, 0, a, b);
13149        assert_eq_m512i(r, a);
13150        let r = _mm512_mask_adds_epi8(
13151            a,
13152            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
13153            a,
13154            b,
13155        );
13156        #[rustfmt::skip]
13157        let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13158                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13159                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13160                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
13161        assert_eq_m512i(r, e);
13162    }
13163
13164    #[simd_test(enable = "avx512bw")]
13165    const fn test_mm512_maskz_adds_epi8() {
13166        let a = _mm512_set1_epi8(1);
13167        let b = _mm512_set1_epi8(i8::MAX);
13168        let r = _mm512_maskz_adds_epi8(0, a, b);
13169        assert_eq_m512i(r, _mm512_setzero_si512());
13170        let r = _mm512_maskz_adds_epi8(
13171            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
13172            a,
13173            b,
13174        );
13175        #[rustfmt::skip]
13176        let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13177                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13178                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13179                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
13180        assert_eq_m512i(r, e);
13181    }
13182
13183    #[simd_test(enable = "avx512bw,avx512vl")]
13184    const fn test_mm256_mask_adds_epi8() {
13185        let a = _mm256_set1_epi8(1);
13186        let b = _mm256_set1_epi8(i8::MAX);
13187        let r = _mm256_mask_adds_epi8(a, 0, a, b);
13188        assert_eq_m256i(r, a);
13189        let r = _mm256_mask_adds_epi8(a, 0b00000000_00000000_00000000_00001111, a, b);
13190        #[rustfmt::skip]
13191        let e = _mm256_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13192                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
13193        assert_eq_m256i(r, e);
13194    }
13195
13196    #[simd_test(enable = "avx512bw,avx512vl")]
13197    const fn test_mm256_maskz_adds_epi8() {
13198        let a = _mm256_set1_epi8(1);
13199        let b = _mm256_set1_epi8(i8::MAX);
13200        let r = _mm256_maskz_adds_epi8(0, a, b);
13201        assert_eq_m256i(r, _mm256_setzero_si256());
13202        let r = _mm256_maskz_adds_epi8(0b00000000_00000000_00000000_00001111, a, b);
13203        #[rustfmt::skip]
13204        let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13205                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
13206        assert_eq_m256i(r, e);
13207    }
13208
13209    #[simd_test(enable = "avx512bw,avx512vl")]
13210    const fn test_mm_mask_adds_epi8() {
13211        let a = _mm_set1_epi8(1);
13212        let b = _mm_set1_epi8(i8::MAX);
13213        let r = _mm_mask_adds_epi8(a, 0, a, b);
13214        assert_eq_m128i(r, a);
13215        let r = _mm_mask_adds_epi8(a, 0b00000000_00001111, a, b);
13216        #[rustfmt::skip]
13217        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);
13218        assert_eq_m128i(r, e);
13219    }
13220
13221    #[simd_test(enable = "avx512bw,avx512vl")]
13222    const fn test_mm_maskz_adds_epi8() {
13223        let a = _mm_set1_epi8(1);
13224        let b = _mm_set1_epi8(i8::MAX);
13225        let r = _mm_maskz_adds_epi8(0, a, b);
13226        assert_eq_m128i(r, _mm_setzero_si128());
13227        let r = _mm_maskz_adds_epi8(0b00000000_00001111, a, b);
13228        #[rustfmt::skip]
13229        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);
13230        assert_eq_m128i(r, e);
13231    }
13232
13233    #[simd_test(enable = "avx512bw")]
13234    const fn test_mm512_sub_epi16() {
13235        let a = _mm512_set1_epi16(1);
13236        let b = _mm512_set1_epi16(2);
13237        let r = _mm512_sub_epi16(a, b);
13238        let e = _mm512_set1_epi16(-1);
13239        assert_eq_m512i(r, e);
13240    }
13241
13242    #[simd_test(enable = "avx512bw")]
13243    const fn test_mm512_mask_sub_epi16() {
13244        let a = _mm512_set1_epi16(1);
13245        let b = _mm512_set1_epi16(2);
13246        let r = _mm512_mask_sub_epi16(a, 0, a, b);
13247        assert_eq_m512i(r, a);
13248        let r = _mm512_mask_sub_epi16(a, 0b00000000_11111111_00000000_11111111, a, b);
13249        #[rustfmt::skip]
13250        let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1,
13251                                 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1);
13252        assert_eq_m512i(r, e);
13253    }
13254
13255    #[simd_test(enable = "avx512bw")]
13256    const fn test_mm512_maskz_sub_epi16() {
13257        let a = _mm512_set1_epi16(1);
13258        let b = _mm512_set1_epi16(2);
13259        let r = _mm512_maskz_sub_epi16(0, a, b);
13260        assert_eq_m512i(r, _mm512_setzero_si512());
13261        let r = _mm512_maskz_sub_epi16(0b00000000_11111111_00000000_11111111, a, b);
13262        #[rustfmt::skip]
13263        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1,
13264                                 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
13265        assert_eq_m512i(r, e);
13266    }
13267
13268    #[simd_test(enable = "avx512bw,avx512vl")]
13269    const fn test_mm256_mask_sub_epi16() {
13270        let a = _mm256_set1_epi16(1);
13271        let b = _mm256_set1_epi16(2);
13272        let r = _mm256_mask_sub_epi16(a, 0, a, b);
13273        assert_eq_m256i(r, a);
13274        let r = _mm256_mask_sub_epi16(a, 0b00000000_11111111, a, b);
13275        let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1);
13276        assert_eq_m256i(r, e);
13277    }
13278
13279    #[simd_test(enable = "avx512bw,avx512vl")]
13280    const fn test_mm256_maskz_sub_epi16() {
13281        let a = _mm256_set1_epi16(1);
13282        let b = _mm256_set1_epi16(2);
13283        let r = _mm256_maskz_sub_epi16(0, a, b);
13284        assert_eq_m256i(r, _mm256_setzero_si256());
13285        let r = _mm256_maskz_sub_epi16(0b00000000_11111111, a, b);
13286        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
13287        assert_eq_m256i(r, e);
13288    }
13289
13290    #[simd_test(enable = "avx512bw,avx512vl")]
13291    const fn test_mm_mask_sub_epi16() {
13292        let a = _mm_set1_epi16(1);
13293        let b = _mm_set1_epi16(2);
13294        let r = _mm_mask_sub_epi16(a, 0, a, b);
13295        assert_eq_m128i(r, a);
13296        let r = _mm_mask_sub_epi16(a, 0b00001111, a, b);
13297        let e = _mm_set_epi16(1, 1, 1, 1, -1, -1, -1, -1);
13298        assert_eq_m128i(r, e);
13299    }
13300
13301    #[simd_test(enable = "avx512bw,avx512vl")]
13302    const fn test_mm_maskz_sub_epi16() {
13303        let a = _mm_set1_epi16(1);
13304        let b = _mm_set1_epi16(2);
13305        let r = _mm_maskz_sub_epi16(0, a, b);
13306        assert_eq_m128i(r, _mm_setzero_si128());
13307        let r = _mm_maskz_sub_epi16(0b00001111, a, b);
13308        let e = _mm_set_epi16(0, 0, 0, 0, -1, -1, -1, -1);
13309        assert_eq_m128i(r, e);
13310    }
13311
13312    #[simd_test(enable = "avx512bw")]
13313    const fn test_mm512_sub_epi8() {
13314        let a = _mm512_set1_epi8(1);
13315        let b = _mm512_set1_epi8(2);
13316        let r = _mm512_sub_epi8(a, b);
13317        let e = _mm512_set1_epi8(-1);
13318        assert_eq_m512i(r, e);
13319    }
13320
13321    #[simd_test(enable = "avx512bw")]
13322    const fn test_mm512_mask_sub_epi8() {
13323        let a = _mm512_set1_epi8(1);
13324        let b = _mm512_set1_epi8(2);
13325        let r = _mm512_mask_sub_epi8(a, 0, a, b);
13326        assert_eq_m512i(r, a);
13327        let r = _mm512_mask_sub_epi8(
13328            a,
13329            0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
13330            a,
13331            b,
13332        );
13333        #[rustfmt::skip]
13334        let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1,
13335                                1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1,
13336                                1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1,
13337                                1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1);
13338        assert_eq_m512i(r, e);
13339    }
13340
13341    #[simd_test(enable = "avx512bw")]
13342    const fn test_mm512_maskz_sub_epi8() {
13343        let a = _mm512_set1_epi8(1);
13344        let b = _mm512_set1_epi8(2);
13345        let r = _mm512_maskz_sub_epi8(0, a, b);
13346        assert_eq_m512i(r, _mm512_setzero_si512());
13347        let r = _mm512_maskz_sub_epi8(
13348            0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
13349            a,
13350            b,
13351        );
13352        #[rustfmt::skip]
13353        let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1,
13354                                0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1,
13355                                0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1,
13356                                0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
13357        assert_eq_m512i(r, e);
13358    }
13359
13360    #[simd_test(enable = "avx512bw,avx512vl")]
13361    const fn test_mm256_mask_sub_epi8() {
13362        let a = _mm256_set1_epi8(1);
13363        let b = _mm256_set1_epi8(2);
13364        let r = _mm256_mask_sub_epi8(a, 0, a, b);
13365        assert_eq_m256i(r, a);
13366        let r = _mm256_mask_sub_epi8(a, 0b00000000_11111111_00000000_11111111, a, b);
13367        #[rustfmt::skip]
13368        let e = _mm256_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1,
13369                                1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1);
13370        assert_eq_m256i(r, e);
13371    }
13372
13373    #[simd_test(enable = "avx512bw,avx512vl")]
13374    const fn test_mm256_maskz_sub_epi8() {
13375        let a = _mm256_set1_epi8(1);
13376        let b = _mm256_set1_epi8(2);
13377        let r = _mm256_maskz_sub_epi8(0, a, b);
13378        assert_eq_m256i(r, _mm256_setzero_si256());
13379        let r = _mm256_maskz_sub_epi8(0b00000000_11111111_00000000_11111111, a, b);
13380        #[rustfmt::skip]
13381        let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1,
13382                                0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
13383        assert_eq_m256i(r, e);
13384    }
13385
13386    #[simd_test(enable = "avx512bw,avx512vl")]
13387    const fn test_mm_mask_sub_epi8() {
13388        let a = _mm_set1_epi8(1);
13389        let b = _mm_set1_epi8(2);
13390        let r = _mm_mask_sub_epi8(a, 0, a, b);
13391        assert_eq_m128i(r, a);
13392        let r = _mm_mask_sub_epi8(a, 0b00000000_11111111, a, b);
13393        let e = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1);
13394        assert_eq_m128i(r, e);
13395    }
13396
13397    #[simd_test(enable = "avx512bw,avx512vl")]
13398    const fn test_mm_maskz_sub_epi8() {
13399        let a = _mm_set1_epi8(1);
13400        let b = _mm_set1_epi8(2);
13401        let r = _mm_maskz_sub_epi8(0, a, b);
13402        assert_eq_m128i(r, _mm_setzero_si128());
13403        let r = _mm_maskz_sub_epi8(0b00000000_11111111, a, b);
13404        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
13405        assert_eq_m128i(r, e);
13406    }
13407
13408    #[simd_test(enable = "avx512bw")]
13409    const fn test_mm512_subs_epu16() {
13410        let a = _mm512_set1_epi16(1);
13411        let b = _mm512_set1_epi16(u16::MAX as i16);
13412        let r = _mm512_subs_epu16(a, b);
13413        let e = _mm512_set1_epi16(0);
13414        assert_eq_m512i(r, e);
13415    }
13416
13417    #[simd_test(enable = "avx512bw")]
13418    const fn test_mm512_mask_subs_epu16() {
13419        let a = _mm512_set1_epi16(1);
13420        let b = _mm512_set1_epi16(u16::MAX as i16);
13421        let r = _mm512_mask_subs_epu16(a, 0, a, b);
13422        assert_eq_m512i(r, a);
13423        let r = _mm512_mask_subs_epu16(a, 0b00000000_00000000_00000000_00001111, a, b);
13424        #[rustfmt::skip]
13425        let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13426                                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
13427        assert_eq_m512i(r, e);
13428    }
13429
13430    #[simd_test(enable = "avx512bw")]
13431    const fn test_mm512_maskz_subs_epu16() {
13432        let a = _mm512_set1_epi16(1);
13433        let b = _mm512_set1_epi16(u16::MAX as i16);
13434        let r = _mm512_maskz_subs_epu16(0, a, b);
13435        assert_eq_m512i(r, _mm512_setzero_si512());
13436        let r = _mm512_maskz_subs_epu16(0b00000000_00000000_00000000_00001111, a, b);
13437        #[rustfmt::skip]
13438        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13439                                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
13440        assert_eq_m512i(r, e);
13441    }
13442
13443    #[simd_test(enable = "avx512bw,avx512vl")]
13444    const fn test_mm256_mask_subs_epu16() {
13445        let a = _mm256_set1_epi16(1);
13446        let b = _mm256_set1_epi16(u16::MAX as i16);
13447        let r = _mm256_mask_subs_epu16(a, 0, a, b);
13448        assert_eq_m256i(r, a);
13449        let r = _mm256_mask_subs_epu16(a, 0b00000000_00001111, a, b);
13450        let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
13451        assert_eq_m256i(r, e);
13452    }
13453
13454    #[simd_test(enable = "avx512bw,avx512vl")]
13455    const fn test_mm256_maskz_subs_epu16() {
13456        let a = _mm256_set1_epi16(1);
13457        let b = _mm256_set1_epi16(u16::MAX as i16);
13458        let r = _mm256_maskz_subs_epu16(0, a, b);
13459        assert_eq_m256i(r, _mm256_setzero_si256());
13460        let r = _mm256_maskz_subs_epu16(0b00000000_00001111, a, b);
13461        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
13462        assert_eq_m256i(r, e);
13463    }
13464
13465    #[simd_test(enable = "avx512bw,avx512vl")]
13466    const fn test_mm_mask_subs_epu16() {
13467        let a = _mm_set1_epi16(1);
13468        let b = _mm_set1_epi16(u16::MAX as i16);
13469        let r = _mm_mask_subs_epu16(a, 0, a, b);
13470        assert_eq_m128i(r, a);
13471        let r = _mm_mask_subs_epu16(a, 0b00001111, a, b);
13472        let e = _mm_set_epi16(1, 1, 1, 1, 0, 0, 0, 0);
13473        assert_eq_m128i(r, e);
13474    }
13475
13476    #[simd_test(enable = "avx512bw,avx512vl")]
13477    const fn test_mm_maskz_subs_epu16() {
13478        let a = _mm_set1_epi16(1);
13479        let b = _mm_set1_epi16(u16::MAX as i16);
13480        let r = _mm_maskz_subs_epu16(0, a, b);
13481        assert_eq_m128i(r, _mm_setzero_si128());
13482        let r = _mm_maskz_subs_epu16(0b00001111, a, b);
13483        let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, 0, 0);
13484        assert_eq_m128i(r, e);
13485    }
13486
13487    #[simd_test(enable = "avx512bw")]
13488    const fn test_mm512_subs_epu8() {
13489        let a = _mm512_set1_epi8(1);
13490        let b = _mm512_set1_epi8(u8::MAX as i8);
13491        let r = _mm512_subs_epu8(a, b);
13492        let e = _mm512_set1_epi8(0);
13493        assert_eq_m512i(r, e);
13494    }
13495
13496    #[simd_test(enable = "avx512bw")]
13497    const fn test_mm512_mask_subs_epu8() {
13498        let a = _mm512_set1_epi8(1);
13499        let b = _mm512_set1_epi8(u8::MAX as i8);
13500        let r = _mm512_mask_subs_epu8(a, 0, a, b);
13501        assert_eq_m512i(r, a);
13502        let r = _mm512_mask_subs_epu8(
13503            a,
13504            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
13505            a,
13506            b,
13507        );
13508        #[rustfmt::skip]
13509        let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13510                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13511                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13512                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
13513        assert_eq_m512i(r, e);
13514    }
13515
13516    #[simd_test(enable = "avx512bw")]
13517    const fn test_mm512_maskz_subs_epu8() {
13518        let a = _mm512_set1_epi8(1);
13519        let b = _mm512_set1_epi8(u8::MAX as i8);
13520        let r = _mm512_maskz_subs_epu8(0, a, b);
13521        assert_eq_m512i(r, _mm512_setzero_si512());
13522        let r = _mm512_maskz_subs_epu8(
13523            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
13524            a,
13525            b,
13526        );
13527        #[rustfmt::skip]
13528        let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13529                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13530                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13531                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
13532        assert_eq_m512i(r, e);
13533    }
13534
13535    #[simd_test(enable = "avx512bw,avx512vl")]
13536    const fn test_mm256_mask_subs_epu8() {
13537        let a = _mm256_set1_epi8(1);
13538        let b = _mm256_set1_epi8(u8::MAX as i8);
13539        let r = _mm256_mask_subs_epu8(a, 0, a, b);
13540        assert_eq_m256i(r, a);
13541        let r = _mm256_mask_subs_epu8(a, 0b00000000_00000000_00000000_00001111, a, b);
13542        #[rustfmt::skip]
13543        let e = _mm256_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13544                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
13545        assert_eq_m256i(r, e);
13546    }
13547
13548    #[simd_test(enable = "avx512bw,avx512vl")]
13549    const fn test_mm256_maskz_subs_epu8() {
13550        let a = _mm256_set1_epi8(1);
13551        let b = _mm256_set1_epi8(u8::MAX as i8);
13552        let r = _mm256_maskz_subs_epu8(0, a, b);
13553        assert_eq_m256i(r, _mm256_setzero_si256());
13554        let r = _mm256_maskz_subs_epu8(0b00000000_00000000_00000000_00001111, a, b);
13555        #[rustfmt::skip]
13556        let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13557                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
13558        assert_eq_m256i(r, e);
13559    }
13560
13561    #[simd_test(enable = "avx512bw,avx512vl")]
13562    const fn test_mm_mask_subs_epu8() {
13563        let a = _mm_set1_epi8(1);
13564        let b = _mm_set1_epi8(u8::MAX as i8);
13565        let r = _mm_mask_subs_epu8(a, 0, a, b);
13566        assert_eq_m128i(r, a);
13567        let r = _mm_mask_subs_epu8(a, 0b00000000_00001111, a, b);
13568        let e = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
13569        assert_eq_m128i(r, e);
13570    }
13571
13572    #[simd_test(enable = "avx512bw,avx512vl")]
13573    const fn test_mm_maskz_subs_epu8() {
13574        let a = _mm_set1_epi8(1);
13575        let b = _mm_set1_epi8(u8::MAX as i8);
13576        let r = _mm_maskz_subs_epu8(0, a, b);
13577        assert_eq_m128i(r, _mm_setzero_si128());
13578        let r = _mm_maskz_subs_epu8(0b00000000_00001111, a, b);
13579        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
13580        assert_eq_m128i(r, e);
13581    }
13582
13583    #[simd_test(enable = "avx512bw")]
13584    const fn test_mm512_subs_epi16() {
13585        let a = _mm512_set1_epi16(-1);
13586        let b = _mm512_set1_epi16(i16::MAX);
13587        let r = _mm512_subs_epi16(a, b);
13588        let e = _mm512_set1_epi16(i16::MIN);
13589        assert_eq_m512i(r, e);
13590    }
13591
13592    #[simd_test(enable = "avx512bw")]
13593    const fn test_mm512_mask_subs_epi16() {
13594        let a = _mm512_set1_epi16(-1);
13595        let b = _mm512_set1_epi16(i16::MAX);
13596        let r = _mm512_mask_subs_epi16(a, 0, a, b);
13597        assert_eq_m512i(r, a);
13598        let r = _mm512_mask_subs_epi16(a, 0b00000000_00000000_00000000_00001111, a, b);
13599        #[rustfmt::skip]
13600        let e = _mm512_set_epi16(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
13601                                 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, i16::MIN, i16::MIN, i16::MIN, i16::MIN);
13602        assert_eq_m512i(r, e);
13603    }
13604
13605    #[simd_test(enable = "avx512bw")]
13606    const fn test_mm512_maskz_subs_epi16() {
13607        let a = _mm512_set1_epi16(-1);
13608        let b = _mm512_set1_epi16(i16::MAX);
13609        let r = _mm512_maskz_subs_epi16(0, a, b);
13610        assert_eq_m512i(r, _mm512_setzero_si512());
13611        let r = _mm512_maskz_subs_epi16(0b00000000_00000000_00000000_00001111, a, b);
13612        #[rustfmt::skip]
13613        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13614                                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i16::MIN, i16::MIN, i16::MIN, i16::MIN);
13615        assert_eq_m512i(r, e);
13616    }
13617
13618    #[simd_test(enable = "avx512bw,avx512vl")]
13619    const fn test_mm256_mask_subs_epi16() {
13620        let a = _mm256_set1_epi16(-1);
13621        let b = _mm256_set1_epi16(i16::MAX);
13622        let r = _mm256_mask_subs_epi16(a, 0, a, b);
13623        assert_eq_m256i(r, a);
13624        let r = _mm256_mask_subs_epi16(a, 0b00000000_00001111, a, b);
13625        #[rustfmt::skip]
13626        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);
13627        assert_eq_m256i(r, e);
13628    }
13629
13630    #[simd_test(enable = "avx512bw,avx512vl")]
13631    const fn test_mm256_maskz_subs_epi16() {
13632        let a = _mm256_set1_epi16(-1);
13633        let b = _mm256_set1_epi16(i16::MAX);
13634        let r = _mm256_maskz_subs_epi16(0, a, b);
13635        assert_eq_m256i(r, _mm256_setzero_si256());
13636        let r = _mm256_maskz_subs_epi16(0b00000000_00001111, a, b);
13637        #[rustfmt::skip]
13638        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);
13639        assert_eq_m256i(r, e);
13640    }
13641
13642    #[simd_test(enable = "avx512bw,avx512vl")]
13643    const fn test_mm_mask_subs_epi16() {
13644        let a = _mm_set1_epi16(-1);
13645        let b = _mm_set1_epi16(i16::MAX);
13646        let r = _mm_mask_subs_epi16(a, 0, a, b);
13647        assert_eq_m128i(r, a);
13648        let r = _mm_mask_subs_epi16(a, 0b00001111, a, b);
13649        let e = _mm_set_epi16(-1, -1, -1, -1, i16::MIN, i16::MIN, i16::MIN, i16::MIN);
13650        assert_eq_m128i(r, e);
13651    }
13652
13653    #[simd_test(enable = "avx512bw,avx512vl")]
13654    const fn test_mm_maskz_subs_epi16() {
13655        let a = _mm_set1_epi16(-1);
13656        let b = _mm_set1_epi16(i16::MAX);
13657        let r = _mm_maskz_subs_epi16(0, a, b);
13658        assert_eq_m128i(r, _mm_setzero_si128());
13659        let r = _mm_maskz_subs_epi16(0b00001111, a, b);
13660        let e = _mm_set_epi16(0, 0, 0, 0, i16::MIN, i16::MIN, i16::MIN, i16::MIN);
13661        assert_eq_m128i(r, e);
13662    }
13663
13664    #[simd_test(enable = "avx512bw")]
13665    const fn test_mm512_subs_epi8() {
13666        let a = _mm512_set1_epi8(-1);
13667        let b = _mm512_set1_epi8(i8::MAX);
13668        let r = _mm512_subs_epi8(a, b);
13669        let e = _mm512_set1_epi8(i8::MIN);
13670        assert_eq_m512i(r, e);
13671    }
13672
13673    #[simd_test(enable = "avx512bw")]
13674    const fn test_mm512_mask_subs_epi8() {
13675        let a = _mm512_set1_epi8(-1);
13676        let b = _mm512_set1_epi8(i8::MAX);
13677        let r = _mm512_mask_subs_epi8(a, 0, a, b);
13678        assert_eq_m512i(r, a);
13679        let r = _mm512_mask_subs_epi8(
13680            a,
13681            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
13682            a,
13683            b,
13684        );
13685        #[rustfmt::skip]
13686        let e = _mm512_set_epi8(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
13687                                -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
13688                                -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
13689                                -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, i8::MIN, i8::MIN, i8::MIN, i8::MIN);
13690        assert_eq_m512i(r, e);
13691    }
13692
13693    #[simd_test(enable = "avx512bw")]
13694    const fn test_mm512_maskz_subs_epi8() {
13695        let a = _mm512_set1_epi8(-1);
13696        let b = _mm512_set1_epi8(i8::MAX);
13697        let r = _mm512_maskz_subs_epi8(0, a, b);
13698        assert_eq_m512i(r, _mm512_setzero_si512());
13699        let r = _mm512_maskz_subs_epi8(
13700            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
13701            a,
13702            b,
13703        );
13704        #[rustfmt::skip]
13705        let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13706                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13707                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13708                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i8::MIN, i8::MIN, i8::MIN, i8::MIN);
13709        assert_eq_m512i(r, e);
13710    }
13711
13712    #[simd_test(enable = "avx512bw,avx512vl")]
13713    const fn test_mm256_mask_subs_epi8() {
13714        let a = _mm256_set1_epi8(-1);
13715        let b = _mm256_set1_epi8(i8::MAX);
13716        let r = _mm256_mask_subs_epi8(a, 0, a, b);
13717        assert_eq_m256i(r, a);
13718        let r = _mm256_mask_subs_epi8(a, 0b00000000_00000000_00000000_00001111, a, b);
13719        #[rustfmt::skip]
13720        let e = _mm256_set_epi8(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
13721                                -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, i8::MIN, i8::MIN, i8::MIN, i8::MIN);
13722        assert_eq_m256i(r, e);
13723    }
13724
13725    #[simd_test(enable = "avx512bw,avx512vl")]
13726    const fn test_mm256_maskz_subs_epi8() {
13727        let a = _mm256_set1_epi8(-1);
13728        let b = _mm256_set1_epi8(i8::MAX);
13729        let r = _mm256_maskz_subs_epi8(0, a, b);
13730        assert_eq_m256i(r, _mm256_setzero_si256());
13731        let r = _mm256_maskz_subs_epi8(0b00000000_00000000_00000000_00001111, a, b);
13732        #[rustfmt::skip]
13733        let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13734                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i8::MIN, i8::MIN, i8::MIN, i8::MIN);
13735        assert_eq_m256i(r, e);
13736    }
13737
13738    #[simd_test(enable = "avx512bw,avx512vl")]
13739    const fn test_mm_mask_subs_epi8() {
13740        let a = _mm_set1_epi8(-1);
13741        let b = _mm_set1_epi8(i8::MAX);
13742        let r = _mm_mask_subs_epi8(a, 0, a, b);
13743        assert_eq_m128i(r, a);
13744        let r = _mm_mask_subs_epi8(a, 0b00000000_00001111, a, b);
13745        #[rustfmt::skip]
13746        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);
13747        assert_eq_m128i(r, e);
13748    }
13749
13750    #[simd_test(enable = "avx512bw,avx512vl")]
13751    const fn test_mm_maskz_subs_epi8() {
13752        let a = _mm_set1_epi8(-1);
13753        let b = _mm_set1_epi8(i8::MAX);
13754        let r = _mm_maskz_subs_epi8(0, a, b);
13755        assert_eq_m128i(r, _mm_setzero_si128());
13756        let r = _mm_maskz_subs_epi8(0b00000000_00001111, a, b);
13757        #[rustfmt::skip]
13758        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);
13759        assert_eq_m128i(r, e);
13760    }
13761
13762    #[simd_test(enable = "avx512bw")]
13763    fn test_mm512_mulhi_epu16() {
13764        let a = _mm512_set1_epi16(1);
13765        let b = _mm512_set1_epi16(1);
13766        let r = _mm512_mulhi_epu16(a, b);
13767        let e = _mm512_set1_epi16(0);
13768        assert_eq_m512i(r, e);
13769    }
13770
13771    #[simd_test(enable = "avx512bw")]
13772    fn test_mm512_mask_mulhi_epu16() {
13773        let a = _mm512_set1_epi16(1);
13774        let b = _mm512_set1_epi16(1);
13775        let r = _mm512_mask_mulhi_epu16(a, 0, a, b);
13776        assert_eq_m512i(r, a);
13777        let r = _mm512_mask_mulhi_epu16(a, 0b00000000_00000000_00000000_00001111, a, b);
13778        #[rustfmt::skip]
13779        let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13780                                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
13781        assert_eq_m512i(r, e);
13782    }
13783
13784    #[simd_test(enable = "avx512bw")]
13785    fn test_mm512_maskz_mulhi_epu16() {
13786        let a = _mm512_set1_epi16(1);
13787        let b = _mm512_set1_epi16(1);
13788        let r = _mm512_maskz_mulhi_epu16(0, a, b);
13789        assert_eq_m512i(r, _mm512_setzero_si512());
13790        let r = _mm512_maskz_mulhi_epu16(0b00000000_00000000_00000000_00001111, a, b);
13791        #[rustfmt::skip]
13792        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13793                                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
13794        assert_eq_m512i(r, e);
13795    }
13796
13797    #[simd_test(enable = "avx512bw,avx512vl")]
13798    fn test_mm256_mask_mulhi_epu16() {
13799        let a = _mm256_set1_epi16(1);
13800        let b = _mm256_set1_epi16(1);
13801        let r = _mm256_mask_mulhi_epu16(a, 0, a, b);
13802        assert_eq_m256i(r, a);
13803        let r = _mm256_mask_mulhi_epu16(a, 0b00000000_00001111, a, b);
13804        let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
13805        assert_eq_m256i(r, e);
13806    }
13807
13808    #[simd_test(enable = "avx512bw,avx512vl")]
13809    fn test_mm256_maskz_mulhi_epu16() {
13810        let a = _mm256_set1_epi16(1);
13811        let b = _mm256_set1_epi16(1);
13812        let r = _mm256_maskz_mulhi_epu16(0, a, b);
13813        assert_eq_m256i(r, _mm256_setzero_si256());
13814        let r = _mm256_maskz_mulhi_epu16(0b00000000_00001111, a, b);
13815        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
13816        assert_eq_m256i(r, e);
13817    }
13818
13819    #[simd_test(enable = "avx512bw,avx512vl")]
13820    fn test_mm_mask_mulhi_epu16() {
13821        let a = _mm_set1_epi16(1);
13822        let b = _mm_set1_epi16(1);
13823        let r = _mm_mask_mulhi_epu16(a, 0, a, b);
13824        assert_eq_m128i(r, a);
13825        let r = _mm_mask_mulhi_epu16(a, 0b00001111, a, b);
13826        let e = _mm_set_epi16(1, 1, 1, 1, 0, 0, 0, 0);
13827        assert_eq_m128i(r, e);
13828    }
13829
13830    #[simd_test(enable = "avx512bw,avx512vl")]
13831    fn test_mm_maskz_mulhi_epu16() {
13832        let a = _mm_set1_epi16(1);
13833        let b = _mm_set1_epi16(1);
13834        let r = _mm_maskz_mulhi_epu16(0, a, b);
13835        assert_eq_m128i(r, _mm_setzero_si128());
13836        let r = _mm_maskz_mulhi_epu16(0b00001111, a, b);
13837        let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, 0, 0);
13838        assert_eq_m128i(r, e);
13839    }
13840
13841    #[simd_test(enable = "avx512bw")]
13842    fn test_mm512_mulhi_epi16() {
13843        let a = _mm512_set1_epi16(1);
13844        let b = _mm512_set1_epi16(1);
13845        let r = _mm512_mulhi_epi16(a, b);
13846        let e = _mm512_set1_epi16(0);
13847        assert_eq_m512i(r, e);
13848    }
13849
13850    #[simd_test(enable = "avx512bw")]
13851    fn test_mm512_mask_mulhi_epi16() {
13852        let a = _mm512_set1_epi16(1);
13853        let b = _mm512_set1_epi16(1);
13854        let r = _mm512_mask_mulhi_epi16(a, 0, a, b);
13855        assert_eq_m512i(r, a);
13856        let r = _mm512_mask_mulhi_epi16(a, 0b00000000_00000000_00000000_00001111, a, b);
13857        #[rustfmt::skip]
13858        let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13859                                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
13860        assert_eq_m512i(r, e);
13861    }
13862
13863    #[simd_test(enable = "avx512bw")]
13864    fn test_mm512_maskz_mulhi_epi16() {
13865        let a = _mm512_set1_epi16(1);
13866        let b = _mm512_set1_epi16(1);
13867        let r = _mm512_maskz_mulhi_epi16(0, a, b);
13868        assert_eq_m512i(r, _mm512_setzero_si512());
13869        let r = _mm512_maskz_mulhi_epi16(0b00000000_00000000_00000000_00001111, a, b);
13870        #[rustfmt::skip]
13871        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13872                                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
13873        assert_eq_m512i(r, e);
13874    }
13875
13876    #[simd_test(enable = "avx512bw,avx512vl")]
13877    fn test_mm256_mask_mulhi_epi16() {
13878        let a = _mm256_set1_epi16(1);
13879        let b = _mm256_set1_epi16(1);
13880        let r = _mm256_mask_mulhi_epi16(a, 0, a, b);
13881        assert_eq_m256i(r, a);
13882        let r = _mm256_mask_mulhi_epi16(a, 0b00000000_00001111, a, b);
13883        let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
13884        assert_eq_m256i(r, e);
13885    }
13886
13887    #[simd_test(enable = "avx512bw,avx512vl")]
13888    fn test_mm256_maskz_mulhi_epi16() {
13889        let a = _mm256_set1_epi16(1);
13890        let b = _mm256_set1_epi16(1);
13891        let r = _mm256_maskz_mulhi_epi16(0, a, b);
13892        assert_eq_m256i(r, _mm256_setzero_si256());
13893        let r = _mm256_maskz_mulhi_epi16(0b00000000_00001111, a, b);
13894        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
13895        assert_eq_m256i(r, e);
13896    }
13897
13898    #[simd_test(enable = "avx512bw,avx512vl")]
13899    fn test_mm_mask_mulhi_epi16() {
13900        let a = _mm_set1_epi16(1);
13901        let b = _mm_set1_epi16(1);
13902        let r = _mm_mask_mulhi_epi16(a, 0, a, b);
13903        assert_eq_m128i(r, a);
13904        let r = _mm_mask_mulhi_epi16(a, 0b00001111, a, b);
13905        let e = _mm_set_epi16(1, 1, 1, 1, 0, 0, 0, 0);
13906        assert_eq_m128i(r, e);
13907    }
13908
13909    #[simd_test(enable = "avx512bw,avx512vl")]
13910    fn test_mm_maskz_mulhi_epi16() {
13911        let a = _mm_set1_epi16(1);
13912        let b = _mm_set1_epi16(1);
13913        let r = _mm_maskz_mulhi_epi16(0, a, b);
13914        assert_eq_m128i(r, _mm_setzero_si128());
13915        let r = _mm_maskz_mulhi_epi16(0b00001111, a, b);
13916        let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, 0, 0);
13917        assert_eq_m128i(r, e);
13918    }
13919
13920    #[simd_test(enable = "avx512bw")]
13921    fn test_mm512_mulhrs_epi16() {
13922        let a = _mm512_set1_epi16(1);
13923        let b = _mm512_set1_epi16(1);
13924        let r = _mm512_mulhrs_epi16(a, b);
13925        let e = _mm512_set1_epi16(0);
13926        assert_eq_m512i(r, e);
13927    }
13928
13929    #[simd_test(enable = "avx512bw")]
13930    fn test_mm512_mask_mulhrs_epi16() {
13931        let a = _mm512_set1_epi16(1);
13932        let b = _mm512_set1_epi16(1);
13933        let r = _mm512_mask_mulhrs_epi16(a, 0, a, b);
13934        assert_eq_m512i(r, a);
13935        let r = _mm512_mask_mulhrs_epi16(a, 0b00000000_00000000_00000000_00001111, a, b);
13936        #[rustfmt::skip]
13937        let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13938                                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
13939        assert_eq_m512i(r, e);
13940    }
13941
13942    #[simd_test(enable = "avx512bw")]
13943    fn test_mm512_maskz_mulhrs_epi16() {
13944        let a = _mm512_set1_epi16(1);
13945        let b = _mm512_set1_epi16(1);
13946        let r = _mm512_maskz_mulhrs_epi16(0, a, b);
13947        assert_eq_m512i(r, _mm512_setzero_si512());
13948        let r = _mm512_maskz_mulhrs_epi16(0b00000000_00000000_00000000_00001111, a, b);
13949        #[rustfmt::skip]
13950        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13951                                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
13952        assert_eq_m512i(r, e);
13953    }
13954
13955    #[simd_test(enable = "avx512bw,avx512vl")]
13956    fn test_mm256_mask_mulhrs_epi16() {
13957        let a = _mm256_set1_epi16(1);
13958        let b = _mm256_set1_epi16(1);
13959        let r = _mm256_mask_mulhrs_epi16(a, 0, a, b);
13960        assert_eq_m256i(r, a);
13961        let r = _mm256_mask_mulhrs_epi16(a, 0b00000000_00001111, a, b);
13962        let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
13963        assert_eq_m256i(r, e);
13964    }
13965
13966    #[simd_test(enable = "avx512bw,avx512vl")]
13967    fn test_mm256_maskz_mulhrs_epi16() {
13968        let a = _mm256_set1_epi16(1);
13969        let b = _mm256_set1_epi16(1);
13970        let r = _mm256_maskz_mulhrs_epi16(0, a, b);
13971        assert_eq_m256i(r, _mm256_setzero_si256());
13972        let r = _mm256_maskz_mulhrs_epi16(0b00000000_00001111, a, b);
13973        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
13974        assert_eq_m256i(r, e);
13975    }
13976
13977    #[simd_test(enable = "avx512bw,avx512vl")]
13978    fn test_mm_mask_mulhrs_epi16() {
13979        let a = _mm_set1_epi16(1);
13980        let b = _mm_set1_epi16(1);
13981        let r = _mm_mask_mulhrs_epi16(a, 0, a, b);
13982        assert_eq_m128i(r, a);
13983        let r = _mm_mask_mulhrs_epi16(a, 0b00001111, a, b);
13984        let e = _mm_set_epi16(1, 1, 1, 1, 0, 0, 0, 0);
13985        assert_eq_m128i(r, e);
13986    }
13987
13988    #[simd_test(enable = "avx512bw,avx512vl")]
13989    fn test_mm_maskz_mulhrs_epi16() {
13990        let a = _mm_set1_epi16(1);
13991        let b = _mm_set1_epi16(1);
13992        let r = _mm_maskz_mulhrs_epi16(0, a, b);
13993        assert_eq_m128i(r, _mm_setzero_si128());
13994        let r = _mm_maskz_mulhrs_epi16(0b00001111, a, b);
13995        let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, 0, 0);
13996        assert_eq_m128i(r, e);
13997    }
13998
13999    #[simd_test(enable = "avx512bw")]
14000    const fn test_mm512_mullo_epi16() {
14001        let a = _mm512_set1_epi16(1);
14002        let b = _mm512_set1_epi16(1);
14003        let r = _mm512_mullo_epi16(a, b);
14004        let e = _mm512_set1_epi16(1);
14005        assert_eq_m512i(r, e);
14006    }
14007
14008    #[simd_test(enable = "avx512bw")]
14009    const fn test_mm512_mask_mullo_epi16() {
14010        let a = _mm512_set1_epi16(1);
14011        let b = _mm512_set1_epi16(1);
14012        let r = _mm512_mask_mullo_epi16(a, 0, a, b);
14013        assert_eq_m512i(r, a);
14014        let r = _mm512_mask_mullo_epi16(a, 0b00000000_00000000_00000000_00001111, a, b);
14015        #[rustfmt::skip]
14016        let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
14017                                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
14018        assert_eq_m512i(r, e);
14019    }
14020
14021    #[simd_test(enable = "avx512bw")]
14022    const fn test_mm512_maskz_mullo_epi16() {
14023        let a = _mm512_set1_epi16(1);
14024        let b = _mm512_set1_epi16(1);
14025        let r = _mm512_maskz_mullo_epi16(0, a, b);
14026        assert_eq_m512i(r, _mm512_setzero_si512());
14027        let r = _mm512_maskz_mullo_epi16(0b00000000_00000000_00000000_00001111, a, b);
14028        #[rustfmt::skip]
14029        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
14030                                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1);
14031        assert_eq_m512i(r, e);
14032    }
14033
14034    #[simd_test(enable = "avx512bw,avx512vl")]
14035    const fn test_mm256_mask_mullo_epi16() {
14036        let a = _mm256_set1_epi16(1);
14037        let b = _mm256_set1_epi16(1);
14038        let r = _mm256_mask_mullo_epi16(a, 0, a, b);
14039        assert_eq_m256i(r, a);
14040        let r = _mm256_mask_mullo_epi16(a, 0b00000000_00001111, a, b);
14041        let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
14042        assert_eq_m256i(r, e);
14043    }
14044
14045    #[simd_test(enable = "avx512bw,avx512vl")]
14046    const fn test_mm256_maskz_mullo_epi16() {
14047        let a = _mm256_set1_epi16(1);
14048        let b = _mm256_set1_epi16(1);
14049        let r = _mm256_maskz_mullo_epi16(0, a, b);
14050        assert_eq_m256i(r, _mm256_setzero_si256());
14051        let r = _mm256_maskz_mullo_epi16(0b00000000_00001111, a, b);
14052        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1);
14053        assert_eq_m256i(r, e);
14054    }
14055
14056    #[simd_test(enable = "avx512bw,avx512vl")]
14057    const fn test_mm_mask_mullo_epi16() {
14058        let a = _mm_set1_epi16(1);
14059        let b = _mm_set1_epi16(1);
14060        let r = _mm_mask_mullo_epi16(a, 0, a, b);
14061        assert_eq_m128i(r, a);
14062        let r = _mm_mask_mullo_epi16(a, 0b00001111, a, b);
14063        let e = _mm_set_epi16(1, 1, 1, 1, 1, 1, 1, 1);
14064        assert_eq_m128i(r, e);
14065    }
14066
14067    #[simd_test(enable = "avx512bw,avx512vl")]
14068    const fn test_mm_maskz_mullo_epi16() {
14069        let a = _mm_set1_epi16(1);
14070        let b = _mm_set1_epi16(1);
14071        let r = _mm_maskz_mullo_epi16(0, a, b);
14072        assert_eq_m128i(r, _mm_setzero_si128());
14073        let r = _mm_maskz_mullo_epi16(0b00001111, a, b);
14074        let e = _mm_set_epi16(0, 0, 0, 0, 1, 1, 1, 1);
14075        assert_eq_m128i(r, e);
14076    }
14077
14078    #[simd_test(enable = "avx512bw")]
14079    const fn test_mm512_max_epu16() {
14080        #[rustfmt::skip]
14081        let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14082                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14083        #[rustfmt::skip]
14084        let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14085                                 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14086        let r = _mm512_max_epu16(a, b);
14087        #[rustfmt::skip]
14088        let e = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15,
14089                                 15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15);
14090        assert_eq_m512i(r, e);
14091    }
14092
14093    #[simd_test(enable = "avx512bw")]
14094    const fn test_mm512_mask_max_epu16() {
14095        #[rustfmt::skip]
14096        let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14097                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14098        #[rustfmt::skip]
14099        let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14100                                 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14101        let r = _mm512_mask_max_epu16(a, 0, a, b);
14102        assert_eq_m512i(r, a);
14103        let r = _mm512_mask_max_epu16(a, 0b00000000_11111111_00000000_11111111, a, b);
14104        #[rustfmt::skip]
14105        let e = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14106                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14107        assert_eq_m512i(r, e);
14108    }
14109
14110    #[simd_test(enable = "avx512bw")]
14111    const fn test_mm512_maskz_max_epu16() {
14112        #[rustfmt::skip]
14113        let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14114                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14115        #[rustfmt::skip]
14116        let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14117                                 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14118        let r = _mm512_maskz_max_epu16(0, a, b);
14119        assert_eq_m512i(r, _mm512_setzero_si512());
14120        let r = _mm512_maskz_max_epu16(0b00000000_11111111_00000000_11111111, a, b);
14121        #[rustfmt::skip]
14122        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
14123                                 0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
14124        assert_eq_m512i(r, e);
14125    }
14126
14127    #[simd_test(enable = "avx512bw,avx512vl")]
14128    const fn test_mm256_mask_max_epu16() {
14129        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14130        let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14131        let r = _mm256_mask_max_epu16(a, 0, a, b);
14132        assert_eq_m256i(r, a);
14133        let r = _mm256_mask_max_epu16(a, 0b00000000_11111111, a, b);
14134        let e = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14135        assert_eq_m256i(r, e);
14136    }
14137
14138    #[simd_test(enable = "avx512bw,avx512vl")]
14139    const fn test_mm256_maskz_max_epu16() {
14140        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14141        let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14142        let r = _mm256_maskz_max_epu16(0, a, b);
14143        assert_eq_m256i(r, _mm256_setzero_si256());
14144        let r = _mm256_maskz_max_epu16(0b00000000_11111111, a, b);
14145        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
14146        assert_eq_m256i(r, e);
14147    }
14148
14149    #[simd_test(enable = "avx512bw,avx512vl")]
14150    const fn test_mm_mask_max_epu16() {
14151        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
14152        let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0);
14153        let r = _mm_mask_max_epu16(a, 0, a, b);
14154        assert_eq_m128i(r, a);
14155        let r = _mm_mask_max_epu16(a, 0b00001111, a, b);
14156        let e = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
14157        assert_eq_m128i(r, e);
14158    }
14159
14160    #[simd_test(enable = "avx512bw,avx512vl")]
14161    const fn test_mm_maskz_max_epu16() {
14162        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
14163        let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0);
14164        let r = _mm_maskz_max_epu16(0, a, b);
14165        assert_eq_m128i(r, _mm_setzero_si128());
14166        let r = _mm_maskz_max_epu16(0b00001111, a, b);
14167        let e = _mm_set_epi16(0, 0, 0, 0, 4, 5, 6, 7);
14168        assert_eq_m128i(r, e);
14169    }
14170
14171    #[simd_test(enable = "avx512bw")]
14172    const fn test_mm512_max_epu8() {
14173        #[rustfmt::skip]
14174        let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14175                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14176                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14177                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14178        #[rustfmt::skip]
14179        let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14180                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14181                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14182                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14183        let r = _mm512_max_epu8(a, b);
14184        #[rustfmt::skip]
14185        let e = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15,
14186                                15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15,
14187                                15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15,
14188                                15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15);
14189        assert_eq_m512i(r, e);
14190    }
14191
14192    #[simd_test(enable = "avx512bw")]
14193    const fn test_mm512_mask_max_epu8() {
14194        #[rustfmt::skip]
14195        let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14196                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14197                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14198                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14199        #[rustfmt::skip]
14200        let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14201                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14202                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14203                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14204        let r = _mm512_mask_max_epu8(a, 0, a, b);
14205        assert_eq_m512i(r, a);
14206        let r = _mm512_mask_max_epu8(
14207            a,
14208            0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
14209            a,
14210            b,
14211        );
14212        #[rustfmt::skip]
14213        let e = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14214                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14215                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14216                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14217        assert_eq_m512i(r, e);
14218    }
14219
14220    #[simd_test(enable = "avx512bw")]
14221    const fn test_mm512_maskz_max_epu8() {
14222        #[rustfmt::skip]
14223        let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14224                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14225                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14226                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14227        #[rustfmt::skip]
14228        let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14229                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14230                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14231                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14232        let r = _mm512_maskz_max_epu8(0, a, b);
14233        assert_eq_m512i(r, _mm512_setzero_si512());
14234        let r = _mm512_maskz_max_epu8(
14235            0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
14236            a,
14237            b,
14238        );
14239        #[rustfmt::skip]
14240        let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
14241                                0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
14242                                0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
14243                                0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
14244        assert_eq_m512i(r, e);
14245    }
14246
14247    #[simd_test(enable = "avx512bw,avx512vl")]
14248    const fn test_mm256_mask_max_epu8() {
14249        #[rustfmt::skip]
14250        let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14251                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14252        #[rustfmt::skip]
14253        let b = _mm256_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14254                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14255        let r = _mm256_mask_max_epu8(a, 0, a, b);
14256        assert_eq_m256i(r, a);
14257        let r = _mm256_mask_max_epu8(a, 0b00000000_11111111_00000000_11111111, a, b);
14258        #[rustfmt::skip]
14259        let e = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14260                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14261        assert_eq_m256i(r, e);
14262    }
14263
14264    #[simd_test(enable = "avx512bw,avx512vl")]
14265    const fn test_mm256_maskz_max_epu8() {
14266        #[rustfmt::skip]
14267        let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14268                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14269        #[rustfmt::skip]
14270        let b = _mm256_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14271                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14272        let r = _mm256_maskz_max_epu8(0, a, b);
14273        assert_eq_m256i(r, _mm256_setzero_si256());
14274        let r = _mm256_maskz_max_epu8(0b00000000_11111111_00000000_11111111, a, b);
14275        #[rustfmt::skip]
14276        let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
14277                                0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
14278        assert_eq_m256i(r, e);
14279    }
14280
14281    #[simd_test(enable = "avx512bw,avx512vl")]
14282    const fn test_mm_mask_max_epu8() {
14283        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14284        let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14285        let r = _mm_mask_max_epu8(a, 0, a, b);
14286        assert_eq_m128i(r, a);
14287        let r = _mm_mask_max_epu8(a, 0b00000000_11111111, a, b);
14288        let e = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14289        assert_eq_m128i(r, e);
14290    }
14291
14292    #[simd_test(enable = "avx512bw,avx512vl")]
14293    const fn test_mm_maskz_max_epu8() {
14294        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14295        let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14296        let r = _mm_maskz_max_epu8(0, a, b);
14297        assert_eq_m128i(r, _mm_setzero_si128());
14298        let r = _mm_maskz_max_epu8(0b00000000_11111111, a, b);
14299        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
14300        assert_eq_m128i(r, e);
14301    }
14302
14303    #[simd_test(enable = "avx512bw")]
14304    const fn test_mm512_max_epi16() {
14305        #[rustfmt::skip]
14306        let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14307                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14308        #[rustfmt::skip]
14309        let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14310                                 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14311        let r = _mm512_max_epi16(a, b);
14312        #[rustfmt::skip]
14313        let e = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15,
14314                                 15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15);
14315        assert_eq_m512i(r, e);
14316    }
14317
14318    #[simd_test(enable = "avx512bw")]
14319    const fn test_mm512_mask_max_epi16() {
14320        #[rustfmt::skip]
14321        let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14322                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14323        #[rustfmt::skip]
14324        let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14325                                 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14326        let r = _mm512_mask_max_epi16(a, 0, a, b);
14327        assert_eq_m512i(r, a);
14328        let r = _mm512_mask_max_epi16(a, 0b00000000_11111111_00000000_11111111, a, b);
14329        #[rustfmt::skip]
14330        let e = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14331                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14332        assert_eq_m512i(r, e);
14333    }
14334
14335    #[simd_test(enable = "avx512bw")]
14336    const fn test_mm512_maskz_max_epi16() {
14337        #[rustfmt::skip]
14338        let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14339                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14340        #[rustfmt::skip]
14341        let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14342                                 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14343        let r = _mm512_maskz_max_epi16(0, a, b);
14344        assert_eq_m512i(r, _mm512_setzero_si512());
14345        let r = _mm512_maskz_max_epi16(0b00000000_11111111_00000000_11111111, a, b);
14346        #[rustfmt::skip]
14347        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
14348                                 0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
14349        assert_eq_m512i(r, e);
14350    }
14351
14352    #[simd_test(enable = "avx512bw,avx512vl")]
14353    const fn test_mm256_mask_max_epi16() {
14354        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14355        let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14356        let r = _mm256_mask_max_epi16(a, 0, a, b);
14357        assert_eq_m256i(r, a);
14358        let r = _mm256_mask_max_epi16(a, 0b00000000_11111111, a, b);
14359        let e = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14360        assert_eq_m256i(r, e);
14361    }
14362
14363    #[simd_test(enable = "avx512bw,avx512vl")]
14364    const fn test_mm256_maskz_max_epi16() {
14365        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14366        let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14367        let r = _mm256_maskz_max_epi16(0, a, b);
14368        assert_eq_m256i(r, _mm256_setzero_si256());
14369        let r = _mm256_maskz_max_epi16(0b00000000_11111111, a, b);
14370        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
14371        assert_eq_m256i(r, e);
14372    }
14373
14374    #[simd_test(enable = "avx512bw,avx512vl")]
14375    const fn test_mm_mask_max_epi16() {
14376        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
14377        let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0);
14378        let r = _mm_mask_max_epi16(a, 0, a, b);
14379        assert_eq_m128i(r, a);
14380        let r = _mm_mask_max_epi16(a, 0b00001111, a, b);
14381        let e = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
14382        assert_eq_m128i(r, e);
14383    }
14384
14385    #[simd_test(enable = "avx512bw,avx512vl")]
14386    const fn test_mm_maskz_max_epi16() {
14387        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
14388        let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0);
14389        let r = _mm_maskz_max_epi16(0, a, b);
14390        assert_eq_m128i(r, _mm_setzero_si128());
14391        let r = _mm_maskz_max_epi16(0b00001111, a, b);
14392        let e = _mm_set_epi16(0, 0, 0, 0, 4, 5, 6, 7);
14393        assert_eq_m128i(r, e);
14394    }
14395
14396    #[simd_test(enable = "avx512bw")]
14397    const fn test_mm512_max_epi8() {
14398        #[rustfmt::skip]
14399        let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14400                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14401                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14402                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14403        #[rustfmt::skip]
14404        let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14405                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14406                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14407                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14408        let r = _mm512_max_epi8(a, b);
14409        #[rustfmt::skip]
14410        let e = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15,
14411                                15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15,
14412                                15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15,
14413                                15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15);
14414        assert_eq_m512i(r, e);
14415    }
14416
14417    #[simd_test(enable = "avx512bw")]
14418    const fn test_mm512_mask_max_epi8() {
14419        #[rustfmt::skip]
14420        let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14421                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14422                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14423                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14424        #[rustfmt::skip]
14425        let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14426                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14427                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14428                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14429        let r = _mm512_mask_max_epi8(a, 0, a, b);
14430        assert_eq_m512i(r, a);
14431        let r = _mm512_mask_max_epi8(
14432            a,
14433            0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
14434            a,
14435            b,
14436        );
14437        #[rustfmt::skip]
14438        let e = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14439                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14440                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14441                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14442        assert_eq_m512i(r, e);
14443    }
14444
14445    #[simd_test(enable = "avx512bw")]
14446    const fn test_mm512_maskz_max_epi8() {
14447        #[rustfmt::skip]
14448        let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14449                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14450                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14451                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14452        #[rustfmt::skip]
14453        let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14454                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14455                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14456                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14457        let r = _mm512_maskz_max_epi8(0, a, b);
14458        assert_eq_m512i(r, _mm512_setzero_si512());
14459        let r = _mm512_maskz_max_epi8(
14460            0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
14461            a,
14462            b,
14463        );
14464        #[rustfmt::skip]
14465        let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
14466                                0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
14467                                0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
14468                                0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
14469        assert_eq_m512i(r, e);
14470    }
14471
14472    #[simd_test(enable = "avx512bw,avx512vl")]
14473    const fn test_mm256_mask_max_epi8() {
14474        #[rustfmt::skip]
14475        let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14476                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14477        #[rustfmt::skip]
14478        let b = _mm256_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14479                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14480        let r = _mm256_mask_max_epi8(a, 0, a, b);
14481        assert_eq_m256i(r, a);
14482        let r = _mm256_mask_max_epi8(a, 0b00000000_11111111_00000000_11111111, a, b);
14483        #[rustfmt::skip]
14484        let e = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14485                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14486        assert_eq_m256i(r, e);
14487    }
14488
14489    #[simd_test(enable = "avx512bw,avx512vl")]
14490    const fn test_mm256_maskz_max_epi8() {
14491        #[rustfmt::skip]
14492        let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14493                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14494        #[rustfmt::skip]
14495        let b = _mm256_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14496                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14497        let r = _mm256_maskz_max_epi8(0, a, b);
14498        assert_eq_m256i(r, _mm256_setzero_si256());
14499        let r = _mm256_maskz_max_epi8(0b00000000_11111111_00000000_11111111, a, b);
14500        #[rustfmt::skip]
14501        let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
14502                                0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
14503        assert_eq_m256i(r, e);
14504    }
14505
14506    #[simd_test(enable = "avx512bw,avx512vl")]
14507    const fn test_mm_mask_max_epi8() {
14508        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14509        let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14510        let r = _mm_mask_max_epi8(a, 0, a, b);
14511        assert_eq_m128i(r, a);
14512        let r = _mm_mask_max_epi8(a, 0b00000000_11111111, a, b);
14513        let e = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14514        assert_eq_m128i(r, e);
14515    }
14516
14517    #[simd_test(enable = "avx512bw,avx512vl")]
14518    const fn test_mm_maskz_max_epi8() {
14519        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14520        let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14521        let r = _mm_maskz_max_epi8(0, a, b);
14522        assert_eq_m128i(r, _mm_setzero_si128());
14523        let r = _mm_maskz_max_epi8(0b00000000_11111111, a, b);
14524        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
14525        assert_eq_m128i(r, e);
14526    }
14527
14528    #[simd_test(enable = "avx512bw")]
14529    const fn test_mm512_min_epu16() {
14530        #[rustfmt::skip]
14531        let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14532                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14533        #[rustfmt::skip]
14534        let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14535                                 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14536        let r = _mm512_min_epu16(a, b);
14537        #[rustfmt::skip]
14538        let e = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14539                                 0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
14540        assert_eq_m512i(r, e);
14541    }
14542
14543    #[simd_test(enable = "avx512bw")]
14544    const fn test_mm512_mask_min_epu16() {
14545        #[rustfmt::skip]
14546        let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14547                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14548        #[rustfmt::skip]
14549        let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14550                                 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14551        let r = _mm512_mask_min_epu16(a, 0, a, b);
14552        assert_eq_m512i(r, a);
14553        let r = _mm512_mask_min_epu16(a, 0b00000000_11111111_00000000_11111111, a, b);
14554        #[rustfmt::skip]
14555        let e = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14556                                 0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
14557        assert_eq_m512i(r, e);
14558    }
14559
14560    #[simd_test(enable = "avx512bw")]
14561    const fn test_mm512_maskz_min_epu16() {
14562        #[rustfmt::skip]
14563        let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14564                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14565        #[rustfmt::skip]
14566        let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14567                                 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14568        let r = _mm512_maskz_min_epu16(0, a, b);
14569        assert_eq_m512i(r, _mm512_setzero_si512());
14570        let r = _mm512_maskz_min_epu16(0b00000000_11111111_00000000_11111111, a, b);
14571        #[rustfmt::skip]
14572        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
14573                                 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
14574        assert_eq_m512i(r, e);
14575    }
14576
14577    #[simd_test(enable = "avx512bw,avx512vl")]
14578    const fn test_mm256_mask_min_epu16() {
14579        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14580        let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14581        let r = _mm256_mask_min_epu16(a, 0, a, b);
14582        assert_eq_m256i(r, a);
14583        let r = _mm256_mask_min_epu16(a, 0b00000000_11111111, a, b);
14584        let e = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
14585        assert_eq_m256i(r, e);
14586    }
14587
14588    #[simd_test(enable = "avx512bw,avx512vl")]
14589    const fn test_mm256_maskz_min_epu16() {
14590        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14591        let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14592        let r = _mm256_maskz_min_epu16(0, a, b);
14593        assert_eq_m256i(r, _mm256_setzero_si256());
14594        let r = _mm256_maskz_min_epu16(0b00000000_11111111, a, b);
14595        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
14596        assert_eq_m256i(r, e);
14597    }
14598
14599    #[simd_test(enable = "avx512bw,avx512vl")]
14600    const fn test_mm_mask_min_epu16() {
14601        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
14602        let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0);
14603        let r = _mm_mask_min_epu16(a, 0, a, b);
14604        assert_eq_m128i(r, a);
14605        let r = _mm_mask_min_epu16(a, 0b00001111, a, b);
14606        let e = _mm_set_epi16(0, 1, 2, 3, 3, 2, 1, 0);
14607        assert_eq_m128i(r, e);
14608    }
14609
14610    #[simd_test(enable = "avx512bw,avx512vl")]
14611    const fn test_mm_maskz_min_epu16() {
14612        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
14613        let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0);
14614        let r = _mm_maskz_min_epu16(0, a, b);
14615        assert_eq_m128i(r, _mm_setzero_si128());
14616        let r = _mm_maskz_min_epu16(0b00001111, a, b);
14617        let e = _mm_set_epi16(0, 0, 0, 0, 3, 2, 1, 0);
14618        assert_eq_m128i(r, e);
14619    }
14620
14621    #[simd_test(enable = "avx512bw")]
14622    const fn test_mm512_min_epu8() {
14623        #[rustfmt::skip]
14624        let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14625                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14626                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14627                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14628        #[rustfmt::skip]
14629        let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14630                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14631                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14632                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14633        let r = _mm512_min_epu8(a, b);
14634        #[rustfmt::skip]
14635        let e = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14636                                0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14637                                0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14638                                0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
14639        assert_eq_m512i(r, e);
14640    }
14641
14642    #[simd_test(enable = "avx512bw")]
14643    const fn test_mm512_mask_min_epu8() {
14644        #[rustfmt::skip]
14645        let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14646                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14647                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14648                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14649        #[rustfmt::skip]
14650        let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14651                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14652                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14653                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14654        let r = _mm512_mask_min_epu8(a, 0, a, b);
14655        assert_eq_m512i(r, a);
14656        let r = _mm512_mask_min_epu8(
14657            a,
14658            0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
14659            a,
14660            b,
14661        );
14662        #[rustfmt::skip]
14663        let e = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14664                                0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14665                                0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14666                                0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
14667        assert_eq_m512i(r, e);
14668    }
14669
14670    #[simd_test(enable = "avx512bw")]
14671    const fn test_mm512_maskz_min_epu8() {
14672        #[rustfmt::skip]
14673        let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14674                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14675                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14676                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14677        #[rustfmt::skip]
14678        let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14679                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14680                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14681                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14682        let r = _mm512_maskz_min_epu8(0, a, b);
14683        assert_eq_m512i(r, _mm512_setzero_si512());
14684        let r = _mm512_maskz_min_epu8(
14685            0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
14686            a,
14687            b,
14688        );
14689        #[rustfmt::skip]
14690        let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
14691                                0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
14692                                0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
14693                                0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
14694        assert_eq_m512i(r, e);
14695    }
14696
14697    #[simd_test(enable = "avx512bw,avx512vl")]
14698    const fn test_mm256_mask_min_epu8() {
14699        #[rustfmt::skip]
14700        let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14701                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14702        #[rustfmt::skip]
14703        let b = _mm256_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14704                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14705        let r = _mm256_mask_min_epu8(a, 0, a, b);
14706        assert_eq_m256i(r, a);
14707        let r = _mm256_mask_min_epu8(a, 0b00000000_11111111_00000000_11111111, a, b);
14708        #[rustfmt::skip]
14709        let e = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14710                                0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
14711        assert_eq_m256i(r, e);
14712    }
14713
14714    #[simd_test(enable = "avx512bw,avx512vl")]
14715    const fn test_mm256_maskz_min_epu8() {
14716        #[rustfmt::skip]
14717        let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14718                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14719        #[rustfmt::skip]
14720        let b = _mm256_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14721                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14722        let r = _mm256_maskz_min_epu8(0, a, b);
14723        assert_eq_m256i(r, _mm256_setzero_si256());
14724        let r = _mm256_maskz_min_epu8(0b00000000_11111111_00000000_11111111, a, b);
14725        #[rustfmt::skip]
14726        let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
14727                                0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
14728        assert_eq_m256i(r, e);
14729    }
14730
14731    #[simd_test(enable = "avx512bw,avx512vl")]
14732    const fn test_mm_mask_min_epu8() {
14733        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14734        let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14735        let r = _mm_mask_min_epu8(a, 0, a, b);
14736        assert_eq_m128i(r, a);
14737        let r = _mm_mask_min_epu8(a, 0b00000000_11111111, a, b);
14738        let e = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
14739        assert_eq_m128i(r, e);
14740    }
14741
14742    #[simd_test(enable = "avx512bw,avx512vl")]
14743    const fn test_mm_maskz_min_epu8() {
14744        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14745        let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14746        let r = _mm_maskz_min_epu8(0, a, b);
14747        assert_eq_m128i(r, _mm_setzero_si128());
14748        let r = _mm_maskz_min_epu8(0b00000000_11111111, a, b);
14749        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
14750        assert_eq_m128i(r, e);
14751    }
14752
14753    #[simd_test(enable = "avx512bw")]
14754    const fn test_mm512_min_epi16() {
14755        #[rustfmt::skip]
14756        let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14757                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14758        #[rustfmt::skip]
14759        let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14760                                 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14761        let r = _mm512_min_epi16(a, b);
14762        #[rustfmt::skip]
14763        let e = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14764                                 0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
14765        assert_eq_m512i(r, e);
14766    }
14767
14768    #[simd_test(enable = "avx512bw")]
14769    const fn test_mm512_mask_min_epi16() {
14770        #[rustfmt::skip]
14771        let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14772                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14773        #[rustfmt::skip]
14774        let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14775                                 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14776        let r = _mm512_mask_min_epi16(a, 0, a, b);
14777        assert_eq_m512i(r, a);
14778        let r = _mm512_mask_min_epi16(a, 0b00000000_11111111_00000000_11111111, a, b);
14779        #[rustfmt::skip]
14780        let e = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14781                                 0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
14782        assert_eq_m512i(r, e);
14783    }
14784
14785    #[simd_test(enable = "avx512bw")]
14786    const fn test_mm512_maskz_min_epi16() {
14787        #[rustfmt::skip]
14788        let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14789                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14790        #[rustfmt::skip]
14791        let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14792                                 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14793        let r = _mm512_maskz_min_epi16(0, a, b);
14794        assert_eq_m512i(r, _mm512_setzero_si512());
14795        let r = _mm512_maskz_min_epi16(0b00000000_11111111_00000000_11111111, a, b);
14796        #[rustfmt::skip]
14797        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
14798                                 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
14799        assert_eq_m512i(r, e);
14800    }
14801
14802    #[simd_test(enable = "avx512bw,avx512vl")]
14803    const fn test_mm256_mask_min_epi16() {
14804        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14805        let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14806        let r = _mm256_mask_min_epi16(a, 0, a, b);
14807        assert_eq_m256i(r, a);
14808        let r = _mm256_mask_min_epi16(a, 0b00000000_11111111, a, b);
14809        let e = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
14810        assert_eq_m256i(r, e);
14811    }
14812
14813    #[simd_test(enable = "avx512bw,avx512vl")]
14814    const fn test_mm256_maskz_min_epi16() {
14815        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14816        let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14817        let r = _mm256_maskz_min_epi16(0, a, b);
14818        assert_eq_m256i(r, _mm256_setzero_si256());
14819        let r = _mm256_maskz_min_epi16(0b00000000_11111111, a, b);
14820        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
14821        assert_eq_m256i(r, e);
14822    }
14823
14824    #[simd_test(enable = "avx512bw,avx512vl")]
14825    const fn test_mm_mask_min_epi16() {
14826        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
14827        let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0);
14828        let r = _mm_mask_min_epi16(a, 0, a, b);
14829        assert_eq_m128i(r, a);
14830        let r = _mm_mask_min_epi16(a, 0b00001111, a, b);
14831        let e = _mm_set_epi16(0, 1, 2, 3, 3, 2, 1, 0);
14832        assert_eq_m128i(r, e);
14833    }
14834
14835    #[simd_test(enable = "avx512bw,avx512vl")]
14836    const fn test_mm_maskz_min_epi16() {
14837        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
14838        let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0);
14839        let r = _mm_maskz_min_epi16(0, a, b);
14840        assert_eq_m128i(r, _mm_setzero_si128());
14841        let r = _mm_maskz_min_epi16(0b00001111, a, b);
14842        let e = _mm_set_epi16(0, 0, 0, 0, 3, 2, 1, 0);
14843        assert_eq_m128i(r, e);
14844    }
14845
14846    #[simd_test(enable = "avx512bw")]
14847    const fn test_mm512_min_epi8() {
14848        #[rustfmt::skip]
14849        let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14850                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14851                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14852                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14853        #[rustfmt::skip]
14854        let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14855                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14856                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14857                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14858        let r = _mm512_min_epi8(a, b);
14859        #[rustfmt::skip]
14860        let e = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14861                                0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14862                                0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14863                                0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
14864        assert_eq_m512i(r, e);
14865    }
14866
14867    #[simd_test(enable = "avx512bw")]
14868    const fn test_mm512_mask_min_epi8() {
14869        #[rustfmt::skip]
14870        let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14871                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14872                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14873                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14874        #[rustfmt::skip]
14875        let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14876                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14877                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14878                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14879        let r = _mm512_mask_min_epi8(a, 0, a, b);
14880        assert_eq_m512i(r, a);
14881        let r = _mm512_mask_min_epi8(
14882            a,
14883            0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
14884            a,
14885            b,
14886        );
14887        #[rustfmt::skip]
14888        let e = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14889                                0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14890                                0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14891                                0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
14892        assert_eq_m512i(r, e);
14893    }
14894
14895    #[simd_test(enable = "avx512bw")]
14896    const fn test_mm512_maskz_min_epi8() {
14897        #[rustfmt::skip]
14898        let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14899                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14900                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14901                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14902        #[rustfmt::skip]
14903        let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14904                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14905                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14906                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14907        let r = _mm512_maskz_min_epi8(0, a, b);
14908        assert_eq_m512i(r, _mm512_setzero_si512());
14909        let r = _mm512_maskz_min_epi8(
14910            0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
14911            a,
14912            b,
14913        );
14914        #[rustfmt::skip]
14915        let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
14916                                0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
14917                                0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
14918                                0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
14919        assert_eq_m512i(r, e);
14920    }
14921
14922    #[simd_test(enable = "avx512bw,avx512vl")]
14923    const fn test_mm256_mask_min_epi8() {
14924        #[rustfmt::skip]
14925        let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14926                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14927        #[rustfmt::skip]
14928        let b = _mm256_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14929                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14930        let r = _mm256_mask_min_epi8(a, 0, a, b);
14931        assert_eq_m256i(r, a);
14932        let r = _mm256_mask_min_epi8(a, 0b00000000_11111111_00000000_11111111, a, b);
14933        #[rustfmt::skip]
14934        let e = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
14935                                0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
14936        assert_eq_m256i(r, e);
14937    }
14938
14939    #[simd_test(enable = "avx512bw,avx512vl")]
14940    const fn test_mm256_maskz_min_epi8() {
14941        #[rustfmt::skip]
14942        let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
14943                                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14944        #[rustfmt::skip]
14945        let b = _mm256_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
14946                                15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14947        let r = _mm256_maskz_min_epi8(0, a, b);
14948        assert_eq_m256i(r, _mm256_setzero_si256());
14949        let r = _mm256_maskz_min_epi8(0b00000000_11111111_00000000_11111111, a, b);
14950        #[rustfmt::skip]
14951        let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
14952                                0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
14953        assert_eq_m256i(r, e);
14954    }
14955
14956    #[simd_test(enable = "avx512bw,avx512vl")]
14957    const fn test_mm_mask_min_epi8() {
14958        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14959        let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14960        let r = _mm_mask_min_epi8(a, 0, a, b);
14961        assert_eq_m128i(r, a);
14962        let r = _mm_mask_min_epi8(a, 0b00000000_11111111, a, b);
14963        let e = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
14964        assert_eq_m128i(r, e);
14965    }
14966
14967    #[simd_test(enable = "avx512bw,avx512vl")]
14968    const fn test_mm_maskz_min_epi8() {
14969        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
14970        let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
14971        let r = _mm_maskz_min_epi8(0, a, b);
14972        assert_eq_m128i(r, _mm_setzero_si128());
14973        let r = _mm_maskz_min_epi8(0b00000000_11111111, a, b);
14974        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
14975        assert_eq_m128i(r, e);
14976    }
14977
14978    #[simd_test(enable = "avx512bw")]
14979    const fn test_mm512_cmplt_epu16_mask() {
14980        let a = _mm512_set1_epi16(-2);
14981        let b = _mm512_set1_epi16(-1);
14982        let m = _mm512_cmplt_epu16_mask(a, b);
14983        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
14984    }
14985
14986    #[simd_test(enable = "avx512bw")]
14987    const fn test_mm512_mask_cmplt_epu16_mask() {
14988        let a = _mm512_set1_epi16(-2);
14989        let b = _mm512_set1_epi16(-1);
14990        let mask = 0b01010101_01010101_01010101_01010101;
14991        let r = _mm512_mask_cmplt_epu16_mask(mask, a, b);
14992        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
14993    }
14994
14995    #[simd_test(enable = "avx512bw,avx512vl")]
14996    const fn test_mm256_cmplt_epu16_mask() {
14997        let a = _mm256_set1_epi16(-2);
14998        let b = _mm256_set1_epi16(-1);
14999        let m = _mm256_cmplt_epu16_mask(a, b);
15000        assert_eq!(m, 0b11111111_11111111);
15001    }
15002
15003    #[simd_test(enable = "avx512bw,avx512vl")]
15004    const fn test_mm256_mask_cmplt_epu16_mask() {
15005        let a = _mm256_set1_epi16(-2);
15006        let b = _mm256_set1_epi16(-1);
15007        let mask = 0b01010101_01010101;
15008        let r = _mm256_mask_cmplt_epu16_mask(mask, a, b);
15009        assert_eq!(r, 0b01010101_01010101);
15010    }
15011
15012    #[simd_test(enable = "avx512bw,avx512vl")]
15013    const fn test_mm_cmplt_epu16_mask() {
15014        let a = _mm_set1_epi16(-2);
15015        let b = _mm_set1_epi16(-1);
15016        let m = _mm_cmplt_epu16_mask(a, b);
15017        assert_eq!(m, 0b11111111);
15018    }
15019
15020    #[simd_test(enable = "avx512bw,avx512vl")]
15021    const fn test_mm_mask_cmplt_epu16_mask() {
15022        let a = _mm_set1_epi16(-2);
15023        let b = _mm_set1_epi16(-1);
15024        let mask = 0b01010101;
15025        let r = _mm_mask_cmplt_epu16_mask(mask, a, b);
15026        assert_eq!(r, 0b01010101);
15027    }
15028
15029    #[simd_test(enable = "avx512bw")]
15030    const fn test_mm512_cmplt_epu8_mask() {
15031        let a = _mm512_set1_epi8(-2);
15032        let b = _mm512_set1_epi8(-1);
15033        let m = _mm512_cmplt_epu8_mask(a, b);
15034        assert_eq!(
15035            m,
15036            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
15037        );
15038    }
15039
15040    #[simd_test(enable = "avx512bw")]
15041    const fn test_mm512_mask_cmplt_epu8_mask() {
15042        let a = _mm512_set1_epi8(-2);
15043        let b = _mm512_set1_epi8(-1);
15044        let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
15045        let r = _mm512_mask_cmplt_epu8_mask(mask, a, b);
15046        assert_eq!(
15047            r,
15048            0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
15049        );
15050    }
15051
15052    #[simd_test(enable = "avx512bw,avx512vl")]
15053    const fn test_mm256_cmplt_epu8_mask() {
15054        let a = _mm256_set1_epi8(-2);
15055        let b = _mm256_set1_epi8(-1);
15056        let m = _mm256_cmplt_epu8_mask(a, b);
15057        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15058    }
15059
15060    #[simd_test(enable = "avx512bw,avx512vl")]
15061    const fn test_mm256_mask_cmplt_epu8_mask() {
15062        let a = _mm256_set1_epi8(-2);
15063        let b = _mm256_set1_epi8(-1);
15064        let mask = 0b01010101_01010101_01010101_01010101;
15065        let r = _mm256_mask_cmplt_epu8_mask(mask, a, b);
15066        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15067    }
15068
15069    #[simd_test(enable = "avx512bw,avx512vl")]
15070    const fn test_mm_cmplt_epu8_mask() {
15071        let a = _mm_set1_epi8(-2);
15072        let b = _mm_set1_epi8(-1);
15073        let m = _mm_cmplt_epu8_mask(a, b);
15074        assert_eq!(m, 0b11111111_11111111);
15075    }
15076
15077    #[simd_test(enable = "avx512bw,avx512vl")]
15078    const fn test_mm_mask_cmplt_epu8_mask() {
15079        let a = _mm_set1_epi8(-2);
15080        let b = _mm_set1_epi8(-1);
15081        let mask = 0b01010101_01010101;
15082        let r = _mm_mask_cmplt_epu8_mask(mask, a, b);
15083        assert_eq!(r, 0b01010101_01010101);
15084    }
15085
15086    #[simd_test(enable = "avx512bw")]
15087    const fn test_mm512_cmplt_epi16_mask() {
15088        let a = _mm512_set1_epi16(-2);
15089        let b = _mm512_set1_epi16(-1);
15090        let m = _mm512_cmplt_epi16_mask(a, b);
15091        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15092    }
15093
15094    #[simd_test(enable = "avx512bw")]
15095    const fn test_mm512_mask_cmplt_epi16_mask() {
15096        let a = _mm512_set1_epi16(-2);
15097        let b = _mm512_set1_epi16(-1);
15098        let mask = 0b01010101_01010101_01010101_01010101;
15099        let r = _mm512_mask_cmplt_epi16_mask(mask, a, b);
15100        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15101    }
15102
15103    #[simd_test(enable = "avx512bw,avx512vl")]
15104    const fn test_mm256_cmplt_epi16_mask() {
15105        let a = _mm256_set1_epi16(-2);
15106        let b = _mm256_set1_epi16(-1);
15107        let m = _mm256_cmplt_epi16_mask(a, b);
15108        assert_eq!(m, 0b11111111_11111111);
15109    }
15110
15111    #[simd_test(enable = "avx512bw,avx512vl")]
15112    const fn test_mm256_mask_cmplt_epi16_mask() {
15113        let a = _mm256_set1_epi16(-2);
15114        let b = _mm256_set1_epi16(-1);
15115        let mask = 0b01010101_01010101;
15116        let r = _mm256_mask_cmplt_epi16_mask(mask, a, b);
15117        assert_eq!(r, 0b01010101_01010101);
15118    }
15119
15120    #[simd_test(enable = "avx512bw,avx512vl")]
15121    const fn test_mm_cmplt_epi16_mask() {
15122        let a = _mm_set1_epi16(-2);
15123        let b = _mm_set1_epi16(-1);
15124        let m = _mm_cmplt_epi16_mask(a, b);
15125        assert_eq!(m, 0b11111111);
15126    }
15127
15128    #[simd_test(enable = "avx512bw,avx512vl")]
15129    const fn test_mm_mask_cmplt_epi16_mask() {
15130        let a = _mm_set1_epi16(-2);
15131        let b = _mm_set1_epi16(-1);
15132        let mask = 0b01010101;
15133        let r = _mm_mask_cmplt_epi16_mask(mask, a, b);
15134        assert_eq!(r, 0b01010101);
15135    }
15136
15137    #[simd_test(enable = "avx512bw")]
15138    const fn test_mm512_cmplt_epi8_mask() {
15139        let a = _mm512_set1_epi8(-2);
15140        let b = _mm512_set1_epi8(-1);
15141        let m = _mm512_cmplt_epi8_mask(a, b);
15142        assert_eq!(
15143            m,
15144            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
15145        );
15146    }
15147
15148    #[simd_test(enable = "avx512bw")]
15149    const fn test_mm512_mask_cmplt_epi8_mask() {
15150        let a = _mm512_set1_epi8(-2);
15151        let b = _mm512_set1_epi8(-1);
15152        let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
15153        let r = _mm512_mask_cmplt_epi8_mask(mask, a, b);
15154        assert_eq!(
15155            r,
15156            0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
15157        );
15158    }
15159
15160    #[simd_test(enable = "avx512bw,avx512vl")]
15161    const fn test_mm256_cmplt_epi8_mask() {
15162        let a = _mm256_set1_epi8(-2);
15163        let b = _mm256_set1_epi8(-1);
15164        let m = _mm256_cmplt_epi8_mask(a, b);
15165        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15166    }
15167
15168    #[simd_test(enable = "avx512bw,avx512vl")]
15169    const fn test_mm256_mask_cmplt_epi8_mask() {
15170        let a = _mm256_set1_epi8(-2);
15171        let b = _mm256_set1_epi8(-1);
15172        let mask = 0b01010101_01010101_01010101_01010101;
15173        let r = _mm256_mask_cmplt_epi8_mask(mask, a, b);
15174        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15175    }
15176
15177    #[simd_test(enable = "avx512bw,avx512vl")]
15178    const fn test_mm_cmplt_epi8_mask() {
15179        let a = _mm_set1_epi8(-2);
15180        let b = _mm_set1_epi8(-1);
15181        let m = _mm_cmplt_epi8_mask(a, b);
15182        assert_eq!(m, 0b11111111_11111111);
15183    }
15184
15185    #[simd_test(enable = "avx512bw,avx512vl")]
15186    const fn test_mm_mask_cmplt_epi8_mask() {
15187        let a = _mm_set1_epi8(-2);
15188        let b = _mm_set1_epi8(-1);
15189        let mask = 0b01010101_01010101;
15190        let r = _mm_mask_cmplt_epi8_mask(mask, a, b);
15191        assert_eq!(r, 0b01010101_01010101);
15192    }
15193
15194    #[simd_test(enable = "avx512bw")]
15195    const fn test_mm512_cmpgt_epu16_mask() {
15196        let a = _mm512_set1_epi16(2);
15197        let b = _mm512_set1_epi16(1);
15198        let m = _mm512_cmpgt_epu16_mask(a, b);
15199        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15200    }
15201
15202    #[simd_test(enable = "avx512bw")]
15203    const fn test_mm512_mask_cmpgt_epu16_mask() {
15204        let a = _mm512_set1_epi16(2);
15205        let b = _mm512_set1_epi16(1);
15206        let mask = 0b01010101_01010101_01010101_01010101;
15207        let r = _mm512_mask_cmpgt_epu16_mask(mask, a, b);
15208        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15209    }
15210
15211    #[simd_test(enable = "avx512bw,avx512vl")]
15212    const fn test_mm256_cmpgt_epu16_mask() {
15213        let a = _mm256_set1_epi16(2);
15214        let b = _mm256_set1_epi16(1);
15215        let m = _mm256_cmpgt_epu16_mask(a, b);
15216        assert_eq!(m, 0b11111111_11111111);
15217    }
15218
15219    #[simd_test(enable = "avx512bw,avx512vl")]
15220    const fn test_mm256_mask_cmpgt_epu16_mask() {
15221        let a = _mm256_set1_epi16(2);
15222        let b = _mm256_set1_epi16(1);
15223        let mask = 0b01010101_01010101;
15224        let r = _mm256_mask_cmpgt_epu16_mask(mask, a, b);
15225        assert_eq!(r, 0b01010101_01010101);
15226    }
15227
15228    #[simd_test(enable = "avx512bw,avx512vl")]
15229    const fn test_mm_cmpgt_epu16_mask() {
15230        let a = _mm_set1_epi16(2);
15231        let b = _mm_set1_epi16(1);
15232        let m = _mm_cmpgt_epu16_mask(a, b);
15233        assert_eq!(m, 0b11111111);
15234    }
15235
15236    #[simd_test(enable = "avx512bw,avx512vl")]
15237    const fn test_mm_mask_cmpgt_epu16_mask() {
15238        let a = _mm_set1_epi16(2);
15239        let b = _mm_set1_epi16(1);
15240        let mask = 0b01010101;
15241        let r = _mm_mask_cmpgt_epu16_mask(mask, a, b);
15242        assert_eq!(r, 0b01010101);
15243    }
15244
15245    #[simd_test(enable = "avx512bw")]
15246    const fn test_mm512_cmpgt_epu8_mask() {
15247        let a = _mm512_set1_epi8(2);
15248        let b = _mm512_set1_epi8(1);
15249        let m = _mm512_cmpgt_epu8_mask(a, b);
15250        assert_eq!(
15251            m,
15252            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
15253        );
15254    }
15255
15256    #[simd_test(enable = "avx512bw")]
15257    const fn test_mm512_mask_cmpgt_epu8_mask() {
15258        let a = _mm512_set1_epi8(2);
15259        let b = _mm512_set1_epi8(1);
15260        let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
15261        let r = _mm512_mask_cmpgt_epu8_mask(mask, a, b);
15262        assert_eq!(
15263            r,
15264            0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
15265        );
15266    }
15267
15268    #[simd_test(enable = "avx512bw,avx512vl")]
15269    const fn test_mm256_cmpgt_epu8_mask() {
15270        let a = _mm256_set1_epi8(2);
15271        let b = _mm256_set1_epi8(1);
15272        let m = _mm256_cmpgt_epu8_mask(a, b);
15273        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15274    }
15275
15276    #[simd_test(enable = "avx512bw,avx512vl")]
15277    const fn test_mm256_mask_cmpgt_epu8_mask() {
15278        let a = _mm256_set1_epi8(2);
15279        let b = _mm256_set1_epi8(1);
15280        let mask = 0b01010101_01010101_01010101_01010101;
15281        let r = _mm256_mask_cmpgt_epu8_mask(mask, a, b);
15282        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15283    }
15284
15285    #[simd_test(enable = "avx512bw,avx512vl")]
15286    const fn test_mm_cmpgt_epu8_mask() {
15287        let a = _mm_set1_epi8(2);
15288        let b = _mm_set1_epi8(1);
15289        let m = _mm_cmpgt_epu8_mask(a, b);
15290        assert_eq!(m, 0b11111111_11111111);
15291    }
15292
15293    #[simd_test(enable = "avx512bw,avx512vl")]
15294    const fn test_mm_mask_cmpgt_epu8_mask() {
15295        let a = _mm_set1_epi8(2);
15296        let b = _mm_set1_epi8(1);
15297        let mask = 0b01010101_01010101;
15298        let r = _mm_mask_cmpgt_epu8_mask(mask, a, b);
15299        assert_eq!(r, 0b01010101_01010101);
15300    }
15301
15302    #[simd_test(enable = "avx512bw")]
15303    const fn test_mm512_cmpgt_epi16_mask() {
15304        let a = _mm512_set1_epi16(2);
15305        let b = _mm512_set1_epi16(-1);
15306        let m = _mm512_cmpgt_epi16_mask(a, b);
15307        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15308    }
15309
15310    #[simd_test(enable = "avx512bw")]
15311    const fn test_mm512_mask_cmpgt_epi16_mask() {
15312        let a = _mm512_set1_epi16(2);
15313        let b = _mm512_set1_epi16(-1);
15314        let mask = 0b01010101_01010101_01010101_01010101;
15315        let r = _mm512_mask_cmpgt_epi16_mask(mask, a, b);
15316        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15317    }
15318
15319    #[simd_test(enable = "avx512bw,avx512vl")]
15320    const fn test_mm256_cmpgt_epi16_mask() {
15321        let a = _mm256_set1_epi16(2);
15322        let b = _mm256_set1_epi16(-1);
15323        let m = _mm256_cmpgt_epi16_mask(a, b);
15324        assert_eq!(m, 0b11111111_11111111);
15325    }
15326
15327    #[simd_test(enable = "avx512bw,avx512vl")]
15328    const fn test_mm256_mask_cmpgt_epi16_mask() {
15329        let a = _mm256_set1_epi16(2);
15330        let b = _mm256_set1_epi16(-1);
15331        let mask = 0b001010101_01010101;
15332        let r = _mm256_mask_cmpgt_epi16_mask(mask, a, b);
15333        assert_eq!(r, 0b01010101_01010101);
15334    }
15335
15336    #[simd_test(enable = "avx512bw,avx512vl")]
15337    const fn test_mm_cmpgt_epi16_mask() {
15338        let a = _mm_set1_epi16(2);
15339        let b = _mm_set1_epi16(-1);
15340        let m = _mm_cmpgt_epi16_mask(a, b);
15341        assert_eq!(m, 0b11111111);
15342    }
15343
15344    #[simd_test(enable = "avx512bw,avx512vl")]
15345    const fn test_mm_mask_cmpgt_epi16_mask() {
15346        let a = _mm_set1_epi16(2);
15347        let b = _mm_set1_epi16(-1);
15348        let mask = 0b01010101;
15349        let r = _mm_mask_cmpgt_epi16_mask(mask, a, b);
15350        assert_eq!(r, 0b01010101);
15351    }
15352
15353    #[simd_test(enable = "avx512bw")]
15354    const fn test_mm512_cmpgt_epi8_mask() {
15355        let a = _mm512_set1_epi8(2);
15356        let b = _mm512_set1_epi8(-1);
15357        let m = _mm512_cmpgt_epi8_mask(a, b);
15358        assert_eq!(
15359            m,
15360            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
15361        );
15362    }
15363
15364    #[simd_test(enable = "avx512bw")]
15365    const fn test_mm512_mask_cmpgt_epi8_mask() {
15366        let a = _mm512_set1_epi8(2);
15367        let b = _mm512_set1_epi8(-1);
15368        let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
15369        let r = _mm512_mask_cmpgt_epi8_mask(mask, a, b);
15370        assert_eq!(
15371            r,
15372            0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
15373        );
15374    }
15375
15376    #[simd_test(enable = "avx512bw,avx512vl")]
15377    const fn test_mm256_cmpgt_epi8_mask() {
15378        let a = _mm256_set1_epi8(2);
15379        let b = _mm256_set1_epi8(-1);
15380        let m = _mm256_cmpgt_epi8_mask(a, b);
15381        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15382    }
15383
15384    #[simd_test(enable = "avx512bw,avx512vl")]
15385    const fn test_mm256_mask_cmpgt_epi8_mask() {
15386        let a = _mm256_set1_epi8(2);
15387        let b = _mm256_set1_epi8(-1);
15388        let mask = 0b01010101_01010101_01010101_01010101;
15389        let r = _mm256_mask_cmpgt_epi8_mask(mask, a, b);
15390        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15391    }
15392
15393    #[simd_test(enable = "avx512bw,avx512vl")]
15394    const fn test_mm_cmpgt_epi8_mask() {
15395        let a = _mm_set1_epi8(2);
15396        let b = _mm_set1_epi8(-1);
15397        let m = _mm_cmpgt_epi8_mask(a, b);
15398        assert_eq!(m, 0b11111111_11111111);
15399    }
15400
15401    #[simd_test(enable = "avx512bw,avx512vl")]
15402    const fn test_mm_mask_cmpgt_epi8_mask() {
15403        let a = _mm_set1_epi8(2);
15404        let b = _mm_set1_epi8(-1);
15405        let mask = 0b01010101_01010101;
15406        let r = _mm_mask_cmpgt_epi8_mask(mask, a, b);
15407        assert_eq!(r, 0b01010101_01010101);
15408    }
15409
15410    #[simd_test(enable = "avx512bw")]
15411    const fn test_mm512_cmple_epu16_mask() {
15412        let a = _mm512_set1_epi16(-1);
15413        let b = _mm512_set1_epi16(-1);
15414        let m = _mm512_cmple_epu16_mask(a, b);
15415        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15416    }
15417
15418    #[simd_test(enable = "avx512bw")]
15419    const fn test_mm512_mask_cmple_epu16_mask() {
15420        let a = _mm512_set1_epi16(-1);
15421        let b = _mm512_set1_epi16(-1);
15422        let mask = 0b01010101_01010101_01010101_01010101;
15423        let r = _mm512_mask_cmple_epu16_mask(mask, a, b);
15424        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15425    }
15426
15427    #[simd_test(enable = "avx512bw,avx512vl")]
15428    const fn test_mm256_cmple_epu16_mask() {
15429        let a = _mm256_set1_epi16(-1);
15430        let b = _mm256_set1_epi16(-1);
15431        let m = _mm256_cmple_epu16_mask(a, b);
15432        assert_eq!(m, 0b11111111_11111111);
15433    }
15434
15435    #[simd_test(enable = "avx512bw,avx512vl")]
15436    const fn test_mm256_mask_cmple_epu16_mask() {
15437        let a = _mm256_set1_epi16(-1);
15438        let b = _mm256_set1_epi16(-1);
15439        let mask = 0b01010101_01010101;
15440        let r = _mm256_mask_cmple_epu16_mask(mask, a, b);
15441        assert_eq!(r, 0b01010101_01010101);
15442    }
15443
15444    #[simd_test(enable = "avx512bw,avx512vl")]
15445    const fn test_mm_cmple_epu16_mask() {
15446        let a = _mm_set1_epi16(-1);
15447        let b = _mm_set1_epi16(-1);
15448        let m = _mm_cmple_epu16_mask(a, b);
15449        assert_eq!(m, 0b11111111);
15450    }
15451
15452    #[simd_test(enable = "avx512bw,avx512vl")]
15453    const fn test_mm_mask_cmple_epu16_mask() {
15454        let a = _mm_set1_epi16(-1);
15455        let b = _mm_set1_epi16(-1);
15456        let mask = 0b01010101;
15457        let r = _mm_mask_cmple_epu16_mask(mask, a, b);
15458        assert_eq!(r, 0b01010101);
15459    }
15460
15461    #[simd_test(enable = "avx512bw")]
15462    const fn test_mm512_cmple_epu8_mask() {
15463        let a = _mm512_set1_epi8(-1);
15464        let b = _mm512_set1_epi8(-1);
15465        let m = _mm512_cmple_epu8_mask(a, b);
15466        assert_eq!(
15467            m,
15468            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
15469        );
15470    }
15471
15472    #[simd_test(enable = "avx512bw")]
15473    const fn test_mm512_mask_cmple_epu8_mask() {
15474        let a = _mm512_set1_epi8(-1);
15475        let b = _mm512_set1_epi8(-1);
15476        let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
15477        let r = _mm512_mask_cmple_epu8_mask(mask, a, b);
15478        assert_eq!(
15479            r,
15480            0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
15481        );
15482    }
15483
15484    #[simd_test(enable = "avx512bw,avx512vl")]
15485    const fn test_mm256_cmple_epu8_mask() {
15486        let a = _mm256_set1_epi8(-1);
15487        let b = _mm256_set1_epi8(-1);
15488        let m = _mm256_cmple_epu8_mask(a, b);
15489        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15490    }
15491
15492    #[simd_test(enable = "avx512bw,avx512vl")]
15493    const fn test_mm256_mask_cmple_epu8_mask() {
15494        let a = _mm256_set1_epi8(-1);
15495        let b = _mm256_set1_epi8(-1);
15496        let mask = 0b01010101_01010101_01010101_01010101;
15497        let r = _mm256_mask_cmple_epu8_mask(mask, a, b);
15498        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15499    }
15500
15501    #[simd_test(enable = "avx512bw,avx512vl")]
15502    const fn test_mm_cmple_epu8_mask() {
15503        let a = _mm_set1_epi8(-1);
15504        let b = _mm_set1_epi8(-1);
15505        let m = _mm_cmple_epu8_mask(a, b);
15506        assert_eq!(m, 0b11111111_11111111);
15507    }
15508
15509    #[simd_test(enable = "avx512bw,avx512vl")]
15510    const fn test_mm_mask_cmple_epu8_mask() {
15511        let a = _mm_set1_epi8(-1);
15512        let b = _mm_set1_epi8(-1);
15513        let mask = 0b01010101_01010101;
15514        let r = _mm_mask_cmple_epu8_mask(mask, a, b);
15515        assert_eq!(r, 0b01010101_01010101);
15516    }
15517
15518    #[simd_test(enable = "avx512bw")]
15519    const fn test_mm512_cmple_epi16_mask() {
15520        let a = _mm512_set1_epi16(-1);
15521        let b = _mm512_set1_epi16(-1);
15522        let m = _mm512_cmple_epi16_mask(a, b);
15523        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15524    }
15525
15526    #[simd_test(enable = "avx512bw")]
15527    const fn test_mm512_mask_cmple_epi16_mask() {
15528        let a = _mm512_set1_epi16(-1);
15529        let b = _mm512_set1_epi16(-1);
15530        let mask = 0b01010101_01010101_01010101_01010101;
15531        let r = _mm512_mask_cmple_epi16_mask(mask, a, b);
15532        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15533    }
15534
15535    #[simd_test(enable = "avx512bw,avx512vl")]
15536    const fn test_mm256_cmple_epi16_mask() {
15537        let a = _mm256_set1_epi16(-1);
15538        let b = _mm256_set1_epi16(-1);
15539        let m = _mm256_cmple_epi16_mask(a, b);
15540        assert_eq!(m, 0b11111111_11111111);
15541    }
15542
15543    #[simd_test(enable = "avx512bw,avx512vl")]
15544    const fn test_mm256_mask_cmple_epi16_mask() {
15545        let a = _mm256_set1_epi16(-1);
15546        let b = _mm256_set1_epi16(-1);
15547        let mask = 0b01010101_01010101;
15548        let r = _mm256_mask_cmple_epi16_mask(mask, a, b);
15549        assert_eq!(r, 0b01010101_01010101);
15550    }
15551
15552    #[simd_test(enable = "avx512bw,avx512vl")]
15553    const fn test_mm_cmple_epi16_mask() {
15554        let a = _mm_set1_epi16(-1);
15555        let b = _mm_set1_epi16(-1);
15556        let m = _mm_cmple_epi16_mask(a, b);
15557        assert_eq!(m, 0b11111111);
15558    }
15559
15560    #[simd_test(enable = "avx512bw,avx512vl")]
15561    const fn test_mm_mask_cmple_epi16_mask() {
15562        let a = _mm_set1_epi16(-1);
15563        let b = _mm_set1_epi16(-1);
15564        let mask = 0b01010101;
15565        let r = _mm_mask_cmple_epi16_mask(mask, a, b);
15566        assert_eq!(r, 0b01010101);
15567    }
15568
15569    #[simd_test(enable = "avx512bw")]
15570    const fn test_mm512_cmple_epi8_mask() {
15571        let a = _mm512_set1_epi8(-1);
15572        let b = _mm512_set1_epi8(-1);
15573        let m = _mm512_cmple_epi8_mask(a, b);
15574        assert_eq!(
15575            m,
15576            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
15577        );
15578    }
15579
15580    #[simd_test(enable = "avx512bw")]
15581    const fn test_mm512_mask_cmple_epi8_mask() {
15582        let a = _mm512_set1_epi8(-1);
15583        let b = _mm512_set1_epi8(-1);
15584        let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
15585        let r = _mm512_mask_cmple_epi8_mask(mask, a, b);
15586        assert_eq!(
15587            r,
15588            0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
15589        );
15590    }
15591
15592    #[simd_test(enable = "avx512bw,avx512vl")]
15593    const fn test_mm256_cmple_epi8_mask() {
15594        let a = _mm256_set1_epi8(-1);
15595        let b = _mm256_set1_epi8(-1);
15596        let m = _mm256_cmple_epi8_mask(a, b);
15597        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15598    }
15599
15600    #[simd_test(enable = "avx512bw,avx512vl")]
15601    const fn test_mm256_mask_cmple_epi8_mask() {
15602        let a = _mm256_set1_epi8(-1);
15603        let b = _mm256_set1_epi8(-1);
15604        let mask = 0b01010101_01010101_01010101_01010101;
15605        let r = _mm256_mask_cmple_epi8_mask(mask, a, b);
15606        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15607    }
15608
15609    #[simd_test(enable = "avx512bw,avx512vl")]
15610    const fn test_mm_cmple_epi8_mask() {
15611        let a = _mm_set1_epi8(-1);
15612        let b = _mm_set1_epi8(-1);
15613        let m = _mm_cmple_epi8_mask(a, b);
15614        assert_eq!(m, 0b11111111_11111111);
15615    }
15616
15617    #[simd_test(enable = "avx512bw,avx512vl")]
15618    const fn test_mm_mask_cmple_epi8_mask() {
15619        let a = _mm_set1_epi8(-1);
15620        let b = _mm_set1_epi8(-1);
15621        let mask = 0b01010101_01010101;
15622        let r = _mm_mask_cmple_epi8_mask(mask, a, b);
15623        assert_eq!(r, 0b01010101_01010101);
15624    }
15625
15626    #[simd_test(enable = "avx512bw")]
15627    const fn test_mm512_cmpge_epu16_mask() {
15628        let a = _mm512_set1_epi16(1);
15629        let b = _mm512_set1_epi16(1);
15630        let m = _mm512_cmpge_epu16_mask(a, b);
15631        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15632    }
15633
15634    #[simd_test(enable = "avx512bw")]
15635    const fn test_mm512_mask_cmpge_epu16_mask() {
15636        let a = _mm512_set1_epi16(1);
15637        let b = _mm512_set1_epi16(1);
15638        let mask = 0b01010101_01010101_01010101_01010101;
15639        let r = _mm512_mask_cmpge_epu16_mask(mask, a, b);
15640        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15641    }
15642
15643    #[simd_test(enable = "avx512bw,avx512vl")]
15644    const fn test_mm256_cmpge_epu16_mask() {
15645        let a = _mm256_set1_epi16(1);
15646        let b = _mm256_set1_epi16(1);
15647        let m = _mm256_cmpge_epu16_mask(a, b);
15648        assert_eq!(m, 0b11111111_11111111);
15649    }
15650
15651    #[simd_test(enable = "avx512bw,avx512vl")]
15652    const fn test_mm256_mask_cmpge_epu16_mask() {
15653        let a = _mm256_set1_epi16(1);
15654        let b = _mm256_set1_epi16(1);
15655        let mask = 0b01010101_01010101;
15656        let r = _mm256_mask_cmpge_epu16_mask(mask, a, b);
15657        assert_eq!(r, 0b01010101_01010101);
15658    }
15659
15660    #[simd_test(enable = "avx512bw,avx512vl")]
15661    const fn test_mm_cmpge_epu16_mask() {
15662        let a = _mm_set1_epi16(1);
15663        let b = _mm_set1_epi16(1);
15664        let m = _mm_cmpge_epu16_mask(a, b);
15665        assert_eq!(m, 0b11111111);
15666    }
15667
15668    #[simd_test(enable = "avx512bw,avx512vl")]
15669    const fn test_mm_mask_cmpge_epu16_mask() {
15670        let a = _mm_set1_epi16(1);
15671        let b = _mm_set1_epi16(1);
15672        let mask = 0b01010101;
15673        let r = _mm_mask_cmpge_epu16_mask(mask, a, b);
15674        assert_eq!(r, 0b01010101);
15675    }
15676
15677    #[simd_test(enable = "avx512bw")]
15678    const fn test_mm512_cmpge_epu8_mask() {
15679        let a = _mm512_set1_epi8(1);
15680        let b = _mm512_set1_epi8(1);
15681        let m = _mm512_cmpge_epu8_mask(a, b);
15682        assert_eq!(
15683            m,
15684            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
15685        );
15686    }
15687
15688    #[simd_test(enable = "avx512bw")]
15689    const fn test_mm512_mask_cmpge_epu8_mask() {
15690        let a = _mm512_set1_epi8(1);
15691        let b = _mm512_set1_epi8(1);
15692        let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
15693        let r = _mm512_mask_cmpge_epu8_mask(mask, a, b);
15694        assert_eq!(
15695            r,
15696            0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
15697        );
15698    }
15699
15700    #[simd_test(enable = "avx512bw,avx512vl")]
15701    const fn test_mm256_cmpge_epu8_mask() {
15702        let a = _mm256_set1_epi8(1);
15703        let b = _mm256_set1_epi8(1);
15704        let m = _mm256_cmpge_epu8_mask(a, b);
15705        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15706    }
15707
15708    #[simd_test(enable = "avx512bw,avx512vl")]
15709    const fn test_mm256_mask_cmpge_epu8_mask() {
15710        let a = _mm256_set1_epi8(1);
15711        let b = _mm256_set1_epi8(1);
15712        let mask = 0b01010101_01010101_01010101_01010101;
15713        let r = _mm256_mask_cmpge_epu8_mask(mask, a, b);
15714        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15715    }
15716
15717    #[simd_test(enable = "avx512bw,avx512vl")]
15718    const fn test_mm_cmpge_epu8_mask() {
15719        let a = _mm_set1_epi8(1);
15720        let b = _mm_set1_epi8(1);
15721        let m = _mm_cmpge_epu8_mask(a, b);
15722        assert_eq!(m, 0b11111111_11111111);
15723    }
15724
15725    #[simd_test(enable = "avx512bw,avx512vl")]
15726    const fn test_mm_mask_cmpge_epu8_mask() {
15727        let a = _mm_set1_epi8(1);
15728        let b = _mm_set1_epi8(1);
15729        let mask = 0b01010101_01010101;
15730        let r = _mm_mask_cmpge_epu8_mask(mask, a, b);
15731        assert_eq!(r, 0b01010101_01010101);
15732    }
15733
15734    #[simd_test(enable = "avx512bw")]
15735    const fn test_mm512_cmpge_epi16_mask() {
15736        let a = _mm512_set1_epi16(-1);
15737        let b = _mm512_set1_epi16(-1);
15738        let m = _mm512_cmpge_epi16_mask(a, b);
15739        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15740    }
15741
15742    #[simd_test(enable = "avx512bw")]
15743    const fn test_mm512_mask_cmpge_epi16_mask() {
15744        let a = _mm512_set1_epi16(-1);
15745        let b = _mm512_set1_epi16(-1);
15746        let mask = 0b01010101_01010101_01010101_01010101;
15747        let r = _mm512_mask_cmpge_epi16_mask(mask, a, b);
15748        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15749    }
15750
15751    #[simd_test(enable = "avx512bw,avx512vl")]
15752    const fn test_mm256_cmpge_epi16_mask() {
15753        let a = _mm256_set1_epi16(-1);
15754        let b = _mm256_set1_epi16(-1);
15755        let m = _mm256_cmpge_epi16_mask(a, b);
15756        assert_eq!(m, 0b11111111_11111111);
15757    }
15758
15759    #[simd_test(enable = "avx512bw,avx512vl")]
15760    const fn test_mm256_mask_cmpge_epi16_mask() {
15761        let a = _mm256_set1_epi16(-1);
15762        let b = _mm256_set1_epi16(-1);
15763        let mask = 0b01010101_01010101;
15764        let r = _mm256_mask_cmpge_epi16_mask(mask, a, b);
15765        assert_eq!(r, 0b01010101_01010101);
15766    }
15767
15768    #[simd_test(enable = "avx512bw,avx512vl")]
15769    const fn test_mm_cmpge_epi16_mask() {
15770        let a = _mm_set1_epi16(-1);
15771        let b = _mm_set1_epi16(-1);
15772        let m = _mm_cmpge_epi16_mask(a, b);
15773        assert_eq!(m, 0b11111111);
15774    }
15775
15776    #[simd_test(enable = "avx512bw,avx512vl")]
15777    const fn test_mm_mask_cmpge_epi16_mask() {
15778        let a = _mm_set1_epi16(-1);
15779        let b = _mm_set1_epi16(-1);
15780        let mask = 0b01010101;
15781        let r = _mm_mask_cmpge_epi16_mask(mask, a, b);
15782        assert_eq!(r, 0b01010101);
15783    }
15784
15785    #[simd_test(enable = "avx512bw")]
15786    const fn test_mm512_cmpge_epi8_mask() {
15787        let a = _mm512_set1_epi8(-1);
15788        let b = _mm512_set1_epi8(-1);
15789        let m = _mm512_cmpge_epi8_mask(a, b);
15790        assert_eq!(
15791            m,
15792            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
15793        );
15794    }
15795
15796    #[simd_test(enable = "avx512bw")]
15797    const fn test_mm512_mask_cmpge_epi8_mask() {
15798        let a = _mm512_set1_epi8(-1);
15799        let b = _mm512_set1_epi8(-1);
15800        let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
15801        let r = _mm512_mask_cmpge_epi8_mask(mask, a, b);
15802        assert_eq!(
15803            r,
15804            0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
15805        );
15806    }
15807
15808    #[simd_test(enable = "avx512bw,avx512vl")]
15809    const fn test_mm256_cmpge_epi8_mask() {
15810        let a = _mm256_set1_epi8(-1);
15811        let b = _mm256_set1_epi8(-1);
15812        let m = _mm256_cmpge_epi8_mask(a, b);
15813        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15814    }
15815
15816    #[simd_test(enable = "avx512bw,avx512vl")]
15817    const fn test_mm256_mask_cmpge_epi8_mask() {
15818        let a = _mm256_set1_epi8(-1);
15819        let b = _mm256_set1_epi8(-1);
15820        let mask = 0b01010101_01010101_01010101_01010101;
15821        let r = _mm256_mask_cmpge_epi8_mask(mask, a, b);
15822        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15823    }
15824
15825    #[simd_test(enable = "avx512bw,avx512vl")]
15826    const fn test_mm_cmpge_epi8_mask() {
15827        let a = _mm_set1_epi8(-1);
15828        let b = _mm_set1_epi8(-1);
15829        let m = _mm_cmpge_epi8_mask(a, b);
15830        assert_eq!(m, 0b11111111_11111111);
15831    }
15832
15833    #[simd_test(enable = "avx512bw,avx512vl")]
15834    const fn test_mm_mask_cmpge_epi8_mask() {
15835        let a = _mm_set1_epi8(-1);
15836        let b = _mm_set1_epi8(-1);
15837        let mask = 0b01010101_01010101;
15838        let r = _mm_mask_cmpge_epi8_mask(mask, a, b);
15839        assert_eq!(r, 0b01010101_01010101);
15840    }
15841
15842    #[simd_test(enable = "avx512bw")]
15843    const fn test_mm512_cmpeq_epu16_mask() {
15844        let a = _mm512_set1_epi16(1);
15845        let b = _mm512_set1_epi16(1);
15846        let m = _mm512_cmpeq_epu16_mask(a, b);
15847        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15848    }
15849
15850    #[simd_test(enable = "avx512bw")]
15851    const fn test_mm512_mask_cmpeq_epu16_mask() {
15852        let a = _mm512_set1_epi16(1);
15853        let b = _mm512_set1_epi16(1);
15854        let mask = 0b01010101_01010101_01010101_01010101;
15855        let r = _mm512_mask_cmpeq_epu16_mask(mask, a, b);
15856        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15857    }
15858
15859    #[simd_test(enable = "avx512bw,avx512vl")]
15860    const fn test_mm256_cmpeq_epu16_mask() {
15861        let a = _mm256_set1_epi16(1);
15862        let b = _mm256_set1_epi16(1);
15863        let m = _mm256_cmpeq_epu16_mask(a, b);
15864        assert_eq!(m, 0b11111111_11111111);
15865    }
15866
15867    #[simd_test(enable = "avx512bw,avx512vl")]
15868    const fn test_mm256_mask_cmpeq_epu16_mask() {
15869        let a = _mm256_set1_epi16(1);
15870        let b = _mm256_set1_epi16(1);
15871        let mask = 0b01010101_01010101;
15872        let r = _mm256_mask_cmpeq_epu16_mask(mask, a, b);
15873        assert_eq!(r, 0b01010101_01010101);
15874    }
15875
15876    #[simd_test(enable = "avx512bw,avx512vl")]
15877    const fn test_mm_cmpeq_epu16_mask() {
15878        let a = _mm_set1_epi16(1);
15879        let b = _mm_set1_epi16(1);
15880        let m = _mm_cmpeq_epu16_mask(a, b);
15881        assert_eq!(m, 0b11111111);
15882    }
15883
15884    #[simd_test(enable = "avx512bw,avx512vl")]
15885    const fn test_mm_mask_cmpeq_epu16_mask() {
15886        let a = _mm_set1_epi16(1);
15887        let b = _mm_set1_epi16(1);
15888        let mask = 0b01010101;
15889        let r = _mm_mask_cmpeq_epu16_mask(mask, a, b);
15890        assert_eq!(r, 0b01010101);
15891    }
15892
15893    #[simd_test(enable = "avx512bw")]
15894    const fn test_mm512_cmpeq_epu8_mask() {
15895        let a = _mm512_set1_epi8(1);
15896        let b = _mm512_set1_epi8(1);
15897        let m = _mm512_cmpeq_epu8_mask(a, b);
15898        assert_eq!(
15899            m,
15900            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
15901        );
15902    }
15903
15904    #[simd_test(enable = "avx512bw")]
15905    const fn test_mm512_mask_cmpeq_epu8_mask() {
15906        let a = _mm512_set1_epi8(1);
15907        let b = _mm512_set1_epi8(1);
15908        let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
15909        let r = _mm512_mask_cmpeq_epu8_mask(mask, a, b);
15910        assert_eq!(
15911            r,
15912            0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
15913        );
15914    }
15915
15916    #[simd_test(enable = "avx512bw,avx512vl")]
15917    const fn test_mm256_cmpeq_epu8_mask() {
15918        let a = _mm256_set1_epi8(1);
15919        let b = _mm256_set1_epi8(1);
15920        let m = _mm256_cmpeq_epu8_mask(a, b);
15921        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15922    }
15923
15924    #[simd_test(enable = "avx512bw,avx512vl")]
15925    const fn test_mm256_mask_cmpeq_epu8_mask() {
15926        let a = _mm256_set1_epi8(1);
15927        let b = _mm256_set1_epi8(1);
15928        let mask = 0b01010101_01010101_01010101_01010101;
15929        let r = _mm256_mask_cmpeq_epu8_mask(mask, a, b);
15930        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15931    }
15932
15933    #[simd_test(enable = "avx512bw,avx512vl")]
15934    const fn test_mm_cmpeq_epu8_mask() {
15935        let a = _mm_set1_epi8(1);
15936        let b = _mm_set1_epi8(1);
15937        let m = _mm_cmpeq_epu8_mask(a, b);
15938        assert_eq!(m, 0b11111111_11111111);
15939    }
15940
15941    #[simd_test(enable = "avx512bw,avx512vl")]
15942    const fn test_mm_mask_cmpeq_epu8_mask() {
15943        let a = _mm_set1_epi8(1);
15944        let b = _mm_set1_epi8(1);
15945        let mask = 0b01010101_01010101;
15946        let r = _mm_mask_cmpeq_epu8_mask(mask, a, b);
15947        assert_eq!(r, 0b01010101_01010101);
15948    }
15949
15950    #[simd_test(enable = "avx512bw")]
15951    const fn test_mm512_cmpeq_epi16_mask() {
15952        let a = _mm512_set1_epi16(-1);
15953        let b = _mm512_set1_epi16(-1);
15954        let m = _mm512_cmpeq_epi16_mask(a, b);
15955        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
15956    }
15957
15958    #[simd_test(enable = "avx512bw")]
15959    const fn test_mm512_mask_cmpeq_epi16_mask() {
15960        let a = _mm512_set1_epi16(-1);
15961        let b = _mm512_set1_epi16(-1);
15962        let mask = 0b01010101_01010101_01010101_01010101;
15963        let r = _mm512_mask_cmpeq_epi16_mask(mask, a, b);
15964        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
15965    }
15966
15967    #[simd_test(enable = "avx512bw,avx512vl")]
15968    const fn test_mm256_cmpeq_epi16_mask() {
15969        let a = _mm256_set1_epi16(-1);
15970        let b = _mm256_set1_epi16(-1);
15971        let m = _mm256_cmpeq_epi16_mask(a, b);
15972        assert_eq!(m, 0b11111111_11111111);
15973    }
15974
15975    #[simd_test(enable = "avx512bw,avx512vl")]
15976    const fn test_mm256_mask_cmpeq_epi16_mask() {
15977        let a = _mm256_set1_epi16(-1);
15978        let b = _mm256_set1_epi16(-1);
15979        let mask = 0b01010101_01010101;
15980        let r = _mm256_mask_cmpeq_epi16_mask(mask, a, b);
15981        assert_eq!(r, 0b01010101_01010101);
15982    }
15983
15984    #[simd_test(enable = "avx512bw,avx512vl")]
15985    const fn test_mm_cmpeq_epi16_mask() {
15986        let a = _mm_set1_epi16(-1);
15987        let b = _mm_set1_epi16(-1);
15988        let m = _mm_cmpeq_epi16_mask(a, b);
15989        assert_eq!(m, 0b11111111);
15990    }
15991
15992    #[simd_test(enable = "avx512bw,avx512vl")]
15993    const fn test_mm_mask_cmpeq_epi16_mask() {
15994        let a = _mm_set1_epi16(-1);
15995        let b = _mm_set1_epi16(-1);
15996        let mask = 0b01010101;
15997        let r = _mm_mask_cmpeq_epi16_mask(mask, a, b);
15998        assert_eq!(r, 0b01010101);
15999    }
16000
16001    #[simd_test(enable = "avx512bw")]
16002    const fn test_mm512_cmpeq_epi8_mask() {
16003        let a = _mm512_set1_epi8(-1);
16004        let b = _mm512_set1_epi8(-1);
16005        let m = _mm512_cmpeq_epi8_mask(a, b);
16006        assert_eq!(
16007            m,
16008            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
16009        );
16010    }
16011
16012    #[simd_test(enable = "avx512bw")]
16013    const fn test_mm512_mask_cmpeq_epi8_mask() {
16014        let a = _mm512_set1_epi8(-1);
16015        let b = _mm512_set1_epi8(-1);
16016        let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
16017        let r = _mm512_mask_cmpeq_epi8_mask(mask, a, b);
16018        assert_eq!(
16019            r,
16020            0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
16021        );
16022    }
16023
16024    #[simd_test(enable = "avx512bw,avx512vl")]
16025    const fn test_mm256_cmpeq_epi8_mask() {
16026        let a = _mm256_set1_epi8(-1);
16027        let b = _mm256_set1_epi8(-1);
16028        let m = _mm256_cmpeq_epi8_mask(a, b);
16029        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
16030    }
16031
16032    #[simd_test(enable = "avx512bw,avx512vl")]
16033    const fn test_mm256_mask_cmpeq_epi8_mask() {
16034        let a = _mm256_set1_epi8(-1);
16035        let b = _mm256_set1_epi8(-1);
16036        let mask = 0b01010101_01010101_01010101_01010101;
16037        let r = _mm256_mask_cmpeq_epi8_mask(mask, a, b);
16038        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
16039    }
16040
16041    #[simd_test(enable = "avx512bw,avx512vl")]
16042    const fn test_mm_cmpeq_epi8_mask() {
16043        let a = _mm_set1_epi8(-1);
16044        let b = _mm_set1_epi8(-1);
16045        let m = _mm_cmpeq_epi8_mask(a, b);
16046        assert_eq!(m, 0b11111111_11111111);
16047    }
16048
16049    #[simd_test(enable = "avx512bw,avx512vl")]
16050    const fn test_mm_mask_cmpeq_epi8_mask() {
16051        let a = _mm_set1_epi8(-1);
16052        let b = _mm_set1_epi8(-1);
16053        let mask = 0b01010101_01010101;
16054        let r = _mm_mask_cmpeq_epi8_mask(mask, a, b);
16055        assert_eq!(r, 0b01010101_01010101);
16056    }
16057
16058    #[simd_test(enable = "avx512bw")]
16059    const fn test_mm512_cmpneq_epu16_mask() {
16060        let a = _mm512_set1_epi16(2);
16061        let b = _mm512_set1_epi16(1);
16062        let m = _mm512_cmpneq_epu16_mask(a, b);
16063        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
16064    }
16065
16066    #[simd_test(enable = "avx512bw")]
16067    const fn test_mm512_mask_cmpneq_epu16_mask() {
16068        let a = _mm512_set1_epi16(2);
16069        let b = _mm512_set1_epi16(1);
16070        let mask = 0b01010101_01010101_01010101_01010101;
16071        let r = _mm512_mask_cmpneq_epu16_mask(mask, a, b);
16072        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
16073    }
16074
16075    #[simd_test(enable = "avx512bw,avx512vl")]
16076    const fn test_mm256_cmpneq_epu16_mask() {
16077        let a = _mm256_set1_epi16(2);
16078        let b = _mm256_set1_epi16(1);
16079        let m = _mm256_cmpneq_epu16_mask(a, b);
16080        assert_eq!(m, 0b11111111_11111111);
16081    }
16082
16083    #[simd_test(enable = "avx512bw,avx512vl")]
16084    const fn test_mm256_mask_cmpneq_epu16_mask() {
16085        let a = _mm256_set1_epi16(2);
16086        let b = _mm256_set1_epi16(1);
16087        let mask = 0b01010101_01010101;
16088        let r = _mm256_mask_cmpneq_epu16_mask(mask, a, b);
16089        assert_eq!(r, 0b01010101_01010101);
16090    }
16091
16092    #[simd_test(enable = "avx512bw,avx512vl")]
16093    const fn test_mm_cmpneq_epu16_mask() {
16094        let a = _mm_set1_epi16(2);
16095        let b = _mm_set1_epi16(1);
16096        let m = _mm_cmpneq_epu16_mask(a, b);
16097        assert_eq!(m, 0b11111111);
16098    }
16099
16100    #[simd_test(enable = "avx512bw,avx512vl")]
16101    const fn test_mm_mask_cmpneq_epu16_mask() {
16102        let a = _mm_set1_epi16(2);
16103        let b = _mm_set1_epi16(1);
16104        let mask = 0b01010101;
16105        let r = _mm_mask_cmpneq_epu16_mask(mask, a, b);
16106        assert_eq!(r, 0b01010101);
16107    }
16108
16109    #[simd_test(enable = "avx512bw")]
16110    const fn test_mm512_cmpneq_epu8_mask() {
16111        let a = _mm512_set1_epi8(2);
16112        let b = _mm512_set1_epi8(1);
16113        let m = _mm512_cmpneq_epu8_mask(a, b);
16114        assert_eq!(
16115            m,
16116            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
16117        );
16118    }
16119
16120    #[simd_test(enable = "avx512bw")]
16121    const fn test_mm512_mask_cmpneq_epu8_mask() {
16122        let a = _mm512_set1_epi8(2);
16123        let b = _mm512_set1_epi8(1);
16124        let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
16125        let r = _mm512_mask_cmpneq_epu8_mask(mask, a, b);
16126        assert_eq!(
16127            r,
16128            0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
16129        );
16130    }
16131
16132    #[simd_test(enable = "avx512bw,avx512vl")]
16133    const fn test_mm256_cmpneq_epu8_mask() {
16134        let a = _mm256_set1_epi8(2);
16135        let b = _mm256_set1_epi8(1);
16136        let m = _mm256_cmpneq_epu8_mask(a, b);
16137        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
16138    }
16139
16140    #[simd_test(enable = "avx512bw,avx512vl")]
16141    const fn test_mm256_mask_cmpneq_epu8_mask() {
16142        let a = _mm256_set1_epi8(2);
16143        let b = _mm256_set1_epi8(1);
16144        let mask = 0b01010101_01010101_01010101_01010101;
16145        let r = _mm256_mask_cmpneq_epu8_mask(mask, a, b);
16146        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
16147    }
16148
16149    #[simd_test(enable = "avx512bw,avx512vl")]
16150    const fn test_mm_cmpneq_epu8_mask() {
16151        let a = _mm_set1_epi8(2);
16152        let b = _mm_set1_epi8(1);
16153        let m = _mm_cmpneq_epu8_mask(a, b);
16154        assert_eq!(m, 0b11111111_11111111);
16155    }
16156
16157    #[simd_test(enable = "avx512bw,avx512vl")]
16158    const fn test_mm_mask_cmpneq_epu8_mask() {
16159        let a = _mm_set1_epi8(2);
16160        let b = _mm_set1_epi8(1);
16161        let mask = 0b01010101_01010101;
16162        let r = _mm_mask_cmpneq_epu8_mask(mask, a, b);
16163        assert_eq!(r, 0b01010101_01010101);
16164    }
16165
16166    #[simd_test(enable = "avx512bw")]
16167    const fn test_mm512_cmpneq_epi16_mask() {
16168        let a = _mm512_set1_epi16(1);
16169        let b = _mm512_set1_epi16(-1);
16170        let m = _mm512_cmpneq_epi16_mask(a, b);
16171        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
16172    }
16173
16174    #[simd_test(enable = "avx512bw")]
16175    const fn test_mm512_mask_cmpneq_epi16_mask() {
16176        let a = _mm512_set1_epi16(1);
16177        let b = _mm512_set1_epi16(-1);
16178        let mask = 0b01010101_01010101_01010101_01010101;
16179        let r = _mm512_mask_cmpneq_epi16_mask(mask, a, b);
16180        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
16181    }
16182
16183    #[simd_test(enable = "avx512bw,avx512vl")]
16184    const fn test_mm256_cmpneq_epi16_mask() {
16185        let a = _mm256_set1_epi16(1);
16186        let b = _mm256_set1_epi16(-1);
16187        let m = _mm256_cmpneq_epi16_mask(a, b);
16188        assert_eq!(m, 0b11111111_11111111);
16189    }
16190
16191    #[simd_test(enable = "avx512bw,avx512vl")]
16192    const fn test_mm256_mask_cmpneq_epi16_mask() {
16193        let a = _mm256_set1_epi16(1);
16194        let b = _mm256_set1_epi16(-1);
16195        let mask = 0b01010101_01010101;
16196        let r = _mm256_mask_cmpneq_epi16_mask(mask, a, b);
16197        assert_eq!(r, 0b01010101_01010101);
16198    }
16199
16200    #[simd_test(enable = "avx512bw,avx512vl")]
16201    const fn test_mm_cmpneq_epi16_mask() {
16202        let a = _mm_set1_epi16(1);
16203        let b = _mm_set1_epi16(-1);
16204        let m = _mm_cmpneq_epi16_mask(a, b);
16205        assert_eq!(m, 0b11111111);
16206    }
16207
16208    #[simd_test(enable = "avx512bw,avx512vl")]
16209    const fn test_mm_mask_cmpneq_epi16_mask() {
16210        let a = _mm_set1_epi16(1);
16211        let b = _mm_set1_epi16(-1);
16212        let mask = 0b01010101;
16213        let r = _mm_mask_cmpneq_epi16_mask(mask, a, b);
16214        assert_eq!(r, 0b01010101);
16215    }
16216
16217    #[simd_test(enable = "avx512bw")]
16218    const fn test_mm512_cmpneq_epi8_mask() {
16219        let a = _mm512_set1_epi8(1);
16220        let b = _mm512_set1_epi8(-1);
16221        let m = _mm512_cmpneq_epi8_mask(a, b);
16222        assert_eq!(
16223            m,
16224            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
16225        );
16226    }
16227
16228    #[simd_test(enable = "avx512bw")]
16229    const fn test_mm512_mask_cmpneq_epi8_mask() {
16230        let a = _mm512_set1_epi8(1);
16231        let b = _mm512_set1_epi8(-1);
16232        let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
16233        let r = _mm512_mask_cmpneq_epi8_mask(mask, a, b);
16234        assert_eq!(
16235            r,
16236            0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
16237        );
16238    }
16239
16240    #[simd_test(enable = "avx512bw,avx512vl")]
16241    const fn test_mm256_cmpneq_epi8_mask() {
16242        let a = _mm256_set1_epi8(1);
16243        let b = _mm256_set1_epi8(-1);
16244        let m = _mm256_cmpneq_epi8_mask(a, b);
16245        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
16246    }
16247
16248    #[simd_test(enable = "avx512bw,avx512vl")]
16249    const fn test_mm256_mask_cmpneq_epi8_mask() {
16250        let a = _mm256_set1_epi8(1);
16251        let b = _mm256_set1_epi8(-1);
16252        let mask = 0b01010101_01010101_01010101_01010101;
16253        let r = _mm256_mask_cmpneq_epi8_mask(mask, a, b);
16254        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
16255    }
16256
16257    #[simd_test(enable = "avx512bw,avx512vl")]
16258    const fn test_mm_cmpneq_epi8_mask() {
16259        let a = _mm_set1_epi8(1);
16260        let b = _mm_set1_epi8(-1);
16261        let m = _mm_cmpneq_epi8_mask(a, b);
16262        assert_eq!(m, 0b11111111_11111111);
16263    }
16264
16265    #[simd_test(enable = "avx512bw,avx512vl")]
16266    const fn test_mm_mask_cmpneq_epi8_mask() {
16267        let a = _mm_set1_epi8(1);
16268        let b = _mm_set1_epi8(-1);
16269        let mask = 0b01010101_01010101;
16270        let r = _mm_mask_cmpneq_epi8_mask(mask, a, b);
16271        assert_eq!(r, 0b01010101_01010101);
16272    }
16273
16274    #[simd_test(enable = "avx512bw")]
16275    const fn test_mm512_cmp_epu16_mask() {
16276        let a = _mm512_set1_epi16(0);
16277        let b = _mm512_set1_epi16(1);
16278        let m = _mm512_cmp_epu16_mask::<_MM_CMPINT_LT>(a, b);
16279        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
16280    }
16281
16282    #[simd_test(enable = "avx512bw")]
16283    const fn test_mm512_mask_cmp_epu16_mask() {
16284        let a = _mm512_set1_epi16(0);
16285        let b = _mm512_set1_epi16(1);
16286        let mask = 0b01010101_01010101_01010101_01010101;
16287        let r = _mm512_mask_cmp_epu16_mask::<_MM_CMPINT_LT>(mask, a, b);
16288        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
16289    }
16290
16291    #[simd_test(enable = "avx512bw,avx512vl")]
16292    const fn test_mm256_cmp_epu16_mask() {
16293        let a = _mm256_set1_epi16(0);
16294        let b = _mm256_set1_epi16(1);
16295        let m = _mm256_cmp_epu16_mask::<_MM_CMPINT_LT>(a, b);
16296        assert_eq!(m, 0b11111111_11111111);
16297    }
16298
16299    #[simd_test(enable = "avx512bw,avx512vl")]
16300    const fn test_mm256_mask_cmp_epu16_mask() {
16301        let a = _mm256_set1_epi16(0);
16302        let b = _mm256_set1_epi16(1);
16303        let mask = 0b01010101_01010101;
16304        let r = _mm256_mask_cmp_epu16_mask::<_MM_CMPINT_LT>(mask, a, b);
16305        assert_eq!(r, 0b01010101_01010101);
16306    }
16307
16308    #[simd_test(enable = "avx512bw,avx512vl")]
16309    const fn test_mm_cmp_epu16_mask() {
16310        let a = _mm_set1_epi16(0);
16311        let b = _mm_set1_epi16(1);
16312        let m = _mm_cmp_epu16_mask::<_MM_CMPINT_LT>(a, b);
16313        assert_eq!(m, 0b11111111);
16314    }
16315
16316    #[simd_test(enable = "avx512bw,avx512vl")]
16317    const fn test_mm_mask_cmp_epu16_mask() {
16318        let a = _mm_set1_epi16(0);
16319        let b = _mm_set1_epi16(1);
16320        let mask = 0b01010101;
16321        let r = _mm_mask_cmp_epu16_mask::<_MM_CMPINT_LT>(mask, a, b);
16322        assert_eq!(r, 0b01010101);
16323    }
16324
16325    #[simd_test(enable = "avx512bw")]
16326    const fn test_mm512_cmp_epu8_mask() {
16327        let a = _mm512_set1_epi8(0);
16328        let b = _mm512_set1_epi8(1);
16329        let m = _mm512_cmp_epu8_mask::<_MM_CMPINT_LT>(a, b);
16330        assert_eq!(
16331            m,
16332            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
16333        );
16334    }
16335
16336    #[simd_test(enable = "avx512bw")]
16337    const fn test_mm512_mask_cmp_epu8_mask() {
16338        let a = _mm512_set1_epi8(0);
16339        let b = _mm512_set1_epi8(1);
16340        let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
16341        let r = _mm512_mask_cmp_epu8_mask::<_MM_CMPINT_LT>(mask, a, b);
16342        assert_eq!(
16343            r,
16344            0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
16345        );
16346    }
16347
16348    #[simd_test(enable = "avx512bw,avx512vl")]
16349    const fn test_mm256_cmp_epu8_mask() {
16350        let a = _mm256_set1_epi8(0);
16351        let b = _mm256_set1_epi8(1);
16352        let m = _mm256_cmp_epu8_mask::<_MM_CMPINT_LT>(a, b);
16353        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
16354    }
16355
16356    #[simd_test(enable = "avx512bw,avx512vl")]
16357    const fn test_mm256_mask_cmp_epu8_mask() {
16358        let a = _mm256_set1_epi8(0);
16359        let b = _mm256_set1_epi8(1);
16360        let mask = 0b01010101_01010101_01010101_01010101;
16361        let r = _mm256_mask_cmp_epu8_mask::<_MM_CMPINT_LT>(mask, a, b);
16362        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
16363    }
16364
16365    #[simd_test(enable = "avx512bw,avx512vl")]
16366    const fn test_mm_cmp_epu8_mask() {
16367        let a = _mm_set1_epi8(0);
16368        let b = _mm_set1_epi8(1);
16369        let m = _mm_cmp_epu8_mask::<_MM_CMPINT_LT>(a, b);
16370        assert_eq!(m, 0b11111111_11111111);
16371    }
16372
16373    #[simd_test(enable = "avx512bw,avx512vl")]
16374    const fn test_mm_mask_cmp_epu8_mask() {
16375        let a = _mm_set1_epi8(0);
16376        let b = _mm_set1_epi8(1);
16377        let mask = 0b01010101_01010101;
16378        let r = _mm_mask_cmp_epu8_mask::<_MM_CMPINT_LT>(mask, a, b);
16379        assert_eq!(r, 0b01010101_01010101);
16380    }
16381
16382    #[simd_test(enable = "avx512bw")]
16383    const fn test_mm512_cmp_epi16_mask() {
16384        let a = _mm512_set1_epi16(0);
16385        let b = _mm512_set1_epi16(1);
16386        let m = _mm512_cmp_epi16_mask::<_MM_CMPINT_LT>(a, b);
16387        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
16388    }
16389
16390    #[simd_test(enable = "avx512bw")]
16391    const fn test_mm512_mask_cmp_epi16_mask() {
16392        let a = _mm512_set1_epi16(0);
16393        let b = _mm512_set1_epi16(1);
16394        let mask = 0b01010101_01010101_01010101_01010101;
16395        let r = _mm512_mask_cmp_epi16_mask::<_MM_CMPINT_LT>(mask, a, b);
16396        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
16397    }
16398
16399    #[simd_test(enable = "avx512bw,avx512vl")]
16400    const fn test_mm256_cmp_epi16_mask() {
16401        let a = _mm256_set1_epi16(0);
16402        let b = _mm256_set1_epi16(1);
16403        let m = _mm256_cmp_epi16_mask::<_MM_CMPINT_LT>(a, b);
16404        assert_eq!(m, 0b11111111_11111111);
16405    }
16406
16407    #[simd_test(enable = "avx512bw,avx512vl")]
16408    const fn test_mm256_mask_cmp_epi16_mask() {
16409        let a = _mm256_set1_epi16(0);
16410        let b = _mm256_set1_epi16(1);
16411        let mask = 0b01010101_01010101;
16412        let r = _mm256_mask_cmp_epi16_mask::<_MM_CMPINT_LT>(mask, a, b);
16413        assert_eq!(r, 0b01010101_01010101);
16414    }
16415
16416    #[simd_test(enable = "avx512bw,avx512vl")]
16417    const fn test_mm_cmp_epi16_mask() {
16418        let a = _mm_set1_epi16(0);
16419        let b = _mm_set1_epi16(1);
16420        let m = _mm_cmp_epi16_mask::<_MM_CMPINT_LT>(a, b);
16421        assert_eq!(m, 0b11111111);
16422    }
16423
16424    #[simd_test(enable = "avx512bw,avx512vl")]
16425    const fn test_mm_mask_cmp_epi16_mask() {
16426        let a = _mm_set1_epi16(0);
16427        let b = _mm_set1_epi16(1);
16428        let mask = 0b01010101;
16429        let r = _mm_mask_cmp_epi16_mask::<_MM_CMPINT_LT>(mask, a, b);
16430        assert_eq!(r, 0b01010101);
16431    }
16432
16433    #[simd_test(enable = "avx512bw")]
16434    const fn test_mm512_cmp_epi8_mask() {
16435        let a = _mm512_set1_epi8(0);
16436        let b = _mm512_set1_epi8(1);
16437        let m = _mm512_cmp_epi8_mask::<_MM_CMPINT_LT>(a, b);
16438        assert_eq!(
16439            m,
16440            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
16441        );
16442    }
16443
16444    #[simd_test(enable = "avx512bw")]
16445    const fn test_mm512_mask_cmp_epi8_mask() {
16446        let a = _mm512_set1_epi8(0);
16447        let b = _mm512_set1_epi8(1);
16448        let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
16449        let r = _mm512_mask_cmp_epi8_mask::<_MM_CMPINT_LT>(mask, a, b);
16450        assert_eq!(
16451            r,
16452            0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
16453        );
16454    }
16455
16456    #[simd_test(enable = "avx512bw,avx512vl")]
16457    const fn test_mm256_cmp_epi8_mask() {
16458        let a = _mm256_set1_epi8(0);
16459        let b = _mm256_set1_epi8(1);
16460        let m = _mm256_cmp_epi8_mask::<_MM_CMPINT_LT>(a, b);
16461        assert_eq!(m, 0b11111111_11111111_11111111_11111111);
16462    }
16463
16464    #[simd_test(enable = "avx512bw,avx512vl")]
16465    const fn test_mm256_mask_cmp_epi8_mask() {
16466        let a = _mm256_set1_epi8(0);
16467        let b = _mm256_set1_epi8(1);
16468        let mask = 0b01010101_01010101_01010101_01010101;
16469        let r = _mm256_mask_cmp_epi8_mask::<_MM_CMPINT_LT>(mask, a, b);
16470        assert_eq!(r, 0b01010101_01010101_01010101_01010101);
16471    }
16472
16473    #[simd_test(enable = "avx512bw,avx512vl")]
16474    const fn test_mm_cmp_epi8_mask() {
16475        let a = _mm_set1_epi8(0);
16476        let b = _mm_set1_epi8(1);
16477        let m = _mm_cmp_epi8_mask::<_MM_CMPINT_LT>(a, b);
16478        assert_eq!(m, 0b11111111_11111111);
16479    }
16480
16481    #[simd_test(enable = "avx512bw,avx512vl")]
16482    const fn test_mm_mask_cmp_epi8_mask() {
16483        let a = _mm_set1_epi8(0);
16484        let b = _mm_set1_epi8(1);
16485        let mask = 0b01010101_01010101;
16486        let r = _mm_mask_cmp_epi8_mask::<_MM_CMPINT_LT>(mask, a, b);
16487        assert_eq!(r, 0b01010101_01010101);
16488    }
16489
16490    #[simd_test(enable = "avx512bw,avx512vl")]
16491    const fn test_mm256_reduce_add_epi16() {
16492        let a = _mm256_set1_epi16(1);
16493        let e = _mm256_reduce_add_epi16(a);
16494        assert_eq!(16, e);
16495    }
16496
16497    #[simd_test(enable = "avx512bw,avx512vl")]
16498    const fn test_mm256_mask_reduce_add_epi16() {
16499        let a = _mm256_set1_epi16(1);
16500        let e = _mm256_mask_reduce_add_epi16(0b11111111_00000000, a);
16501        assert_eq!(8, e);
16502    }
16503
16504    #[simd_test(enable = "avx512bw,avx512vl")]
16505    const fn test_mm_reduce_add_epi16() {
16506        let a = _mm_set1_epi16(1);
16507        let e = _mm_reduce_add_epi16(a);
16508        assert_eq!(8, e);
16509    }
16510
16511    #[simd_test(enable = "avx512bw,avx512vl")]
16512    const fn test_mm_mask_reduce_add_epi16() {
16513        let a = _mm_set1_epi16(1);
16514        let e = _mm_mask_reduce_add_epi16(0b11110000, a);
16515        assert_eq!(4, e);
16516    }
16517
16518    #[simd_test(enable = "avx512bw,avx512vl")]
16519    const fn test_mm256_reduce_add_epi8() {
16520        let a = _mm256_set1_epi8(1);
16521        let e = _mm256_reduce_add_epi8(a);
16522        assert_eq!(32, e);
16523    }
16524
16525    #[simd_test(enable = "avx512bw,avx512vl")]
16526    const fn test_mm256_mask_reduce_add_epi8() {
16527        let a = _mm256_set1_epi8(1);
16528        let e = _mm256_mask_reduce_add_epi8(0b11111111_00000000_11111111_00000000, a);
16529        assert_eq!(16, e);
16530    }
16531
16532    #[simd_test(enable = "avx512bw,avx512vl")]
16533    const fn test_mm_reduce_add_epi8() {
16534        let a = _mm_set1_epi8(1);
16535        let e = _mm_reduce_add_epi8(a);
16536        assert_eq!(16, e);
16537    }
16538
16539    #[simd_test(enable = "avx512bw,avx512vl")]
16540    const fn test_mm_mask_reduce_add_epi8() {
16541        let a = _mm_set1_epi8(1);
16542        let e = _mm_mask_reduce_add_epi8(0b11111111_00000000, a);
16543        assert_eq!(8, e);
16544    }
16545
16546    #[simd_test(enable = "avx512bw,avx512vl")]
16547    const fn test_mm256_reduce_and_epi16() {
16548        let a = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
16549        let e = _mm256_reduce_and_epi16(a);
16550        assert_eq!(0, e);
16551    }
16552
16553    #[simd_test(enable = "avx512bw,avx512vl")]
16554    const fn test_mm256_mask_reduce_and_epi16() {
16555        let a = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
16556        let e = _mm256_mask_reduce_and_epi16(0b11111111_00000000, a);
16557        assert_eq!(1, e);
16558    }
16559
16560    #[simd_test(enable = "avx512bw,avx512vl")]
16561    const fn test_mm_reduce_and_epi16() {
16562        let a = _mm_set_epi16(1, 1, 1, 1, 2, 2, 2, 2);
16563        let e = _mm_reduce_and_epi16(a);
16564        assert_eq!(0, e);
16565    }
16566
16567    #[simd_test(enable = "avx512bw,avx512vl")]
16568    const fn test_mm_mask_reduce_and_epi16() {
16569        let a = _mm_set_epi16(1, 1, 1, 1, 2, 2, 2, 2);
16570        let e = _mm_mask_reduce_and_epi16(0b11110000, a);
16571        assert_eq!(1, e);
16572    }
16573
16574    #[simd_test(enable = "avx512bw,avx512vl")]
16575    const fn test_mm256_reduce_and_epi8() {
16576        let a = _mm256_set_epi8(
16577            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,
16578            2, 2, 2,
16579        );
16580        let e = _mm256_reduce_and_epi8(a);
16581        assert_eq!(0, e);
16582    }
16583
16584    #[simd_test(enable = "avx512bw,avx512vl")]
16585    const fn test_mm256_mask_reduce_and_epi8() {
16586        let a = _mm256_set_epi8(
16587            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,
16588            2, 2, 2,
16589        );
16590        let e = _mm256_mask_reduce_and_epi8(0b11111111_00000000_11111111_00000000, a);
16591        assert_eq!(1, e);
16592    }
16593
16594    #[simd_test(enable = "avx512bw,avx512vl")]
16595    const fn test_mm_reduce_and_epi8() {
16596        let a = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
16597        let e = _mm_reduce_and_epi8(a);
16598        assert_eq!(0, e);
16599    }
16600
16601    #[simd_test(enable = "avx512bw,avx512vl")]
16602    const fn test_mm_mask_reduce_and_epi8() {
16603        let a = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
16604        let e = _mm_mask_reduce_and_epi8(0b11111111_00000000, a);
16605        assert_eq!(1, e);
16606    }
16607
16608    #[simd_test(enable = "avx512bw,avx512vl")]
16609    const fn test_mm256_reduce_mul_epi16() {
16610        let a = _mm256_set_epi16(2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1);
16611        let e = _mm256_reduce_mul_epi16(a);
16612        assert_eq!(256, e);
16613    }
16614
16615    #[simd_test(enable = "avx512bw,avx512vl")]
16616    const fn test_mm256_mask_reduce_mul_epi16() {
16617        let a = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
16618        let e = _mm256_mask_reduce_mul_epi16(0b11111111_00000000, a);
16619        assert_eq!(1, e);
16620    }
16621
16622    #[simd_test(enable = "avx512bw,avx512vl")]
16623    const fn test_mm_reduce_mul_epi16() {
16624        let a = _mm_set_epi16(2, 2, 2, 2, 1, 1, 1, 1);
16625        let e = _mm_reduce_mul_epi16(a);
16626        assert_eq!(16, e);
16627    }
16628
16629    #[simd_test(enable = "avx512bw,avx512vl")]
16630    const fn test_mm_mask_reduce_mul_epi16() {
16631        let a = _mm_set_epi16(1, 1, 1, 1, 2, 2, 2, 2);
16632        let e = _mm_mask_reduce_mul_epi16(0b11110000, a);
16633        assert_eq!(1, e);
16634    }
16635
16636    #[simd_test(enable = "avx512bw,avx512vl")]
16637    const fn test_mm256_reduce_mul_epi8() {
16638        let a = _mm256_set_epi8(
16639            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,
16640            2, 2, 2,
16641        );
16642        let e = _mm256_reduce_mul_epi8(a);
16643        assert_eq!(64, e);
16644    }
16645
16646    #[simd_test(enable = "avx512bw,avx512vl")]
16647    const fn test_mm256_mask_reduce_mul_epi8() {
16648        let a = _mm256_set_epi8(
16649            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,
16650            2, 2, 2,
16651        );
16652        let e = _mm256_mask_reduce_mul_epi8(0b11111111_00000000_11111111_00000000, a);
16653        assert_eq!(1, e);
16654    }
16655
16656    #[simd_test(enable = "avx512bw,avx512vl")]
16657    const fn test_mm_reduce_mul_epi8() {
16658        let a = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2);
16659        let e = _mm_reduce_mul_epi8(a);
16660        assert_eq!(8, e);
16661    }
16662
16663    #[simd_test(enable = "avx512bw,avx512vl")]
16664    const fn test_mm_mask_reduce_mul_epi8() {
16665        let a = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2);
16666        let e = _mm_mask_reduce_mul_epi8(0b11111111_00000000, a);
16667        assert_eq!(1, e);
16668    }
16669
16670    #[simd_test(enable = "avx512bw,avx512vl")]
16671    const fn test_mm256_reduce_max_epi16() {
16672        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16673        let e: i16 = _mm256_reduce_max_epi16(a);
16674        assert_eq!(15, e);
16675    }
16676
16677    #[simd_test(enable = "avx512bw,avx512vl")]
16678    const fn test_mm256_mask_reduce_max_epi16() {
16679        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16680        let e: i16 = _mm256_mask_reduce_max_epi16(0b11111111_00000000, a);
16681        assert_eq!(7, e);
16682    }
16683
16684    #[simd_test(enable = "avx512bw,avx512vl")]
16685    const fn test_mm_reduce_max_epi16() {
16686        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
16687        let e: i16 = _mm_reduce_max_epi16(a);
16688        assert_eq!(7, e);
16689    }
16690
16691    #[simd_test(enable = "avx512bw,avx512vl")]
16692    const fn test_mm_mask_reduce_max_epi16() {
16693        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
16694        let e: i16 = _mm_mask_reduce_max_epi16(0b11110000, a);
16695        assert_eq!(3, e);
16696    }
16697
16698    #[simd_test(enable = "avx512bw,avx512vl")]
16699    const fn test_mm256_reduce_max_epi8() {
16700        let a = _mm256_set_epi8(
16701            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
16702            24, 25, 26, 27, 28, 29, 30, 31,
16703        );
16704        let e: i8 = _mm256_reduce_max_epi8(a);
16705        assert_eq!(31, e);
16706    }
16707
16708    #[simd_test(enable = "avx512bw,avx512vl")]
16709    const fn test_mm256_mask_reduce_max_epi8() {
16710        let a = _mm256_set_epi8(
16711            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
16712            24, 25, 26, 27, 28, 29, 30, 31,
16713        );
16714        let e: i8 = _mm256_mask_reduce_max_epi8(0b1111111111111111_0000000000000000, a);
16715        assert_eq!(15, e);
16716    }
16717
16718    #[simd_test(enable = "avx512bw,avx512vl")]
16719    const fn test_mm_reduce_max_epi8() {
16720        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16721        let e: i8 = _mm_reduce_max_epi8(a);
16722        assert_eq!(15, e);
16723    }
16724
16725    #[simd_test(enable = "avx512bw,avx512vl")]
16726    const fn test_mm_mask_reduce_max_epi8() {
16727        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16728        let e: i8 = _mm_mask_reduce_max_epi8(0b11111111_00000000, a);
16729        assert_eq!(7, e);
16730    }
16731
16732    #[simd_test(enable = "avx512bw,avx512vl")]
16733    const fn test_mm256_reduce_max_epu16() {
16734        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16735        let e: u16 = _mm256_reduce_max_epu16(a);
16736        assert_eq!(15, e);
16737    }
16738
16739    #[simd_test(enable = "avx512bw,avx512vl")]
16740    const fn test_mm256_mask_reduce_max_epu16() {
16741        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16742        let e: u16 = _mm256_mask_reduce_max_epu16(0b11111111_00000000, a);
16743        assert_eq!(7, e);
16744    }
16745
16746    #[simd_test(enable = "avx512bw,avx512vl")]
16747    const fn test_mm_reduce_max_epu16() {
16748        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
16749        let e: u16 = _mm_reduce_max_epu16(a);
16750        assert_eq!(7, e);
16751    }
16752
16753    #[simd_test(enable = "avx512bw,avx512vl")]
16754    const fn test_mm_mask_reduce_max_epu16() {
16755        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
16756        let e: u16 = _mm_mask_reduce_max_epu16(0b11110000, a);
16757        assert_eq!(3, e);
16758    }
16759
16760    #[simd_test(enable = "avx512bw,avx512vl")]
16761    const fn test_mm256_reduce_max_epu8() {
16762        let a = _mm256_set_epi8(
16763            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
16764            24, 25, 26, 27, 28, 29, 30, 31,
16765        );
16766        let e: u8 = _mm256_reduce_max_epu8(a);
16767        assert_eq!(31, e);
16768    }
16769
16770    #[simd_test(enable = "avx512bw,avx512vl")]
16771    const fn test_mm256_mask_reduce_max_epu8() {
16772        let a = _mm256_set_epi8(
16773            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
16774            24, 25, 26, 27, 28, 29, 30, 31,
16775        );
16776        let e: u8 = _mm256_mask_reduce_max_epu8(0b1111111111111111_0000000000000000, a);
16777        assert_eq!(15, e);
16778    }
16779
16780    #[simd_test(enable = "avx512bw,avx512vl")]
16781    const fn test_mm_reduce_max_epu8() {
16782        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16783        let e: u8 = _mm_reduce_max_epu8(a);
16784        assert_eq!(15, e);
16785    }
16786
16787    #[simd_test(enable = "avx512bw,avx512vl")]
16788    const fn test_mm_mask_reduce_max_epu8() {
16789        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16790        let e: u8 = _mm_mask_reduce_max_epu8(0b11111111_00000000, a);
16791        assert_eq!(7, e);
16792    }
16793
16794    #[simd_test(enable = "avx512bw,avx512vl")]
16795    const fn test_mm256_reduce_min_epi16() {
16796        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16797        let e: i16 = _mm256_reduce_min_epi16(a);
16798        assert_eq!(0, e);
16799    }
16800
16801    #[simd_test(enable = "avx512bw,avx512vl")]
16802    const fn test_mm256_mask_reduce_min_epi16() {
16803        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16804        let e: i16 = _mm256_mask_reduce_min_epi16(0b11111111_00000000, a);
16805        assert_eq!(0, e);
16806    }
16807
16808    #[simd_test(enable = "avx512bw,avx512vl")]
16809    const fn test_mm_reduce_min_epi16() {
16810        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
16811        let e: i16 = _mm_reduce_min_epi16(a);
16812        assert_eq!(0, e);
16813    }
16814
16815    #[simd_test(enable = "avx512bw,avx512vl")]
16816    const fn test_mm_mask_reduce_min_epi16() {
16817        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
16818        let e: i16 = _mm_mask_reduce_min_epi16(0b11110000, a);
16819        assert_eq!(0, e);
16820    }
16821
16822    #[simd_test(enable = "avx512bw,avx512vl")]
16823    const fn test_mm256_reduce_min_epi8() {
16824        let a = _mm256_set_epi8(
16825            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
16826            24, 25, 26, 27, 28, 29, 30, 31,
16827        );
16828        let e: i8 = _mm256_reduce_min_epi8(a);
16829        assert_eq!(0, e);
16830    }
16831
16832    #[simd_test(enable = "avx512bw,avx512vl")]
16833    const fn test_mm256_mask_reduce_min_epi8() {
16834        let a = _mm256_set_epi8(
16835            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
16836            24, 25, 26, 27, 28, 29, 30, 31,
16837        );
16838        let e: i8 = _mm256_mask_reduce_min_epi8(0b1111111111111111_0000000000000000, a);
16839        assert_eq!(0, e);
16840    }
16841
16842    #[simd_test(enable = "avx512bw,avx512vl")]
16843    const fn test_mm_reduce_min_epi8() {
16844        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16845        let e: i8 = _mm_reduce_min_epi8(a);
16846        assert_eq!(0, e);
16847    }
16848
16849    #[simd_test(enable = "avx512bw,avx512vl")]
16850    const fn test_mm_mask_reduce_min_epi8() {
16851        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16852        let e: i8 = _mm_mask_reduce_min_epi8(0b11111111_00000000, a);
16853        assert_eq!(0, e);
16854    }
16855
16856    #[simd_test(enable = "avx512bw,avx512vl")]
16857    const fn test_mm256_reduce_min_epu16() {
16858        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16859        let e: u16 = _mm256_reduce_min_epu16(a);
16860        assert_eq!(0, e);
16861    }
16862
16863    #[simd_test(enable = "avx512bw,avx512vl")]
16864    const fn test_mm256_mask_reduce_min_epu16() {
16865        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16866        let e: u16 = _mm256_mask_reduce_min_epu16(0b11111111_00000000, a);
16867        assert_eq!(0, e);
16868    }
16869
16870    #[simd_test(enable = "avx512bw,avx512vl")]
16871    const fn test_mm_reduce_min_epu16() {
16872        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
16873        let e: u16 = _mm_reduce_min_epu16(a);
16874        assert_eq!(0, e);
16875    }
16876
16877    #[simd_test(enable = "avx512bw,avx512vl")]
16878    const fn test_mm_mask_reduce_min_epu16() {
16879        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
16880        let e: u16 = _mm_mask_reduce_min_epu16(0b11110000, a);
16881        assert_eq!(0, e);
16882    }
16883
16884    #[simd_test(enable = "avx512bw,avx512vl")]
16885    const fn test_mm256_reduce_min_epu8() {
16886        let a = _mm256_set_epi8(
16887            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
16888            24, 25, 26, 27, 28, 29, 30, 31,
16889        );
16890        let e: u8 = _mm256_reduce_min_epu8(a);
16891        assert_eq!(0, e);
16892    }
16893
16894    #[simd_test(enable = "avx512bw,avx512vl")]
16895    const fn test_mm256_mask_reduce_min_epu8() {
16896        let a = _mm256_set_epi8(
16897            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
16898            24, 25, 26, 27, 28, 29, 30, 31,
16899        );
16900        let e: u8 = _mm256_mask_reduce_min_epu8(0b1111111111111111_0000000000000000, a);
16901        assert_eq!(0, e);
16902    }
16903
16904    #[simd_test(enable = "avx512bw,avx512vl")]
16905    const fn test_mm_reduce_min_epu8() {
16906        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16907        let e: u8 = _mm_reduce_min_epu8(a);
16908        assert_eq!(0, e);
16909    }
16910
16911    #[simd_test(enable = "avx512bw,avx512vl")]
16912    const fn test_mm_mask_reduce_min_epu8() {
16913        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
16914        let e: u8 = _mm_mask_reduce_min_epu8(0b11111111_00000000, a);
16915        assert_eq!(0, e);
16916    }
16917
16918    #[simd_test(enable = "avx512bw,avx512vl")]
16919    const fn test_mm256_reduce_or_epi16() {
16920        let a = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
16921        let e = _mm256_reduce_or_epi16(a);
16922        assert_eq!(3, e);
16923    }
16924
16925    #[simd_test(enable = "avx512bw,avx512vl")]
16926    const fn test_mm256_mask_reduce_or_epi16() {
16927        let a = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
16928        let e = _mm256_mask_reduce_or_epi16(0b11111111_00000000, a);
16929        assert_eq!(1, e);
16930    }
16931
16932    #[simd_test(enable = "avx512bw,avx512vl")]
16933    const fn test_mm_reduce_or_epi16() {
16934        let a = _mm_set_epi16(1, 1, 1, 1, 2, 2, 2, 2);
16935        let e = _mm_reduce_or_epi16(a);
16936        assert_eq!(3, e);
16937    }
16938
16939    #[simd_test(enable = "avx512bw,avx512vl")]
16940    const fn test_mm_mask_reduce_or_epi16() {
16941        let a = _mm_set_epi16(1, 1, 1, 1, 2, 2, 2, 2);
16942        let e = _mm_mask_reduce_or_epi16(0b11110000, a);
16943        assert_eq!(1, e);
16944    }
16945
16946    #[simd_test(enable = "avx512bw,avx512vl")]
16947    const fn test_mm256_reduce_or_epi8() {
16948        let a = _mm256_set_epi8(
16949            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,
16950            2, 2, 2,
16951        );
16952        let e = _mm256_reduce_or_epi8(a);
16953        assert_eq!(3, e);
16954    }
16955
16956    #[simd_test(enable = "avx512bw,avx512vl")]
16957    const fn test_mm256_mask_reduce_or_epi8() {
16958        let a = _mm256_set_epi8(
16959            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,
16960            2, 2, 2,
16961        );
16962        let e = _mm256_mask_reduce_or_epi8(0b11111111_00000000_11111111_00000000, a);
16963        assert_eq!(1, e);
16964    }
16965
16966    #[simd_test(enable = "avx512bw,avx512vl")]
16967    const fn test_mm_reduce_or_epi8() {
16968        let a = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
16969        let e = _mm_reduce_or_epi8(a);
16970        assert_eq!(3, e);
16971    }
16972
16973    #[simd_test(enable = "avx512bw,avx512vl")]
16974    const fn test_mm_mask_reduce_or_epi8() {
16975        let a = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
16976        let e = _mm_mask_reduce_or_epi8(0b11111111_00000000, a);
16977        assert_eq!(1, e);
16978    }
16979
16980    #[simd_test(enable = "avx512bw")]
16981    const fn test_mm512_loadu_epi16() {
16982        #[rustfmt::skip]
16983        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];
16984        let r = unsafe { _mm512_loadu_epi16(&a[0]) };
16985        #[rustfmt::skip]
16986        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);
16987        assert_eq_m512i(r, e);
16988    }
16989
16990    #[simd_test(enable = "avx512bw,avx512vl")]
16991    const fn test_mm256_loadu_epi16() {
16992        let a: [i16; 16] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
16993        let r = unsafe { _mm256_loadu_epi16(&a[0]) };
16994        let e = _mm256_set_epi16(16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
16995        assert_eq_m256i(r, e);
16996    }
16997
16998    #[simd_test(enable = "avx512bw,avx512vl")]
16999    const fn test_mm_loadu_epi16() {
17000        let a: [i16; 8] = [1, 2, 3, 4, 5, 6, 7, 8];
17001        let r = unsafe { _mm_loadu_epi16(&a[0]) };
17002        let e = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
17003        assert_eq_m128i(r, e);
17004    }
17005
17006    #[simd_test(enable = "avx512bw")]
17007    const fn test_mm512_loadu_epi8() {
17008        #[rustfmt::skip]
17009        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,
17010                           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];
17011        let r = unsafe { _mm512_loadu_epi8(&a[0]) };
17012        #[rustfmt::skip]
17013        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,
17014                                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);
17015        assert_eq_m512i(r, e);
17016    }
17017
17018    #[simd_test(enable = "avx512bw,avx512vl")]
17019    const fn test_mm256_loadu_epi8() {
17020        #[rustfmt::skip]
17021        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];
17022        let r = unsafe { _mm256_loadu_epi8(&a[0]) };
17023        #[rustfmt::skip]
17024        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);
17025        assert_eq_m256i(r, e);
17026    }
17027
17028    #[simd_test(enable = "avx512bw,avx512vl")]
17029    const fn test_mm_loadu_epi8() {
17030        let a: [i8; 16] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
17031        let r = unsafe { _mm_loadu_epi8(&a[0]) };
17032        let e = _mm_set_epi8(16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
17033        assert_eq_m128i(r, e);
17034    }
17035
17036    #[simd_test(enable = "avx512bw")]
17037    const fn test_mm512_storeu_epi16() {
17038        let a = _mm512_set1_epi16(9);
17039        let mut r = _mm512_undefined_epi32();
17040        unsafe {
17041            _mm512_storeu_epi16(&mut r as *mut _ as *mut i16, a);
17042        }
17043        assert_eq_m512i(r, a);
17044    }
17045
17046    #[simd_test(enable = "avx512bw,avx512vl")]
17047    const fn test_mm256_storeu_epi16() {
17048        let a = _mm256_set1_epi16(9);
17049        let mut r = _mm256_set1_epi32(0);
17050        unsafe {
17051            _mm256_storeu_epi16(&mut r as *mut _ as *mut i16, a);
17052        }
17053        assert_eq_m256i(r, a);
17054    }
17055
17056    #[simd_test(enable = "avx512bw,avx512vl")]
17057    const fn test_mm_storeu_epi16() {
17058        let a = _mm_set1_epi16(9);
17059        let mut r = _mm_set1_epi32(0);
17060        unsafe {
17061            _mm_storeu_epi16(&mut r as *mut _ as *mut i16, a);
17062        }
17063        assert_eq_m128i(r, a);
17064    }
17065
17066    #[simd_test(enable = "avx512bw")]
17067    const fn test_mm512_storeu_epi8() {
17068        let a = _mm512_set1_epi8(9);
17069        let mut r = _mm512_undefined_epi32();
17070        unsafe {
17071            _mm512_storeu_epi8(&mut r as *mut _ as *mut i8, a);
17072        }
17073        assert_eq_m512i(r, a);
17074    }
17075
17076    #[simd_test(enable = "avx512bw,avx512vl")]
17077    const fn test_mm256_storeu_epi8() {
17078        let a = _mm256_set1_epi8(9);
17079        let mut r = _mm256_set1_epi32(0);
17080        unsafe {
17081            _mm256_storeu_epi8(&mut r as *mut _ as *mut i8, a);
17082        }
17083        assert_eq_m256i(r, a);
17084    }
17085
17086    #[simd_test(enable = "avx512bw,avx512vl")]
17087    const fn test_mm_storeu_epi8() {
17088        let a = _mm_set1_epi8(9);
17089        let mut r = _mm_set1_epi32(0);
17090        unsafe {
17091            _mm_storeu_epi8(&mut r as *mut _ as *mut i8, a);
17092        }
17093        assert_eq_m128i(r, a);
17094    }
17095
17096    #[simd_test(enable = "avx512bw")]
17097    const fn test_mm512_mask_loadu_epi16() {
17098        let src = _mm512_set1_epi16(42);
17099        let a = &[
17100            1_i16, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
17101            24, 25, 26, 27, 28, 29, 30, 31, 32,
17102        ];
17103        let p = a.as_ptr();
17104        let m = 0b10101010_11001100_11101000_11001010;
17105        let r = unsafe { _mm512_mask_loadu_epi16(src, m, black_box(p)) };
17106        let e = &[
17107            42_i16, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16, 42, 42, 19, 20, 42, 42,
17108            23, 24, 42, 26, 42, 28, 42, 30, 42, 32,
17109        ];
17110        let e = unsafe { _mm512_loadu_epi16(e.as_ptr()) };
17111        assert_eq_m512i(r, e);
17112    }
17113
17114    #[simd_test(enable = "avx512bw")]
17115    const fn test_mm512_maskz_loadu_epi16() {
17116        let a = &[
17117            1_i16, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
17118            24, 25, 26, 27, 28, 29, 30, 31, 32,
17119        ];
17120        let p = a.as_ptr();
17121        let m = 0b10101010_11001100_11101000_11001010;
17122        let r = unsafe { _mm512_maskz_loadu_epi16(m, black_box(p)) };
17123        let e = &[
17124            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,
17125            26, 0, 28, 0, 30, 0, 32,
17126        ];
17127        let e = unsafe { _mm512_loadu_epi16(e.as_ptr()) };
17128        assert_eq_m512i(r, e);
17129    }
17130
17131    #[simd_test(enable = "avx512bw")]
17132    const fn test_mm512_mask_storeu_epi16() {
17133        let mut r = [42_i16; 32];
17134        let a = &[
17135            1_i16, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
17136            24, 25, 26, 27, 28, 29, 30, 31, 32,
17137        ];
17138        let a = unsafe { _mm512_loadu_epi16(a.as_ptr()) };
17139        let m = 0b10101010_11001100_11101000_11001010;
17140        unsafe {
17141            _mm512_mask_storeu_epi16(r.as_mut_ptr(), m, a);
17142        }
17143        let e = &[
17144            42_i16, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16, 42, 42, 19, 20, 42, 42,
17145            23, 24, 42, 26, 42, 28, 42, 30, 42, 32,
17146        ];
17147        let e = unsafe { _mm512_loadu_epi16(e.as_ptr()) };
17148        assert_eq_m512i(unsafe { _mm512_loadu_epi16(r.as_ptr()) }, e);
17149    }
17150
17151    #[simd_test(enable = "avx512bw")]
17152    const fn test_mm512_mask_loadu_epi8() {
17153        let src = _mm512_set1_epi8(42);
17154        let a = &[
17155            1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
17156            24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
17157            46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
17158        ];
17159        let p = a.as_ptr();
17160        let m = 0b00000000_11111111_11111111_00000000_10101010_11001100_11101000_11001010;
17161        let r = unsafe { _mm512_mask_loadu_epi8(src, m, black_box(p)) };
17162        let e = &[
17163            42_i8, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16, 42, 42, 19, 20, 42, 42,
17164            23, 24, 42, 26, 42, 28, 42, 30, 42, 32, 42, 42, 42, 42, 42, 42, 42, 42, 41, 42, 43, 44,
17165            45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 42, 42, 42, 42, 42, 42, 42, 42,
17166        ];
17167        let e = unsafe { _mm512_loadu_epi8(e.as_ptr()) };
17168        assert_eq_m512i(r, e);
17169    }
17170
17171    #[simd_test(enable = "avx512bw")]
17172    const fn test_mm512_maskz_loadu_epi8() {
17173        let a = &[
17174            1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
17175            24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
17176            46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
17177        ];
17178        let p = a.as_ptr();
17179        let m = 0b00000000_11111111_11111111_00000000_10101010_11001100_11101000_11001010;
17180        let r = unsafe { _mm512_maskz_loadu_epi8(m, black_box(p)) };
17181        let e = &[
17182            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,
17183            26, 0, 28, 0, 30, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 41, 42, 43, 44, 45, 46, 47, 48, 49,
17184            50, 51, 52, 53, 54, 55, 56, 0, 0, 0, 0, 0, 0, 0, 0,
17185        ];
17186        let e = unsafe { _mm512_loadu_epi8(e.as_ptr()) };
17187        assert_eq_m512i(r, e);
17188    }
17189
17190    #[simd_test(enable = "avx512bw")]
17191    const fn test_mm512_mask_storeu_epi8() {
17192        let mut r = [42_i8; 64];
17193        let a = &[
17194            1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
17195            24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
17196            46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
17197        ];
17198        let a = unsafe { _mm512_loadu_epi8(a.as_ptr()) };
17199        let m = 0b00000000_11111111_11111111_00000000_10101010_11001100_11101000_11001010;
17200        unsafe {
17201            _mm512_mask_storeu_epi8(r.as_mut_ptr(), m, a);
17202        }
17203        let e = &[
17204            42_i8, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16, 42, 42, 19, 20, 42, 42,
17205            23, 24, 42, 26, 42, 28, 42, 30, 42, 32, 42, 42, 42, 42, 42, 42, 42, 42, 41, 42, 43, 44,
17206            45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 42, 42, 42, 42, 42, 42, 42, 42,
17207        ];
17208        let e = unsafe { _mm512_loadu_epi8(e.as_ptr()) };
17209        assert_eq_m512i(unsafe { _mm512_loadu_epi8(r.as_ptr()) }, e);
17210    }
17211
17212    #[simd_test(enable = "avx512bw,avx512vl")]
17213    const fn test_mm256_mask_loadu_epi16() {
17214        let src = _mm256_set1_epi16(42);
17215        let a = &[1_i16, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
17216        let p = a.as_ptr();
17217        let m = 0b11101000_11001010;
17218        let r = unsafe { _mm256_mask_loadu_epi16(src, m, black_box(p)) };
17219        let e = &[
17220            42_i16, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16,
17221        ];
17222        let e = unsafe { _mm256_loadu_epi16(e.as_ptr()) };
17223        assert_eq_m256i(r, e);
17224    }
17225
17226    #[simd_test(enable = "avx512bw,avx512vl")]
17227    const fn test_mm256_maskz_loadu_epi16() {
17228        let a = &[1_i16, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
17229        let p = a.as_ptr();
17230        let m = 0b11101000_11001010;
17231        let r = unsafe { _mm256_maskz_loadu_epi16(m, black_box(p)) };
17232        let e = &[0_i16, 2, 0, 4, 0, 0, 7, 8, 0, 0, 0, 12, 0, 14, 15, 16];
17233        let e = unsafe { _mm256_loadu_epi16(e.as_ptr()) };
17234        assert_eq_m256i(r, e);
17235    }
17236
17237    #[simd_test(enable = "avx512bw,avx512vl")]
17238    const fn test_mm256_mask_storeu_epi16() {
17239        let mut r = [42_i16; 16];
17240        let a = &[1_i16, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
17241        let a = unsafe { _mm256_loadu_epi16(a.as_ptr()) };
17242        let m = 0b11101000_11001010;
17243        unsafe {
17244            _mm256_mask_storeu_epi16(r.as_mut_ptr(), m, a);
17245        }
17246        let e = &[
17247            42_i16, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16,
17248        ];
17249        let e = unsafe { _mm256_loadu_epi16(e.as_ptr()) };
17250        assert_eq_m256i(unsafe { _mm256_loadu_epi16(r.as_ptr()) }, e);
17251    }
17252
17253    #[simd_test(enable = "avx512bw,avx512vl")]
17254    const fn test_mm256_mask_loadu_epi8() {
17255        let src = _mm256_set1_epi8(42);
17256        let a = &[
17257            1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
17258            24, 25, 26, 27, 28, 29, 30, 31, 32,
17259        ];
17260        let p = a.as_ptr();
17261        let m = 0b10101010_11001100_11101000_11001010;
17262        let r = unsafe { _mm256_mask_loadu_epi8(src, m, black_box(p)) };
17263        let e = &[
17264            42_i8, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16, 42, 42, 19, 20, 42, 42,
17265            23, 24, 42, 26, 42, 28, 42, 30, 42, 32,
17266        ];
17267        let e = unsafe { _mm256_loadu_epi8(e.as_ptr()) };
17268        assert_eq_m256i(r, e);
17269    }
17270
17271    #[simd_test(enable = "avx512bw,avx512vl")]
17272    const fn test_mm256_maskz_loadu_epi8() {
17273        let a = &[
17274            1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
17275            24, 25, 26, 27, 28, 29, 30, 31, 32,
17276        ];
17277        let p = a.as_ptr();
17278        let m = 0b10101010_11001100_11101000_11001010;
17279        let r = unsafe { _mm256_maskz_loadu_epi8(m, black_box(p)) };
17280        let e = &[
17281            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,
17282            26, 0, 28, 0, 30, 0, 32,
17283        ];
17284        let e = unsafe { _mm256_loadu_epi8(e.as_ptr()) };
17285        assert_eq_m256i(r, e);
17286    }
17287
17288    #[simd_test(enable = "avx512bw,avx512vl")]
17289    const fn test_mm256_mask_storeu_epi8() {
17290        let mut r = [42_i8; 32];
17291        let a = &[
17292            1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
17293            24, 25, 26, 27, 28, 29, 30, 31, 32,
17294        ];
17295        let a = unsafe { _mm256_loadu_epi8(a.as_ptr()) };
17296        let m = 0b10101010_11001100_11101000_11001010;
17297        unsafe {
17298            _mm256_mask_storeu_epi8(r.as_mut_ptr(), m, a);
17299        }
17300        let e = &[
17301            42_i8, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16, 42, 42, 19, 20, 42, 42,
17302            23, 24, 42, 26, 42, 28, 42, 30, 42, 32,
17303        ];
17304        let e = unsafe { _mm256_loadu_epi8(e.as_ptr()) };
17305        assert_eq_m256i(unsafe { _mm256_loadu_epi8(r.as_ptr()) }, e);
17306    }
17307
17308    #[simd_test(enable = "avx512bw,avx512vl")]
17309    const fn test_mm_mask_loadu_epi16() {
17310        let src = _mm_set1_epi16(42);
17311        let a = &[1_i16, 2, 3, 4, 5, 6, 7, 8];
17312        let p = a.as_ptr();
17313        let m = 0b11001010;
17314        let r = unsafe { _mm_mask_loadu_epi16(src, m, black_box(p)) };
17315        let e = &[42_i16, 2, 42, 4, 42, 42, 7, 8];
17316        let e = unsafe { _mm_loadu_epi16(e.as_ptr()) };
17317        assert_eq_m128i(r, e);
17318    }
17319
17320    #[simd_test(enable = "avx512bw,avx512vl")]
17321    const fn test_mm_maskz_loadu_epi16() {
17322        let a = &[1_i16, 2, 3, 4, 5, 6, 7, 8];
17323        let p = a.as_ptr();
17324        let m = 0b11001010;
17325        let r = unsafe { _mm_maskz_loadu_epi16(m, black_box(p)) };
17326        let e = &[0_i16, 2, 0, 4, 0, 0, 7, 8];
17327        let e = unsafe { _mm_loadu_epi16(e.as_ptr()) };
17328        assert_eq_m128i(r, e);
17329    }
17330
17331    #[simd_test(enable = "avx512bw,avx512vl")]
17332    const fn test_mm_mask_storeu_epi16() {
17333        let mut r = [42_i16; 8];
17334        let a = &[1_i16, 2, 3, 4, 5, 6, 7, 8];
17335        let a = unsafe { _mm_loadu_epi16(a.as_ptr()) };
17336        let m = 0b11001010;
17337        unsafe { _mm_mask_storeu_epi16(r.as_mut_ptr(), m, a) };
17338        let e = &[42_i16, 2, 42, 4, 42, 42, 7, 8];
17339        let e = unsafe { _mm_loadu_epi16(e.as_ptr()) };
17340        assert_eq_m128i(unsafe { _mm_loadu_epi16(r.as_ptr()) }, e);
17341    }
17342
17343    #[simd_test(enable = "avx512bw,avx512vl")]
17344    const fn test_mm_mask_loadu_epi8() {
17345        let src = _mm_set1_epi8(42);
17346        let a = &[1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
17347        let p = a.as_ptr();
17348        let m = 0b11101000_11001010;
17349        let r = unsafe { _mm_mask_loadu_epi8(src, m, black_box(p)) };
17350        let e = &[
17351            42_i8, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16,
17352        ];
17353        let e = unsafe { _mm_loadu_epi8(e.as_ptr()) };
17354        assert_eq_m128i(r, e);
17355    }
17356
17357    #[simd_test(enable = "avx512bw,avx512vl")]
17358    const fn test_mm_maskz_loadu_epi8() {
17359        let a = &[1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
17360        let p = a.as_ptr();
17361        let m = 0b11101000_11001010;
17362        let r = unsafe { _mm_maskz_loadu_epi8(m, black_box(p)) };
17363        let e = &[0_i8, 2, 0, 4, 0, 0, 7, 8, 0, 0, 0, 12, 0, 14, 15, 16];
17364        let e = unsafe { _mm_loadu_epi8(e.as_ptr()) };
17365        assert_eq_m128i(r, e);
17366    }
17367
17368    #[simd_test(enable = "avx512bw,avx512vl")]
17369    const fn test_mm_mask_storeu_epi8() {
17370        let mut r = [42_i8; 16];
17371        let a = &[1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
17372        let a = unsafe { _mm_loadu_epi8(a.as_ptr()) };
17373        let m = 0b11101000_11001010;
17374        unsafe { _mm_mask_storeu_epi8(r.as_mut_ptr(), m, a) };
17375        let e = &[
17376            42_i8, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16,
17377        ];
17378        let e = unsafe { _mm_loadu_epi8(e.as_ptr()) };
17379        assert_eq_m128i(unsafe { _mm_loadu_epi8(r.as_ptr()) }, e);
17380    }
17381
17382    #[simd_test(enable = "avx512bw")]
17383    fn test_mm512_madd_epi16() {
17384        let a = _mm512_set1_epi16(1);
17385        let b = _mm512_set1_epi16(1);
17386        let r = _mm512_madd_epi16(a, b);
17387        let e = _mm512_set1_epi32(2);
17388        assert_eq_m512i(r, e);
17389    }
17390
17391    #[simd_test(enable = "avx512bw")]
17392    fn test_mm512_mask_madd_epi16() {
17393        let a = _mm512_set1_epi16(1);
17394        let b = _mm512_set1_epi16(1);
17395        let r = _mm512_mask_madd_epi16(a, 0, a, b);
17396        assert_eq_m512i(r, a);
17397        let r = _mm512_mask_madd_epi16(a, 0b00000000_00001111, a, b);
17398        let e = _mm512_set_epi32(
17399            1 << 16 | 1,
17400            1 << 16 | 1,
17401            1 << 16 | 1,
17402            1 << 16 | 1,
17403            1 << 16 | 1,
17404            1 << 16 | 1,
17405            1 << 16 | 1,
17406            1 << 16 | 1,
17407            1 << 16 | 1,
17408            1 << 16 | 1,
17409            1 << 16 | 1,
17410            1 << 16 | 1,
17411            2,
17412            2,
17413            2,
17414            2,
17415        );
17416        assert_eq_m512i(r, e);
17417    }
17418
17419    #[simd_test(enable = "avx512bw")]
17420    fn test_mm512_maskz_madd_epi16() {
17421        let a = _mm512_set1_epi16(1);
17422        let b = _mm512_set1_epi16(1);
17423        let r = _mm512_maskz_madd_epi16(0, a, b);
17424        assert_eq_m512i(r, _mm512_setzero_si512());
17425        let r = _mm512_maskz_madd_epi16(0b00000000_00001111, a, b);
17426        let e = _mm512_set_epi32(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2);
17427        assert_eq_m512i(r, e);
17428    }
17429
17430    #[simd_test(enable = "avx512bw,avx512vl")]
17431    fn test_mm256_mask_madd_epi16() {
17432        let a = _mm256_set1_epi16(1);
17433        let b = _mm256_set1_epi16(1);
17434        let r = _mm256_mask_madd_epi16(a, 0, a, b);
17435        assert_eq_m256i(r, a);
17436        let r = _mm256_mask_madd_epi16(a, 0b00001111, a, b);
17437        let e = _mm256_set_epi32(
17438            1 << 16 | 1,
17439            1 << 16 | 1,
17440            1 << 16 | 1,
17441            1 << 16 | 1,
17442            2,
17443            2,
17444            2,
17445            2,
17446        );
17447        assert_eq_m256i(r, e);
17448    }
17449
17450    #[simd_test(enable = "avx512bw,avx512vl")]
17451    fn test_mm256_maskz_madd_epi16() {
17452        let a = _mm256_set1_epi16(1);
17453        let b = _mm256_set1_epi16(1);
17454        let r = _mm256_maskz_madd_epi16(0, a, b);
17455        assert_eq_m256i(r, _mm256_setzero_si256());
17456        let r = _mm256_maskz_madd_epi16(0b00001111, a, b);
17457        let e = _mm256_set_epi32(0, 0, 0, 0, 2, 2, 2, 2);
17458        assert_eq_m256i(r, e);
17459    }
17460
17461    #[simd_test(enable = "avx512bw,avx512vl")]
17462    fn test_mm_mask_madd_epi16() {
17463        let a = _mm_set1_epi16(1);
17464        let b = _mm_set1_epi16(1);
17465        let r = _mm_mask_madd_epi16(a, 0, a, b);
17466        assert_eq_m128i(r, a);
17467        let r = _mm_mask_madd_epi16(a, 0b00001111, a, b);
17468        let e = _mm_set_epi32(2, 2, 2, 2);
17469        assert_eq_m128i(r, e);
17470    }
17471
17472    #[simd_test(enable = "avx512bw,avx512vl")]
17473    fn test_mm_maskz_madd_epi16() {
17474        let a = _mm_set1_epi16(1);
17475        let b = _mm_set1_epi16(1);
17476        let r = _mm_maskz_madd_epi16(0, a, b);
17477        assert_eq_m128i(r, _mm_setzero_si128());
17478        let r = _mm_maskz_madd_epi16(0b00001111, a, b);
17479        let e = _mm_set_epi32(2, 2, 2, 2);
17480        assert_eq_m128i(r, e);
17481    }
17482
17483    #[simd_test(enable = "avx512bw")]
17484    fn test_mm512_maddubs_epi16() {
17485        let a = _mm512_set1_epi8(1);
17486        let b = _mm512_set1_epi8(1);
17487        let r = _mm512_maddubs_epi16(a, b);
17488        let e = _mm512_set1_epi16(2);
17489        assert_eq_m512i(r, e);
17490    }
17491
17492    #[simd_test(enable = "avx512bw")]
17493    fn test_mm512_mask_maddubs_epi16() {
17494        let a = _mm512_set1_epi8(1);
17495        let b = _mm512_set1_epi8(1);
17496        let src = _mm512_set1_epi16(1);
17497        let r = _mm512_mask_maddubs_epi16(src, 0, a, b);
17498        assert_eq_m512i(r, src);
17499        let r = _mm512_mask_add_epi16(src, 0b00000000_00000000_00000000_00000001, a, b);
17500        #[rustfmt::skip]
17501        let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
17502                                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1<<9|2);
17503        assert_eq_m512i(r, e);
17504    }
17505
17506    #[simd_test(enable = "avx512bw")]
17507    fn test_mm512_maskz_maddubs_epi16() {
17508        let a = _mm512_set1_epi8(1);
17509        let b = _mm512_set1_epi8(1);
17510        let r = _mm512_maskz_maddubs_epi16(0, a, b);
17511        assert_eq_m512i(r, _mm512_setzero_si512());
17512        let r = _mm512_maskz_maddubs_epi16(0b00000000_11111111_00000000_11111111, a, b);
17513        #[rustfmt::skip]
17514        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2,
17515                                 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2);
17516        assert_eq_m512i(r, e);
17517    }
17518
17519    #[simd_test(enable = "avx512bw,avx512vl")]
17520    fn test_mm256_mask_maddubs_epi16() {
17521        let a = _mm256_set1_epi8(1);
17522        let b = _mm256_set1_epi8(1);
17523        let src = _mm256_set1_epi16(1);
17524        let r = _mm256_mask_maddubs_epi16(src, 0, a, b);
17525        assert_eq_m256i(r, src);
17526        let r = _mm256_mask_add_epi16(src, 0b00000000_00000001, a, b);
17527        let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 << 9 | 2);
17528        assert_eq_m256i(r, e);
17529    }
17530
17531    #[simd_test(enable = "avx512bw,avx512vl")]
17532    fn test_mm256_maskz_maddubs_epi16() {
17533        let a = _mm256_set1_epi8(1);
17534        let b = _mm256_set1_epi8(1);
17535        let r = _mm256_maskz_maddubs_epi16(0, a, b);
17536        assert_eq_m256i(r, _mm256_setzero_si256());
17537        let r = _mm256_maskz_maddubs_epi16(0b00000000_11111111, a, b);
17538        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2);
17539        assert_eq_m256i(r, e);
17540    }
17541
17542    #[simd_test(enable = "avx512bw,avx512vl")]
17543    fn test_mm_mask_maddubs_epi16() {
17544        let a = _mm_set1_epi8(1);
17545        let b = _mm_set1_epi8(1);
17546        let src = _mm_set1_epi16(1);
17547        let r = _mm_mask_maddubs_epi16(src, 0, a, b);
17548        assert_eq_m128i(r, src);
17549        let r = _mm_mask_add_epi16(src, 0b00000001, a, b);
17550        let e = _mm_set_epi16(1, 1, 1, 1, 1, 1, 1, 1 << 9 | 2);
17551        assert_eq_m128i(r, e);
17552    }
17553
17554    #[simd_test(enable = "avx512bw,avx512vl")]
17555    fn test_mm_maskz_maddubs_epi16() {
17556        let a = _mm_set1_epi8(1);
17557        let b = _mm_set1_epi8(1);
17558        let r = _mm_maskz_maddubs_epi16(0, a, b);
17559        assert_eq_m128i(r, _mm_setzero_si128());
17560        let r = _mm_maskz_maddubs_epi16(0b00001111, a, b);
17561        let e = _mm_set_epi16(0, 0, 0, 0, 2, 2, 2, 2);
17562        assert_eq_m128i(r, e);
17563    }
17564
17565    #[simd_test(enable = "avx512bw")]
17566    fn test_mm512_packs_epi32() {
17567        let a = _mm512_set1_epi32(i32::MAX);
17568        let b = _mm512_set1_epi32(1);
17569        let r = _mm512_packs_epi32(a, b);
17570        #[rustfmt::skip]
17571        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,
17572                                 1, 1, 1, 1, i16::MAX, i16::MAX, i16::MAX, i16::MAX, 1, 1, 1, 1, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
17573        assert_eq_m512i(r, e);
17574    }
17575
17576    #[simd_test(enable = "avx512bw")]
17577    fn test_mm512_mask_packs_epi32() {
17578        let a = _mm512_set1_epi32(i32::MAX);
17579        let b = _mm512_set1_epi32(1 << 16 | 1);
17580        let r = _mm512_mask_packs_epi32(a, 0, a, b);
17581        assert_eq_m512i(r, a);
17582        let r = _mm512_mask_packs_epi32(b, 0b00000000_00000000_00000000_00001111, a, b);
17583        #[rustfmt::skip]
17584        let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
17585                                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
17586        assert_eq_m512i(r, e);
17587    }
17588
17589    #[simd_test(enable = "avx512bw")]
17590    fn test_mm512_maskz_packs_epi32() {
17591        let a = _mm512_set1_epi32(i32::MAX);
17592        let b = _mm512_set1_epi32(1);
17593        let r = _mm512_maskz_packs_epi32(0, a, b);
17594        assert_eq_m512i(r, _mm512_setzero_si512());
17595        let r = _mm512_maskz_packs_epi32(0b00000000_00000000_00000000_00001111, a, b);
17596        #[rustfmt::skip]
17597        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17598                                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
17599        assert_eq_m512i(r, e);
17600    }
17601
17602    #[simd_test(enable = "avx512bw,avx512vl")]
17603    fn test_mm256_mask_packs_epi32() {
17604        let a = _mm256_set1_epi32(i32::MAX);
17605        let b = _mm256_set1_epi32(1 << 16 | 1);
17606        let r = _mm256_mask_packs_epi32(a, 0, a, b);
17607        assert_eq_m256i(r, a);
17608        let r = _mm256_mask_packs_epi32(b, 0b00000000_00001111, a, b);
17609        #[rustfmt::skip]
17610        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);
17611        assert_eq_m256i(r, e);
17612    }
17613
17614    #[simd_test(enable = "avx512bw,avx512vl")]
17615    fn test_mm256_maskz_packs_epi32() {
17616        let a = _mm256_set1_epi32(i32::MAX);
17617        let b = _mm256_set1_epi32(1);
17618        let r = _mm256_maskz_packs_epi32(0, a, b);
17619        assert_eq_m256i(r, _mm256_setzero_si256());
17620        let r = _mm256_maskz_packs_epi32(0b00000000_00001111, a, b);
17621        #[rustfmt::skip]
17622        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);
17623        assert_eq_m256i(r, e);
17624    }
17625
17626    #[simd_test(enable = "avx512bw,avx512vl")]
17627    fn test_mm_mask_packs_epi32() {
17628        let a = _mm_set1_epi32(i32::MAX);
17629        let b = _mm_set1_epi32(1 << 16 | 1);
17630        let r = _mm_mask_packs_epi32(a, 0, a, b);
17631        assert_eq_m128i(r, a);
17632        let r = _mm_mask_packs_epi32(b, 0b00001111, a, b);
17633        let e = _mm_set_epi16(1, 1, 1, 1, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
17634        assert_eq_m128i(r, e);
17635    }
17636
17637    #[simd_test(enable = "avx512bw,avx512vl")]
17638    fn test_mm_maskz_packs_epi32() {
17639        let a = _mm_set1_epi32(i32::MAX);
17640        let b = _mm_set1_epi32(1);
17641        let r = _mm_maskz_packs_epi32(0, a, b);
17642        assert_eq_m128i(r, _mm_setzero_si128());
17643        let r = _mm_maskz_packs_epi32(0b00001111, a, b);
17644        let e = _mm_set_epi16(0, 0, 0, 0, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
17645        assert_eq_m128i(r, e);
17646    }
17647
17648    #[simd_test(enable = "avx512bw")]
17649    fn test_mm512_packs_epi16() {
17650        let a = _mm512_set1_epi16(i16::MAX);
17651        let b = _mm512_set1_epi16(1);
17652        let r = _mm512_packs_epi16(a, b);
17653        #[rustfmt::skip]
17654        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,
17655                                1, 1, 1, 1, 1, 1, 1, 1, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX,
17656                                1, 1, 1, 1, 1, 1, 1, 1, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX,
17657                                1, 1, 1, 1, 1, 1, 1, 1, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
17658        assert_eq_m512i(r, e);
17659    }
17660
17661    #[simd_test(enable = "avx512bw")]
17662    fn test_mm512_mask_packs_epi16() {
17663        let a = _mm512_set1_epi16(i16::MAX);
17664        let b = _mm512_set1_epi16(1 << 8 | 1);
17665        let r = _mm512_mask_packs_epi16(a, 0, a, b);
17666        assert_eq_m512i(r, a);
17667        let r = _mm512_mask_packs_epi16(
17668            b,
17669            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
17670            a,
17671            b,
17672        );
17673        #[rustfmt::skip]
17674        let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
17675                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
17676                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
17677                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
17678        assert_eq_m512i(r, e);
17679    }
17680
17681    #[simd_test(enable = "avx512bw")]
17682    fn test_mm512_maskz_packs_epi16() {
17683        let a = _mm512_set1_epi16(i16::MAX);
17684        let b = _mm512_set1_epi16(1);
17685        let r = _mm512_maskz_packs_epi16(0, a, b);
17686        assert_eq_m512i(r, _mm512_setzero_si512());
17687        let r = _mm512_maskz_packs_epi16(
17688            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
17689            a,
17690            b,
17691        );
17692        #[rustfmt::skip]
17693        let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17694                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17695                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17696                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
17697        assert_eq_m512i(r, e);
17698    }
17699
17700    #[simd_test(enable = "avx512bw,avx512vl")]
17701    fn test_mm256_mask_packs_epi16() {
17702        let a = _mm256_set1_epi16(i16::MAX);
17703        let b = _mm256_set1_epi16(1 << 8 | 1);
17704        let r = _mm256_mask_packs_epi16(a, 0, a, b);
17705        assert_eq_m256i(r, a);
17706        let r = _mm256_mask_packs_epi16(b, 0b00000000_00000000_00000000_00001111, a, b);
17707        #[rustfmt::skip]
17708        let e = _mm256_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
17709                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
17710        assert_eq_m256i(r, e);
17711    }
17712
17713    #[simd_test(enable = "avx512bw,avx512vl")]
17714    fn test_mm256_maskz_packs_epi16() {
17715        let a = _mm256_set1_epi16(i16::MAX);
17716        let b = _mm256_set1_epi16(1);
17717        let r = _mm256_maskz_packs_epi16(0, a, b);
17718        assert_eq_m256i(r, _mm256_setzero_si256());
17719        let r = _mm256_maskz_packs_epi16(0b00000000_00000000_00000000_00001111, a, b);
17720        #[rustfmt::skip]
17721        let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17722                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
17723        assert_eq_m256i(r, e);
17724    }
17725
17726    #[simd_test(enable = "avx512bw,avx512vl")]
17727    fn test_mm_mask_packs_epi16() {
17728        let a = _mm_set1_epi16(i16::MAX);
17729        let b = _mm_set1_epi16(1 << 8 | 1);
17730        let r = _mm_mask_packs_epi16(a, 0, a, b);
17731        assert_eq_m128i(r, a);
17732        let r = _mm_mask_packs_epi16(b, 0b00000000_00001111, a, b);
17733        #[rustfmt::skip]
17734        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);
17735        assert_eq_m128i(r, e);
17736    }
17737
17738    #[simd_test(enable = "avx512bw,avx512vl")]
17739    fn test_mm_maskz_packs_epi16() {
17740        let a = _mm_set1_epi16(i16::MAX);
17741        let b = _mm_set1_epi16(1);
17742        let r = _mm_maskz_packs_epi16(0, a, b);
17743        assert_eq_m128i(r, _mm_setzero_si128());
17744        let r = _mm_maskz_packs_epi16(0b00000000_00001111, a, b);
17745        #[rustfmt::skip]
17746        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);
17747        assert_eq_m128i(r, e);
17748    }
17749
17750    #[simd_test(enable = "avx512bw")]
17751    fn test_mm512_packus_epi32() {
17752        let a = _mm512_set1_epi32(-1);
17753        let b = _mm512_set1_epi32(1);
17754        let r = _mm512_packus_epi32(a, b);
17755        #[rustfmt::skip]
17756        let e = _mm512_set_epi16(1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0,
17757                                 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0);
17758        assert_eq_m512i(r, e);
17759    }
17760
17761    #[simd_test(enable = "avx512bw")]
17762    fn test_mm512_mask_packus_epi32() {
17763        let a = _mm512_set1_epi32(-1);
17764        let b = _mm512_set1_epi32(1 << 16 | 1);
17765        let r = _mm512_mask_packus_epi32(a, 0, a, b);
17766        assert_eq_m512i(r, a);
17767        let r = _mm512_mask_packus_epi32(b, 0b00000000_00000000_00000000_00001111, a, b);
17768        #[rustfmt::skip]
17769        let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
17770                                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
17771        assert_eq_m512i(r, e);
17772    }
17773
17774    #[simd_test(enable = "avx512bw")]
17775    fn test_mm512_maskz_packus_epi32() {
17776        let a = _mm512_set1_epi32(-1);
17777        let b = _mm512_set1_epi32(1);
17778        let r = _mm512_maskz_packus_epi32(0, a, b);
17779        assert_eq_m512i(r, _mm512_setzero_si512());
17780        let r = _mm512_maskz_packus_epi32(0b00000000_00000000_00000000_00001111, a, b);
17781        #[rustfmt::skip]
17782        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17783                                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
17784        assert_eq_m512i(r, e);
17785    }
17786
17787    #[simd_test(enable = "avx512bw,avx512vl")]
17788    fn test_mm256_mask_packus_epi32() {
17789        let a = _mm256_set1_epi32(-1);
17790        let b = _mm256_set1_epi32(1 << 16 | 1);
17791        let r = _mm256_mask_packus_epi32(a, 0, a, b);
17792        assert_eq_m256i(r, a);
17793        let r = _mm256_mask_packus_epi32(b, 0b00000000_00001111, a, b);
17794        let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
17795        assert_eq_m256i(r, e);
17796    }
17797
17798    #[simd_test(enable = "avx512bw,avx512vl")]
17799    fn test_mm256_maskz_packus_epi32() {
17800        let a = _mm256_set1_epi32(-1);
17801        let b = _mm256_set1_epi32(1);
17802        let r = _mm256_maskz_packus_epi32(0, a, b);
17803        assert_eq_m256i(r, _mm256_setzero_si256());
17804        let r = _mm256_maskz_packus_epi32(0b00000000_00001111, a, b);
17805        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
17806        assert_eq_m256i(r, e);
17807    }
17808
17809    #[simd_test(enable = "avx512bw,avx512vl")]
17810    fn test_mm_mask_packus_epi32() {
17811        let a = _mm_set1_epi32(-1);
17812        let b = _mm_set1_epi32(1 << 16 | 1);
17813        let r = _mm_mask_packus_epi32(a, 0, a, b);
17814        assert_eq_m128i(r, a);
17815        let r = _mm_mask_packus_epi32(b, 0b00001111, a, b);
17816        let e = _mm_set_epi16(1, 1, 1, 1, 0, 0, 0, 0);
17817        assert_eq_m128i(r, e);
17818    }
17819
17820    #[simd_test(enable = "avx512bw,avx512vl")]
17821    fn test_mm_maskz_packus_epi32() {
17822        let a = _mm_set1_epi32(-1);
17823        let b = _mm_set1_epi32(1);
17824        let r = _mm_maskz_packus_epi32(0, a, b);
17825        assert_eq_m128i(r, _mm_setzero_si128());
17826        let r = _mm_maskz_packus_epi32(0b00001111, a, b);
17827        let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, 0, 0);
17828        assert_eq_m128i(r, e);
17829    }
17830
17831    #[simd_test(enable = "avx512bw")]
17832    fn test_mm512_packus_epi16() {
17833        let a = _mm512_set1_epi16(-1);
17834        let b = _mm512_set1_epi16(1);
17835        let r = _mm512_packus_epi16(a, b);
17836        #[rustfmt::skip]
17837        let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
17838                                1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
17839                                1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
17840                                1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0);
17841        assert_eq_m512i(r, e);
17842    }
17843
17844    #[simd_test(enable = "avx512bw")]
17845    fn test_mm512_mask_packus_epi16() {
17846        let a = _mm512_set1_epi16(-1);
17847        let b = _mm512_set1_epi16(1 << 8 | 1);
17848        let r = _mm512_mask_packus_epi16(a, 0, a, b);
17849        assert_eq_m512i(r, a);
17850        let r = _mm512_mask_packus_epi16(
17851            b,
17852            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
17853            a,
17854            b,
17855        );
17856        #[rustfmt::skip]
17857        let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
17858                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
17859                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
17860                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
17861        assert_eq_m512i(r, e);
17862    }
17863
17864    #[simd_test(enable = "avx512bw")]
17865    fn test_mm512_maskz_packus_epi16() {
17866        let a = _mm512_set1_epi16(-1);
17867        let b = _mm512_set1_epi16(1);
17868        let r = _mm512_maskz_packus_epi16(0, a, b);
17869        assert_eq_m512i(r, _mm512_setzero_si512());
17870        let r = _mm512_maskz_packus_epi16(
17871            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
17872            a,
17873            b,
17874        );
17875        #[rustfmt::skip]
17876        let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17877                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17878                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17879                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
17880        assert_eq_m512i(r, e);
17881    }
17882
17883    #[simd_test(enable = "avx512bw,avx512vl")]
17884    fn test_mm256_mask_packus_epi16() {
17885        let a = _mm256_set1_epi16(-1);
17886        let b = _mm256_set1_epi16(1 << 8 | 1);
17887        let r = _mm256_mask_packus_epi16(a, 0, a, b);
17888        assert_eq_m256i(r, a);
17889        let r = _mm256_mask_packus_epi16(b, 0b00000000_00000000_00000000_00001111, a, b);
17890        #[rustfmt::skip]
17891        let e = _mm256_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
17892                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
17893        assert_eq_m256i(r, e);
17894    }
17895
17896    #[simd_test(enable = "avx512bw,avx512vl")]
17897    fn test_mm256_maskz_packus_epi16() {
17898        let a = _mm256_set1_epi16(-1);
17899        let b = _mm256_set1_epi16(1);
17900        let r = _mm256_maskz_packus_epi16(0, a, b);
17901        assert_eq_m256i(r, _mm256_setzero_si256());
17902        let r = _mm256_maskz_packus_epi16(0b00000000_00000000_00000000_00001111, a, b);
17903        #[rustfmt::skip]
17904        let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17905                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
17906        assert_eq_m256i(r, e);
17907    }
17908
17909    #[simd_test(enable = "avx512bw,avx512vl")]
17910    fn test_mm_mask_packus_epi16() {
17911        let a = _mm_set1_epi16(-1);
17912        let b = _mm_set1_epi16(1 << 8 | 1);
17913        let r = _mm_mask_packus_epi16(a, 0, a, b);
17914        assert_eq_m128i(r, a);
17915        let r = _mm_mask_packus_epi16(b, 0b00000000_00001111, a, b);
17916        let e = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
17917        assert_eq_m128i(r, e);
17918    }
17919
17920    #[simd_test(enable = "avx512bw,avx512vl")]
17921    fn test_mm_maskz_packus_epi16() {
17922        let a = _mm_set1_epi16(-1);
17923        let b = _mm_set1_epi16(1);
17924        let r = _mm_maskz_packus_epi16(0, a, b);
17925        assert_eq_m128i(r, _mm_setzero_si128());
17926        let r = _mm_maskz_packus_epi16(0b00000000_00001111, a, b);
17927        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
17928        assert_eq_m128i(r, e);
17929    }
17930
17931    #[simd_test(enable = "avx512bw")]
17932    fn test_mm512_avg_epu16() {
17933        let a = _mm512_set1_epi16(1);
17934        let b = _mm512_set1_epi16(1);
17935        let r = _mm512_avg_epu16(a, b);
17936        let e = _mm512_set1_epi16(1);
17937        assert_eq_m512i(r, e);
17938    }
17939
17940    #[simd_test(enable = "avx512bw")]
17941    fn test_mm512_mask_avg_epu16() {
17942        let a = _mm512_set1_epi16(1);
17943        let b = _mm512_set1_epi16(1);
17944        let r = _mm512_mask_avg_epu16(a, 0, a, b);
17945        assert_eq_m512i(r, a);
17946        let r = _mm512_mask_avg_epu16(a, 0b00000000_00000000_00000000_00001111, a, b);
17947        #[rustfmt::skip]
17948        let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
17949                                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
17950        assert_eq_m512i(r, e);
17951    }
17952
17953    #[simd_test(enable = "avx512bw")]
17954    fn test_mm512_maskz_avg_epu16() {
17955        let a = _mm512_set1_epi16(1);
17956        let b = _mm512_set1_epi16(1);
17957        let r = _mm512_maskz_avg_epu16(0, a, b);
17958        assert_eq_m512i(r, _mm512_setzero_si512());
17959        let r = _mm512_maskz_avg_epu16(0b00000000_00000000_00000000_00001111, a, b);
17960        #[rustfmt::skip]
17961        let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17962                                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1);
17963        assert_eq_m512i(r, e);
17964    }
17965
17966    #[simd_test(enable = "avx512bw,avx512vl")]
17967    fn test_mm256_mask_avg_epu16() {
17968        let a = _mm256_set1_epi16(1);
17969        let b = _mm256_set1_epi16(1);
17970        let r = _mm256_mask_avg_epu16(a, 0, a, b);
17971        assert_eq_m256i(r, a);
17972        let r = _mm256_mask_avg_epu16(a, 0b00000000_00001111, a, b);
17973        let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
17974        assert_eq_m256i(r, e);
17975    }
17976
17977    #[simd_test(enable = "avx512bw,avx512vl")]
17978    fn test_mm256_maskz_avg_epu16() {
17979        let a = _mm256_set1_epi16(1);
17980        let b = _mm256_set1_epi16(1);
17981        let r = _mm256_maskz_avg_epu16(0, a, b);
17982        assert_eq_m256i(r, _mm256_setzero_si256());
17983        let r = _mm256_maskz_avg_epu16(0b00000000_00001111, a, b);
17984        let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1);
17985        assert_eq_m256i(r, e);
17986    }
17987
17988    #[simd_test(enable = "avx512bw,avx512vl")]
17989    fn test_mm_mask_avg_epu16() {
17990        let a = _mm_set1_epi16(1);
17991        let b = _mm_set1_epi16(1);
17992        let r = _mm_mask_avg_epu16(a, 0, a, b);
17993        assert_eq_m128i(r, a);
17994        let r = _mm_mask_avg_epu16(a, 0b00001111, a, b);
17995        let e = _mm_set_epi16(1, 1, 1, 1, 1, 1, 1, 1);
17996        assert_eq_m128i(r, e);
17997    }
17998
17999    #[simd_test(enable = "avx512bw,avx512vl")]
18000    fn test_mm_maskz_avg_epu16() {
18001        let a = _mm_set1_epi16(1);
18002        let b = _mm_set1_epi16(1);
18003        let r = _mm_maskz_avg_epu16(0, a, b);
18004        assert_eq_m128i(r, _mm_setzero_si128());
18005        let r = _mm_maskz_avg_epu16(0b00001111, a, b);
18006        let e = _mm_set_epi16(0, 0, 0, 0, 1, 1, 1, 1);
18007        assert_eq_m128i(r, e);
18008    }
18009
18010    #[simd_test(enable = "avx512bw")]
18011    fn test_mm512_avg_epu8() {
18012        let a = _mm512_set1_epi8(1);
18013        let b = _mm512_set1_epi8(1);
18014        let r = _mm512_avg_epu8(a, b);
18015        let e = _mm512_set1_epi8(1);
18016        assert_eq_m512i(r, e);
18017    }
18018
18019    #[simd_test(enable = "avx512bw")]
18020    fn test_mm512_mask_avg_epu8() {
18021        let a = _mm512_set1_epi8(1);
18022        let b = _mm512_set1_epi8(1);
18023        let r = _mm512_mask_avg_epu8(a, 0, a, b);
18024        assert_eq_m512i(r, a);
18025        let r = _mm512_mask_avg_epu8(
18026            a,
18027            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
18028            a,
18029            b,
18030        );
18031        #[rustfmt::skip]
18032        let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
18033                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
18034                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
18035                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
18036        assert_eq_m512i(r, e);
18037    }
18038
18039    #[simd_test(enable = "avx512bw")]
18040    fn test_mm512_maskz_avg_epu8() {
18041        let a = _mm512_set1_epi8(1);
18042        let b = _mm512_set1_epi8(1);
18043        let r = _mm512_maskz_avg_epu8(0, a, b);
18044        assert_eq_m512i(r, _mm512_setzero_si512());
18045        let r = _mm512_maskz_avg_epu8(
18046            0b00000000_000000000_00000000_00000000_00000000_0000000_00000000_00001111,
18047            a,
18048            b,
18049        );
18050        #[rustfmt::skip]
18051        let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
18052                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
18053                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
18054                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1);
18055        assert_eq_m512i(r, e);
18056    }
18057
18058    #[simd_test(enable = "avx512bw,avx512vl")]
18059    fn test_mm256_mask_avg_epu8() {
18060        let a = _mm256_set1_epi8(1);
18061        let b = _mm256_set1_epi8(1);
18062        let r = _mm256_mask_avg_epu8(a, 0, a, b);
18063        assert_eq_m256i(r, a);
18064        let r = _mm256_mask_avg_epu8(a, 0b00000000_00000000_00000000_00001111, a, b);
18065        #[rustfmt::skip]
18066        let e = _mm256_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
18067                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
18068        assert_eq_m256i(r, e);
18069    }
18070
18071    #[simd_test(enable = "avx512bw,avx512vl")]
18072    fn test_mm256_maskz_avg_epu8() {
18073        let a = _mm256_set1_epi8(1);
18074        let b = _mm256_set1_epi8(1);
18075        let r = _mm256_maskz_avg_epu8(0, a, b);
18076        assert_eq_m256i(r, _mm256_setzero_si256());
18077        let r = _mm256_maskz_avg_epu8(0b00000000_0000000_00000000_00001111, a, b);
18078        #[rustfmt::skip]
18079        let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
18080                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1);
18081        assert_eq_m256i(r, e);
18082    }
18083
18084    #[simd_test(enable = "avx512bw,avx512vl")]
18085    fn test_mm_mask_avg_epu8() {
18086        let a = _mm_set1_epi8(1);
18087        let b = _mm_set1_epi8(1);
18088        let r = _mm_mask_avg_epu8(a, 0, a, b);
18089        assert_eq_m128i(r, a);
18090        let r = _mm_mask_avg_epu8(a, 0b00000000_00001111, a, b);
18091        let e = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
18092        assert_eq_m128i(r, e);
18093    }
18094
18095    #[simd_test(enable = "avx512bw,avx512vl")]
18096    fn test_mm_maskz_avg_epu8() {
18097        let a = _mm_set1_epi8(1);
18098        let b = _mm_set1_epi8(1);
18099        let r = _mm_maskz_avg_epu8(0, a, b);
18100        assert_eq_m128i(r, _mm_setzero_si128());
18101        let r = _mm_maskz_avg_epu8(0b00000000_00001111, a, b);
18102        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1);
18103        assert_eq_m128i(r, e);
18104    }
18105
18106    #[simd_test(enable = "avx512bw")]
18107    fn test_mm512_sll_epi16() {
18108        let a = _mm512_set1_epi16(1 << 15);
18109        let count = _mm_set1_epi16(2);
18110        let r = _mm512_sll_epi16(a, count);
18111        let e = _mm512_set1_epi16(0);
18112        assert_eq_m512i(r, e);
18113    }
18114
18115    #[simd_test(enable = "avx512bw")]
18116    fn test_mm512_mask_sll_epi16() {
18117        let a = _mm512_set1_epi16(1 << 15);
18118        let count = _mm_set1_epi16(2);
18119        let r = _mm512_mask_sll_epi16(a, 0, a, count);
18120        assert_eq_m512i(r, a);
18121        let r = _mm512_mask_sll_epi16(a, 0b11111111_11111111_11111111_11111111, a, count);
18122        let e = _mm512_set1_epi16(0);
18123        assert_eq_m512i(r, e);
18124    }
18125
18126    #[simd_test(enable = "avx512bw")]
18127    fn test_mm512_maskz_sll_epi16() {
18128        let a = _mm512_set1_epi16(1 << 15);
18129        let count = _mm_set1_epi16(2);
18130        let r = _mm512_maskz_sll_epi16(0, a, count);
18131        assert_eq_m512i(r, _mm512_setzero_si512());
18132        let r = _mm512_maskz_sll_epi16(0b11111111_11111111_11111111_11111111, a, count);
18133        let e = _mm512_set1_epi16(0);
18134        assert_eq_m512i(r, e);
18135    }
18136
18137    #[simd_test(enable = "avx512bw,avx512vl")]
18138    fn test_mm256_mask_sll_epi16() {
18139        let a = _mm256_set1_epi16(1 << 15);
18140        let count = _mm_set1_epi16(2);
18141        let r = _mm256_mask_sll_epi16(a, 0, a, count);
18142        assert_eq_m256i(r, a);
18143        let r = _mm256_mask_sll_epi16(a, 0b11111111_11111111, a, count);
18144        let e = _mm256_set1_epi16(0);
18145        assert_eq_m256i(r, e);
18146    }
18147
18148    #[simd_test(enable = "avx512bw,avx512vl")]
18149    fn test_mm256_maskz_sll_epi16() {
18150        let a = _mm256_set1_epi16(1 << 15);
18151        let count = _mm_set1_epi16(2);
18152        let r = _mm256_maskz_sll_epi16(0, a, count);
18153        assert_eq_m256i(r, _mm256_setzero_si256());
18154        let r = _mm256_maskz_sll_epi16(0b11111111_11111111, a, count);
18155        let e = _mm256_set1_epi16(0);
18156        assert_eq_m256i(r, e);
18157    }
18158
18159    #[simd_test(enable = "avx512bw,avx512vl")]
18160    fn test_mm_mask_sll_epi16() {
18161        let a = _mm_set1_epi16(1 << 15);
18162        let count = _mm_set1_epi16(2);
18163        let r = _mm_mask_sll_epi16(a, 0, a, count);
18164        assert_eq_m128i(r, a);
18165        let r = _mm_mask_sll_epi16(a, 0b11111111, a, count);
18166        let e = _mm_set1_epi16(0);
18167        assert_eq_m128i(r, e);
18168    }
18169
18170    #[simd_test(enable = "avx512bw,avx512vl")]
18171    fn test_mm_maskz_sll_epi16() {
18172        let a = _mm_set1_epi16(1 << 15);
18173        let count = _mm_set1_epi16(2);
18174        let r = _mm_maskz_sll_epi16(0, a, count);
18175        assert_eq_m128i(r, _mm_setzero_si128());
18176        let r = _mm_maskz_sll_epi16(0b11111111, a, count);
18177        let e = _mm_set1_epi16(0);
18178        assert_eq_m128i(r, e);
18179    }
18180
18181    #[simd_test(enable = "avx512bw")]
18182    const fn test_mm512_slli_epi16() {
18183        let a = _mm512_set1_epi16(1 << 15);
18184        let r = _mm512_slli_epi16::<1>(a);
18185        let e = _mm512_set1_epi16(0);
18186        assert_eq_m512i(r, e);
18187    }
18188
18189    #[simd_test(enable = "avx512bw")]
18190    const fn test_mm512_mask_slli_epi16() {
18191        let a = _mm512_set1_epi16(1 << 15);
18192        let r = _mm512_mask_slli_epi16::<1>(a, 0, a);
18193        assert_eq_m512i(r, a);
18194        let r = _mm512_mask_slli_epi16::<1>(a, 0b11111111_11111111_11111111_11111111, a);
18195        let e = _mm512_set1_epi16(0);
18196        assert_eq_m512i(r, e);
18197    }
18198
18199    #[simd_test(enable = "avx512bw")]
18200    const fn test_mm512_maskz_slli_epi16() {
18201        let a = _mm512_set1_epi16(1 << 15);
18202        let r = _mm512_maskz_slli_epi16::<1>(0, a);
18203        assert_eq_m512i(r, _mm512_setzero_si512());
18204        let r = _mm512_maskz_slli_epi16::<1>(0b11111111_11111111_11111111_11111111, a);
18205        let e = _mm512_set1_epi16(0);
18206        assert_eq_m512i(r, e);
18207    }
18208
18209    #[simd_test(enable = "avx512bw,avx512vl")]
18210    const fn test_mm256_mask_slli_epi16() {
18211        let a = _mm256_set1_epi16(1 << 15);
18212        let r = _mm256_mask_slli_epi16::<1>(a, 0, a);
18213        assert_eq_m256i(r, a);
18214        let r = _mm256_mask_slli_epi16::<1>(a, 0b11111111_11111111, a);
18215        let e = _mm256_set1_epi16(0);
18216        assert_eq_m256i(r, e);
18217    }
18218
18219    #[simd_test(enable = "avx512bw,avx512vl")]
18220    const fn test_mm256_maskz_slli_epi16() {
18221        let a = _mm256_set1_epi16(1 << 15);
18222        let r = _mm256_maskz_slli_epi16::<1>(0, a);
18223        assert_eq_m256i(r, _mm256_setzero_si256());
18224        let r = _mm256_maskz_slli_epi16::<1>(0b11111111_11111111, a);
18225        let e = _mm256_set1_epi16(0);
18226        assert_eq_m256i(r, e);
18227    }
18228
18229    #[simd_test(enable = "avx512bw,avx512vl")]
18230    const fn test_mm_mask_slli_epi16() {
18231        let a = _mm_set1_epi16(1 << 15);
18232        let r = _mm_mask_slli_epi16::<1>(a, 0, a);
18233        assert_eq_m128i(r, a);
18234        let r = _mm_mask_slli_epi16::<1>(a, 0b11111111, a);
18235        let e = _mm_set1_epi16(0);
18236        assert_eq_m128i(r, e);
18237    }
18238
18239    #[simd_test(enable = "avx512bw,avx512vl")]
18240    const fn test_mm_maskz_slli_epi16() {
18241        let a = _mm_set1_epi16(1 << 15);
18242        let r = _mm_maskz_slli_epi16::<1>(0, a);
18243        assert_eq_m128i(r, _mm_setzero_si128());
18244        let r = _mm_maskz_slli_epi16::<1>(0b11111111, a);
18245        let e = _mm_set1_epi16(0);
18246        assert_eq_m128i(r, e);
18247    }
18248
18249    #[simd_test(enable = "avx512bw")]
18250    fn test_mm512_sllv_epi16() {
18251        let a = _mm512_set1_epi16(1 << 15);
18252        let count = _mm512_set1_epi16(2);
18253        let r = _mm512_sllv_epi16(a, count);
18254        let e = _mm512_set1_epi16(0);
18255        assert_eq_m512i(r, e);
18256    }
18257
18258    #[simd_test(enable = "avx512bw")]
18259    fn test_mm512_mask_sllv_epi16() {
18260        let a = _mm512_set1_epi16(1 << 15);
18261        let count = _mm512_set1_epi16(2);
18262        let r = _mm512_mask_sllv_epi16(a, 0, a, count);
18263        assert_eq_m512i(r, a);
18264        let r = _mm512_mask_sllv_epi16(a, 0b11111111_11111111_11111111_11111111, a, count);
18265        let e = _mm512_set1_epi16(0);
18266        assert_eq_m512i(r, e);
18267    }
18268
18269    #[simd_test(enable = "avx512bw")]
18270    fn test_mm512_maskz_sllv_epi16() {
18271        let a = _mm512_set1_epi16(1 << 15);
18272        let count = _mm512_set1_epi16(2);
18273        let r = _mm512_maskz_sllv_epi16(0, a, count);
18274        assert_eq_m512i(r, _mm512_setzero_si512());
18275        let r = _mm512_maskz_sllv_epi16(0b11111111_11111111_11111111_11111111, a, count);
18276        let e = _mm512_set1_epi16(0);
18277        assert_eq_m512i(r, e);
18278    }
18279
18280    #[simd_test(enable = "avx512bw,avx512vl")]
18281    fn test_mm256_sllv_epi16() {
18282        let a = _mm256_set1_epi16(1 << 15);
18283        let count = _mm256_set1_epi16(2);
18284        let r = _mm256_sllv_epi16(a, count);
18285        let e = _mm256_set1_epi16(0);
18286        assert_eq_m256i(r, e);
18287    }
18288
18289    #[simd_test(enable = "avx512bw,avx512vl")]
18290    fn test_mm256_mask_sllv_epi16() {
18291        let a = _mm256_set1_epi16(1 << 15);
18292        let count = _mm256_set1_epi16(2);
18293        let r = _mm256_mask_sllv_epi16(a, 0, a, count);
18294        assert_eq_m256i(r, a);
18295        let r = _mm256_mask_sllv_epi16(a, 0b11111111_11111111, a, count);
18296        let e = _mm256_set1_epi16(0);
18297        assert_eq_m256i(r, e);
18298    }
18299
18300    #[simd_test(enable = "avx512bw,avx512vl")]
18301    fn test_mm256_maskz_sllv_epi16() {
18302        let a = _mm256_set1_epi16(1 << 15);
18303        let count = _mm256_set1_epi16(2);
18304        let r = _mm256_maskz_sllv_epi16(0, a, count);
18305        assert_eq_m256i(r, _mm256_setzero_si256());
18306        let r = _mm256_maskz_sllv_epi16(0b11111111_11111111, a, count);
18307        let e = _mm256_set1_epi16(0);
18308        assert_eq_m256i(r, e);
18309    }
18310
18311    #[simd_test(enable = "avx512bw,avx512vl")]
18312    fn test_mm_sllv_epi16() {
18313        let a = _mm_set1_epi16(1 << 15);
18314        let count = _mm_set1_epi16(2);
18315        let r = _mm_sllv_epi16(a, count);
18316        let e = _mm_set1_epi16(0);
18317        assert_eq_m128i(r, e);
18318    }
18319
18320    #[simd_test(enable = "avx512bw,avx512vl")]
18321    fn test_mm_mask_sllv_epi16() {
18322        let a = _mm_set1_epi16(1 << 15);
18323        let count = _mm_set1_epi16(2);
18324        let r = _mm_mask_sllv_epi16(a, 0, a, count);
18325        assert_eq_m128i(r, a);
18326        let r = _mm_mask_sllv_epi16(a, 0b11111111, a, count);
18327        let e = _mm_set1_epi16(0);
18328        assert_eq_m128i(r, e);
18329    }
18330
18331    #[simd_test(enable = "avx512bw,avx512vl")]
18332    fn test_mm_maskz_sllv_epi16() {
18333        let a = _mm_set1_epi16(1 << 15);
18334        let count = _mm_set1_epi16(2);
18335        let r = _mm_maskz_sllv_epi16(0, a, count);
18336        assert_eq_m128i(r, _mm_setzero_si128());
18337        let r = _mm_maskz_sllv_epi16(0b11111111, a, count);
18338        let e = _mm_set1_epi16(0);
18339        assert_eq_m128i(r, e);
18340    }
18341
18342    #[simd_test(enable = "avx512bw")]
18343    fn test_mm512_srl_epi16() {
18344        let a = _mm512_set1_epi16(1 << 1);
18345        let count = _mm_set1_epi16(2);
18346        let r = _mm512_srl_epi16(a, count);
18347        let e = _mm512_set1_epi16(0);
18348        assert_eq_m512i(r, e);
18349    }
18350
18351    #[simd_test(enable = "avx512bw")]
18352    fn test_mm512_mask_srl_epi16() {
18353        let a = _mm512_set1_epi16(1 << 1);
18354        let count = _mm_set1_epi16(2);
18355        let r = _mm512_mask_srl_epi16(a, 0, a, count);
18356        assert_eq_m512i(r, a);
18357        let r = _mm512_mask_srl_epi16(a, 0b11111111_11111111_11111111_11111111, a, count);
18358        let e = _mm512_set1_epi16(0);
18359        assert_eq_m512i(r, e);
18360    }
18361
18362    #[simd_test(enable = "avx512bw")]
18363    fn test_mm512_maskz_srl_epi16() {
18364        let a = _mm512_set1_epi16(1 << 1);
18365        let count = _mm_set1_epi16(2);
18366        let r = _mm512_maskz_srl_epi16(0, a, count);
18367        assert_eq_m512i(r, _mm512_setzero_si512());
18368        let r = _mm512_maskz_srl_epi16(0b11111111_11111111_11111111_11111111, a, count);
18369        let e = _mm512_set1_epi16(0);
18370        assert_eq_m512i(r, e);
18371    }
18372
18373    #[simd_test(enable = "avx512bw,avx512vl")]
18374    fn test_mm256_mask_srl_epi16() {
18375        let a = _mm256_set1_epi16(1 << 1);
18376        let count = _mm_set1_epi16(2);
18377        let r = _mm256_mask_srl_epi16(a, 0, a, count);
18378        assert_eq_m256i(r, a);
18379        let r = _mm256_mask_srl_epi16(a, 0b11111111_11111111, a, count);
18380        let e = _mm256_set1_epi16(0);
18381        assert_eq_m256i(r, e);
18382    }
18383
18384    #[simd_test(enable = "avx512bw,avx512vl")]
18385    fn test_mm256_maskz_srl_epi16() {
18386        let a = _mm256_set1_epi16(1 << 1);
18387        let count = _mm_set1_epi16(2);
18388        let r = _mm256_maskz_srl_epi16(0, a, count);
18389        assert_eq_m256i(r, _mm256_setzero_si256());
18390        let r = _mm256_maskz_srl_epi16(0b11111111_11111111, a, count);
18391        let e = _mm256_set1_epi16(0);
18392        assert_eq_m256i(r, e);
18393    }
18394
18395    #[simd_test(enable = "avx512bw,avx512vl")]
18396    fn test_mm_mask_srl_epi16() {
18397        let a = _mm_set1_epi16(1 << 1);
18398        let count = _mm_set1_epi16(2);
18399        let r = _mm_mask_srl_epi16(a, 0, a, count);
18400        assert_eq_m128i(r, a);
18401        let r = _mm_mask_srl_epi16(a, 0b11111111, a, count);
18402        let e = _mm_set1_epi16(0);
18403        assert_eq_m128i(r, e);
18404    }
18405
18406    #[simd_test(enable = "avx512bw,avx512vl")]
18407    fn test_mm_maskz_srl_epi16() {
18408        let a = _mm_set1_epi16(1 << 1);
18409        let count = _mm_set1_epi16(2);
18410        let r = _mm_maskz_srl_epi16(0, a, count);
18411        assert_eq_m128i(r, _mm_setzero_si128());
18412        let r = _mm_maskz_srl_epi16(0b11111111, a, count);
18413        let e = _mm_set1_epi16(0);
18414        assert_eq_m128i(r, e);
18415    }
18416
18417    #[simd_test(enable = "avx512bw")]
18418    const fn test_mm512_srli_epi16() {
18419        let a = _mm512_set1_epi16(1 << 1);
18420        let r = _mm512_srli_epi16::<2>(a);
18421        let e = _mm512_set1_epi16(0);
18422        assert_eq_m512i(r, e);
18423    }
18424
18425    #[simd_test(enable = "avx512bw")]
18426    const fn test_mm512_mask_srli_epi16() {
18427        let a = _mm512_set1_epi16(1 << 1);
18428        let r = _mm512_mask_srli_epi16::<2>(a, 0, a);
18429        assert_eq_m512i(r, a);
18430        let r = _mm512_mask_srli_epi16::<2>(a, 0b11111111_11111111_11111111_11111111, a);
18431        let e = _mm512_set1_epi16(0);
18432        assert_eq_m512i(r, e);
18433    }
18434
18435    #[simd_test(enable = "avx512bw")]
18436    const fn test_mm512_maskz_srli_epi16() {
18437        let a = _mm512_set1_epi16(1 << 1);
18438        let r = _mm512_maskz_srli_epi16::<2>(0, a);
18439        assert_eq_m512i(r, _mm512_setzero_si512());
18440        let r = _mm512_maskz_srli_epi16::<2>(0b11111111_11111111_11111111_11111111, a);
18441        let e = _mm512_set1_epi16(0);
18442        assert_eq_m512i(r, e);
18443    }
18444
18445    #[simd_test(enable = "avx512bw,avx512vl")]
18446    const fn test_mm256_mask_srli_epi16() {
18447        let a = _mm256_set1_epi16(1 << 1);
18448        let r = _mm256_mask_srli_epi16::<2>(a, 0, a);
18449        assert_eq_m256i(r, a);
18450        let r = _mm256_mask_srli_epi16::<2>(a, 0b11111111_11111111, a);
18451        let e = _mm256_set1_epi16(0);
18452        assert_eq_m256i(r, e);
18453    }
18454
18455    #[simd_test(enable = "avx512bw,avx512vl")]
18456    const fn test_mm256_maskz_srli_epi16() {
18457        let a = _mm256_set1_epi16(1 << 1);
18458        let r = _mm256_maskz_srli_epi16::<2>(0, a);
18459        assert_eq_m256i(r, _mm256_setzero_si256());
18460        let r = _mm256_maskz_srli_epi16::<2>(0b11111111_11111111, a);
18461        let e = _mm256_set1_epi16(0);
18462        assert_eq_m256i(r, e);
18463    }
18464
18465    #[simd_test(enable = "avx512bw,avx512vl")]
18466    const fn test_mm_mask_srli_epi16() {
18467        let a = _mm_set1_epi16(1 << 1);
18468        let r = _mm_mask_srli_epi16::<2>(a, 0, a);
18469        assert_eq_m128i(r, a);
18470        let r = _mm_mask_srli_epi16::<2>(a, 0b11111111, a);
18471        let e = _mm_set1_epi16(0);
18472        assert_eq_m128i(r, e);
18473    }
18474
18475    #[simd_test(enable = "avx512bw,avx512vl")]
18476    const fn test_mm_maskz_srli_epi16() {
18477        let a = _mm_set1_epi16(1 << 1);
18478        let r = _mm_maskz_srli_epi16::<2>(0, a);
18479        assert_eq_m128i(r, _mm_setzero_si128());
18480        let r = _mm_maskz_srli_epi16::<2>(0b11111111, a);
18481        let e = _mm_set1_epi16(0);
18482        assert_eq_m128i(r, e);
18483    }
18484
18485    #[simd_test(enable = "avx512bw")]
18486    fn test_mm512_srlv_epi16() {
18487        let a = _mm512_set1_epi16(1 << 1);
18488        let count = _mm512_set1_epi16(2);
18489        let r = _mm512_srlv_epi16(a, count);
18490        let e = _mm512_set1_epi16(0);
18491        assert_eq_m512i(r, e);
18492    }
18493
18494    #[simd_test(enable = "avx512bw")]
18495    fn test_mm512_mask_srlv_epi16() {
18496        let a = _mm512_set1_epi16(1 << 1);
18497        let count = _mm512_set1_epi16(2);
18498        let r = _mm512_mask_srlv_epi16(a, 0, a, count);
18499        assert_eq_m512i(r, a);
18500        let r = _mm512_mask_srlv_epi16(a, 0b11111111_11111111_11111111_11111111, a, count);
18501        let e = _mm512_set1_epi16(0);
18502        assert_eq_m512i(r, e);
18503    }
18504
18505    #[simd_test(enable = "avx512bw")]
18506    fn test_mm512_maskz_srlv_epi16() {
18507        let a = _mm512_set1_epi16(1 << 1);
18508        let count = _mm512_set1_epi16(2);
18509        let r = _mm512_maskz_srlv_epi16(0, a, count);
18510        assert_eq_m512i(r, _mm512_setzero_si512());
18511        let r = _mm512_maskz_srlv_epi16(0b11111111_11111111_11111111_11111111, a, count);
18512        let e = _mm512_set1_epi16(0);
18513        assert_eq_m512i(r, e);
18514    }
18515
18516    #[simd_test(enable = "avx512bw,avx512vl")]
18517    fn test_mm256_srlv_epi16() {
18518        let a = _mm256_set1_epi16(1 << 1);
18519        let count = _mm256_set1_epi16(2);
18520        let r = _mm256_srlv_epi16(a, count);
18521        let e = _mm256_set1_epi16(0);
18522        assert_eq_m256i(r, e);
18523    }
18524
18525    #[simd_test(enable = "avx512bw,avx512vl")]
18526    fn test_mm256_mask_srlv_epi16() {
18527        let a = _mm256_set1_epi16(1 << 1);
18528        let count = _mm256_set1_epi16(2);
18529        let r = _mm256_mask_srlv_epi16(a, 0, a, count);
18530        assert_eq_m256i(r, a);
18531        let r = _mm256_mask_srlv_epi16(a, 0b11111111_11111111, a, count);
18532        let e = _mm256_set1_epi16(0);
18533        assert_eq_m256i(r, e);
18534    }
18535
18536    #[simd_test(enable = "avx512bw,avx512vl")]
18537    fn test_mm256_maskz_srlv_epi16() {
18538        let a = _mm256_set1_epi16(1 << 1);
18539        let count = _mm256_set1_epi16(2);
18540        let r = _mm256_maskz_srlv_epi16(0, a, count);
18541        assert_eq_m256i(r, _mm256_setzero_si256());
18542        let r = _mm256_maskz_srlv_epi16(0b11111111_11111111, a, count);
18543        let e = _mm256_set1_epi16(0);
18544        assert_eq_m256i(r, e);
18545    }
18546
18547    #[simd_test(enable = "avx512bw,avx512vl")]
18548    fn test_mm_srlv_epi16() {
18549        let a = _mm_set1_epi16(1 << 1);
18550        let count = _mm_set1_epi16(2);
18551        let r = _mm_srlv_epi16(a, count);
18552        let e = _mm_set1_epi16(0);
18553        assert_eq_m128i(r, e);
18554    }
18555
18556    #[simd_test(enable = "avx512bw,avx512vl")]
18557    fn test_mm_mask_srlv_epi16() {
18558        let a = _mm_set1_epi16(1 << 1);
18559        let count = _mm_set1_epi16(2);
18560        let r = _mm_mask_srlv_epi16(a, 0, a, count);
18561        assert_eq_m128i(r, a);
18562        let r = _mm_mask_srlv_epi16(a, 0b11111111, a, count);
18563        let e = _mm_set1_epi16(0);
18564        assert_eq_m128i(r, e);
18565    }
18566
18567    #[simd_test(enable = "avx512bw,avx512vl")]
18568    fn test_mm_maskz_srlv_epi16() {
18569        let a = _mm_set1_epi16(1 << 1);
18570        let count = _mm_set1_epi16(2);
18571        let r = _mm_maskz_srlv_epi16(0, a, count);
18572        assert_eq_m128i(r, _mm_setzero_si128());
18573        let r = _mm_maskz_srlv_epi16(0b11111111, a, count);
18574        let e = _mm_set1_epi16(0);
18575        assert_eq_m128i(r, e);
18576    }
18577
18578    #[simd_test(enable = "avx512bw")]
18579    fn test_mm512_sra_epi16() {
18580        let a = _mm512_set1_epi16(8);
18581        let count = _mm_set1_epi16(1);
18582        let r = _mm512_sra_epi16(a, count);
18583        let e = _mm512_set1_epi16(0);
18584        assert_eq_m512i(r, e);
18585    }
18586
18587    #[simd_test(enable = "avx512bw")]
18588    fn test_mm512_mask_sra_epi16() {
18589        let a = _mm512_set1_epi16(8);
18590        let count = _mm_set1_epi16(1);
18591        let r = _mm512_mask_sra_epi16(a, 0, a, count);
18592        assert_eq_m512i(r, a);
18593        let r = _mm512_mask_sra_epi16(a, 0b11111111_11111111_11111111_11111111, a, count);
18594        let e = _mm512_set1_epi16(0);
18595        assert_eq_m512i(r, e);
18596    }
18597
18598    #[simd_test(enable = "avx512bw")]
18599    fn test_mm512_maskz_sra_epi16() {
18600        let a = _mm512_set1_epi16(8);
18601        let count = _mm_set1_epi16(1);
18602        let r = _mm512_maskz_sra_epi16(0, a, count);
18603        assert_eq_m512i(r, _mm512_setzero_si512());
18604        let r = _mm512_maskz_sra_epi16(0b11111111_11111111_11111111_11111111, a, count);
18605        let e = _mm512_set1_epi16(0);
18606        assert_eq_m512i(r, e);
18607    }
18608
18609    #[simd_test(enable = "avx512bw,avx512vl")]
18610    fn test_mm256_mask_sra_epi16() {
18611        let a = _mm256_set1_epi16(8);
18612        let count = _mm_set1_epi16(1);
18613        let r = _mm256_mask_sra_epi16(a, 0, a, count);
18614        assert_eq_m256i(r, a);
18615        let r = _mm256_mask_sra_epi16(a, 0b11111111_11111111, a, count);
18616        let e = _mm256_set1_epi16(0);
18617        assert_eq_m256i(r, e);
18618    }
18619
18620    #[simd_test(enable = "avx512bw,avx512vl")]
18621    fn test_mm256_maskz_sra_epi16() {
18622        let a = _mm256_set1_epi16(8);
18623        let count = _mm_set1_epi16(1);
18624        let r = _mm256_maskz_sra_epi16(0, a, count);
18625        assert_eq_m256i(r, _mm256_setzero_si256());
18626        let r = _mm256_maskz_sra_epi16(0b11111111_11111111, a, count);
18627        let e = _mm256_set1_epi16(0);
18628        assert_eq_m256i(r, e);
18629    }
18630
18631    #[simd_test(enable = "avx512bw,avx512vl")]
18632    fn test_mm_mask_sra_epi16() {
18633        let a = _mm_set1_epi16(8);
18634        let count = _mm_set1_epi16(1);
18635        let r = _mm_mask_sra_epi16(a, 0, a, count);
18636        assert_eq_m128i(r, a);
18637        let r = _mm_mask_sra_epi16(a, 0b11111111, a, count);
18638        let e = _mm_set1_epi16(0);
18639        assert_eq_m128i(r, e);
18640    }
18641
18642    #[simd_test(enable = "avx512bw,avx512vl")]
18643    fn test_mm_maskz_sra_epi16() {
18644        let a = _mm_set1_epi16(8);
18645        let count = _mm_set1_epi16(1);
18646        let r = _mm_maskz_sra_epi16(0, a, count);
18647        assert_eq_m128i(r, _mm_setzero_si128());
18648        let r = _mm_maskz_sra_epi16(0b11111111, a, count);
18649        let e = _mm_set1_epi16(0);
18650        assert_eq_m128i(r, e);
18651    }
18652
18653    #[simd_test(enable = "avx512bw")]
18654    const fn test_mm512_srai_epi16() {
18655        let a = _mm512_set1_epi16(8);
18656        let r = _mm512_srai_epi16::<2>(a);
18657        let e = _mm512_set1_epi16(2);
18658        assert_eq_m512i(r, e);
18659    }
18660
18661    #[simd_test(enable = "avx512bw")]
18662    const fn test_mm512_mask_srai_epi16() {
18663        let a = _mm512_set1_epi16(8);
18664        let r = _mm512_mask_srai_epi16::<2>(a, 0, a);
18665        assert_eq_m512i(r, a);
18666        let r = _mm512_mask_srai_epi16::<2>(a, 0b11111111_11111111_11111111_11111111, a);
18667        let e = _mm512_set1_epi16(2);
18668        assert_eq_m512i(r, e);
18669    }
18670
18671    #[simd_test(enable = "avx512bw")]
18672    const fn test_mm512_maskz_srai_epi16() {
18673        let a = _mm512_set1_epi16(8);
18674        let r = _mm512_maskz_srai_epi16::<2>(0, a);
18675        assert_eq_m512i(r, _mm512_setzero_si512());
18676        let r = _mm512_maskz_srai_epi16::<2>(0b11111111_11111111_11111111_11111111, a);
18677        let e = _mm512_set1_epi16(2);
18678        assert_eq_m512i(r, e);
18679    }
18680
18681    #[simd_test(enable = "avx512bw,avx512vl")]
18682    const fn test_mm256_mask_srai_epi16() {
18683        let a = _mm256_set1_epi16(8);
18684        let r = _mm256_mask_srai_epi16::<2>(a, 0, a);
18685        assert_eq_m256i(r, a);
18686        let r = _mm256_mask_srai_epi16::<2>(a, 0b11111111_11111111, a);
18687        let e = _mm256_set1_epi16(2);
18688        assert_eq_m256i(r, e);
18689    }
18690
18691    #[simd_test(enable = "avx512bw,avx512vl")]
18692    const fn test_mm256_maskz_srai_epi16() {
18693        let a = _mm256_set1_epi16(8);
18694        let r = _mm256_maskz_srai_epi16::<2>(0, a);
18695        assert_eq_m256i(r, _mm256_setzero_si256());
18696        let r = _mm256_maskz_srai_epi16::<2>(0b11111111_11111111, a);
18697        let e = _mm256_set1_epi16(2);
18698        assert_eq_m256i(r, e);
18699    }
18700
18701    #[simd_test(enable = "avx512bw,avx512vl")]
18702    const fn test_mm_mask_srai_epi16() {
18703        let a = _mm_set1_epi16(8);
18704        let r = _mm_mask_srai_epi16::<2>(a, 0, a);
18705        assert_eq_m128i(r, a);
18706        let r = _mm_mask_srai_epi16::<2>(a, 0b11111111, a);
18707        let e = _mm_set1_epi16(2);
18708        assert_eq_m128i(r, e);
18709    }
18710
18711    #[simd_test(enable = "avx512bw,avx512vl")]
18712    const fn test_mm_maskz_srai_epi16() {
18713        let a = _mm_set1_epi16(8);
18714        let r = _mm_maskz_srai_epi16::<2>(0, a);
18715        assert_eq_m128i(r, _mm_setzero_si128());
18716        let r = _mm_maskz_srai_epi16::<2>(0b11111111, a);
18717        let e = _mm_set1_epi16(2);
18718        assert_eq_m128i(r, e);
18719    }
18720
18721    #[simd_test(enable = "avx512bw")]
18722    fn test_mm512_srav_epi16() {
18723        let a = _mm512_set1_epi16(8);
18724        let count = _mm512_set1_epi16(2);
18725        let r = _mm512_srav_epi16(a, count);
18726        let e = _mm512_set1_epi16(2);
18727        assert_eq_m512i(r, e);
18728    }
18729
18730    #[simd_test(enable = "avx512bw")]
18731    fn test_mm512_mask_srav_epi16() {
18732        let a = _mm512_set1_epi16(8);
18733        let count = _mm512_set1_epi16(2);
18734        let r = _mm512_mask_srav_epi16(a, 0, a, count);
18735        assert_eq_m512i(r, a);
18736        let r = _mm512_mask_srav_epi16(a, 0b11111111_11111111_11111111_11111111, a, count);
18737        let e = _mm512_set1_epi16(2);
18738        assert_eq_m512i(r, e);
18739    }
18740
18741    #[simd_test(enable = "avx512bw")]
18742    fn test_mm512_maskz_srav_epi16() {
18743        let a = _mm512_set1_epi16(8);
18744        let count = _mm512_set1_epi16(2);
18745        let r = _mm512_maskz_srav_epi16(0, a, count);
18746        assert_eq_m512i(r, _mm512_setzero_si512());
18747        let r = _mm512_maskz_srav_epi16(0b11111111_11111111_11111111_11111111, a, count);
18748        let e = _mm512_set1_epi16(2);
18749        assert_eq_m512i(r, e);
18750    }
18751
18752    #[simd_test(enable = "avx512bw,avx512vl")]
18753    fn test_mm256_srav_epi16() {
18754        let a = _mm256_set1_epi16(8);
18755        let count = _mm256_set1_epi16(2);
18756        let r = _mm256_srav_epi16(a, count);
18757        let e = _mm256_set1_epi16(2);
18758        assert_eq_m256i(r, e);
18759    }
18760
18761    #[simd_test(enable = "avx512bw,avx512vl")]
18762    fn test_mm256_mask_srav_epi16() {
18763        let a = _mm256_set1_epi16(8);
18764        let count = _mm256_set1_epi16(2);
18765        let r = _mm256_mask_srav_epi16(a, 0, a, count);
18766        assert_eq_m256i(r, a);
18767        let r = _mm256_mask_srav_epi16(a, 0b11111111_11111111, a, count);
18768        let e = _mm256_set1_epi16(2);
18769        assert_eq_m256i(r, e);
18770    }
18771
18772    #[simd_test(enable = "avx512bw,avx512vl")]
18773    fn test_mm256_maskz_srav_epi16() {
18774        let a = _mm256_set1_epi16(8);
18775        let count = _mm256_set1_epi16(2);
18776        let r = _mm256_maskz_srav_epi16(0, a, count);
18777        assert_eq_m256i(r, _mm256_setzero_si256());
18778        let r = _mm256_maskz_srav_epi16(0b11111111_11111111, a, count);
18779        let e = _mm256_set1_epi16(2);
18780        assert_eq_m256i(r, e);
18781    }
18782
18783    #[simd_test(enable = "avx512bw,avx512vl")]
18784    fn test_mm_srav_epi16() {
18785        let a = _mm_set1_epi16(8);
18786        let count = _mm_set1_epi16(2);
18787        let r = _mm_srav_epi16(a, count);
18788        let e = _mm_set1_epi16(2);
18789        assert_eq_m128i(r, e);
18790    }
18791
18792    #[simd_test(enable = "avx512bw,avx512vl")]
18793    fn test_mm_mask_srav_epi16() {
18794        let a = _mm_set1_epi16(8);
18795        let count = _mm_set1_epi16(2);
18796        let r = _mm_mask_srav_epi16(a, 0, a, count);
18797        assert_eq_m128i(r, a);
18798        let r = _mm_mask_srav_epi16(a, 0b11111111, a, count);
18799        let e = _mm_set1_epi16(2);
18800        assert_eq_m128i(r, e);
18801    }
18802
18803    #[simd_test(enable = "avx512bw,avx512vl")]
18804    fn test_mm_maskz_srav_epi16() {
18805        let a = _mm_set1_epi16(8);
18806        let count = _mm_set1_epi16(2);
18807        let r = _mm_maskz_srav_epi16(0, a, count);
18808        assert_eq_m128i(r, _mm_setzero_si128());
18809        let r = _mm_maskz_srav_epi16(0b11111111, a, count);
18810        let e = _mm_set1_epi16(2);
18811        assert_eq_m128i(r, e);
18812    }
18813
18814    #[simd_test(enable = "avx512bw")]
18815    fn test_mm512_permutex2var_epi16() {
18816        #[rustfmt::skip]
18817        let a = _mm512_set_epi16(0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,
18818                                 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
18819        #[rustfmt::skip]
18820        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,
18821                                   9, 1<<5, 10, 1<<5, 11, 1<<5, 12, 1<<5, 13, 1<<5, 14, 1<<5, 15, 1<<5, 16, 1<<5);
18822        let b = _mm512_set1_epi16(100);
18823        let r = _mm512_permutex2var_epi16(a, idx, b);
18824        #[rustfmt::skip]
18825        let e = _mm512_set_epi16(
18826            30, 100, 29, 100, 28, 100, 27, 100, 26, 100, 25, 100, 24, 100, 23, 100,
18827            22, 100, 21, 100, 20, 100, 19, 100, 18, 100, 17, 100, 16, 100, 15, 100,
18828        );
18829        assert_eq_m512i(r, e);
18830    }
18831
18832    #[simd_test(enable = "avx512bw")]
18833    fn test_mm512_mask_permutex2var_epi16() {
18834        #[rustfmt::skip]
18835        let a = _mm512_set_epi16(0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,
18836                                 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
18837        #[rustfmt::skip]
18838        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,
18839                                   9, 1<<5, 10, 1<<5, 11, 1<<5, 12, 1<<5, 13, 1<<5, 14, 1<<5, 15, 1<<5, 16, 1<<5);
18840        let b = _mm512_set1_epi16(100);
18841        let r = _mm512_mask_permutex2var_epi16(a, 0, idx, b);
18842        assert_eq_m512i(r, a);
18843        let r = _mm512_mask_permutex2var_epi16(a, 0b11111111_11111111_11111111_11111111, idx, b);
18844        #[rustfmt::skip]
18845        let e = _mm512_set_epi16(
18846            30, 100, 29, 100, 28, 100, 27, 100, 26, 100, 25, 100, 24, 100, 23, 100,
18847            22, 100, 21, 100, 20, 100, 19, 100, 18, 100, 17, 100, 16, 100, 15, 100,
18848        );
18849        assert_eq_m512i(r, e);
18850    }
18851
18852    #[simd_test(enable = "avx512bw")]
18853    fn test_mm512_maskz_permutex2var_epi16() {
18854        #[rustfmt::skip]
18855        let a = _mm512_set_epi16(0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,
18856                                 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
18857        #[rustfmt::skip]
18858        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,
18859                                   9, 1<<5, 10, 1<<5, 11, 1<<5, 12, 1<<5, 13, 1<<5, 14, 1<<5, 15, 1<<5, 16, 1<<5);
18860        let b = _mm512_set1_epi16(100);
18861        let r = _mm512_maskz_permutex2var_epi16(0, a, idx, b);
18862        assert_eq_m512i(r, _mm512_setzero_si512());
18863        let r = _mm512_maskz_permutex2var_epi16(0b11111111_11111111_11111111_11111111, a, idx, b);
18864        #[rustfmt::skip]
18865        let e = _mm512_set_epi16(
18866            30, 100, 29, 100, 28, 100, 27, 100, 26, 100, 25, 100, 24, 100, 23, 100,
18867            22, 100, 21, 100, 20, 100, 19, 100, 18, 100, 17, 100, 16, 100, 15, 100,
18868        );
18869        assert_eq_m512i(r, e);
18870    }
18871
18872    #[simd_test(enable = "avx512bw")]
18873    fn test_mm512_mask2_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_mask2_permutex2var_epi16(a, idx, 0, b);
18882        assert_eq_m512i(r, idx);
18883        let r = _mm512_mask2_permutex2var_epi16(a, idx, 0b11111111_11111111_11111111_11111111, b);
18884        #[rustfmt::skip]
18885        let e = _mm512_set_epi16(
18886            30, 100, 29, 100, 28, 100, 27, 100, 26, 100, 25, 100, 24, 100, 23, 100,
18887            22, 100, 21, 100, 20, 100, 19, 100, 18, 100, 17, 100, 16, 100, 15, 100,
18888        );
18889        assert_eq_m512i(r, e);
18890    }
18891
18892    #[simd_test(enable = "avx512bw,avx512vl")]
18893    fn test_mm256_permutex2var_epi16() {
18894        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
18895        #[rustfmt::skip]
18896        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);
18897        let b = _mm256_set1_epi16(100);
18898        let r = _mm256_permutex2var_epi16(a, idx, b);
18899        let e = _mm256_set_epi16(
18900            14, 100, 13, 100, 12, 100, 11, 100, 10, 100, 9, 100, 8, 100, 7, 100,
18901        );
18902        assert_eq_m256i(r, e);
18903    }
18904
18905    #[simd_test(enable = "avx512bw,avx512vl")]
18906    fn test_mm256_mask_permutex2var_epi16() {
18907        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
18908        #[rustfmt::skip]
18909        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);
18910        let b = _mm256_set1_epi16(100);
18911        let r = _mm256_mask_permutex2var_epi16(a, 0, idx, b);
18912        assert_eq_m256i(r, a);
18913        let r = _mm256_mask_permutex2var_epi16(a, 0b11111111_11111111, idx, b);
18914        let e = _mm256_set_epi16(
18915            14, 100, 13, 100, 12, 100, 11, 100, 10, 100, 9, 100, 8, 100, 7, 100,
18916        );
18917        assert_eq_m256i(r, e);
18918    }
18919
18920    #[simd_test(enable = "avx512bw,avx512vl")]
18921    fn test_mm256_maskz_permutex2var_epi16() {
18922        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
18923        #[rustfmt::skip]
18924        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);
18925        let b = _mm256_set1_epi16(100);
18926        let r = _mm256_maskz_permutex2var_epi16(0, a, idx, b);
18927        assert_eq_m256i(r, _mm256_setzero_si256());
18928        let r = _mm256_maskz_permutex2var_epi16(0b11111111_11111111, a, idx, b);
18929        let e = _mm256_set_epi16(
18930            14, 100, 13, 100, 12, 100, 11, 100, 10, 100, 9, 100, 8, 100, 7, 100,
18931        );
18932        assert_eq_m256i(r, e);
18933    }
18934
18935    #[simd_test(enable = "avx512bw,avx512vl")]
18936    fn test_mm256_mask2_permutex2var_epi16() {
18937        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
18938        #[rustfmt::skip]
18939        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);
18940        let b = _mm256_set1_epi16(100);
18941        let r = _mm256_mask2_permutex2var_epi16(a, idx, 0, b);
18942        assert_eq_m256i(r, idx);
18943        let r = _mm256_mask2_permutex2var_epi16(a, idx, 0b11111111_11111111, b);
18944        #[rustfmt::skip]
18945        let e = _mm256_set_epi16(
18946            14, 100, 13, 100, 12, 100, 11, 100, 10, 100, 9, 100, 8, 100, 7, 100,
18947        );
18948        assert_eq_m256i(r, e);
18949    }
18950
18951    #[simd_test(enable = "avx512bw,avx512vl")]
18952    fn test_mm_permutex2var_epi16() {
18953        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
18954        let idx = _mm_set_epi16(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3);
18955        let b = _mm_set1_epi16(100);
18956        let r = _mm_permutex2var_epi16(a, idx, b);
18957        let e = _mm_set_epi16(6, 100, 5, 100, 4, 100, 3, 100);
18958        assert_eq_m128i(r, e);
18959    }
18960
18961    #[simd_test(enable = "avx512bw,avx512vl")]
18962    fn test_mm_mask_permutex2var_epi16() {
18963        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
18964        let idx = _mm_set_epi16(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3);
18965        let b = _mm_set1_epi16(100);
18966        let r = _mm_mask_permutex2var_epi16(a, 0, idx, b);
18967        assert_eq_m128i(r, a);
18968        let r = _mm_mask_permutex2var_epi16(a, 0b11111111, idx, b);
18969        let e = _mm_set_epi16(6, 100, 5, 100, 4, 100, 3, 100);
18970        assert_eq_m128i(r, e);
18971    }
18972
18973    #[simd_test(enable = "avx512bw,avx512vl")]
18974    fn test_mm_maskz_permutex2var_epi16() {
18975        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
18976        let idx = _mm_set_epi16(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3);
18977        let b = _mm_set1_epi16(100);
18978        let r = _mm_maskz_permutex2var_epi16(0, a, idx, b);
18979        assert_eq_m128i(r, _mm_setzero_si128());
18980        let r = _mm_maskz_permutex2var_epi16(0b11111111, a, idx, b);
18981        let e = _mm_set_epi16(6, 100, 5, 100, 4, 100, 3, 100);
18982        assert_eq_m128i(r, e);
18983    }
18984
18985    #[simd_test(enable = "avx512bw,avx512vl")]
18986    fn test_mm_mask2_permutex2var_epi16() {
18987        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
18988        let idx = _mm_set_epi16(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3);
18989        let b = _mm_set1_epi16(100);
18990        let r = _mm_mask2_permutex2var_epi16(a, idx, 0, b);
18991        assert_eq_m128i(r, idx);
18992        let r = _mm_mask2_permutex2var_epi16(a, idx, 0b11111111, b);
18993        let e = _mm_set_epi16(6, 100, 5, 100, 4, 100, 3, 100);
18994        assert_eq_m128i(r, e);
18995    }
18996
18997    #[simd_test(enable = "avx512bw")]
18998    fn test_mm512_permutexvar_epi16() {
18999        let idx = _mm512_set1_epi16(1);
19000        #[rustfmt::skip]
19001        let a = _mm512_set_epi16(0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,
19002                                 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
19003        let r = _mm512_permutexvar_epi16(idx, a);
19004        let e = _mm512_set1_epi16(30);
19005        assert_eq_m512i(r, e);
19006    }
19007
19008    #[simd_test(enable = "avx512bw")]
19009    fn test_mm512_mask_permutexvar_epi16() {
19010        let idx = _mm512_set1_epi16(1);
19011        #[rustfmt::skip]
19012        let a = _mm512_set_epi16(0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,
19013                                 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
19014        let r = _mm512_mask_permutexvar_epi16(a, 0, idx, a);
19015        assert_eq_m512i(r, a);
19016        let r = _mm512_mask_permutexvar_epi16(a, 0b11111111_11111111_11111111_11111111, idx, a);
19017        let e = _mm512_set1_epi16(30);
19018        assert_eq_m512i(r, e);
19019    }
19020
19021    #[simd_test(enable = "avx512bw")]
19022    fn test_mm512_maskz_permutexvar_epi16() {
19023        let idx = _mm512_set1_epi16(1);
19024        #[rustfmt::skip]
19025        let a = _mm512_set_epi16(0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,
19026                                 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
19027        let r = _mm512_maskz_permutexvar_epi16(0, idx, a);
19028        assert_eq_m512i(r, _mm512_setzero_si512());
19029        let r = _mm512_maskz_permutexvar_epi16(0b11111111_11111111_11111111_11111111, idx, a);
19030        let e = _mm512_set1_epi16(30);
19031        assert_eq_m512i(r, e);
19032    }
19033
19034    #[simd_test(enable = "avx512bw,avx512vl")]
19035    fn test_mm256_permutexvar_epi16() {
19036        let idx = _mm256_set1_epi16(1);
19037        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
19038        let r = _mm256_permutexvar_epi16(idx, a);
19039        let e = _mm256_set1_epi16(14);
19040        assert_eq_m256i(r, e);
19041    }
19042
19043    #[simd_test(enable = "avx512bw,avx512vl")]
19044    fn test_mm256_mask_permutexvar_epi16() {
19045        let idx = _mm256_set1_epi16(1);
19046        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
19047        let r = _mm256_mask_permutexvar_epi16(a, 0, idx, a);
19048        assert_eq_m256i(r, a);
19049        let r = _mm256_mask_permutexvar_epi16(a, 0b11111111_11111111, idx, a);
19050        let e = _mm256_set1_epi16(14);
19051        assert_eq_m256i(r, e);
19052    }
19053
19054    #[simd_test(enable = "avx512bw,avx512vl")]
19055    fn test_mm256_maskz_permutexvar_epi16() {
19056        let idx = _mm256_set1_epi16(1);
19057        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
19058        let r = _mm256_maskz_permutexvar_epi16(0, idx, a);
19059        assert_eq_m256i(r, _mm256_setzero_si256());
19060        let r = _mm256_maskz_permutexvar_epi16(0b11111111_11111111, idx, a);
19061        let e = _mm256_set1_epi16(14);
19062        assert_eq_m256i(r, e);
19063    }
19064
19065    #[simd_test(enable = "avx512bw,avx512vl")]
19066    fn test_mm_permutexvar_epi16() {
19067        let idx = _mm_set1_epi16(1);
19068        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
19069        let r = _mm_permutexvar_epi16(idx, a);
19070        let e = _mm_set1_epi16(6);
19071        assert_eq_m128i(r, e);
19072    }
19073
19074    #[simd_test(enable = "avx512bw,avx512vl")]
19075    fn test_mm_mask_permutexvar_epi16() {
19076        let idx = _mm_set1_epi16(1);
19077        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
19078        let r = _mm_mask_permutexvar_epi16(a, 0, idx, a);
19079        assert_eq_m128i(r, a);
19080        let r = _mm_mask_permutexvar_epi16(a, 0b11111111, idx, a);
19081        let e = _mm_set1_epi16(6);
19082        assert_eq_m128i(r, e);
19083    }
19084
19085    #[simd_test(enable = "avx512bw,avx512vl")]
19086    fn test_mm_maskz_permutexvar_epi16() {
19087        let idx = _mm_set1_epi16(1);
19088        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
19089        let r = _mm_maskz_permutexvar_epi16(0, idx, a);
19090        assert_eq_m128i(r, _mm_setzero_si128());
19091        let r = _mm_maskz_permutexvar_epi16(0b11111111, idx, a);
19092        let e = _mm_set1_epi16(6);
19093        assert_eq_m128i(r, e);
19094    }
19095
19096    #[simd_test(enable = "avx512bw")]
19097    const fn test_mm512_mask_blend_epi16() {
19098        let a = _mm512_set1_epi16(1);
19099        let b = _mm512_set1_epi16(2);
19100        let r = _mm512_mask_blend_epi16(0b11111111_00000000_11111111_00000000, a, b);
19101        #[rustfmt::skip]
19102        let e = _mm512_set_epi16(2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
19103                                 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1);
19104        assert_eq_m512i(r, e);
19105    }
19106
19107    #[simd_test(enable = "avx512bw,avx512vl")]
19108    const fn test_mm256_mask_blend_epi16() {
19109        let a = _mm256_set1_epi16(1);
19110        let b = _mm256_set1_epi16(2);
19111        let r = _mm256_mask_blend_epi16(0b11111111_00000000, a, b);
19112        let e = _mm256_set_epi16(2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1);
19113        assert_eq_m256i(r, e);
19114    }
19115
19116    #[simd_test(enable = "avx512bw,avx512vl")]
19117    const fn test_mm_mask_blend_epi16() {
19118        let a = _mm_set1_epi16(1);
19119        let b = _mm_set1_epi16(2);
19120        let r = _mm_mask_blend_epi16(0b11110000, a, b);
19121        let e = _mm_set_epi16(2, 2, 2, 2, 1, 1, 1, 1);
19122        assert_eq_m128i(r, e);
19123    }
19124
19125    #[simd_test(enable = "avx512bw")]
19126    const fn test_mm512_mask_blend_epi8() {
19127        let a = _mm512_set1_epi8(1);
19128        let b = _mm512_set1_epi8(2);
19129        let r = _mm512_mask_blend_epi8(
19130            0b11111111_00000000_11111111_00000000_11111111_00000000_11111111_00000000,
19131            a,
19132            b,
19133        );
19134        #[rustfmt::skip]
19135        let e = _mm512_set_epi8(2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
19136                                2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
19137                                2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
19138                                2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1);
19139        assert_eq_m512i(r, e);
19140    }
19141
19142    #[simd_test(enable = "avx512bw,avx512vl")]
19143    const fn test_mm256_mask_blend_epi8() {
19144        let a = _mm256_set1_epi8(1);
19145        let b = _mm256_set1_epi8(2);
19146        let r = _mm256_mask_blend_epi8(0b11111111_00000000_11111111_00000000, a, b);
19147        #[rustfmt::skip]
19148        let e = _mm256_set_epi8(2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
19149                                2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1);
19150        assert_eq_m256i(r, e);
19151    }
19152
19153    #[simd_test(enable = "avx512bw,avx512vl")]
19154    const fn test_mm_mask_blend_epi8() {
19155        let a = _mm_set1_epi8(1);
19156        let b = _mm_set1_epi8(2);
19157        let r = _mm_mask_blend_epi8(0b11111111_00000000, a, b);
19158        let e = _mm_set_epi8(2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1);
19159        assert_eq_m128i(r, e);
19160    }
19161
19162    #[simd_test(enable = "avx512bw")]
19163    const fn test_mm512_broadcastw_epi16() {
19164        let a = _mm_set_epi16(17, 18, 19, 20, 21, 22, 23, 24);
19165        let r = _mm512_broadcastw_epi16(a);
19166        let e = _mm512_set1_epi16(24);
19167        assert_eq_m512i(r, e);
19168    }
19169
19170    #[simd_test(enable = "avx512bw")]
19171    const fn test_mm512_mask_broadcastw_epi16() {
19172        let src = _mm512_set1_epi16(1);
19173        let a = _mm_set_epi16(17, 18, 19, 20, 21, 22, 23, 24);
19174        let r = _mm512_mask_broadcastw_epi16(src, 0, a);
19175        assert_eq_m512i(r, src);
19176        let r = _mm512_mask_broadcastw_epi16(src, 0b11111111_11111111_11111111_11111111, a);
19177        let e = _mm512_set1_epi16(24);
19178        assert_eq_m512i(r, e);
19179    }
19180
19181    #[simd_test(enable = "avx512bw")]
19182    const fn test_mm512_maskz_broadcastw_epi16() {
19183        let a = _mm_set_epi16(17, 18, 19, 20, 21, 22, 23, 24);
19184        let r = _mm512_maskz_broadcastw_epi16(0, a);
19185        assert_eq_m512i(r, _mm512_setzero_si512());
19186        let r = _mm512_maskz_broadcastw_epi16(0b11111111_11111111_11111111_11111111, a);
19187        let e = _mm512_set1_epi16(24);
19188        assert_eq_m512i(r, e);
19189    }
19190
19191    #[simd_test(enable = "avx512bw,avx512vl")]
19192    const fn test_mm256_mask_broadcastw_epi16() {
19193        let src = _mm256_set1_epi16(1);
19194        let a = _mm_set_epi16(17, 18, 19, 20, 21, 22, 23, 24);
19195        let r = _mm256_mask_broadcastw_epi16(src, 0, a);
19196        assert_eq_m256i(r, src);
19197        let r = _mm256_mask_broadcastw_epi16(src, 0b11111111_11111111, a);
19198        let e = _mm256_set1_epi16(24);
19199        assert_eq_m256i(r, e);
19200    }
19201
19202    #[simd_test(enable = "avx512bw,avx512vl")]
19203    const fn test_mm256_maskz_broadcastw_epi16() {
19204        let a = _mm_set_epi16(17, 18, 19, 20, 21, 22, 23, 24);
19205        let r = _mm256_maskz_broadcastw_epi16(0, a);
19206        assert_eq_m256i(r, _mm256_setzero_si256());
19207        let r = _mm256_maskz_broadcastw_epi16(0b11111111_11111111, a);
19208        let e = _mm256_set1_epi16(24);
19209        assert_eq_m256i(r, e);
19210    }
19211
19212    #[simd_test(enable = "avx512bw,avx512vl")]
19213    const fn test_mm_mask_broadcastw_epi16() {
19214        let src = _mm_set1_epi16(1);
19215        let a = _mm_set_epi16(17, 18, 19, 20, 21, 22, 23, 24);
19216        let r = _mm_mask_broadcastw_epi16(src, 0, a);
19217        assert_eq_m128i(r, src);
19218        let r = _mm_mask_broadcastw_epi16(src, 0b11111111, a);
19219        let e = _mm_set1_epi16(24);
19220        assert_eq_m128i(r, e);
19221    }
19222
19223    #[simd_test(enable = "avx512bw,avx512vl")]
19224    const fn test_mm_maskz_broadcastw_epi16() {
19225        let a = _mm_set_epi16(17, 18, 19, 20, 21, 22, 23, 24);
19226        let r = _mm_maskz_broadcastw_epi16(0, a);
19227        assert_eq_m128i(r, _mm_setzero_si128());
19228        let r = _mm_maskz_broadcastw_epi16(0b11111111, a);
19229        let e = _mm_set1_epi16(24);
19230        assert_eq_m128i(r, e);
19231    }
19232
19233    #[simd_test(enable = "avx512bw")]
19234    const fn test_mm512_broadcastb_epi8() {
19235        let a = _mm_set_epi8(
19236            17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
19237        );
19238        let r = _mm512_broadcastb_epi8(a);
19239        let e = _mm512_set1_epi8(32);
19240        assert_eq_m512i(r, e);
19241    }
19242
19243    #[simd_test(enable = "avx512bw")]
19244    const fn test_mm512_mask_broadcastb_epi8() {
19245        let src = _mm512_set1_epi8(1);
19246        let a = _mm_set_epi8(
19247            17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
19248        );
19249        let r = _mm512_mask_broadcastb_epi8(src, 0, a);
19250        assert_eq_m512i(r, src);
19251        let r = _mm512_mask_broadcastb_epi8(
19252            src,
19253            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
19254            a,
19255        );
19256        let e = _mm512_set1_epi8(32);
19257        assert_eq_m512i(r, e);
19258    }
19259
19260    #[simd_test(enable = "avx512bw")]
19261    const fn test_mm512_maskz_broadcastb_epi8() {
19262        let a = _mm_set_epi8(
19263            17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
19264        );
19265        let r = _mm512_maskz_broadcastb_epi8(0, a);
19266        assert_eq_m512i(r, _mm512_setzero_si512());
19267        let r = _mm512_maskz_broadcastb_epi8(
19268            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
19269            a,
19270        );
19271        let e = _mm512_set1_epi8(32);
19272        assert_eq_m512i(r, e);
19273    }
19274
19275    #[simd_test(enable = "avx512bw,avx512vl")]
19276    const fn test_mm256_mask_broadcastb_epi8() {
19277        let src = _mm256_set1_epi8(1);
19278        let a = _mm_set_epi8(
19279            17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
19280        );
19281        let r = _mm256_mask_broadcastb_epi8(src, 0, a);
19282        assert_eq_m256i(r, src);
19283        let r = _mm256_mask_broadcastb_epi8(src, 0b11111111_11111111_11111111_11111111, a);
19284        let e = _mm256_set1_epi8(32);
19285        assert_eq_m256i(r, e);
19286    }
19287
19288    #[simd_test(enable = "avx512bw,avx512vl")]
19289    const fn test_mm256_maskz_broadcastb_epi8() {
19290        let a = _mm_set_epi8(
19291            17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
19292        );
19293        let r = _mm256_maskz_broadcastb_epi8(0, a);
19294        assert_eq_m256i(r, _mm256_setzero_si256());
19295        let r = _mm256_maskz_broadcastb_epi8(0b11111111_11111111_11111111_11111111, a);
19296        let e = _mm256_set1_epi8(32);
19297        assert_eq_m256i(r, e);
19298    }
19299
19300    #[simd_test(enable = "avx512bw,avx512vl")]
19301    const fn test_mm_mask_broadcastb_epi8() {
19302        let src = _mm_set1_epi8(1);
19303        let a = _mm_set_epi8(
19304            17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
19305        );
19306        let r = _mm_mask_broadcastb_epi8(src, 0, a);
19307        assert_eq_m128i(r, src);
19308        let r = _mm_mask_broadcastb_epi8(src, 0b11111111_11111111, a);
19309        let e = _mm_set1_epi8(32);
19310        assert_eq_m128i(r, e);
19311    }
19312
19313    #[simd_test(enable = "avx512bw,avx512vl")]
19314    const fn test_mm_maskz_broadcastb_epi8() {
19315        let a = _mm_set_epi8(
19316            17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
19317        );
19318        let r = _mm_maskz_broadcastb_epi8(0, a);
19319        assert_eq_m128i(r, _mm_setzero_si128());
19320        let r = _mm_maskz_broadcastb_epi8(0b11111111_11111111, a);
19321        let e = _mm_set1_epi8(32);
19322        assert_eq_m128i(r, e);
19323    }
19324
19325    #[simd_test(enable = "avx512bw")]
19326    const fn test_mm512_unpackhi_epi16() {
19327        #[rustfmt::skip]
19328        let a = _mm512_set_epi16(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19329                                 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
19330        #[rustfmt::skip]
19331        let b = _mm512_set_epi16(33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19332                                 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
19333        let r = _mm512_unpackhi_epi16(a, b);
19334        #[rustfmt::skip]
19335        let e = _mm512_set_epi16(33, 1,  34, 2,  35, 3,  36, 4,  41, 9,  42, 10, 43, 11, 44, 12,
19336                                 49, 17, 50, 18, 51, 19, 52, 20, 57, 25, 58, 26, 59, 27, 60, 28);
19337        assert_eq_m512i(r, e);
19338    }
19339
19340    #[simd_test(enable = "avx512bw")]
19341    const fn test_mm512_mask_unpackhi_epi16() {
19342        #[rustfmt::skip]
19343        let a = _mm512_set_epi16(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19344                                 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
19345        #[rustfmt::skip]
19346        let b = _mm512_set_epi16(33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19347                                 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
19348        let r = _mm512_mask_unpackhi_epi16(a, 0, a, b);
19349        assert_eq_m512i(r, a);
19350        let r = _mm512_mask_unpackhi_epi16(a, 0b11111111_11111111_11111111_11111111, a, b);
19351        #[rustfmt::skip]
19352        let e = _mm512_set_epi16(33, 1,  34, 2,  35, 3,  36, 4,  41, 9,  42, 10, 43, 11, 44, 12,
19353                                 49, 17, 50, 18, 51, 19, 52, 20, 57, 25, 58, 26, 59, 27, 60, 28);
19354        assert_eq_m512i(r, e);
19355    }
19356
19357    #[simd_test(enable = "avx512bw")]
19358    const fn test_mm512_maskz_unpackhi_epi16() {
19359        #[rustfmt::skip]
19360        let a = _mm512_set_epi16(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19361                                 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
19362        #[rustfmt::skip]
19363        let b = _mm512_set_epi16(33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19364                                 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
19365        let r = _mm512_maskz_unpackhi_epi16(0, a, b);
19366        assert_eq_m512i(r, _mm512_setzero_si512());
19367        let r = _mm512_maskz_unpackhi_epi16(0b11111111_11111111_11111111_11111111, a, b);
19368        #[rustfmt::skip]
19369        let e = _mm512_set_epi16(33, 1,  34, 2,  35, 3,  36, 4,  41, 9,  42, 10, 43, 11, 44, 12,
19370                                 49, 17, 50, 18, 51, 19, 52, 20, 57, 25, 58, 26, 59, 27, 60, 28);
19371        assert_eq_m512i(r, e);
19372    }
19373
19374    #[simd_test(enable = "avx512bw,avx512vl")]
19375    const fn test_mm256_mask_unpackhi_epi16() {
19376        let a = _mm256_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
19377        let b = _mm256_set_epi16(
19378            33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19379        );
19380        let r = _mm256_mask_unpackhi_epi16(a, 0, a, b);
19381        assert_eq_m256i(r, a);
19382        let r = _mm256_mask_unpackhi_epi16(a, 0b11111111_11111111, a, b);
19383        let e = _mm256_set_epi16(33, 1, 34, 2, 35, 3, 36, 4, 41, 9, 42, 10, 43, 11, 44, 12);
19384        assert_eq_m256i(r, e);
19385    }
19386
19387    #[simd_test(enable = "avx512bw,avx512vl")]
19388    const fn test_mm256_maskz_unpackhi_epi16() {
19389        let a = _mm256_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
19390        let b = _mm256_set_epi16(
19391            33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19392        );
19393        let r = _mm256_maskz_unpackhi_epi16(0, a, b);
19394        assert_eq_m256i(r, _mm256_setzero_si256());
19395        let r = _mm256_maskz_unpackhi_epi16(0b11111111_11111111, a, b);
19396        let e = _mm256_set_epi16(33, 1, 34, 2, 35, 3, 36, 4, 41, 9, 42, 10, 43, 11, 44, 12);
19397        assert_eq_m256i(r, e);
19398    }
19399
19400    #[simd_test(enable = "avx512bw,avx512vl")]
19401    const fn test_mm_mask_unpackhi_epi16() {
19402        let a = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8);
19403        let b = _mm_set_epi16(33, 34, 35, 36, 37, 38, 39, 40);
19404        let r = _mm_mask_unpackhi_epi16(a, 0, a, b);
19405        assert_eq_m128i(r, a);
19406        let r = _mm_mask_unpackhi_epi16(a, 0b11111111, a, b);
19407        let e = _mm_set_epi16(33, 1, 34, 2, 35, 3, 36, 4);
19408        assert_eq_m128i(r, e);
19409    }
19410
19411    #[simd_test(enable = "avx512bw,avx512vl")]
19412    const fn test_mm_maskz_unpackhi_epi16() {
19413        let a = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8);
19414        let b = _mm_set_epi16(33, 34, 35, 36, 37, 38, 39, 40);
19415        let r = _mm_maskz_unpackhi_epi16(0, a, b);
19416        assert_eq_m128i(r, _mm_setzero_si128());
19417        let r = _mm_maskz_unpackhi_epi16(0b11111111, a, b);
19418        let e = _mm_set_epi16(33, 1, 34, 2, 35, 3, 36, 4);
19419        assert_eq_m128i(r, e);
19420    }
19421
19422    #[simd_test(enable = "avx512bw")]
19423    const fn test_mm512_unpackhi_epi8() {
19424        #[rustfmt::skip]
19425        let a = _mm512_set_epi8(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19426                                17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
19427                                33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19428                                49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
19429        #[rustfmt::skip]
19430        let b = _mm512_set_epi8(65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,  80,
19431                                81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,  96,
19432                                97,  98,  99,  100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
19433                                113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 0);
19434        let r = _mm512_unpackhi_epi8(a, b);
19435        #[rustfmt::skip]
19436        let e = _mm512_set_epi8(65, 1,  66, 2,  67, 3,  68, 4,  69, 5,  70, 6,  71, 7,  72, 8,
19437                                81, 17, 82, 18, 83, 19, 84, 20, 85, 21, 86, 22, 87, 23, 88, 24,
19438                                97, 33, 98, 34, 99, 35, 100, 36, 101, 37, 102, 38, 103, 39, 104, 40,
19439                                113, 49, 114, 50, 115, 51, 116, 52, 117, 53, 118, 54, 119, 55, 120, 56);
19440        assert_eq_m512i(r, e);
19441    }
19442
19443    #[simd_test(enable = "avx512bw")]
19444    const fn test_mm512_mask_unpackhi_epi8() {
19445        #[rustfmt::skip]
19446        let a = _mm512_set_epi8(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19447                                17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
19448                                33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19449                                49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
19450        #[rustfmt::skip]
19451        let b = _mm512_set_epi8(65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,  80,
19452                                81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,  96,
19453                                97,  98,  99,  100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
19454                                113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 0);
19455        let r = _mm512_mask_unpackhi_epi8(a, 0, a, b);
19456        assert_eq_m512i(r, a);
19457        let r = _mm512_mask_unpackhi_epi8(
19458            a,
19459            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
19460            a,
19461            b,
19462        );
19463        #[rustfmt::skip]
19464        let e = _mm512_set_epi8(65, 1,  66, 2,  67, 3,  68, 4,  69, 5,  70, 6,  71, 7,  72, 8,
19465                                81, 17, 82, 18, 83, 19, 84, 20, 85, 21, 86, 22, 87, 23, 88, 24,
19466                                97, 33, 98, 34, 99, 35, 100, 36, 101, 37, 102, 38, 103, 39, 104, 40,
19467                                113, 49, 114, 50, 115, 51, 116, 52, 117, 53, 118, 54, 119, 55, 120, 56);
19468        assert_eq_m512i(r, e);
19469    }
19470
19471    #[simd_test(enable = "avx512bw")]
19472    const fn test_mm512_maskz_unpackhi_epi8() {
19473        #[rustfmt::skip]
19474        let a = _mm512_set_epi8(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19475                                17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
19476                                33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19477                                49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
19478        #[rustfmt::skip]
19479        let b = _mm512_set_epi8(65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,  80,
19480                                81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,  96,
19481                                97,  98,  99,  100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
19482                                113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 0);
19483        let r = _mm512_maskz_unpackhi_epi8(0, a, b);
19484        assert_eq_m512i(r, _mm512_setzero_si512());
19485        let r = _mm512_maskz_unpackhi_epi8(
19486            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
19487            a,
19488            b,
19489        );
19490        #[rustfmt::skip]
19491        let e = _mm512_set_epi8(65, 1,  66, 2,  67, 3,  68, 4,  69, 5,  70, 6,  71, 7,  72, 8,
19492                                81, 17, 82, 18, 83, 19, 84, 20, 85, 21, 86, 22, 87, 23, 88, 24,
19493                                97, 33, 98, 34, 99, 35, 100, 36, 101, 37, 102, 38, 103, 39, 104, 40,
19494                                113, 49, 114, 50, 115, 51, 116, 52, 117, 53, 118, 54, 119, 55, 120, 56);
19495        assert_eq_m512i(r, e);
19496    }
19497
19498    #[simd_test(enable = "avx512bw,avx512vl")]
19499    const fn test_mm256_mask_unpackhi_epi8() {
19500        #[rustfmt::skip]
19501        let a = _mm256_set_epi8(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19502                                17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
19503        #[rustfmt::skip]
19504        let b = _mm256_set_epi8(65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,  80,
19505                                81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,  96);
19506        let r = _mm256_mask_unpackhi_epi8(a, 0, a, b);
19507        assert_eq_m256i(r, a);
19508        let r = _mm256_mask_unpackhi_epi8(a, 0b11111111_11111111_11111111_11111111, a, b);
19509        #[rustfmt::skip]
19510        let e = _mm256_set_epi8(65, 1,  66, 2,  67, 3,  68, 4,  69, 5,  70, 6,  71, 7,  72, 8,
19511                                81, 17, 82, 18, 83, 19, 84, 20, 85, 21, 86, 22, 87, 23, 88, 24);
19512        assert_eq_m256i(r, e);
19513    }
19514
19515    #[simd_test(enable = "avx512bw,avx512vl")]
19516    const fn test_mm256_maskz_unpackhi_epi8() {
19517        #[rustfmt::skip]
19518        let a = _mm256_set_epi8(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19519                                17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
19520        #[rustfmt::skip]
19521        let b = _mm256_set_epi8(65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,  80,
19522                                81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,  96);
19523        let r = _mm256_maskz_unpackhi_epi8(0, a, b);
19524        assert_eq_m256i(r, _mm256_setzero_si256());
19525        let r = _mm256_maskz_unpackhi_epi8(0b11111111_11111111_11111111_11111111, a, b);
19526        #[rustfmt::skip]
19527        let e = _mm256_set_epi8(65, 1,  66, 2,  67, 3,  68, 4,  69, 5,  70, 6,  71, 7,  72, 8,
19528                                81, 17, 82, 18, 83, 19, 84, 20, 85, 21, 86, 22, 87, 23, 88, 24);
19529        assert_eq_m256i(r, e);
19530    }
19531
19532    #[simd_test(enable = "avx512bw,avx512vl")]
19533    const fn test_mm_mask_unpackhi_epi8() {
19534        let a = _mm_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
19535        let b = _mm_set_epi8(
19536            65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
19537        );
19538        let r = _mm_mask_unpackhi_epi8(a, 0, a, b);
19539        assert_eq_m128i(r, a);
19540        let r = _mm_mask_unpackhi_epi8(a, 0b11111111_11111111, a, b);
19541        let e = _mm_set_epi8(65, 1, 66, 2, 67, 3, 68, 4, 69, 5, 70, 6, 71, 7, 72, 8);
19542        assert_eq_m128i(r, e);
19543    }
19544
19545    #[simd_test(enable = "avx512bw,avx512vl")]
19546    const fn test_mm_maskz_unpackhi_epi8() {
19547        let a = _mm_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
19548        let b = _mm_set_epi8(
19549            65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
19550        );
19551        let r = _mm_maskz_unpackhi_epi8(0, a, b);
19552        assert_eq_m128i(r, _mm_setzero_si128());
19553        let r = _mm_maskz_unpackhi_epi8(0b11111111_11111111, a, b);
19554        let e = _mm_set_epi8(65, 1, 66, 2, 67, 3, 68, 4, 69, 5, 70, 6, 71, 7, 72, 8);
19555        assert_eq_m128i(r, e);
19556    }
19557
19558    #[simd_test(enable = "avx512bw")]
19559    const fn test_mm512_unpacklo_epi16() {
19560        #[rustfmt::skip]
19561        let a = _mm512_set_epi16(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19562                                 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
19563        #[rustfmt::skip]
19564        let b = _mm512_set_epi16(33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19565                                 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
19566        let r = _mm512_unpacklo_epi16(a, b);
19567        #[rustfmt::skip]
19568        let e = _mm512_set_epi16(37, 5,  38, 6,  39, 7,  40, 8,  45, 13, 46, 14, 47, 15, 48, 16,
19569                                 53, 21, 54, 22, 55, 23, 56, 24, 61, 29, 62, 30, 63, 31, 64, 32);
19570        assert_eq_m512i(r, e);
19571    }
19572
19573    #[simd_test(enable = "avx512bw")]
19574    const fn test_mm512_mask_unpacklo_epi16() {
19575        #[rustfmt::skip]
19576        let a = _mm512_set_epi16(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 = _mm512_set_epi16(33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19580                                 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
19581        let r = _mm512_mask_unpacklo_epi16(a, 0, a, b);
19582        assert_eq_m512i(r, a);
19583        let r = _mm512_mask_unpacklo_epi16(a, 0b11111111_11111111_11111111_11111111, a, b);
19584        #[rustfmt::skip]
19585        let e = _mm512_set_epi16(37, 5,  38, 6,  39, 7,  40, 8,  45, 13, 46, 14, 47, 15, 48, 16,
19586                                 53, 21, 54, 22, 55, 23, 56, 24, 61, 29, 62, 30, 63, 31, 64, 32);
19587        assert_eq_m512i(r, e);
19588    }
19589
19590    #[simd_test(enable = "avx512bw")]
19591    const fn test_mm512_maskz_unpacklo_epi16() {
19592        #[rustfmt::skip]
19593        let a = _mm512_set_epi16(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19594                                 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
19595        #[rustfmt::skip]
19596        let b = _mm512_set_epi16(33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19597                                 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
19598        let r = _mm512_maskz_unpacklo_epi16(0, a, b);
19599        assert_eq_m512i(r, _mm512_setzero_si512());
19600        let r = _mm512_maskz_unpacklo_epi16(0b11111111_11111111_11111111_11111111, a, b);
19601        #[rustfmt::skip]
19602        let e = _mm512_set_epi16(37, 5,  38, 6,  39, 7,  40, 8,  45, 13, 46, 14, 47, 15, 48, 16,
19603                                 53, 21, 54, 22, 55, 23, 56, 24, 61, 29, 62, 30, 63, 31, 64, 32);
19604        assert_eq_m512i(r, e);
19605    }
19606
19607    #[simd_test(enable = "avx512bw,avx512vl")]
19608    const fn test_mm256_mask_unpacklo_epi16() {
19609        let a = _mm256_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
19610        let b = _mm256_set_epi16(
19611            33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19612        );
19613        let r = _mm256_mask_unpacklo_epi16(a, 0, a, b);
19614        assert_eq_m256i(r, a);
19615        let r = _mm256_mask_unpacklo_epi16(a, 0b11111111_11111111, a, b);
19616        let e = _mm256_set_epi16(37, 5, 38, 6, 39, 7, 40, 8, 45, 13, 46, 14, 47, 15, 48, 16);
19617        assert_eq_m256i(r, e);
19618    }
19619
19620    #[simd_test(enable = "avx512bw,avx512vl")]
19621    const fn test_mm256_maskz_unpacklo_epi16() {
19622        let a = _mm256_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
19623        let b = _mm256_set_epi16(
19624            33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19625        );
19626        let r = _mm256_maskz_unpacklo_epi16(0, a, b);
19627        assert_eq_m256i(r, _mm256_setzero_si256());
19628        let r = _mm256_maskz_unpacklo_epi16(0b11111111_11111111, a, b);
19629        let e = _mm256_set_epi16(37, 5, 38, 6, 39, 7, 40, 8, 45, 13, 46, 14, 47, 15, 48, 16);
19630        assert_eq_m256i(r, e);
19631    }
19632
19633    #[simd_test(enable = "avx512bw,avx512vl")]
19634    const fn test_mm_mask_unpacklo_epi16() {
19635        let a = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8);
19636        let b = _mm_set_epi16(33, 34, 35, 36, 37, 38, 39, 40);
19637        let r = _mm_mask_unpacklo_epi16(a, 0, a, b);
19638        assert_eq_m128i(r, a);
19639        let r = _mm_mask_unpacklo_epi16(a, 0b11111111, a, b);
19640        let e = _mm_set_epi16(37, 5, 38, 6, 39, 7, 40, 8);
19641        assert_eq_m128i(r, e);
19642    }
19643
19644    #[simd_test(enable = "avx512bw,avx512vl")]
19645    const fn test_mm_maskz_unpacklo_epi16() {
19646        let a = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8);
19647        let b = _mm_set_epi16(33, 34, 35, 36, 37, 38, 39, 40);
19648        let r = _mm_maskz_unpacklo_epi16(0, a, b);
19649        assert_eq_m128i(r, _mm_setzero_si128());
19650        let r = _mm_maskz_unpacklo_epi16(0b11111111, a, b);
19651        let e = _mm_set_epi16(37, 5, 38, 6, 39, 7, 40, 8);
19652        assert_eq_m128i(r, e);
19653    }
19654
19655    #[simd_test(enable = "avx512bw")]
19656    const fn test_mm512_unpacklo_epi8() {
19657        #[rustfmt::skip]
19658        let a = _mm512_set_epi8(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19659                                17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
19660                                33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19661                                49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
19662        #[rustfmt::skip]
19663        let b = _mm512_set_epi8(65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,  80,
19664                                81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,  96,
19665                                97,  98,  99,  100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
19666                                113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 0);
19667        let r = _mm512_unpacklo_epi8(a, b);
19668        #[rustfmt::skip]
19669        let e = _mm512_set_epi8(73,  9,  74,  10, 75,  11, 76,  12, 77,  13, 78,  14, 79,  15, 80,  16,
19670                                89,  25, 90,  26, 91,  27, 92,  28, 93,  29, 94,  30, 95,  31, 96,  32,
19671                                105, 41, 106, 42, 107, 43, 108, 44, 109, 45, 110, 46, 111, 47, 112, 48,
19672                                121, 57, 122, 58, 123, 59, 124, 60, 125, 61, 126, 62, 127, 63, 0,   64);
19673        assert_eq_m512i(r, e);
19674    }
19675
19676    #[simd_test(enable = "avx512bw")]
19677    const fn test_mm512_mask_unpacklo_epi8() {
19678        #[rustfmt::skip]
19679        let a = _mm512_set_epi8(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19680                                17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
19681                                33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19682                                49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
19683        #[rustfmt::skip]
19684        let b = _mm512_set_epi8(65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,  80,
19685                                81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,  96,
19686                                97,  98,  99,  100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
19687                                113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 0);
19688        let r = _mm512_mask_unpacklo_epi8(a, 0, a, b);
19689        assert_eq_m512i(r, a);
19690        let r = _mm512_mask_unpacklo_epi8(
19691            a,
19692            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
19693            a,
19694            b,
19695        );
19696        #[rustfmt::skip]
19697        let e = _mm512_set_epi8(73,  9,  74,  10, 75,  11, 76,  12, 77,  13, 78,  14, 79,  15, 80,  16,
19698                                89,  25, 90,  26, 91,  27, 92,  28, 93,  29, 94,  30, 95,  31, 96,  32,
19699                                105, 41, 106, 42, 107, 43, 108, 44, 109, 45, 110, 46, 111, 47, 112, 48,
19700                                121, 57, 122, 58, 123, 59, 124, 60, 125, 61, 126, 62, 127, 63, 0,   64);
19701        assert_eq_m512i(r, e);
19702    }
19703
19704    #[simd_test(enable = "avx512bw")]
19705    const fn test_mm512_maskz_unpacklo_epi8() {
19706        #[rustfmt::skip]
19707        let a = _mm512_set_epi8(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19708                                17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
19709                                33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
19710                                49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
19711        #[rustfmt::skip]
19712        let b = _mm512_set_epi8(65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,  80,
19713                                81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,  96,
19714                                97,  98,  99,  100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
19715                                113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 0);
19716        let r = _mm512_maskz_unpacklo_epi8(0, a, b);
19717        assert_eq_m512i(r, _mm512_setzero_si512());
19718        let r = _mm512_maskz_unpacklo_epi8(
19719            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
19720            a,
19721            b,
19722        );
19723        #[rustfmt::skip]
19724        let e = _mm512_set_epi8(73,  9,  74,  10, 75,  11, 76,  12, 77,  13, 78,  14, 79,  15, 80,  16,
19725                                89,  25, 90,  26, 91,  27, 92,  28, 93,  29, 94,  30, 95,  31, 96,  32,
19726                                105, 41, 106, 42, 107, 43, 108, 44, 109, 45, 110, 46, 111, 47, 112, 48,
19727                                121, 57, 122, 58, 123, 59, 124, 60, 125, 61, 126, 62, 127, 63, 0,   64);
19728        assert_eq_m512i(r, e);
19729    }
19730
19731    #[simd_test(enable = "avx512bw,avx512vl")]
19732    const fn test_mm256_mask_unpacklo_epi8() {
19733        #[rustfmt::skip]
19734        let a = _mm256_set_epi8(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19735                                17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
19736        #[rustfmt::skip]
19737        let b = _mm256_set_epi8(65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,  80,
19738                                81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,  96);
19739        let r = _mm256_mask_unpacklo_epi8(a, 0, a, b);
19740        assert_eq_m256i(r, a);
19741        let r = _mm256_mask_unpacklo_epi8(a, 0b11111111_11111111_11111111_11111111, a, b);
19742        #[rustfmt::skip]
19743        let e = _mm256_set_epi8(73,  9,  74,  10, 75,  11, 76,  12, 77,  13, 78,  14, 79,  15, 80,  16,
19744                                89,  25, 90,  26, 91,  27, 92,  28, 93,  29, 94,  30, 95,  31, 96,  32);
19745        assert_eq_m256i(r, e);
19746    }
19747
19748    #[simd_test(enable = "avx512bw,avx512vl")]
19749    const fn test_mm256_maskz_unpacklo_epi8() {
19750        #[rustfmt::skip]
19751        let a = _mm256_set_epi8(1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
19752                                17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
19753        #[rustfmt::skip]
19754        let b = _mm256_set_epi8(65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,  80,
19755                                81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,  96);
19756        let r = _mm256_maskz_unpacklo_epi8(0, a, b);
19757        assert_eq_m256i(r, _mm256_setzero_si256());
19758        let r = _mm256_maskz_unpacklo_epi8(0b11111111_11111111_11111111_11111111, a, b);
19759        #[rustfmt::skip]
19760        let e = _mm256_set_epi8(73,  9,  74,  10, 75,  11, 76,  12, 77,  13, 78,  14, 79,  15, 80,  16,
19761                                89,  25, 90,  26, 91,  27, 92,  28, 93,  29, 94,  30, 95,  31, 96,  32);
19762        assert_eq_m256i(r, e);
19763    }
19764
19765    #[simd_test(enable = "avx512bw,avx512vl")]
19766    const fn test_mm_mask_unpacklo_epi8() {
19767        let a = _mm_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
19768        let b = _mm_set_epi8(
19769            65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
19770        );
19771        let r = _mm_mask_unpacklo_epi8(a, 0, a, b);
19772        assert_eq_m128i(r, a);
19773        let r = _mm_mask_unpacklo_epi8(a, 0b11111111_11111111, a, b);
19774        let e = _mm_set_epi8(
19775            73, 9, 74, 10, 75, 11, 76, 12, 77, 13, 78, 14, 79, 15, 80, 16,
19776        );
19777        assert_eq_m128i(r, e);
19778    }
19779
19780    #[simd_test(enable = "avx512bw,avx512vl")]
19781    const fn test_mm_maskz_unpacklo_epi8() {
19782        let a = _mm_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
19783        let b = _mm_set_epi8(
19784            65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
19785        );
19786        let r = _mm_maskz_unpacklo_epi8(0, a, b);
19787        assert_eq_m128i(r, _mm_setzero_si128());
19788        let r = _mm_maskz_unpacklo_epi8(0b11111111_11111111, a, b);
19789        let e = _mm_set_epi8(
19790            73, 9, 74, 10, 75, 11, 76, 12, 77, 13, 78, 14, 79, 15, 80, 16,
19791        );
19792        assert_eq_m128i(r, e);
19793    }
19794
19795    #[simd_test(enable = "avx512bw")]
19796    const fn test_mm512_mask_mov_epi16() {
19797        let src = _mm512_set1_epi16(1);
19798        let a = _mm512_set1_epi16(2);
19799        let r = _mm512_mask_mov_epi16(src, 0, a);
19800        assert_eq_m512i(r, src);
19801        let r = _mm512_mask_mov_epi16(src, 0b11111111_11111111_11111111_11111111, a);
19802        assert_eq_m512i(r, a);
19803    }
19804
19805    #[simd_test(enable = "avx512bw")]
19806    const fn test_mm512_maskz_mov_epi16() {
19807        let a = _mm512_set1_epi16(2);
19808        let r = _mm512_maskz_mov_epi16(0, a);
19809        assert_eq_m512i(r, _mm512_setzero_si512());
19810        let r = _mm512_maskz_mov_epi16(0b11111111_11111111_11111111_11111111, a);
19811        assert_eq_m512i(r, a);
19812    }
19813
19814    #[simd_test(enable = "avx512bw,avx512vl")]
19815    const fn test_mm256_mask_mov_epi16() {
19816        let src = _mm256_set1_epi16(1);
19817        let a = _mm256_set1_epi16(2);
19818        let r = _mm256_mask_mov_epi16(src, 0, a);
19819        assert_eq_m256i(r, src);
19820        let r = _mm256_mask_mov_epi16(src, 0b11111111_11111111, a);
19821        assert_eq_m256i(r, a);
19822    }
19823
19824    #[simd_test(enable = "avx512bw,avx512vl")]
19825    const fn test_mm256_maskz_mov_epi16() {
19826        let a = _mm256_set1_epi16(2);
19827        let r = _mm256_maskz_mov_epi16(0, a);
19828        assert_eq_m256i(r, _mm256_setzero_si256());
19829        let r = _mm256_maskz_mov_epi16(0b11111111_11111111, a);
19830        assert_eq_m256i(r, a);
19831    }
19832
19833    #[simd_test(enable = "avx512bw,avx512vl")]
19834    const fn test_mm_mask_mov_epi16() {
19835        let src = _mm_set1_epi16(1);
19836        let a = _mm_set1_epi16(2);
19837        let r = _mm_mask_mov_epi16(src, 0, a);
19838        assert_eq_m128i(r, src);
19839        let r = _mm_mask_mov_epi16(src, 0b11111111, a);
19840        assert_eq_m128i(r, a);
19841    }
19842
19843    #[simd_test(enable = "avx512bw,avx512vl")]
19844    const fn test_mm_maskz_mov_epi16() {
19845        let a = _mm_set1_epi16(2);
19846        let r = _mm_maskz_mov_epi16(0, a);
19847        assert_eq_m128i(r, _mm_setzero_si128());
19848        let r = _mm_maskz_mov_epi16(0b11111111, a);
19849        assert_eq_m128i(r, a);
19850    }
19851
19852    #[simd_test(enable = "avx512bw")]
19853    const fn test_mm512_mask_mov_epi8() {
19854        let src = _mm512_set1_epi8(1);
19855        let a = _mm512_set1_epi8(2);
19856        let r = _mm512_mask_mov_epi8(src, 0, a);
19857        assert_eq_m512i(r, src);
19858        let r = _mm512_mask_mov_epi8(
19859            src,
19860            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
19861            a,
19862        );
19863        assert_eq_m512i(r, a);
19864    }
19865
19866    #[simd_test(enable = "avx512bw")]
19867    const fn test_mm512_maskz_mov_epi8() {
19868        let a = _mm512_set1_epi8(2);
19869        let r = _mm512_maskz_mov_epi8(0, a);
19870        assert_eq_m512i(r, _mm512_setzero_si512());
19871        let r = _mm512_maskz_mov_epi8(
19872            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
19873            a,
19874        );
19875        assert_eq_m512i(r, a);
19876    }
19877
19878    #[simd_test(enable = "avx512bw,avx512vl")]
19879    const fn test_mm256_mask_mov_epi8() {
19880        let src = _mm256_set1_epi8(1);
19881        let a = _mm256_set1_epi8(2);
19882        let r = _mm256_mask_mov_epi8(src, 0, a);
19883        assert_eq_m256i(r, src);
19884        let r = _mm256_mask_mov_epi8(src, 0b11111111_11111111_11111111_11111111, a);
19885        assert_eq_m256i(r, a);
19886    }
19887
19888    #[simd_test(enable = "avx512bw,avx512vl")]
19889    const fn test_mm256_maskz_mov_epi8() {
19890        let a = _mm256_set1_epi8(2);
19891        let r = _mm256_maskz_mov_epi8(0, a);
19892        assert_eq_m256i(r, _mm256_setzero_si256());
19893        let r = _mm256_maskz_mov_epi8(0b11111111_11111111_11111111_11111111, a);
19894        assert_eq_m256i(r, a);
19895    }
19896
19897    #[simd_test(enable = "avx512bw,avx512vl")]
19898    const fn test_mm_mask_mov_epi8() {
19899        let src = _mm_set1_epi8(1);
19900        let a = _mm_set1_epi8(2);
19901        let r = _mm_mask_mov_epi8(src, 0, a);
19902        assert_eq_m128i(r, src);
19903        let r = _mm_mask_mov_epi8(src, 0b11111111_11111111, a);
19904        assert_eq_m128i(r, a);
19905    }
19906
19907    #[simd_test(enable = "avx512bw,avx512vl")]
19908    const fn test_mm_maskz_mov_epi8() {
19909        let a = _mm_set1_epi8(2);
19910        let r = _mm_maskz_mov_epi8(0, a);
19911        assert_eq_m128i(r, _mm_setzero_si128());
19912        let r = _mm_maskz_mov_epi8(0b11111111_11111111, a);
19913        assert_eq_m128i(r, a);
19914    }
19915
19916    #[simd_test(enable = "avx512bw")]
19917    const fn test_mm512_mask_set1_epi16() {
19918        let src = _mm512_set1_epi16(2);
19919        let a: i16 = 11;
19920        let r = _mm512_mask_set1_epi16(src, 0, a);
19921        assert_eq_m512i(r, src);
19922        let r = _mm512_mask_set1_epi16(src, 0b11111111_11111111_11111111_11111111, a);
19923        let e = _mm512_set1_epi16(11);
19924        assert_eq_m512i(r, e);
19925    }
19926
19927    #[simd_test(enable = "avx512bw")]
19928    const fn test_mm512_maskz_set1_epi16() {
19929        let a: i16 = 11;
19930        let r = _mm512_maskz_set1_epi16(0, a);
19931        assert_eq_m512i(r, _mm512_setzero_si512());
19932        let r = _mm512_maskz_set1_epi16(0b11111111_11111111_11111111_11111111, a);
19933        let e = _mm512_set1_epi16(11);
19934        assert_eq_m512i(r, e);
19935    }
19936
19937    #[simd_test(enable = "avx512bw,avx512vl")]
19938    const fn test_mm256_mask_set1_epi16() {
19939        let src = _mm256_set1_epi16(2);
19940        let a: i16 = 11;
19941        let r = _mm256_mask_set1_epi16(src, 0, a);
19942        assert_eq_m256i(r, src);
19943        let r = _mm256_mask_set1_epi16(src, 0b11111111_11111111, a);
19944        let e = _mm256_set1_epi16(11);
19945        assert_eq_m256i(r, e);
19946    }
19947
19948    #[simd_test(enable = "avx512bw,avx512vl")]
19949    const fn test_mm256_maskz_set1_epi16() {
19950        let a: i16 = 11;
19951        let r = _mm256_maskz_set1_epi16(0, a);
19952        assert_eq_m256i(r, _mm256_setzero_si256());
19953        let r = _mm256_maskz_set1_epi16(0b11111111_11111111, a);
19954        let e = _mm256_set1_epi16(11);
19955        assert_eq_m256i(r, e);
19956    }
19957
19958    #[simd_test(enable = "avx512bw,avx512vl")]
19959    const fn test_mm_mask_set1_epi16() {
19960        let src = _mm_set1_epi16(2);
19961        let a: i16 = 11;
19962        let r = _mm_mask_set1_epi16(src, 0, a);
19963        assert_eq_m128i(r, src);
19964        let r = _mm_mask_set1_epi16(src, 0b11111111, a);
19965        let e = _mm_set1_epi16(11);
19966        assert_eq_m128i(r, e);
19967    }
19968
19969    #[simd_test(enable = "avx512bw,avx512vl")]
19970    const fn test_mm_maskz_set1_epi16() {
19971        let a: i16 = 11;
19972        let r = _mm_maskz_set1_epi16(0, a);
19973        assert_eq_m128i(r, _mm_setzero_si128());
19974        let r = _mm_maskz_set1_epi16(0b11111111, a);
19975        let e = _mm_set1_epi16(11);
19976        assert_eq_m128i(r, e);
19977    }
19978
19979    #[simd_test(enable = "avx512bw")]
19980    const fn test_mm512_mask_set1_epi8() {
19981        let src = _mm512_set1_epi8(2);
19982        let a: i8 = 11;
19983        let r = _mm512_mask_set1_epi8(src, 0, a);
19984        assert_eq_m512i(r, src);
19985        let r = _mm512_mask_set1_epi8(
19986            src,
19987            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
19988            a,
19989        );
19990        let e = _mm512_set1_epi8(11);
19991        assert_eq_m512i(r, e);
19992    }
19993
19994    #[simd_test(enable = "avx512bw")]
19995    const fn test_mm512_maskz_set1_epi8() {
19996        let a: i8 = 11;
19997        let r = _mm512_maskz_set1_epi8(0, a);
19998        assert_eq_m512i(r, _mm512_setzero_si512());
19999        let r = _mm512_maskz_set1_epi8(
20000            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
20001            a,
20002        );
20003        let e = _mm512_set1_epi8(11);
20004        assert_eq_m512i(r, e);
20005    }
20006
20007    #[simd_test(enable = "avx512bw,avx512vl")]
20008    const fn test_mm256_mask_set1_epi8() {
20009        let src = _mm256_set1_epi8(2);
20010        let a: i8 = 11;
20011        let r = _mm256_mask_set1_epi8(src, 0, a);
20012        assert_eq_m256i(r, src);
20013        let r = _mm256_mask_set1_epi8(src, 0b11111111_11111111_11111111_11111111, a);
20014        let e = _mm256_set1_epi8(11);
20015        assert_eq_m256i(r, e);
20016    }
20017
20018    #[simd_test(enable = "avx512bw,avx512vl")]
20019    const fn test_mm256_maskz_set1_epi8() {
20020        let a: i8 = 11;
20021        let r = _mm256_maskz_set1_epi8(0, a);
20022        assert_eq_m256i(r, _mm256_setzero_si256());
20023        let r = _mm256_maskz_set1_epi8(0b11111111_11111111_11111111_11111111, a);
20024        let e = _mm256_set1_epi8(11);
20025        assert_eq_m256i(r, e);
20026    }
20027
20028    #[simd_test(enable = "avx512bw,avx512vl")]
20029    const fn test_mm_mask_set1_epi8() {
20030        let src = _mm_set1_epi8(2);
20031        let a: i8 = 11;
20032        let r = _mm_mask_set1_epi8(src, 0, a);
20033        assert_eq_m128i(r, src);
20034        let r = _mm_mask_set1_epi8(src, 0b11111111_11111111, a);
20035        let e = _mm_set1_epi8(11);
20036        assert_eq_m128i(r, e);
20037    }
20038
20039    #[simd_test(enable = "avx512bw,avx512vl")]
20040    const fn test_mm_maskz_set1_epi8() {
20041        let a: i8 = 11;
20042        let r = _mm_maskz_set1_epi8(0, a);
20043        assert_eq_m128i(r, _mm_setzero_si128());
20044        let r = _mm_maskz_set1_epi8(0b11111111_11111111, a);
20045        let e = _mm_set1_epi8(11);
20046        assert_eq_m128i(r, e);
20047    }
20048
20049    #[simd_test(enable = "avx512bw")]
20050    const fn test_mm512_shufflelo_epi16() {
20051        #[rustfmt::skip]
20052        let a = _mm512_set_epi16(
20053            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
20054            16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
20055        );
20056        #[rustfmt::skip]
20057        let e = _mm512_set_epi16(
20058            0, 1, 2, 3, 7, 6, 6, 4, 8, 9, 10, 11, 15, 14, 14, 12,
20059            16, 17, 18, 19, 23, 22, 22, 20, 24, 25, 26, 27, 31, 30, 30, 28,
20060        );
20061        let r = _mm512_shufflelo_epi16::<0b00_01_01_11>(a);
20062        assert_eq_m512i(r, e);
20063    }
20064
20065    #[simd_test(enable = "avx512bw")]
20066    const fn test_mm512_mask_shufflelo_epi16() {
20067        #[rustfmt::skip]
20068        let a = _mm512_set_epi16(
20069            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
20070            16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
20071        );
20072        let r = _mm512_mask_shufflelo_epi16::<0b00_01_01_11>(a, 0, a);
20073        assert_eq_m512i(r, a);
20074        let r = _mm512_mask_shufflelo_epi16::<0b00_01_01_11>(
20075            a,
20076            0b11111111_11111111_11111111_11111111,
20077            a,
20078        );
20079        #[rustfmt::skip]
20080        let e = _mm512_set_epi16(
20081            0, 1, 2, 3, 7, 6, 6, 4, 8, 9, 10, 11, 15, 14, 14, 12,
20082            16, 17, 18, 19, 23, 22, 22, 20, 24, 25, 26, 27, 31, 30, 30, 28,
20083        );
20084        assert_eq_m512i(r, e);
20085    }
20086
20087    #[simd_test(enable = "avx512bw")]
20088    const fn test_mm512_maskz_shufflelo_epi16() {
20089        #[rustfmt::skip]
20090        let a = _mm512_set_epi16(
20091            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
20092            16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
20093        );
20094        let r = _mm512_maskz_shufflelo_epi16::<0b00_01_01_11>(0, a);
20095        assert_eq_m512i(r, _mm512_setzero_si512());
20096        let r =
20097            _mm512_maskz_shufflelo_epi16::<0b00_01_01_11>(0b11111111_11111111_11111111_11111111, a);
20098        #[rustfmt::skip]
20099        let e = _mm512_set_epi16(
20100            0, 1, 2, 3, 7, 6, 6, 4, 8, 9, 10, 11, 15, 14, 14, 12,
20101            16, 17, 18, 19, 23, 22, 22, 20, 24, 25, 26, 27, 31, 30, 30, 28,
20102        );
20103        assert_eq_m512i(r, e);
20104    }
20105
20106    #[simd_test(enable = "avx512bw,avx512vl")]
20107    const fn test_mm256_mask_shufflelo_epi16() {
20108        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
20109        let r = _mm256_mask_shufflelo_epi16::<0b00_01_01_11>(a, 0, a);
20110        assert_eq_m256i(r, a);
20111        let r = _mm256_mask_shufflelo_epi16::<0b00_01_01_11>(a, 0b11111111_11111111, a);
20112        let e = _mm256_set_epi16(0, 1, 2, 3, 7, 6, 6, 4, 8, 9, 10, 11, 15, 14, 14, 12);
20113        assert_eq_m256i(r, e);
20114    }
20115
20116    #[simd_test(enable = "avx512bw,avx512vl")]
20117    const fn test_mm256_maskz_shufflelo_epi16() {
20118        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
20119        let r = _mm256_maskz_shufflelo_epi16::<0b00_01_01_11>(0, a);
20120        assert_eq_m256i(r, _mm256_setzero_si256());
20121        let r = _mm256_maskz_shufflelo_epi16::<0b00_01_01_11>(0b11111111_11111111, a);
20122        let e = _mm256_set_epi16(0, 1, 2, 3, 7, 6, 6, 4, 8, 9, 10, 11, 15, 14, 14, 12);
20123        assert_eq_m256i(r, e);
20124    }
20125
20126    #[simd_test(enable = "avx512bw,avx512vl")]
20127    const fn test_mm_mask_shufflelo_epi16() {
20128        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
20129        let r = _mm_mask_shufflelo_epi16::<0b00_01_01_11>(a, 0, a);
20130        assert_eq_m128i(r, a);
20131        let r = _mm_mask_shufflelo_epi16::<0b00_01_01_11>(a, 0b11111111, a);
20132        let e = _mm_set_epi16(0, 1, 2, 3, 7, 6, 6, 4);
20133        assert_eq_m128i(r, e);
20134    }
20135
20136    #[simd_test(enable = "avx512bw,avx512vl")]
20137    const fn test_mm_maskz_shufflelo_epi16() {
20138        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
20139        let r = _mm_maskz_shufflelo_epi16::<0b00_01_01_11>(0, a);
20140        assert_eq_m128i(r, _mm_setzero_si128());
20141        let r = _mm_maskz_shufflelo_epi16::<0b00_01_01_11>(0b11111111, a);
20142        let e = _mm_set_epi16(0, 1, 2, 3, 7, 6, 6, 4);
20143        assert_eq_m128i(r, e);
20144    }
20145
20146    #[simd_test(enable = "avx512bw")]
20147    const fn test_mm512_shufflehi_epi16() {
20148        #[rustfmt::skip]
20149        let a = _mm512_set_epi16(
20150            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
20151            16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
20152        );
20153        #[rustfmt::skip]
20154        let e = _mm512_set_epi16(
20155            3, 2, 2, 0, 4, 5, 6, 7, 11, 10, 10, 8, 12, 13, 14, 15,
20156            19, 18, 18, 16, 20, 21, 22, 23, 27, 26, 26, 24, 28, 29, 30, 31,
20157        );
20158        let r = _mm512_shufflehi_epi16::<0b00_01_01_11>(a);
20159        assert_eq_m512i(r, e);
20160    }
20161
20162    #[simd_test(enable = "avx512bw")]
20163    const fn test_mm512_mask_shufflehi_epi16() {
20164        #[rustfmt::skip]
20165        let a = _mm512_set_epi16(
20166            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
20167            16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
20168        );
20169        let r = _mm512_mask_shufflehi_epi16::<0b00_01_01_11>(a, 0, a);
20170        assert_eq_m512i(r, a);
20171        let r = _mm512_mask_shufflehi_epi16::<0b00_01_01_11>(
20172            a,
20173            0b11111111_11111111_11111111_11111111,
20174            a,
20175        );
20176        #[rustfmt::skip]
20177        let e = _mm512_set_epi16(
20178            3, 2, 2, 0, 4, 5, 6, 7, 11, 10, 10, 8, 12, 13, 14, 15,
20179            19, 18, 18, 16, 20, 21, 22, 23, 27, 26, 26, 24, 28, 29, 30, 31,
20180        );
20181        assert_eq_m512i(r, e);
20182    }
20183
20184    #[simd_test(enable = "avx512bw")]
20185    const fn test_mm512_maskz_shufflehi_epi16() {
20186        #[rustfmt::skip]
20187        let a = _mm512_set_epi16(
20188            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
20189            16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
20190        );
20191        let r = _mm512_maskz_shufflehi_epi16::<0b00_01_01_11>(0, a);
20192        assert_eq_m512i(r, _mm512_setzero_si512());
20193        let r =
20194            _mm512_maskz_shufflehi_epi16::<0b00_01_01_11>(0b11111111_11111111_11111111_11111111, a);
20195        #[rustfmt::skip]
20196        let e = _mm512_set_epi16(
20197            3, 2, 2, 0, 4, 5, 6, 7, 11, 10, 10, 8, 12, 13, 14, 15,
20198            19, 18, 18, 16, 20, 21, 22, 23, 27, 26, 26, 24, 28, 29, 30, 31,
20199        );
20200        assert_eq_m512i(r, e);
20201    }
20202
20203    #[simd_test(enable = "avx512bw,avx512vl")]
20204    const fn test_mm256_mask_shufflehi_epi16() {
20205        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
20206        let r = _mm256_mask_shufflehi_epi16::<0b00_01_01_11>(a, 0, a);
20207        assert_eq_m256i(r, a);
20208        let r = _mm256_mask_shufflehi_epi16::<0b00_01_01_11>(a, 0b11111111_11111111, a);
20209        let e = _mm256_set_epi16(3, 2, 2, 0, 4, 5, 6, 7, 11, 10, 10, 8, 12, 13, 14, 15);
20210        assert_eq_m256i(r, e);
20211    }
20212
20213    #[simd_test(enable = "avx512bw,avx512vl")]
20214    const fn test_mm256_maskz_shufflehi_epi16() {
20215        let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
20216        let r = _mm256_maskz_shufflehi_epi16::<0b00_01_01_11>(0, a);
20217        assert_eq_m256i(r, _mm256_setzero_si256());
20218        let r = _mm256_maskz_shufflehi_epi16::<0b00_01_01_11>(0b11111111_11111111, a);
20219        let e = _mm256_set_epi16(3, 2, 2, 0, 4, 5, 6, 7, 11, 10, 10, 8, 12, 13, 14, 15);
20220        assert_eq_m256i(r, e);
20221    }
20222
20223    #[simd_test(enable = "avx512bw,avx512vl")]
20224    const fn test_mm_mask_shufflehi_epi16() {
20225        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
20226        let r = _mm_mask_shufflehi_epi16::<0b00_01_01_11>(a, 0, a);
20227        assert_eq_m128i(r, a);
20228        let r = _mm_mask_shufflehi_epi16::<0b00_01_01_11>(a, 0b11111111, a);
20229        let e = _mm_set_epi16(3, 2, 2, 0, 4, 5, 6, 7);
20230        assert_eq_m128i(r, e);
20231    }
20232
20233    #[simd_test(enable = "avx512bw,avx512vl")]
20234    const fn test_mm_maskz_shufflehi_epi16() {
20235        let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
20236        let r = _mm_maskz_shufflehi_epi16::<0b00_01_01_11>(0, a);
20237        assert_eq_m128i(r, _mm_setzero_si128());
20238        let r = _mm_maskz_shufflehi_epi16::<0b00_01_01_11>(0b11111111, a);
20239        let e = _mm_set_epi16(3, 2, 2, 0, 4, 5, 6, 7);
20240        assert_eq_m128i(r, e);
20241    }
20242
20243    #[simd_test(enable = "avx512bw")]
20244    fn test_mm512_shuffle_epi8() {
20245        #[rustfmt::skip]
20246        let a = _mm512_set_epi8(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                                32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
20249                                48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63);
20250        let b = _mm512_set1_epi8(1);
20251        let r = _mm512_shuffle_epi8(a, b);
20252        #[rustfmt::skip]
20253        let e = _mm512_set_epi8(14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
20254                                30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
20255                                46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
20256                                62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62);
20257        assert_eq_m512i(r, e);
20258    }
20259
20260    #[simd_test(enable = "avx512bw")]
20261    fn test_mm512_mask_shuffle_epi8() {
20262        #[rustfmt::skip]
20263        let a = _mm512_set_epi8(0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,
20264                                16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
20265                                32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
20266                                48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63);
20267        let b = _mm512_set1_epi8(1);
20268        let r = _mm512_mask_shuffle_epi8(a, 0, a, b);
20269        assert_eq_m512i(r, a);
20270        let r = _mm512_mask_shuffle_epi8(
20271            a,
20272            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
20273            a,
20274            b,
20275        );
20276        #[rustfmt::skip]
20277        let e = _mm512_set_epi8(14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
20278                                30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
20279                                46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
20280                                62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62);
20281        assert_eq_m512i(r, e);
20282    }
20283
20284    #[simd_test(enable = "avx512bw")]
20285    fn test_mm512_maskz_shuffle_epi8() {
20286        #[rustfmt::skip]
20287        let a = _mm512_set_epi8(0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,
20288                                16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
20289                                32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
20290                                48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63);
20291        let b = _mm512_set1_epi8(1);
20292        let r = _mm512_maskz_shuffle_epi8(0, a, b);
20293        assert_eq_m512i(r, _mm512_setzero_si512());
20294        let r = _mm512_maskz_shuffle_epi8(
20295            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
20296            a,
20297            b,
20298        );
20299        #[rustfmt::skip]
20300        let e = _mm512_set_epi8(14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
20301                                30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
20302                                46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
20303                                62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62);
20304        assert_eq_m512i(r, e);
20305    }
20306
20307    #[simd_test(enable = "avx512bw,avx512vl")]
20308    fn test_mm256_mask_shuffle_epi8() {
20309        #[rustfmt::skip]
20310        let a = _mm256_set_epi8(0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,
20311                                16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
20312        let b = _mm256_set1_epi8(1);
20313        let r = _mm256_mask_shuffle_epi8(a, 0, a, b);
20314        assert_eq_m256i(r, a);
20315        let r = _mm256_mask_shuffle_epi8(a, 0b11111111_11111111_11111111_11111111, a, b);
20316        #[rustfmt::skip]
20317        let e = _mm256_set_epi8(14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
20318                                30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30);
20319        assert_eq_m256i(r, e);
20320    }
20321
20322    #[simd_test(enable = "avx512bw,avx512vl")]
20323    fn test_mm256_maskz_shuffle_epi8() {
20324        #[rustfmt::skip]
20325        let a = _mm256_set_epi8(0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,
20326                                16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
20327        let b = _mm256_set1_epi8(1);
20328        let r = _mm256_maskz_shuffle_epi8(0, a, b);
20329        assert_eq_m256i(r, _mm256_setzero_si256());
20330        let r = _mm256_maskz_shuffle_epi8(0b11111111_11111111_11111111_11111111, a, b);
20331        #[rustfmt::skip]
20332        let e = _mm256_set_epi8(14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
20333                                30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30);
20334        assert_eq_m256i(r, e);
20335    }
20336
20337    #[simd_test(enable = "avx512bw,avx512vl")]
20338    fn test_mm_mask_shuffle_epi8() {
20339        let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
20340        let b = _mm_set1_epi8(1);
20341        let r = _mm_mask_shuffle_epi8(a, 0, a, b);
20342        assert_eq_m128i(r, a);
20343        let r = _mm_mask_shuffle_epi8(a, 0b11111111_11111111, a, b);
20344        let e = _mm_set_epi8(
20345            14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
20346        );
20347        assert_eq_m128i(r, e);
20348    }
20349
20350    #[simd_test(enable = "avx512bw,avx512vl")]
20351    fn test_mm_maskz_shuffle_epi8() {
20352        #[rustfmt::skip]
20353        let a = _mm_set_epi8(0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15);
20354        let b = _mm_set1_epi8(1);
20355        let r = _mm_maskz_shuffle_epi8(0, a, b);
20356        assert_eq_m128i(r, _mm_setzero_si128());
20357        let r = _mm_maskz_shuffle_epi8(0b11111111_11111111, a, b);
20358        let e = _mm_set_epi8(
20359            14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
20360        );
20361        assert_eq_m128i(r, e);
20362    }
20363
20364    #[simd_test(enable = "avx512bw")]
20365    const fn test_mm512_test_epi16_mask() {
20366        let a = _mm512_set1_epi16(1 << 0);
20367        let b = _mm512_set1_epi16(1 << 0 | 1 << 1);
20368        let r = _mm512_test_epi16_mask(a, b);
20369        let e: __mmask32 = 0b11111111_11111111_11111111_11111111;
20370        assert_eq!(r, e);
20371    }
20372
20373    #[simd_test(enable = "avx512bw")]
20374    const fn test_mm512_mask_test_epi16_mask() {
20375        let a = _mm512_set1_epi16(1 << 0);
20376        let b = _mm512_set1_epi16(1 << 0 | 1 << 1);
20377        let r = _mm512_mask_test_epi16_mask(0, a, b);
20378        assert_eq!(r, 0);
20379        let r = _mm512_mask_test_epi16_mask(0b11111111_11111111_11111111_11111111, a, b);
20380        let e: __mmask32 = 0b11111111_11111111_11111111_11111111;
20381        assert_eq!(r, e);
20382    }
20383
20384    #[simd_test(enable = "avx512bw,avx512vl")]
20385    const fn test_mm256_test_epi16_mask() {
20386        let a = _mm256_set1_epi16(1 << 0);
20387        let b = _mm256_set1_epi16(1 << 0 | 1 << 1);
20388        let r = _mm256_test_epi16_mask(a, b);
20389        let e: __mmask16 = 0b11111111_11111111;
20390        assert_eq!(r, e);
20391    }
20392
20393    #[simd_test(enable = "avx512bw,avx512vl")]
20394    const fn test_mm256_mask_test_epi16_mask() {
20395        let a = _mm256_set1_epi16(1 << 0);
20396        let b = _mm256_set1_epi16(1 << 0 | 1 << 1);
20397        let r = _mm256_mask_test_epi16_mask(0, a, b);
20398        assert_eq!(r, 0);
20399        let r = _mm256_mask_test_epi16_mask(0b11111111_11111111, a, b);
20400        let e: __mmask16 = 0b11111111_11111111;
20401        assert_eq!(r, e);
20402    }
20403
20404    #[simd_test(enable = "avx512bw,avx512vl")]
20405    const fn test_mm_test_epi16_mask() {
20406        let a = _mm_set1_epi16(1 << 0);
20407        let b = _mm_set1_epi16(1 << 0 | 1 << 1);
20408        let r = _mm_test_epi16_mask(a, b);
20409        let e: __mmask8 = 0b11111111;
20410        assert_eq!(r, e);
20411    }
20412
20413    #[simd_test(enable = "avx512bw,avx512vl")]
20414    const fn test_mm_mask_test_epi16_mask() {
20415        let a = _mm_set1_epi16(1 << 0);
20416        let b = _mm_set1_epi16(1 << 0 | 1 << 1);
20417        let r = _mm_mask_test_epi16_mask(0, a, b);
20418        assert_eq!(r, 0);
20419        let r = _mm_mask_test_epi16_mask(0b11111111, a, b);
20420        let e: __mmask8 = 0b11111111;
20421        assert_eq!(r, e);
20422    }
20423
20424    #[simd_test(enable = "avx512bw")]
20425    const fn test_mm512_test_epi8_mask() {
20426        let a = _mm512_set1_epi8(1 << 0);
20427        let b = _mm512_set1_epi8(1 << 0 | 1 << 1);
20428        let r = _mm512_test_epi8_mask(a, b);
20429        let e: __mmask64 =
20430            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111;
20431        assert_eq!(r, e);
20432    }
20433
20434    #[simd_test(enable = "avx512bw")]
20435    const fn test_mm512_mask_test_epi8_mask() {
20436        let a = _mm512_set1_epi8(1 << 0);
20437        let b = _mm512_set1_epi8(1 << 0 | 1 << 1);
20438        let r = _mm512_mask_test_epi8_mask(0, a, b);
20439        assert_eq!(r, 0);
20440        let r = _mm512_mask_test_epi8_mask(
20441            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
20442            a,
20443            b,
20444        );
20445        let e: __mmask64 =
20446            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111;
20447        assert_eq!(r, e);
20448    }
20449
20450    #[simd_test(enable = "avx512bw,avx512vl")]
20451    const fn test_mm256_test_epi8_mask() {
20452        let a = _mm256_set1_epi8(1 << 0);
20453        let b = _mm256_set1_epi8(1 << 0 | 1 << 1);
20454        let r = _mm256_test_epi8_mask(a, b);
20455        let e: __mmask32 = 0b11111111_11111111_11111111_11111111;
20456        assert_eq!(r, e);
20457    }
20458
20459    #[simd_test(enable = "avx512bw,avx512vl")]
20460    const fn test_mm256_mask_test_epi8_mask() {
20461        let a = _mm256_set1_epi8(1 << 0);
20462        let b = _mm256_set1_epi8(1 << 0 | 1 << 1);
20463        let r = _mm256_mask_test_epi8_mask(0, a, b);
20464        assert_eq!(r, 0);
20465        let r = _mm256_mask_test_epi8_mask(0b11111111_11111111_11111111_11111111, a, b);
20466        let e: __mmask32 = 0b11111111_11111111_11111111_11111111;
20467        assert_eq!(r, e);
20468    }
20469
20470    #[simd_test(enable = "avx512bw,avx512vl")]
20471    const fn test_mm_test_epi8_mask() {
20472        let a = _mm_set1_epi8(1 << 0);
20473        let b = _mm_set1_epi8(1 << 0 | 1 << 1);
20474        let r = _mm_test_epi8_mask(a, b);
20475        let e: __mmask16 = 0b11111111_11111111;
20476        assert_eq!(r, e);
20477    }
20478
20479    #[simd_test(enable = "avx512bw,avx512vl")]
20480    const fn test_mm_mask_test_epi8_mask() {
20481        let a = _mm_set1_epi8(1 << 0);
20482        let b = _mm_set1_epi8(1 << 0 | 1 << 1);
20483        let r = _mm_mask_test_epi8_mask(0, a, b);
20484        assert_eq!(r, 0);
20485        let r = _mm_mask_test_epi8_mask(0b11111111_11111111, a, b);
20486        let e: __mmask16 = 0b11111111_11111111;
20487        assert_eq!(r, e);
20488    }
20489
20490    #[simd_test(enable = "avx512bw")]
20491    const fn test_mm512_testn_epi16_mask() {
20492        let a = _mm512_set1_epi16(1 << 0);
20493        let b = _mm512_set1_epi16(1 << 0 | 1 << 1);
20494        let r = _mm512_testn_epi16_mask(a, b);
20495        let e: __mmask32 = 0b00000000_00000000_00000000_00000000;
20496        assert_eq!(r, e);
20497    }
20498
20499    #[simd_test(enable = "avx512bw")]
20500    const fn test_mm512_mask_testn_epi16_mask() {
20501        let a = _mm512_set1_epi16(1 << 0);
20502        let b = _mm512_set1_epi16(1 << 0 | 1 << 1);
20503        let r = _mm512_mask_testn_epi16_mask(0, a, b);
20504        assert_eq!(r, 0);
20505        let r = _mm512_mask_testn_epi16_mask(0b11111111_11111111_11111111_11111111, a, b);
20506        let e: __mmask32 = 0b00000000_00000000_00000000_00000000;
20507        assert_eq!(r, e);
20508    }
20509
20510    #[simd_test(enable = "avx512bw,avx512vl")]
20511    const fn test_mm256_testn_epi16_mask() {
20512        let a = _mm256_set1_epi16(1 << 0);
20513        let b = _mm256_set1_epi16(1 << 0 | 1 << 1);
20514        let r = _mm256_testn_epi16_mask(a, b);
20515        let e: __mmask16 = 0b00000000_00000000;
20516        assert_eq!(r, e);
20517    }
20518
20519    #[simd_test(enable = "avx512bw,avx512vl")]
20520    const fn test_mm256_mask_testn_epi16_mask() {
20521        let a = _mm256_set1_epi16(1 << 0);
20522        let b = _mm256_set1_epi16(1 << 0 | 1 << 1);
20523        let r = _mm256_mask_testn_epi16_mask(0, a, b);
20524        assert_eq!(r, 0);
20525        let r = _mm256_mask_testn_epi16_mask(0b11111111_11111111, a, b);
20526        let e: __mmask16 = 0b00000000_00000000;
20527        assert_eq!(r, e);
20528    }
20529
20530    #[simd_test(enable = "avx512bw,avx512vl")]
20531    const fn test_mm_testn_epi16_mask() {
20532        let a = _mm_set1_epi16(1 << 0);
20533        let b = _mm_set1_epi16(1 << 0 | 1 << 1);
20534        let r = _mm_testn_epi16_mask(a, b);
20535        let e: __mmask8 = 0b00000000;
20536        assert_eq!(r, e);
20537    }
20538
20539    #[simd_test(enable = "avx512bw,avx512vl")]
20540    const fn test_mm_mask_testn_epi16_mask() {
20541        let a = _mm_set1_epi16(1 << 0);
20542        let b = _mm_set1_epi16(1 << 0 | 1 << 1);
20543        let r = _mm_mask_testn_epi16_mask(0, a, b);
20544        assert_eq!(r, 0);
20545        let r = _mm_mask_testn_epi16_mask(0b11111111, a, b);
20546        let e: __mmask8 = 0b00000000;
20547        assert_eq!(r, e);
20548    }
20549
20550    #[simd_test(enable = "avx512bw")]
20551    const fn test_mm512_testn_epi8_mask() {
20552        let a = _mm512_set1_epi8(1 << 0);
20553        let b = _mm512_set1_epi8(1 << 0 | 1 << 1);
20554        let r = _mm512_testn_epi8_mask(a, b);
20555        let e: __mmask64 =
20556            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000;
20557        assert_eq!(r, e);
20558    }
20559
20560    #[simd_test(enable = "avx512bw")]
20561    const fn test_mm512_mask_testn_epi8_mask() {
20562        let a = _mm512_set1_epi8(1 << 0);
20563        let b = _mm512_set1_epi8(1 << 0 | 1 << 1);
20564        let r = _mm512_mask_testn_epi8_mask(0, a, b);
20565        assert_eq!(r, 0);
20566        let r = _mm512_mask_testn_epi8_mask(
20567            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
20568            a,
20569            b,
20570        );
20571        let e: __mmask64 =
20572            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000;
20573        assert_eq!(r, e);
20574    }
20575
20576    #[simd_test(enable = "avx512bw,avx512vl")]
20577    const fn test_mm256_testn_epi8_mask() {
20578        let a = _mm256_set1_epi8(1 << 0);
20579        let b = _mm256_set1_epi8(1 << 0 | 1 << 1);
20580        let r = _mm256_testn_epi8_mask(a, b);
20581        let e: __mmask32 = 0b00000000_00000000_00000000_00000000;
20582        assert_eq!(r, e);
20583    }
20584
20585    #[simd_test(enable = "avx512bw,avx512vl")]
20586    const fn test_mm256_mask_testn_epi8_mask() {
20587        let a = _mm256_set1_epi8(1 << 0);
20588        let b = _mm256_set1_epi8(1 << 0 | 1 << 1);
20589        let r = _mm256_mask_testn_epi8_mask(0, a, b);
20590        assert_eq!(r, 0);
20591        let r = _mm256_mask_testn_epi8_mask(0b11111111_11111111_11111111_11111111, a, b);
20592        let e: __mmask32 = 0b00000000_00000000_00000000_00000000;
20593        assert_eq!(r, e);
20594    }
20595
20596    #[simd_test(enable = "avx512bw,avx512vl")]
20597    const fn test_mm_testn_epi8_mask() {
20598        let a = _mm_set1_epi8(1 << 0);
20599        let b = _mm_set1_epi8(1 << 0 | 1 << 1);
20600        let r = _mm_testn_epi8_mask(a, b);
20601        let e: __mmask16 = 0b00000000_00000000;
20602        assert_eq!(r, e);
20603    }
20604
20605    #[simd_test(enable = "avx512bw,avx512vl")]
20606    const fn test_mm_mask_testn_epi8_mask() {
20607        let a = _mm_set1_epi8(1 << 0);
20608        let b = _mm_set1_epi8(1 << 0 | 1 << 1);
20609        let r = _mm_mask_testn_epi8_mask(0, a, b);
20610        assert_eq!(r, 0);
20611        let r = _mm_mask_testn_epi8_mask(0b11111111_11111111, a, b);
20612        let e: __mmask16 = 0b00000000_00000000;
20613        assert_eq!(r, e);
20614    }
20615
20616    #[simd_test(enable = "avx512bw")]
20617    const fn test_store_mask64() {
20618        let a: __mmask64 =
20619            0b11111111_00000000_11111111_00000000_11111111_00000000_11111111_00000000;
20620        let mut r = 0;
20621        unsafe {
20622            _store_mask64(&mut r, a);
20623        }
20624        assert_eq!(r, a);
20625    }
20626
20627    #[simd_test(enable = "avx512bw")]
20628    const fn test_store_mask32() {
20629        let a: __mmask32 = 0b11111111_00000000_11111111_00000000;
20630        let mut r = 0;
20631        unsafe {
20632            _store_mask32(&mut r, a);
20633        }
20634        assert_eq!(r, a);
20635    }
20636
20637    #[simd_test(enable = "avx512bw")]
20638    const fn test_load_mask64() {
20639        let p: __mmask64 =
20640            0b11111111_00000000_11111111_00000000_11111111_00000000_11111111_00000000;
20641        let r = unsafe { _load_mask64(&p) };
20642        let e: __mmask64 =
20643            0b11111111_00000000_11111111_00000000_11111111_00000000_11111111_00000000;
20644        assert_eq!(r, e);
20645    }
20646
20647    #[simd_test(enable = "avx512bw")]
20648    const fn test_load_mask32() {
20649        let p: __mmask32 = 0b11111111_00000000_11111111_00000000;
20650        let r = unsafe { _load_mask32(&p) };
20651        let e: __mmask32 = 0b11111111_00000000_11111111_00000000;
20652        assert_eq!(r, e);
20653    }
20654
20655    #[simd_test(enable = "avx512bw")]
20656    fn test_mm512_sad_epu8() {
20657        let a = _mm512_set1_epi8(2);
20658        let b = _mm512_set1_epi8(4);
20659        let r = _mm512_sad_epu8(a, b);
20660        let e = _mm512_set1_epi64(16);
20661        assert_eq_m512i(r, e);
20662    }
20663
20664    #[simd_test(enable = "avx512bw")]
20665    fn test_mm512_dbsad_epu8() {
20666        let a = _mm512_set1_epi8(2);
20667        let b = _mm512_set1_epi8(4);
20668        let r = _mm512_dbsad_epu8::<0>(a, b);
20669        let e = _mm512_set1_epi16(8);
20670        assert_eq_m512i(r, e);
20671    }
20672
20673    #[simd_test(enable = "avx512bw")]
20674    fn test_mm512_mask_dbsad_epu8() {
20675        let src = _mm512_set1_epi16(1);
20676        let a = _mm512_set1_epi8(2);
20677        let b = _mm512_set1_epi8(4);
20678        let r = _mm512_mask_dbsad_epu8::<0>(src, 0, a, b);
20679        assert_eq_m512i(r, src);
20680        let r = _mm512_mask_dbsad_epu8::<0>(src, 0b11111111_11111111_11111111_11111111, a, b);
20681        let e = _mm512_set1_epi16(8);
20682        assert_eq_m512i(r, e);
20683    }
20684
20685    #[simd_test(enable = "avx512bw")]
20686    fn test_mm512_maskz_dbsad_epu8() {
20687        let a = _mm512_set1_epi8(2);
20688        let b = _mm512_set1_epi8(4);
20689        let r = _mm512_maskz_dbsad_epu8::<0>(0, a, b);
20690        assert_eq_m512i(r, _mm512_setzero_si512());
20691        let r = _mm512_maskz_dbsad_epu8::<0>(0b11111111_11111111_11111111_11111111, a, b);
20692        let e = _mm512_set1_epi16(8);
20693        assert_eq_m512i(r, e);
20694    }
20695
20696    #[simd_test(enable = "avx512bw,avx512vl")]
20697    fn test_mm256_dbsad_epu8() {
20698        let a = _mm256_set1_epi8(2);
20699        let b = _mm256_set1_epi8(4);
20700        let r = _mm256_dbsad_epu8::<0>(a, b);
20701        let e = _mm256_set1_epi16(8);
20702        assert_eq_m256i(r, e);
20703    }
20704
20705    #[simd_test(enable = "avx512bw,avx512vl")]
20706    fn test_mm256_mask_dbsad_epu8() {
20707        let src = _mm256_set1_epi16(1);
20708        let a = _mm256_set1_epi8(2);
20709        let b = _mm256_set1_epi8(4);
20710        let r = _mm256_mask_dbsad_epu8::<0>(src, 0, a, b);
20711        assert_eq_m256i(r, src);
20712        let r = _mm256_mask_dbsad_epu8::<0>(src, 0b11111111_11111111, a, b);
20713        let e = _mm256_set1_epi16(8);
20714        assert_eq_m256i(r, e);
20715    }
20716
20717    #[simd_test(enable = "avx512bw,avx512vl")]
20718    fn test_mm256_maskz_dbsad_epu8() {
20719        let a = _mm256_set1_epi8(2);
20720        let b = _mm256_set1_epi8(4);
20721        let r = _mm256_maskz_dbsad_epu8::<0>(0, a, b);
20722        assert_eq_m256i(r, _mm256_setzero_si256());
20723        let r = _mm256_maskz_dbsad_epu8::<0>(0b11111111_11111111, a, b);
20724        let e = _mm256_set1_epi16(8);
20725        assert_eq_m256i(r, e);
20726    }
20727
20728    #[simd_test(enable = "avx512bw,avx512vl")]
20729    fn test_mm_dbsad_epu8() {
20730        let a = _mm_set1_epi8(2);
20731        let b = _mm_set1_epi8(4);
20732        let r = _mm_dbsad_epu8::<0>(a, b);
20733        let e = _mm_set1_epi16(8);
20734        assert_eq_m128i(r, e);
20735    }
20736
20737    #[simd_test(enable = "avx512bw,avx512vl")]
20738    fn test_mm_mask_dbsad_epu8() {
20739        let src = _mm_set1_epi16(1);
20740        let a = _mm_set1_epi8(2);
20741        let b = _mm_set1_epi8(4);
20742        let r = _mm_mask_dbsad_epu8::<0>(src, 0, a, b);
20743        assert_eq_m128i(r, src);
20744        let r = _mm_mask_dbsad_epu8::<0>(src, 0b11111111, a, b);
20745        let e = _mm_set1_epi16(8);
20746        assert_eq_m128i(r, e);
20747    }
20748
20749    #[simd_test(enable = "avx512bw,avx512vl")]
20750    fn test_mm_maskz_dbsad_epu8() {
20751        let a = _mm_set1_epi8(2);
20752        let b = _mm_set1_epi8(4);
20753        let r = _mm_maskz_dbsad_epu8::<0>(0, a, b);
20754        assert_eq_m128i(r, _mm_setzero_si128());
20755        let r = _mm_maskz_dbsad_epu8::<0>(0b11111111, a, b);
20756        let e = _mm_set1_epi16(8);
20757        assert_eq_m128i(r, e);
20758    }
20759
20760    #[simd_test(enable = "avx512bw")]
20761    const fn test_mm512_movepi16_mask() {
20762        let a = _mm512_set1_epi16(1 << 15);
20763        let r = _mm512_movepi16_mask(a);
20764        let e: __mmask32 = 0b11111111_11111111_11111111_11111111;
20765        assert_eq!(r, e);
20766    }
20767
20768    #[simd_test(enable = "avx512bw,avx512vl")]
20769    const fn test_mm256_movepi16_mask() {
20770        let a = _mm256_set1_epi16(1 << 15);
20771        let r = _mm256_movepi16_mask(a);
20772        let e: __mmask16 = 0b11111111_11111111;
20773        assert_eq!(r, e);
20774    }
20775
20776    #[simd_test(enable = "avx512bw,avx512vl")]
20777    const fn test_mm_movepi16_mask() {
20778        let a = _mm_set1_epi16(1 << 15);
20779        let r = _mm_movepi16_mask(a);
20780        let e: __mmask8 = 0b11111111;
20781        assert_eq!(r, e);
20782    }
20783
20784    #[simd_test(enable = "avx512bw")]
20785    const fn test_mm512_movepi8_mask() {
20786        let a = _mm512_set1_epi8(1 << 7);
20787        let r = _mm512_movepi8_mask(a);
20788        let e: __mmask64 =
20789            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111;
20790        assert_eq!(r, e);
20791    }
20792
20793    #[simd_test(enable = "avx512bw,avx512vl")]
20794    const fn test_mm256_movepi8_mask() {
20795        let a = _mm256_set1_epi8(1 << 7);
20796        let r = _mm256_movepi8_mask(a);
20797        let e: __mmask32 = 0b11111111_11111111_11111111_11111111;
20798        assert_eq!(r, e);
20799    }
20800
20801    #[simd_test(enable = "avx512bw,avx512vl")]
20802    const fn test_mm_movepi8_mask() {
20803        let a = _mm_set1_epi8(1 << 7);
20804        let r = _mm_movepi8_mask(a);
20805        let e: __mmask16 = 0b11111111_11111111;
20806        assert_eq!(r, e);
20807    }
20808
20809    #[simd_test(enable = "avx512bw")]
20810    const fn test_mm512_movm_epi16() {
20811        let a: __mmask32 = 0b11111111_11111111_11111111_11111111;
20812        let r = _mm512_movm_epi16(a);
20813        let e = _mm512_set1_epi16(
20814            1 << 15
20815                | 1 << 14
20816                | 1 << 13
20817                | 1 << 12
20818                | 1 << 11
20819                | 1 << 10
20820                | 1 << 9
20821                | 1 << 8
20822                | 1 << 7
20823                | 1 << 6
20824                | 1 << 5
20825                | 1 << 4
20826                | 1 << 3
20827                | 1 << 2
20828                | 1 << 1
20829                | 1 << 0,
20830        );
20831        assert_eq_m512i(r, e);
20832    }
20833
20834    #[simd_test(enable = "avx512bw,avx512vl")]
20835    const fn test_mm256_movm_epi16() {
20836        let a: __mmask16 = 0b11111111_11111111;
20837        let r = _mm256_movm_epi16(a);
20838        let e = _mm256_set1_epi16(
20839            1 << 15
20840                | 1 << 14
20841                | 1 << 13
20842                | 1 << 12
20843                | 1 << 11
20844                | 1 << 10
20845                | 1 << 9
20846                | 1 << 8
20847                | 1 << 7
20848                | 1 << 6
20849                | 1 << 5
20850                | 1 << 4
20851                | 1 << 3
20852                | 1 << 2
20853                | 1 << 1
20854                | 1 << 0,
20855        );
20856        assert_eq_m256i(r, e);
20857    }
20858
20859    #[simd_test(enable = "avx512bw,avx512vl")]
20860    const fn test_mm_movm_epi16() {
20861        let a: __mmask8 = 0b11111111;
20862        let r = _mm_movm_epi16(a);
20863        let e = _mm_set1_epi16(
20864            1 << 15
20865                | 1 << 14
20866                | 1 << 13
20867                | 1 << 12
20868                | 1 << 11
20869                | 1 << 10
20870                | 1 << 9
20871                | 1 << 8
20872                | 1 << 7
20873                | 1 << 6
20874                | 1 << 5
20875                | 1 << 4
20876                | 1 << 3
20877                | 1 << 2
20878                | 1 << 1
20879                | 1 << 0,
20880        );
20881        assert_eq_m128i(r, e);
20882    }
20883
20884    #[simd_test(enable = "avx512bw")]
20885    const fn test_mm512_movm_epi8() {
20886        let a: __mmask64 =
20887            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111;
20888        let r = _mm512_movm_epi8(a);
20889        let e =
20890            _mm512_set1_epi8(1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0);
20891        assert_eq_m512i(r, e);
20892    }
20893
20894    #[simd_test(enable = "avx512bw,avx512vl")]
20895    const fn test_mm256_movm_epi8() {
20896        let a: __mmask32 = 0b11111111_11111111_11111111_11111111;
20897        let r = _mm256_movm_epi8(a);
20898        let e =
20899            _mm256_set1_epi8(1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0);
20900        assert_eq_m256i(r, e);
20901    }
20902
20903    #[simd_test(enable = "avx512bw,avx512vl")]
20904    const fn test_mm_movm_epi8() {
20905        let a: __mmask16 = 0b11111111_11111111;
20906        let r = _mm_movm_epi8(a);
20907        let e =
20908            _mm_set1_epi8(1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0);
20909        assert_eq_m128i(r, e);
20910    }
20911
20912    #[simd_test(enable = "avx512bw")]
20913    const fn test_cvtmask32_u32() {
20914        let a: __mmask32 = 0b11001100_00110011_01100110_10011001;
20915        let r = _cvtmask32_u32(a);
20916        let e: u32 = 0b11001100_00110011_01100110_10011001;
20917        assert_eq!(r, e);
20918    }
20919
20920    #[simd_test(enable = "avx512bw")]
20921    const fn test_cvtu32_mask32() {
20922        let a: u32 = 0b11001100_00110011_01100110_10011001;
20923        let r = _cvtu32_mask32(a);
20924        let e: __mmask32 = 0b11001100_00110011_01100110_10011001;
20925        assert_eq!(r, e);
20926    }
20927
20928    #[simd_test(enable = "avx512bw")]
20929    const fn test_kadd_mask32() {
20930        let a: __mmask32 = 11;
20931        let b: __mmask32 = 22;
20932        let r = _kadd_mask32(a, b);
20933        let e: __mmask32 = 33;
20934        assert_eq!(r, e);
20935    }
20936
20937    #[simd_test(enable = "avx512bw")]
20938    const fn test_kadd_mask64() {
20939        let a: __mmask64 = 11;
20940        let b: __mmask64 = 22;
20941        let r = _kadd_mask64(a, b);
20942        let e: __mmask64 = 33;
20943        assert_eq!(r, e);
20944    }
20945
20946    #[simd_test(enable = "avx512bw")]
20947    const fn test_kand_mask32() {
20948        let a: __mmask32 = 0b11001100_00110011_11001100_00110011;
20949        let b: __mmask32 = 0b11001100_00110011_11001100_00110011;
20950        let r = _kand_mask32(a, b);
20951        let e: __mmask32 = 0b11001100_00110011_11001100_00110011;
20952        assert_eq!(r, e);
20953    }
20954
20955    #[simd_test(enable = "avx512bw")]
20956    const fn test_kand_mask64() {
20957        let a: __mmask64 =
20958            0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011;
20959        let b: __mmask64 =
20960            0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011;
20961        let r = _kand_mask64(a, b);
20962        let e: __mmask64 =
20963            0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011;
20964        assert_eq!(r, e);
20965    }
20966
20967    #[simd_test(enable = "avx512bw")]
20968    const fn test_knot_mask32() {
20969        let a: __mmask32 = 0b11001100_00110011_11001100_00110011;
20970        let r = _knot_mask32(a);
20971        let e: __mmask32 = 0b00110011_11001100_00110011_11001100;
20972        assert_eq!(r, e);
20973    }
20974
20975    #[simd_test(enable = "avx512bw")]
20976    const fn test_knot_mask64() {
20977        let a: __mmask64 =
20978            0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011;
20979        let r = _knot_mask64(a);
20980        let e: __mmask64 =
20981            0b00110011_11001100_00110011_11001100_00110011_11001100_00110011_11001100;
20982        assert_eq!(r, e);
20983    }
20984
20985    #[simd_test(enable = "avx512bw")]
20986    const fn test_kandn_mask32() {
20987        let a: __mmask32 = 0b11001100_00110011_11001100_00110011;
20988        let b: __mmask32 = 0b11001100_00110011_11001100_00110011;
20989        let r = _kandn_mask32(a, b);
20990        let e: __mmask32 = 0b00000000_00000000_00000000_00000000;
20991        assert_eq!(r, e);
20992    }
20993
20994    #[simd_test(enable = "avx512bw")]
20995    const fn test_kandn_mask64() {
20996        let a: __mmask64 =
20997            0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011;
20998        let b: __mmask64 =
20999            0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011;
21000        let r = _kandn_mask64(a, b);
21001        let e: __mmask64 =
21002            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000;
21003        assert_eq!(r, e);
21004    }
21005
21006    #[simd_test(enable = "avx512bw")]
21007    const fn test_kor_mask32() {
21008        let a: __mmask32 = 0b00110011_11001100_00110011_11001100;
21009        let b: __mmask32 = 0b11001100_00110011_11001100_00110011;
21010        let r = _kor_mask32(a, b);
21011        let e: __mmask32 = 0b11111111_11111111_11111111_11111111;
21012        assert_eq!(r, e);
21013    }
21014
21015    #[simd_test(enable = "avx512bw")]
21016    const fn test_kor_mask64() {
21017        let a: __mmask64 =
21018            0b00110011_11001100_00110011_11001100_00110011_11001100_00110011_11001100;
21019        let b: __mmask64 =
21020            0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011;
21021        let r = _kor_mask64(a, b);
21022        let e: __mmask64 =
21023            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111;
21024        assert_eq!(r, e);
21025    }
21026
21027    #[simd_test(enable = "avx512bw")]
21028    const fn test_kxor_mask32() {
21029        let a: __mmask32 = 0b00110011_11001100_00110011_11001100;
21030        let b: __mmask32 = 0b11001100_00110011_11001100_00110011;
21031        let r = _kxor_mask32(a, b);
21032        let e: __mmask32 = 0b11111111_11111111_11111111_11111111;
21033        assert_eq!(r, e);
21034    }
21035
21036    #[simd_test(enable = "avx512bw")]
21037    const fn test_kxor_mask64() {
21038        let a: __mmask64 =
21039            0b00110011_11001100_00110011_11001100_00110011_11001100_00110011_11001100;
21040        let b: __mmask64 =
21041            0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011;
21042        let r = _kxor_mask64(a, b);
21043        let e: __mmask64 =
21044            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111;
21045        assert_eq!(r, e);
21046    }
21047
21048    #[simd_test(enable = "avx512bw")]
21049    const fn test_kxnor_mask32() {
21050        let a: __mmask32 = 0b00110011_11001100_00110011_11001100;
21051        let b: __mmask32 = 0b11001100_00110011_11001100_00110011;
21052        let r = _kxnor_mask32(a, b);
21053        let e: __mmask32 = 0b00000000_00000000_00000000_00000000;
21054        assert_eq!(r, e);
21055    }
21056
21057    #[simd_test(enable = "avx512bw")]
21058    const fn test_kxnor_mask64() {
21059        let a: __mmask64 =
21060            0b00110011_11001100_00110011_11001100_00110011_11001100_00110011_11001100;
21061        let b: __mmask64 =
21062            0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011;
21063        let r = _kxnor_mask64(a, b);
21064        let e: __mmask64 =
21065            0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000;
21066        assert_eq!(r, e);
21067    }
21068
21069    #[simd_test(enable = "avx512bw")]
21070    const fn test_kortest_mask32_u8() {
21071        let a: __mmask32 = 0b0110100101101001_0110100101101001;
21072        let b: __mmask32 = 0b1011011010110110_1011011010110110;
21073        let mut all_ones: u8 = 0;
21074        let r = unsafe { _kortest_mask32_u8(a, b, &mut all_ones) };
21075        assert_eq!(r, 0);
21076        assert_eq!(all_ones, 1);
21077    }
21078
21079    #[simd_test(enable = "avx512bw")]
21080    const fn test_kortest_mask64_u8() {
21081        let a: __mmask64 = 0b0110100101101001_0110100101101001;
21082        let b: __mmask64 = 0b1011011010110110_1011011010110110;
21083        let mut all_ones: u8 = 0;
21084        let r = unsafe { _kortest_mask64_u8(a, b, &mut all_ones) };
21085        assert_eq!(r, 0);
21086        assert_eq!(all_ones, 0);
21087    }
21088
21089    #[simd_test(enable = "avx512bw")]
21090    const fn test_kortestc_mask32_u8() {
21091        let a: __mmask32 = 0b0110100101101001_0110100101101001;
21092        let b: __mmask32 = 0b1011011010110110_1011011010110110;
21093        let r = _kortestc_mask32_u8(a, b);
21094        assert_eq!(r, 1);
21095    }
21096
21097    #[simd_test(enable = "avx512bw")]
21098    const fn test_kortestc_mask64_u8() {
21099        let a: __mmask64 = 0b0110100101101001_0110100101101001;
21100        let b: __mmask64 = 0b1011011010110110_1011011010110110;
21101        let r = _kortestc_mask64_u8(a, b);
21102        assert_eq!(r, 0);
21103    }
21104
21105    #[simd_test(enable = "avx512bw")]
21106    const fn test_kortestz_mask32_u8() {
21107        let a: __mmask32 = 0b0110100101101001_0110100101101001;
21108        let b: __mmask32 = 0b1011011010110110_1011011010110110;
21109        let r = _kortestz_mask32_u8(a, b);
21110        assert_eq!(r, 0);
21111    }
21112
21113    #[simd_test(enable = "avx512bw")]
21114    const fn test_kortestz_mask64_u8() {
21115        let a: __mmask64 = 0b0110100101101001_0110100101101001;
21116        let b: __mmask64 = 0b1011011010110110_1011011010110110;
21117        let r = _kortestz_mask64_u8(a, b);
21118        assert_eq!(r, 0);
21119    }
21120
21121    #[simd_test(enable = "avx512bw")]
21122    const fn test_kshiftli_mask32() {
21123        let a: __mmask32 = 0b0110100101101001_0110100101101001;
21124        let r = _kshiftli_mask32::<3>(a);
21125        let e: __mmask32 = 0b0100101101001011_0100101101001000;
21126        assert_eq!(r, e);
21127
21128        let r = _kshiftli_mask32::<31>(a);
21129        let e: __mmask32 = 0b1000000000000000_0000000000000000;
21130        assert_eq!(r, e);
21131
21132        let r = _kshiftli_mask32::<32>(a);
21133        let e: __mmask32 = 0b0000000000000000_0000000000000000;
21134        assert_eq!(r, e);
21135
21136        let r = _kshiftli_mask32::<33>(a);
21137        let e: __mmask32 = 0b0000000000000000_0000000000000000;
21138        assert_eq!(r, e);
21139    }
21140
21141    #[simd_test(enable = "avx512bw")]
21142    const fn test_kshiftli_mask64() {
21143        let a: __mmask64 = 0b0110100101101001_0110100101101001;
21144        let r = _kshiftli_mask64::<3>(a);
21145        let e: __mmask64 = 0b0110100101101001011_0100101101001000;
21146        assert_eq!(r, e);
21147
21148        let r = _kshiftli_mask64::<63>(a);
21149        let e: __mmask64 = 0b1000000000000000_0000000000000000_0000000000000000_0000000000000000;
21150        assert_eq!(r, e);
21151
21152        let r = _kshiftli_mask64::<64>(a);
21153        let e: __mmask64 = 0b0000000000000000_0000000000000000_0000000000000000_0000000000000000;
21154        assert_eq!(r, e);
21155
21156        let r = _kshiftli_mask64::<65>(a);
21157        let e: __mmask64 = 0b0000000000000000_0000000000000000_0000000000000000_0000000000000000;
21158        assert_eq!(r, e);
21159    }
21160
21161    #[simd_test(enable = "avx512bw")]
21162    const fn test_kshiftri_mask32() {
21163        let a: __mmask32 = 0b1010100101101001_0110100101101001;
21164        let r = _kshiftri_mask32::<3>(a);
21165        let e: __mmask32 = 0b0001010100101101_0010110100101101;
21166        assert_eq!(r, e);
21167
21168        let r = _kshiftri_mask32::<31>(a);
21169        let e: __mmask32 = 0b0000000000000000_0000000000000001;
21170        assert_eq!(r, e);
21171
21172        let r = _kshiftri_mask32::<32>(a);
21173        let e: __mmask32 = 0b0000000000000000_0000000000000000;
21174        assert_eq!(r, e);
21175
21176        let r = _kshiftri_mask32::<33>(a);
21177        let e: __mmask32 = 0b0000000000000000_0000000000000000;
21178        assert_eq!(r, e);
21179    }
21180
21181    #[simd_test(enable = "avx512bw")]
21182    const fn test_kshiftri_mask64() {
21183        let a: __mmask64 = 0b1010100101101001011_0100101101001000;
21184        let r = _kshiftri_mask64::<3>(a);
21185        let e: __mmask64 = 0b1010100101101001_0110100101101001;
21186        assert_eq!(r, e);
21187
21188        let r = _kshiftri_mask64::<34>(a);
21189        let e: __mmask64 = 0b0000000000000000_0000000000000000_0000000000000000_0000000000000001;
21190        assert_eq!(r, e);
21191
21192        let r = _kshiftri_mask64::<35>(a);
21193        let e: __mmask64 = 0b0000000000000000_0000000000000000_0000000000000000_0000000000000000;
21194        assert_eq!(r, e);
21195
21196        let r = _kshiftri_mask64::<64>(a);
21197        let e: __mmask64 = 0b0000000000000000_0000000000000000_0000000000000000_0000000000000000;
21198        assert_eq!(r, e);
21199
21200        let r = _kshiftri_mask64::<65>(a);
21201        let e: __mmask64 = 0b0000000000000000_0000000000000000_0000000000000000_0000000000000000;
21202        assert_eq!(r, e);
21203    }
21204
21205    #[simd_test(enable = "avx512bw")]
21206    const fn test_ktest_mask32_u8() {
21207        let a: __mmask32 = 0b0110100100111100_0110100100111100;
21208        let b: __mmask32 = 0b1001011011000011_1001011011000011;
21209        let mut and_not: u8 = 0;
21210        let r = unsafe { _ktest_mask32_u8(a, b, &mut and_not) };
21211        assert_eq!(r, 1);
21212        assert_eq!(and_not, 0);
21213    }
21214
21215    #[simd_test(enable = "avx512bw")]
21216    const fn test_ktestc_mask32_u8() {
21217        let a: __mmask32 = 0b0110100100111100_0110100100111100;
21218        let b: __mmask32 = 0b1001011011000011_1001011011000011;
21219        let r = _ktestc_mask32_u8(a, b);
21220        assert_eq!(r, 0);
21221    }
21222
21223    #[simd_test(enable = "avx512bw")]
21224    const fn test_ktestz_mask32_u8() {
21225        let a: __mmask32 = 0b0110100100111100_0110100100111100;
21226        let b: __mmask32 = 0b1001011011000011_1001011011000011;
21227        let r = _ktestz_mask32_u8(a, b);
21228        assert_eq!(r, 1);
21229    }
21230
21231    #[simd_test(enable = "avx512bw")]
21232    const fn test_ktest_mask64_u8() {
21233        let a: __mmask64 = 0b0110100100111100_0110100100111100;
21234        let b: __mmask64 = 0b1001011011000011_1001011011000011;
21235        let mut and_not: u8 = 0;
21236        let r = unsafe { _ktest_mask64_u8(a, b, &mut and_not) };
21237        assert_eq!(r, 1);
21238        assert_eq!(and_not, 0);
21239    }
21240
21241    #[simd_test(enable = "avx512bw")]
21242    const fn test_ktestc_mask64_u8() {
21243        let a: __mmask64 = 0b0110100100111100_0110100100111100;
21244        let b: __mmask64 = 0b1001011011000011_1001011011000011;
21245        let r = _ktestc_mask64_u8(a, b);
21246        assert_eq!(r, 0);
21247    }
21248
21249    #[simd_test(enable = "avx512bw")]
21250    const fn test_ktestz_mask64_u8() {
21251        let a: __mmask64 = 0b0110100100111100_0110100100111100;
21252        let b: __mmask64 = 0b1001011011000011_1001011011000011;
21253        let r = _ktestz_mask64_u8(a, b);
21254        assert_eq!(r, 1);
21255    }
21256
21257    #[simd_test(enable = "avx512bw")]
21258    const fn test_mm512_kunpackw() {
21259        let a: u32 = 0x00110011;
21260        let b: u32 = 0x00001011;
21261        let r = _mm512_kunpackw(a, b);
21262        let e: u32 = 0x00111011;
21263        assert_eq!(r, e);
21264    }
21265
21266    #[simd_test(enable = "avx512bw")]
21267    const fn test_mm512_kunpackd() {
21268        let a: u64 = 0x11001100_00110011;
21269        let b: u64 = 0x00101110_00001011;
21270        let r = _mm512_kunpackd(a, b);
21271        let e: u64 = 0x00110011_00001011;
21272        assert_eq!(r, e);
21273    }
21274
21275    #[simd_test(enable = "avx512bw")]
21276    const fn test_mm512_cvtepi16_epi8() {
21277        let a = _mm512_set1_epi16(2);
21278        let r = _mm512_cvtepi16_epi8(a);
21279        let e = _mm256_set1_epi8(2);
21280        assert_eq_m256i(r, e);
21281    }
21282
21283    #[simd_test(enable = "avx512bw")]
21284    const fn test_mm512_mask_cvtepi16_epi8() {
21285        let src = _mm256_set1_epi8(1);
21286        let a = _mm512_set1_epi16(2);
21287        let r = _mm512_mask_cvtepi16_epi8(src, 0, a);
21288        assert_eq_m256i(r, src);
21289        let r = _mm512_mask_cvtepi16_epi8(src, 0b11111111_11111111_11111111_11111111, a);
21290        let e = _mm256_set1_epi8(2);
21291        assert_eq_m256i(r, e);
21292    }
21293
21294    #[simd_test(enable = "avx512bw")]
21295    const fn test_mm512_maskz_cvtepi16_epi8() {
21296        let a = _mm512_set1_epi16(2);
21297        let r = _mm512_maskz_cvtepi16_epi8(0, a);
21298        assert_eq_m256i(r, _mm256_setzero_si256());
21299        let r = _mm512_maskz_cvtepi16_epi8(0b11111111_11111111_11111111_11111111, a);
21300        let e = _mm256_set1_epi8(2);
21301        assert_eq_m256i(r, e);
21302    }
21303
21304    #[simd_test(enable = "avx512bw,avx512vl")]
21305    const fn test_mm256_cvtepi16_epi8() {
21306        let a = _mm256_set1_epi16(2);
21307        let r = _mm256_cvtepi16_epi8(a);
21308        let e = _mm_set1_epi8(2);
21309        assert_eq_m128i(r, e);
21310    }
21311
21312    #[simd_test(enable = "avx512bw,avx512vl")]
21313    const fn test_mm256_mask_cvtepi16_epi8() {
21314        let src = _mm_set1_epi8(1);
21315        let a = _mm256_set1_epi16(2);
21316        let r = _mm256_mask_cvtepi16_epi8(src, 0, a);
21317        assert_eq_m128i(r, src);
21318        let r = _mm256_mask_cvtepi16_epi8(src, 0b11111111_11111111, a);
21319        let e = _mm_set1_epi8(2);
21320        assert_eq_m128i(r, e);
21321    }
21322
21323    #[simd_test(enable = "avx512bw,avx512vl")]
21324    const fn test_mm256_maskz_cvtepi16_epi8() {
21325        let a = _mm256_set1_epi16(2);
21326        let r = _mm256_maskz_cvtepi16_epi8(0, a);
21327        assert_eq_m128i(r, _mm_setzero_si128());
21328        let r = _mm256_maskz_cvtepi16_epi8(0b11111111_11111111, a);
21329        let e = _mm_set1_epi8(2);
21330        assert_eq_m128i(r, e);
21331    }
21332
21333    #[simd_test(enable = "avx512bw,avx512vl")]
21334    const fn test_mm_cvtepi16_epi8() {
21335        let a = _mm_set1_epi16(2);
21336        let r = _mm_cvtepi16_epi8(a);
21337        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2);
21338        assert_eq_m128i(r, e);
21339    }
21340
21341    #[simd_test(enable = "avx512bw,avx512vl")]
21342    const fn test_mm_mask_cvtepi16_epi8() {
21343        let src = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
21344        let a = _mm_set1_epi16(2);
21345        let r = _mm_mask_cvtepi16_epi8(src, 0, a);
21346        assert_eq_m128i(r, src);
21347        let r = _mm_mask_cvtepi16_epi8(src, 0b11111111, a);
21348        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2);
21349        assert_eq_m128i(r, e);
21350    }
21351
21352    #[simd_test(enable = "avx512bw,avx512vl")]
21353    const fn test_mm_maskz_cvtepi16_epi8() {
21354        let a = _mm_set1_epi16(2);
21355        let r = _mm_maskz_cvtepi16_epi8(0, a);
21356        assert_eq_m128i(r, _mm_setzero_si128());
21357        let r = _mm_maskz_cvtepi16_epi8(0b11111111, a);
21358        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2);
21359        assert_eq_m128i(r, e);
21360    }
21361
21362    #[simd_test(enable = "avx512bw")]
21363    fn test_mm512_cvtsepi16_epi8() {
21364        let a = _mm512_set1_epi16(i16::MAX);
21365        let r = _mm512_cvtsepi16_epi8(a);
21366        let e = _mm256_set1_epi8(i8::MAX);
21367        assert_eq_m256i(r, e);
21368    }
21369
21370    #[simd_test(enable = "avx512bw")]
21371    fn test_mm512_mask_cvtsepi16_epi8() {
21372        let src = _mm256_set1_epi8(1);
21373        let a = _mm512_set1_epi16(i16::MAX);
21374        let r = _mm512_mask_cvtsepi16_epi8(src, 0, a);
21375        assert_eq_m256i(r, src);
21376        let r = _mm512_mask_cvtsepi16_epi8(src, 0b11111111_11111111_11111111_11111111, a);
21377        let e = _mm256_set1_epi8(i8::MAX);
21378        assert_eq_m256i(r, e);
21379    }
21380
21381    #[simd_test(enable = "avx512bw,avx512vl")]
21382    fn test_mm256_cvtsepi16_epi8() {
21383        let a = _mm256_set1_epi16(i16::MAX);
21384        let r = _mm256_cvtsepi16_epi8(a);
21385        let e = _mm_set1_epi8(i8::MAX);
21386        assert_eq_m128i(r, e);
21387    }
21388
21389    #[simd_test(enable = "avx512bw,avx512vl")]
21390    fn test_mm256_mask_cvtsepi16_epi8() {
21391        let src = _mm_set1_epi8(1);
21392        let a = _mm256_set1_epi16(i16::MAX);
21393        let r = _mm256_mask_cvtsepi16_epi8(src, 0, a);
21394        assert_eq_m128i(r, src);
21395        let r = _mm256_mask_cvtsepi16_epi8(src, 0b11111111_11111111, a);
21396        let e = _mm_set1_epi8(i8::MAX);
21397        assert_eq_m128i(r, e);
21398    }
21399
21400    #[simd_test(enable = "avx512bw,avx512vl")]
21401    fn test_mm256_maskz_cvtsepi16_epi8() {
21402        let a = _mm256_set1_epi16(i16::MAX);
21403        let r = _mm256_maskz_cvtsepi16_epi8(0, a);
21404        assert_eq_m128i(r, _mm_setzero_si128());
21405        let r = _mm256_maskz_cvtsepi16_epi8(0b11111111_11111111, a);
21406        let e = _mm_set1_epi8(i8::MAX);
21407        assert_eq_m128i(r, e);
21408    }
21409
21410    #[simd_test(enable = "avx512bw,avx512vl")]
21411    fn test_mm_cvtsepi16_epi8() {
21412        let a = _mm_set1_epi16(i16::MAX);
21413        let r = _mm_cvtsepi16_epi8(a);
21414        #[rustfmt::skip]
21415        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);
21416        assert_eq_m128i(r, e);
21417    }
21418
21419    #[simd_test(enable = "avx512bw,avx512vl")]
21420    fn test_mm_mask_cvtsepi16_epi8() {
21421        let src = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
21422        let a = _mm_set1_epi16(i16::MAX);
21423        let r = _mm_mask_cvtsepi16_epi8(src, 0, a);
21424        assert_eq_m128i(r, src);
21425        let r = _mm_mask_cvtsepi16_epi8(src, 0b11111111, a);
21426        #[rustfmt::skip]
21427        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);
21428        assert_eq_m128i(r, e);
21429    }
21430
21431    #[simd_test(enable = "avx512bw,avx512vl")]
21432    fn test_mm_maskz_cvtsepi16_epi8() {
21433        let a = _mm_set1_epi16(i16::MAX);
21434        let r = _mm_maskz_cvtsepi16_epi8(0, a);
21435        assert_eq_m128i(r, _mm_setzero_si128());
21436        let r = _mm_maskz_cvtsepi16_epi8(0b11111111, a);
21437        #[rustfmt::skip]
21438        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);
21439        assert_eq_m128i(r, e);
21440    }
21441
21442    #[simd_test(enable = "avx512bw")]
21443    fn test_mm512_maskz_cvtsepi16_epi8() {
21444        let a = _mm512_set1_epi16(i16::MAX);
21445        let r = _mm512_maskz_cvtsepi16_epi8(0, a);
21446        assert_eq_m256i(r, _mm256_setzero_si256());
21447        let r = _mm512_maskz_cvtsepi16_epi8(0b11111111_11111111_11111111_11111111, a);
21448        let e = _mm256_set1_epi8(i8::MAX);
21449        assert_eq_m256i(r, e);
21450    }
21451
21452    #[simd_test(enable = "avx512bw")]
21453    fn test_mm512_cvtusepi16_epi8() {
21454        let a = _mm512_set1_epi16(i16::MIN);
21455        let r = _mm512_cvtusepi16_epi8(a);
21456        let e = _mm256_set1_epi8(-1);
21457        assert_eq_m256i(r, e);
21458    }
21459
21460    #[simd_test(enable = "avx512bw")]
21461    fn test_mm512_mask_cvtusepi16_epi8() {
21462        let src = _mm256_set1_epi8(1);
21463        let a = _mm512_set1_epi16(i16::MIN);
21464        let r = _mm512_mask_cvtusepi16_epi8(src, 0, a);
21465        assert_eq_m256i(r, src);
21466        let r = _mm512_mask_cvtusepi16_epi8(src, 0b11111111_11111111_11111111_11111111, a);
21467        let e = _mm256_set1_epi8(-1);
21468        assert_eq_m256i(r, e);
21469    }
21470
21471    #[simd_test(enable = "avx512bw")]
21472    fn test_mm512_maskz_cvtusepi16_epi8() {
21473        let a = _mm512_set1_epi16(i16::MIN);
21474        let r = _mm512_maskz_cvtusepi16_epi8(0, a);
21475        assert_eq_m256i(r, _mm256_setzero_si256());
21476        let r = _mm512_maskz_cvtusepi16_epi8(0b11111111_11111111_11111111_11111111, a);
21477        let e = _mm256_set1_epi8(-1);
21478        assert_eq_m256i(r, e);
21479    }
21480
21481    #[simd_test(enable = "avx512bw,avx512vl")]
21482    fn test_mm256_cvtusepi16_epi8() {
21483        let a = _mm256_set1_epi16(i16::MIN);
21484        let r = _mm256_cvtusepi16_epi8(a);
21485        let e = _mm_set1_epi8(-1);
21486        assert_eq_m128i(r, e);
21487    }
21488
21489    #[simd_test(enable = "avx512bw,avx512vl")]
21490    fn test_mm256_mask_cvtusepi16_epi8() {
21491        let src = _mm_set1_epi8(1);
21492        let a = _mm256_set1_epi16(i16::MIN);
21493        let r = _mm256_mask_cvtusepi16_epi8(src, 0, a);
21494        assert_eq_m128i(r, src);
21495        let r = _mm256_mask_cvtusepi16_epi8(src, 0b11111111_11111111, a);
21496        let e = _mm_set1_epi8(-1);
21497        assert_eq_m128i(r, e);
21498    }
21499
21500    #[simd_test(enable = "avx512bw,avx512vl")]
21501    fn test_mm256_maskz_cvtusepi16_epi8() {
21502        let a = _mm256_set1_epi16(i16::MIN);
21503        let r = _mm256_maskz_cvtusepi16_epi8(0, a);
21504        assert_eq_m128i(r, _mm_setzero_si128());
21505        let r = _mm256_maskz_cvtusepi16_epi8(0b11111111_11111111, a);
21506        let e = _mm_set1_epi8(-1);
21507        assert_eq_m128i(r, e);
21508    }
21509
21510    #[simd_test(enable = "avx512bw,avx512vl")]
21511    fn test_mm_cvtusepi16_epi8() {
21512        let a = _mm_set1_epi16(i16::MIN);
21513        let r = _mm_cvtusepi16_epi8(a);
21514        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
21515        assert_eq_m128i(r, e);
21516    }
21517
21518    #[simd_test(enable = "avx512bw,avx512vl")]
21519    fn test_mm_mask_cvtusepi16_epi8() {
21520        let src = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
21521        let a = _mm_set1_epi16(i16::MIN);
21522        let r = _mm_mask_cvtusepi16_epi8(src, 0, a);
21523        assert_eq_m128i(r, src);
21524        let r = _mm_mask_cvtusepi16_epi8(src, 0b11111111, a);
21525        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
21526        assert_eq_m128i(r, e);
21527    }
21528
21529    #[simd_test(enable = "avx512bw,avx512vl")]
21530    fn test_mm_maskz_cvtusepi16_epi8() {
21531        let a = _mm_set1_epi16(i16::MIN);
21532        let r = _mm_maskz_cvtusepi16_epi8(0, a);
21533        assert_eq_m128i(r, _mm_setzero_si128());
21534        let r = _mm_maskz_cvtusepi16_epi8(0b11111111, a);
21535        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
21536        assert_eq_m128i(r, e);
21537    }
21538
21539    #[simd_test(enable = "avx512bw")]
21540    const fn test_mm512_cvtepi8_epi16() {
21541        let a = _mm256_set1_epi8(2);
21542        let r = _mm512_cvtepi8_epi16(a);
21543        let e = _mm512_set1_epi16(2);
21544        assert_eq_m512i(r, e);
21545    }
21546
21547    #[simd_test(enable = "avx512bw")]
21548    const fn test_mm512_mask_cvtepi8_epi16() {
21549        let src = _mm512_set1_epi16(1);
21550        let a = _mm256_set1_epi8(2);
21551        let r = _mm512_mask_cvtepi8_epi16(src, 0, a);
21552        assert_eq_m512i(r, src);
21553        let r = _mm512_mask_cvtepi8_epi16(src, 0b11111111_11111111_11111111_11111111, a);
21554        let e = _mm512_set1_epi16(2);
21555        assert_eq_m512i(r, e);
21556    }
21557
21558    #[simd_test(enable = "avx512bw")]
21559    const fn test_mm512_maskz_cvtepi8_epi16() {
21560        let a = _mm256_set1_epi8(2);
21561        let r = _mm512_maskz_cvtepi8_epi16(0, a);
21562        assert_eq_m512i(r, _mm512_setzero_si512());
21563        let r = _mm512_maskz_cvtepi8_epi16(0b11111111_11111111_11111111_11111111, a);
21564        let e = _mm512_set1_epi16(2);
21565        assert_eq_m512i(r, e);
21566    }
21567
21568    #[simd_test(enable = "avx512bw,avx512vl")]
21569    const fn test_mm256_mask_cvtepi8_epi16() {
21570        let src = _mm256_set1_epi16(1);
21571        let a = _mm_set1_epi8(2);
21572        let r = _mm256_mask_cvtepi8_epi16(src, 0, a);
21573        assert_eq_m256i(r, src);
21574        let r = _mm256_mask_cvtepi8_epi16(src, 0b11111111_11111111, a);
21575        let e = _mm256_set1_epi16(2);
21576        assert_eq_m256i(r, e);
21577    }
21578
21579    #[simd_test(enable = "avx512bw,avx512vl")]
21580    const fn test_mm256_maskz_cvtepi8_epi16() {
21581        let a = _mm_set1_epi8(2);
21582        let r = _mm256_maskz_cvtepi8_epi16(0, a);
21583        assert_eq_m256i(r, _mm256_setzero_si256());
21584        let r = _mm256_maskz_cvtepi8_epi16(0b11111111_11111111, a);
21585        let e = _mm256_set1_epi16(2);
21586        assert_eq_m256i(r, e);
21587    }
21588
21589    #[simd_test(enable = "avx512bw,avx512vl")]
21590    const fn test_mm_mask_cvtepi8_epi16() {
21591        let src = _mm_set1_epi16(1);
21592        let a = _mm_set1_epi8(2);
21593        let r = _mm_mask_cvtepi8_epi16(src, 0, a);
21594        assert_eq_m128i(r, src);
21595        let r = _mm_mask_cvtepi8_epi16(src, 0b11111111, a);
21596        let e = _mm_set1_epi16(2);
21597        assert_eq_m128i(r, e);
21598    }
21599
21600    #[simd_test(enable = "avx512bw,avx512vl")]
21601    const fn test_mm_maskz_cvtepi8_epi16() {
21602        let a = _mm_set1_epi8(2);
21603        let r = _mm_maskz_cvtepi8_epi16(0, a);
21604        assert_eq_m128i(r, _mm_setzero_si128());
21605        let r = _mm_maskz_cvtepi8_epi16(0b11111111, a);
21606        let e = _mm_set1_epi16(2);
21607        assert_eq_m128i(r, e);
21608    }
21609
21610    #[simd_test(enable = "avx512bw")]
21611    const fn test_mm512_cvtepu8_epi16() {
21612        let a = _mm256_set1_epi8(2);
21613        let r = _mm512_cvtepu8_epi16(a);
21614        let e = _mm512_set1_epi16(2);
21615        assert_eq_m512i(r, e);
21616    }
21617
21618    #[simd_test(enable = "avx512bw")]
21619    const fn test_mm512_mask_cvtepu8_epi16() {
21620        let src = _mm512_set1_epi16(1);
21621        let a = _mm256_set1_epi8(2);
21622        let r = _mm512_mask_cvtepu8_epi16(src, 0, a);
21623        assert_eq_m512i(r, src);
21624        let r = _mm512_mask_cvtepu8_epi16(src, 0b11111111_11111111_11111111_11111111, a);
21625        let e = _mm512_set1_epi16(2);
21626        assert_eq_m512i(r, e);
21627    }
21628
21629    #[simd_test(enable = "avx512bw")]
21630    const fn test_mm512_maskz_cvtepu8_epi16() {
21631        let a = _mm256_set1_epi8(2);
21632        let r = _mm512_maskz_cvtepu8_epi16(0, a);
21633        assert_eq_m512i(r, _mm512_setzero_si512());
21634        let r = _mm512_maskz_cvtepu8_epi16(0b11111111_11111111_11111111_11111111, a);
21635        let e = _mm512_set1_epi16(2);
21636        assert_eq_m512i(r, e);
21637    }
21638
21639    #[simd_test(enable = "avx512bw,avx512vl")]
21640    const fn test_mm256_mask_cvtepu8_epi16() {
21641        let src = _mm256_set1_epi16(1);
21642        let a = _mm_set1_epi8(2);
21643        let r = _mm256_mask_cvtepu8_epi16(src, 0, a);
21644        assert_eq_m256i(r, src);
21645        let r = _mm256_mask_cvtepu8_epi16(src, 0b11111111_11111111, a);
21646        let e = _mm256_set1_epi16(2);
21647        assert_eq_m256i(r, e);
21648    }
21649
21650    #[simd_test(enable = "avx512bw,avx512vl")]
21651    const fn test_mm256_maskz_cvtepu8_epi16() {
21652        let a = _mm_set1_epi8(2);
21653        let r = _mm256_maskz_cvtepu8_epi16(0, a);
21654        assert_eq_m256i(r, _mm256_setzero_si256());
21655        let r = _mm256_maskz_cvtepu8_epi16(0b11111111_11111111, a);
21656        let e = _mm256_set1_epi16(2);
21657        assert_eq_m256i(r, e);
21658    }
21659
21660    #[simd_test(enable = "avx512bw,avx512vl")]
21661    const fn test_mm_mask_cvtepu8_epi16() {
21662        let src = _mm_set1_epi16(1);
21663        let a = _mm_set1_epi8(2);
21664        let r = _mm_mask_cvtepu8_epi16(src, 0, a);
21665        assert_eq_m128i(r, src);
21666        let r = _mm_mask_cvtepu8_epi16(src, 0b11111111, a);
21667        let e = _mm_set1_epi16(2);
21668        assert_eq_m128i(r, e);
21669    }
21670
21671    #[simd_test(enable = "avx512bw,avx512vl")]
21672    const fn test_mm_maskz_cvtepu8_epi16() {
21673        let a = _mm_set1_epi8(2);
21674        let r = _mm_maskz_cvtepu8_epi16(0, a);
21675        assert_eq_m128i(r, _mm_setzero_si128());
21676        let r = _mm_maskz_cvtepu8_epi16(0b11111111, a);
21677        let e = _mm_set1_epi16(2);
21678        assert_eq_m128i(r, e);
21679    }
21680
21681    #[simd_test(enable = "avx512bw")]
21682    const fn test_mm512_bslli_epi128() {
21683        #[rustfmt::skip]
21684        let a = _mm512_set_epi8(
21685            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21686            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21687            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21688            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21689        );
21690        let r = _mm512_bslli_epi128::<9>(a);
21691        #[rustfmt::skip]
21692        let e = _mm512_set_epi8(
21693            0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
21694            0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
21695            0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
21696            0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
21697        );
21698        assert_eq_m512i(r, e);
21699    }
21700
21701    #[simd_test(enable = "avx512bw")]
21702    const fn test_mm512_bsrli_epi128() {
21703        #[rustfmt::skip]
21704        let a = _mm512_set_epi8(
21705            1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
21706            17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
21707            33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
21708            49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
21709        );
21710        let r = _mm512_bsrli_epi128::<3>(a);
21711        #[rustfmt::skip]
21712        let e = _mm512_set_epi8(
21713            0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
21714            0, 0, 0, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
21715            0, 0, 0, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
21716            0, 0, 0, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
21717        );
21718        assert_eq_m512i(r, e);
21719    }
21720
21721    #[simd_test(enable = "avx512bw")]
21722    const fn test_mm512_alignr_epi8() {
21723        #[rustfmt::skip]
21724        let a = _mm512_set_epi8(
21725            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21726            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21727            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21728            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21729        );
21730        let b = _mm512_set1_epi8(1);
21731        let r = _mm512_alignr_epi8::<14>(a, b);
21732        #[rustfmt::skip]
21733        let e = _mm512_set_epi8(
21734            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21735            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21736            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21737            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21738        );
21739        assert_eq_m512i(r, e);
21740    }
21741
21742    #[simd_test(enable = "avx512bw")]
21743    const fn test_mm512_mask_alignr_epi8() {
21744        #[rustfmt::skip]
21745        let a = _mm512_set_epi8(
21746            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21747            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21748            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21749            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21750        );
21751        let b = _mm512_set1_epi8(1);
21752        let r = _mm512_mask_alignr_epi8::<14>(a, 0, a, b);
21753        assert_eq_m512i(r, a);
21754        let r = _mm512_mask_alignr_epi8::<14>(
21755            a,
21756            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
21757            a,
21758            b,
21759        );
21760        #[rustfmt::skip]
21761        let e = _mm512_set_epi8(
21762            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21763            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21764            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21765            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21766        );
21767        assert_eq_m512i(r, e);
21768    }
21769
21770    #[simd_test(enable = "avx512bw")]
21771    const fn test_mm512_maskz_alignr_epi8() {
21772        #[rustfmt::skip]
21773        let a = _mm512_set_epi8(
21774            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21775            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21776            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21777            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21778        );
21779        let b = _mm512_set1_epi8(1);
21780        let r = _mm512_maskz_alignr_epi8::<14>(0, a, b);
21781        assert_eq_m512i(r, _mm512_setzero_si512());
21782        let r = _mm512_maskz_alignr_epi8::<14>(
21783            0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
21784            a,
21785            b,
21786        );
21787        #[rustfmt::skip]
21788        let e = _mm512_set_epi8(
21789            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21790            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21791            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21792            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21793        );
21794        assert_eq_m512i(r, e);
21795    }
21796
21797    #[simd_test(enable = "avx512bw,avx512vl")]
21798    const fn test_mm256_mask_alignr_epi8() {
21799        #[rustfmt::skip]
21800        let a = _mm256_set_epi8(
21801            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21802            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21803        );
21804        let b = _mm256_set1_epi8(1);
21805        let r = _mm256_mask_alignr_epi8::<14>(a, 0, a, b);
21806        assert_eq_m256i(r, a);
21807        let r = _mm256_mask_alignr_epi8::<14>(a, 0b11111111_11111111_11111111_11111111, a, b);
21808        #[rustfmt::skip]
21809        let e = _mm256_set_epi8(
21810            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21811            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21812        );
21813        assert_eq_m256i(r, e);
21814    }
21815
21816    #[simd_test(enable = "avx512bw,avx512vl")]
21817    const fn test_mm256_maskz_alignr_epi8() {
21818        #[rustfmt::skip]
21819        let a = _mm256_set_epi8(
21820            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21821            1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
21822        );
21823        let b = _mm256_set1_epi8(1);
21824        let r = _mm256_maskz_alignr_epi8::<14>(0, a, b);
21825        assert_eq_m256i(r, _mm256_setzero_si256());
21826        let r = _mm256_maskz_alignr_epi8::<14>(0b11111111_11111111_11111111_11111111, a, b);
21827        #[rustfmt::skip]
21828        let e = _mm256_set_epi8(
21829            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21830            0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
21831        );
21832        assert_eq_m256i(r, e);
21833    }
21834
21835    #[simd_test(enable = "avx512bw,avx512vl")]
21836    const fn test_mm_mask_alignr_epi8() {
21837        let a = _mm_set_epi8(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0);
21838        let b = _mm_set1_epi8(1);
21839        let r = _mm_mask_alignr_epi8::<14>(a, 0, a, b);
21840        assert_eq_m128i(r, a);
21841        let r = _mm_mask_alignr_epi8::<14>(a, 0b11111111_11111111, a, b);
21842        let e = _mm_set_epi8(0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1);
21843        assert_eq_m128i(r, e);
21844    }
21845
21846    #[simd_test(enable = "avx512bw,avx512vl")]
21847    const fn test_mm_maskz_alignr_epi8() {
21848        let a = _mm_set_epi8(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0);
21849        let b = _mm_set1_epi8(1);
21850        let r = _mm_maskz_alignr_epi8::<14>(0, a, b);
21851        assert_eq_m128i(r, _mm_setzero_si128());
21852        let r = _mm_maskz_alignr_epi8::<14>(0b11111111_11111111, a, b);
21853        let e = _mm_set_epi8(0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1);
21854        assert_eq_m128i(r, e);
21855    }
21856
21857    #[simd_test(enable = "avx512bw")]
21858    fn test_mm512_mask_cvtsepi16_storeu_epi8() {
21859        let a = _mm512_set1_epi16(i16::MAX);
21860        let mut r = _mm256_undefined_si256();
21861        unsafe {
21862            _mm512_mask_cvtsepi16_storeu_epi8(
21863                &mut r as *mut _ as *mut i8,
21864                0b11111111_11111111_11111111_11111111,
21865                a,
21866            );
21867        }
21868        let e = _mm256_set1_epi8(i8::MAX);
21869        assert_eq_m256i(r, e);
21870    }
21871
21872    #[simd_test(enable = "avx512bw,avx512vl")]
21873    fn test_mm256_mask_cvtsepi16_storeu_epi8() {
21874        let a = _mm256_set1_epi16(i16::MAX);
21875        let mut r = _mm_undefined_si128();
21876        unsafe {
21877            _mm256_mask_cvtsepi16_storeu_epi8(&mut r as *mut _ as *mut i8, 0b11111111_11111111, a);
21878        }
21879        let e = _mm_set1_epi8(i8::MAX);
21880        assert_eq_m128i(r, e);
21881    }
21882
21883    #[simd_test(enable = "avx512bw,avx512vl")]
21884    fn test_mm_mask_cvtsepi16_storeu_epi8() {
21885        let a = _mm_set1_epi16(i16::MAX);
21886        let mut r = _mm_set1_epi8(0);
21887        unsafe {
21888            _mm_mask_cvtsepi16_storeu_epi8(&mut r as *mut _ as *mut i8, 0b11111111, a);
21889        }
21890        #[rustfmt::skip]
21891        let e = _mm_set_epi8(
21892            0, 0, 0, 0, 0, 0, 0, 0,
21893            i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX,
21894        );
21895        assert_eq_m128i(r, e);
21896    }
21897
21898    #[simd_test(enable = "avx512bw")]
21899    fn test_mm512_mask_cvtepi16_storeu_epi8() {
21900        let a = _mm512_set1_epi16(8);
21901        let mut r = _mm256_undefined_si256();
21902        unsafe {
21903            _mm512_mask_cvtepi16_storeu_epi8(
21904                &mut r as *mut _ as *mut i8,
21905                0b11111111_11111111_11111111_11111111,
21906                a,
21907            );
21908        }
21909        let e = _mm256_set1_epi8(8);
21910        assert_eq_m256i(r, e);
21911    }
21912
21913    #[simd_test(enable = "avx512bw,avx512vl")]
21914    fn test_mm256_mask_cvtepi16_storeu_epi8() {
21915        let a = _mm256_set1_epi16(8);
21916        let mut r = _mm_undefined_si128();
21917        unsafe {
21918            _mm256_mask_cvtepi16_storeu_epi8(&mut r as *mut _ as *mut i8, 0b11111111_11111111, a);
21919        }
21920        let e = _mm_set1_epi8(8);
21921        assert_eq_m128i(r, e);
21922    }
21923
21924    #[simd_test(enable = "avx512bw,avx512vl")]
21925    fn test_mm_mask_cvtepi16_storeu_epi8() {
21926        let a = _mm_set1_epi16(8);
21927        let mut r = _mm_set1_epi8(0);
21928        unsafe {
21929            _mm_mask_cvtepi16_storeu_epi8(&mut r as *mut _ as *mut i8, 0b11111111, a);
21930        }
21931        let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8);
21932        assert_eq_m128i(r, e);
21933    }
21934
21935    #[simd_test(enable = "avx512bw")]
21936    fn test_mm512_mask_cvtusepi16_storeu_epi8() {
21937        let a = _mm512_set1_epi16(i16::MAX);
21938        let mut r = _mm256_undefined_si256();
21939        unsafe {
21940            _mm512_mask_cvtusepi16_storeu_epi8(
21941                &mut r as *mut _ as *mut i8,
21942                0b11111111_11111111_11111111_11111111,
21943                a,
21944            );
21945        }
21946        let e = _mm256_set1_epi8(u8::MAX as i8);
21947        assert_eq_m256i(r, e);
21948    }
21949
21950    #[simd_test(enable = "avx512bw,avx512vl")]
21951    fn test_mm256_mask_cvtusepi16_storeu_epi8() {
21952        let a = _mm256_set1_epi16(i16::MAX);
21953        let mut r = _mm_undefined_si128();
21954        unsafe {
21955            _mm256_mask_cvtusepi16_storeu_epi8(&mut r as *mut _ as *mut i8, 0b11111111_11111111, a);
21956        }
21957        let e = _mm_set1_epi8(u8::MAX as i8);
21958        assert_eq_m128i(r, e);
21959    }
21960
21961    #[simd_test(enable = "avx512bw,avx512vl")]
21962    fn test_mm_mask_cvtusepi16_storeu_epi8() {
21963        let a = _mm_set1_epi16(i16::MAX);
21964        let mut r = _mm_set1_epi8(0);
21965        unsafe {
21966            _mm_mask_cvtusepi16_storeu_epi8(&mut r as *mut _ as *mut i8, 0b11111111, a);
21967        }
21968        #[rustfmt::skip]
21969        let e = _mm_set_epi8(
21970            0, 0, 0, 0,
21971            0, 0, 0, 0,
21972            u8::MAX as i8, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8,
21973            u8::MAX as i8, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8,
21974        );
21975        assert_eq_m128i(r, e);
21976    }
21977}