clang 24.0.0git
avx10v2aux_512intrin.h
Go to the documentation of this file.
1/*===------------- avx10v2aux_512intrin.h - AVX10V2AUX 512 ----------------===
2 *
3 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 * See https://llvm.org/LICENSE.txt for license information.
5 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 *
7 *===-----------------------------------------------------------------------===
8 */
9#ifndef __IMMINTRIN_H
10#error \
11 "Never use <avx10v2aux_512intrin.h> directly; include <immintrin.h> instead."
12#endif // __IMMINTRIN_H
13
14#ifdef __SSE2__
15
16#ifndef __AVX10V2AUX_512INTRIN_H
17#define __AVX10V2AUX_512INTRIN_H
18
19/* Define the default attributes for the functions in this file. */
20#define __DEFAULT_FN_ATTRS512 \
21 __attribute__((__always_inline__, __nodebug__, __target__("avx10v2aux"), \
22 __min_vector_width__(512)))
23
24/// Convert packed single-precision (32-bit) floating-point elements in \a __A
25/// to packed BF8 (8-bit) floating-point elements, and store the results in
26/// a 128-bit vector.
27///
28/// \headerfile <immintrin.h>
29///
30/// This intrinsic corresponds to the \c VCVTPS2BF8 instruction.
31///
32/// \param __A
33/// A 512-bit vector of [16 x float].
34/// \returns
35/// A 128-bit vector of [16 x i8] containing the converted values.
36static __inline__ __m128i __DEFAULT_FN_ATTRS512 _mm512_cvtps_bf8(__m512 __A) {
37 return (__m128i)__builtin_ia32_vcvtps2bf8_512((__v16sf)__A);
38}
39
40/// Convert packed single-precision (32-bit) floating-point elements in \a __A
41/// to packed BF8 (8-bit) floating-point elements, and store the results in
42/// a 128-bit vector using writemask \a __U.
43///
44/// \headerfile <immintrin.h>
45///
46/// This intrinsic corresponds to the \c VCVTPS2BF8 instruction.
47///
48/// \param __W
49/// A 128-bit vector of [16 x i8] used for writemask.
50/// \param __U
51/// A 16-bit mask indicating which elements to write.
52/// \param __A
53/// A 512-bit vector of [16 x float].
54/// \returns
55/// A 128-bit vector of [16 x i8] containing the converted values.
56static __inline__ __m128i __DEFAULT_FN_ATTRS512
57_mm512_mask_cvtps_bf8(__m128i __W, __mmask16 __U, __m512 __A) {
58 return (__m128i)__builtin_ia32_selectb_128(
59 (__mmask16)__U, (__v16qi)_mm512_cvtps_bf8(__A), (__v16qi)__W);
60}
61
62/// Convert packed single-precision (32-bit) floating-point elements in \a __A
63/// to packed BF8 (8-bit) floating-point elements, and store the results in
64/// a 128-bit vector using zeromask \a __U.
65///
66/// \headerfile <immintrin.h>
67///
68/// This intrinsic corresponds to the \c VCVTPS2BF8 instruction.
69///
70/// \param __U
71/// A 16-bit mask indicating which elements to write (zero otherwise).
72/// \param __A
73/// A 512-bit vector of [16 x float].
74/// \returns
75/// A 128-bit vector of [16 x i8] containing the converted values.
76static __inline__ __m128i __DEFAULT_FN_ATTRS512
77_mm512_maskz_cvtps_bf8(__mmask16 __U, __m512 __A) {
78 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,
79 (__v16qi)_mm512_cvtps_bf8(__A),
80 (__v16qi)_mm_setzero_si128());
81}
82
83/// Convert packed single-precision (32-bit) floating-point elements in \a __A
84/// to packed BF8 (8-bit) floating-point elements with saturation, and store
85/// the results in a 128-bit vector.
86///
87/// \headerfile <immintrin.h>
88///
89/// This intrinsic corresponds to the \c VCVTPS2BF8S instruction.
90///
91/// \param __A
92/// A 512-bit vector of [16 x float].
93/// \returns
94/// A 128-bit vector of [16 x i8] containing the converted values.
95static __inline__ __m128i __DEFAULT_FN_ATTRS512 _mm512_cvts_ps_bf8(__m512 __A) {
96 return (__m128i)__builtin_ia32_vcvtps2bf8s_512((__v16sf)__A);
97}
98
99/// Convert packed single-precision (32-bit) floating-point elements in \a __A
100/// to packed BF8 (8-bit) floating-point elements with saturation, and store
101/// the results in a 128-bit vector using writemask \a __U.
102///
103/// \headerfile <immintrin.h>
104///
105/// This intrinsic corresponds to the \c VCVTPS2BF8S instruction.
106///
107/// \param __W
108/// A 128-bit vector of [16 x i8] used for writemask.
109/// \param __U
110/// A 16-bit mask indicating which elements to write.
111/// \param __A
112/// A 512-bit vector of [16 x float].
113/// \returns
114/// A 128-bit vector of [16 x i8] containing the converted values.
115static __inline__ __m128i __DEFAULT_FN_ATTRS512
116_mm512_mask_cvts_ps_bf8(__m128i __W, __mmask16 __U, __m512 __A) {
117 return (__m128i)__builtin_ia32_selectb_128(
118 (__mmask16)__U, (__v16qi)_mm512_cvts_ps_bf8(__A), (__v16qi)__W);
119}
120
121/// Convert packed single-precision (32-bit) floating-point elements in \a __A
122/// to packed BF8 (8-bit) floating-point elements with saturation, and store
123/// the results in a 128-bit vector using zeromask \a __U.
124///
125/// \headerfile <immintrin.h>
126///
127/// This intrinsic corresponds to the \c VCVTPS2BF8S instruction.
128///
129/// \param __U
130/// A 16-bit mask indicating which elements to write (zero otherwise).
131/// \param __A
132/// A 512-bit vector of [16 x float].
133/// \returns
134/// A 128-bit vector of [16 x i8] containing the converted values.
135static __inline__ __m128i __DEFAULT_FN_ATTRS512
136_mm512_maskz_cvts_ps_bf8(__mmask16 __U, __m512 __A) {
137 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,
138 (__v16qi)_mm512_cvts_ps_bf8(__A),
139 (__v16qi)_mm_setzero_si128());
140}
141
142/// Convert packed single-precision (32-bit) floating-point elements in \a __A
143/// to packed HF8 (8-bit) floating-point elements, and store the results in
144/// a 128-bit vector.
145///
146/// \headerfile <immintrin.h>
147///
148/// This intrinsic corresponds to the \c VCVTPS2HF8 instruction.
149///
150/// \param __A
151/// A 512-bit vector of [16 x float].
152/// \returns
153/// A 128-bit vector of [16 x i8] containing the converted values.
154static __inline__ __m128i __DEFAULT_FN_ATTRS512 _mm512_cvtps_hf8(__m512 __A) {
155 return (__m128i)__builtin_ia32_vcvtps2hf8_512((__v16sf)__A);
156}
157
158/// Convert packed single-precision (32-bit) floating-point elements in \a __A
159/// to packed HF8 (8-bit) floating-point elements, and store the results in
160/// a 128-bit vector using writemask \a __U.
161///
162/// \headerfile <immintrin.h>
163///
164/// This intrinsic corresponds to the \c VCVTPS2HF8 instruction.
165///
166/// \param __W
167/// A 128-bit vector of [16 x i8] used for writemask.
168/// \param __U
169/// A 16-bit mask indicating which elements to write.
170/// \param __A
171/// A 512-bit vector of [16 x float].
172/// \returns
173/// A 128-bit vector of [16 x i8] containing the converted values.
174static __inline__ __m128i __DEFAULT_FN_ATTRS512
175_mm512_mask_cvtps_hf8(__m128i __W, __mmask16 __U, __m512 __A) {
176 return (__m128i)__builtin_ia32_selectb_128(
177 (__mmask16)__U, (__v16qi)_mm512_cvtps_hf8(__A), (__v16qi)__W);
178}
179
180/// Convert packed single-precision (32-bit) floating-point elements in \a __A
181/// to packed HF8 (8-bit) floating-point elements, and store the results in
182/// a 128-bit vector using zeromask \a __U.
183///
184/// \headerfile <immintrin.h>
185///
186/// This intrinsic corresponds to the \c VCVTPS2HF8 instruction.
187///
188/// \param __U
189/// A 16-bit mask indicating which elements to write (zero otherwise).
190/// \param __A
191/// A 512-bit vector of [16 x float].
192/// \returns
193/// A 128-bit vector of [16 x i8] containing the converted values.
194static __inline__ __m128i __DEFAULT_FN_ATTRS512
195_mm512_maskz_cvtps_hf8(__mmask16 __U, __m512 __A) {
196 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,
197 (__v16qi)_mm512_cvtps_hf8(__A),
198 (__v16qi)_mm_setzero_si128());
199}
200
201/// Convert packed single-precision (32-bit) floating-point elements in \a __A
202/// to packed HF8 (8-bit) floating-point elements with saturation, and store
203/// the results in a 128-bit vector.
204///
205/// \headerfile <immintrin.h>
206///
207/// This intrinsic corresponds to the \c VCVTPS2HF8S instruction.
208///
209/// \param __A
210/// A 512-bit vector of [16 x float].
211/// \returns
212/// A 128-bit vector of [16 x i8] containing the converted values.
213static __inline__ __m128i __DEFAULT_FN_ATTRS512 _mm512_cvts_ps_hf8(__m512 __A) {
214 return (__m128i)__builtin_ia32_vcvtps2hf8s_512((__v16sf)__A);
215}
216
217/// Convert packed single-precision (32-bit) floating-point elements in \a __A
218/// to packed HF8 (8-bit) floating-point elements with saturation, and store
219/// the results in a 128-bit vector using writemask \a __U.
220///
221/// \headerfile <immintrin.h>
222///
223/// This intrinsic corresponds to the \c VCVTPS2HF8S instruction.
224///
225/// \param __W
226/// A 128-bit vector of [16 x i8] used for writemask.
227/// \param __U
228/// A 16-bit mask indicating which elements to write.
229/// \param __A
230/// A 512-bit vector of [16 x float].
231/// \returns
232/// A 128-bit vector of [16 x i8] containing the converted values.
233static __inline__ __m128i __DEFAULT_FN_ATTRS512
234_mm512_mask_cvts_ps_hf8(__m128i __W, __mmask16 __U, __m512 __A) {
235 return (__m128i)__builtin_ia32_selectb_128(
236 (__mmask16)__U, (__v16qi)_mm512_cvts_ps_hf8(__A), (__v16qi)__W);
237}
238
239/// Convert packed single-precision (32-bit) floating-point elements in \a __A
240/// to packed HF8 (8-bit) floating-point elements with saturation, and store
241/// the results in a 128-bit vector using zeromask \a __U.
242///
243/// \headerfile <immintrin.h>
244///
245/// This intrinsic corresponds to the \c VCVTPS2HF8S instruction.
246///
247/// \param __U
248/// A 16-bit mask indicating which elements to write (zero otherwise).
249/// \param __A
250/// A 512-bit vector of [16 x float].
251/// \returns
252/// A 128-bit vector of [16 x i8] containing the converted values.
253static __inline__ __m128i __DEFAULT_FN_ATTRS512
254_mm512_maskz_cvts_ps_hf8(__mmask16 __U, __m512 __A) {
255 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,
256 (__v16qi)_mm512_cvts_ps_hf8(__A),
257 (__v16qi)_mm_setzero_si128());
258}
259
260/// Convert packed single-precision (32-bit) floating-point elements in \a __A
261/// to packed HF8 (8-bit) floating-point elements using round-to-odd, and
262/// store the results in a 128-bit vector.
263///
264/// \headerfile <immintrin.h>
265///
266/// This intrinsic corresponds to the \c VCVTROPS2HF8 instruction.
267///
268/// \param __A
269/// A 512-bit vector of [16 x float].
270/// \returns
271/// A 128-bit vector of [16 x i8] containing the converted values.
272static __inline__ __m128i __DEFAULT_FN_ATTRS512 _mm512_cvtrops_hf8(__m512 __A) {
273 return (__m128i)__builtin_ia32_vcvtrops2hf8_512((__v16sf)__A);
274}
275
276/// Convert packed single-precision (32-bit) floating-point elements in \a __A
277/// to packed HF8 (8-bit) floating-point elements using round-to-odd, and
278/// store the results in a 128-bit vector using writemask \a __U.
279///
280/// \headerfile <immintrin.h>
281///
282/// This intrinsic corresponds to the \c VCVTROPS2HF8 instruction.
283///
284/// \param __W
285/// A 128-bit vector of [16 x i8] used for writemask.
286/// \param __U
287/// A 16-bit mask indicating which elements to write.
288/// \param __A
289/// A 512-bit vector of [16 x float].
290/// \returns
291/// A 128-bit vector of [16 x i8] containing the converted values.
292static __inline__ __m128i __DEFAULT_FN_ATTRS512
293_mm512_mask_cvtrops_hf8(__m128i __W, __mmask16 __U, __m512 __A) {
294 return (__m128i)__builtin_ia32_selectb_128(
295 (__mmask16)__U, (__v16qi)_mm512_cvtrops_hf8(__A), (__v16qi)__W);
296}
297
298/// Convert packed single-precision (32-bit) floating-point elements in \a __A
299/// to packed HF8 (8-bit) floating-point elements using round-to-odd, and
300/// store the results in a 128-bit vector using zeromask \a __U.
301///
302/// \headerfile <immintrin.h>
303///
304/// This intrinsic corresponds to the \c VCVTROPS2HF8 instruction.
305///
306/// \param __U
307/// A 16-bit mask indicating which elements to write (zero otherwise).
308/// \param __A
309/// A 512-bit vector of [16 x float].
310/// \returns
311/// A 128-bit vector of [16 x i8] containing the converted values.
312static __inline__ __m128i __DEFAULT_FN_ATTRS512
313_mm512_maskz_cvtrops_hf8(__mmask16 __U, __m512 __A) {
314 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,
315 (__v16qi)_mm512_cvtrops_hf8(__A),
316 (__v16qi)_mm_setzero_si128());
317}
318
319/// Convert packed single-precision (32-bit) floating-point elements in \a __A
320/// to packed HF8 (8-bit) floating-point elements using round-to-odd with
321/// saturation, and store the results in a 128-bit vector.
322///
323/// \headerfile <immintrin.h>
324///
325/// This intrinsic corresponds to the \c VCVTROPS2HF8S instruction.
326///
327/// \param __A
328/// A 512-bit vector of [16 x float].
329/// \returns
330/// A 128-bit vector of [16 x i8] containing the converted values.
331static __inline__ __m128i __DEFAULT_FN_ATTRS512
332_mm512_cvts_rops_hf8(__m512 __A) {
333 return (__m128i)__builtin_ia32_vcvtrops2hf8s_512((__v16sf)__A);
334}
335
336/// Convert packed single-precision (32-bit) floating-point elements in \a __A
337/// to packed HF8 (8-bit) floating-point elements using round-to-odd with
338/// saturation, and store the results in a 128-bit vector using writemask
339/// \a __U.
340///
341/// \headerfile <immintrin.h>
342///
343/// This intrinsic corresponds to the \c VCVTROPS2HF8S instruction.
344///
345/// \param __W
346/// A 128-bit vector of [16 x i8] used for writemask.
347/// \param __U
348/// A 16-bit mask indicating which elements to write.
349/// \param __A
350/// A 512-bit vector of [16 x float].
351/// \returns
352/// A 128-bit vector of [16 x i8] containing the converted values.
353static __inline__ __m128i __DEFAULT_FN_ATTRS512
354_mm512_mask_cvts_rops_hf8(__m128i __W, __mmask16 __U, __m512 __A) {
355 return (__m128i)__builtin_ia32_selectb_128(
356 (__mmask16)__U, (__v16qi)_mm512_cvts_rops_hf8(__A), (__v16qi)__W);
357}
358
359/// Convert packed single-precision (32-bit) floating-point elements in \a __A
360/// to packed HF8 (8-bit) floating-point elements using round-to-odd with
361/// saturation, and store the results in a 128-bit vector using zeromask
362/// \a __U.
363///
364/// \headerfile <immintrin.h>
365///
366/// This intrinsic corresponds to the \c VCVTROPS2HF8S instruction.
367///
368/// \param __U
369/// A 16-bit mask indicating which elements to write (zero otherwise).
370/// \param __A
371/// A 512-bit vector of [16 x float].
372/// \returns
373/// A 128-bit vector of [16 x i8] containing the converted values.
374static __inline__ __m128i __DEFAULT_FN_ATTRS512
375_mm512_maskz_cvts_rops_hf8(__mmask16 __U, __m512 __A) {
376 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,
377 (__v16qi)_mm512_cvts_rops_hf8(__A),
378 (__v16qi)_mm_setzero_si128());
379}
380
381/// Convert packed single-precision (32-bit) floating-point elements in \a __B
382/// to packed BF8 (8-bit) floating-point elements using bias values from
383/// \a __A, and store the results in a 128-bit vector.
384///
385/// \headerfile <immintrin.h>
386///
387/// This intrinsic corresponds to the \c VCVTBIASPS2BF8 instruction.
388///
389/// \param __A
390/// A 512-bit vector of [16 x i32] containing bias values.
391/// \param __B
392/// A 512-bit vector of [16 x float].
393/// \returns
394/// A 128-bit vector of [16 x i8] containing the converted values.
395static __inline__ __m128i __DEFAULT_FN_ATTRS512
396_mm512_cvtbiasps_bf8(__m512i __A, __m512 __B) {
397 return (__m128i)__builtin_ia32_vcvtbiasps2bf8_512((__v16si)__A, (__v16sf)__B);
398}
399
400/// Convert packed single-precision (32-bit) floating-point elements in \a __B
401/// to packed BF8 (8-bit) floating-point elements using bias values from
402/// \a __A, and store the results in a 128-bit vector using writemask \a __U.
403///
404/// \headerfile <immintrin.h>
405///
406/// This intrinsic corresponds to the \c VCVTBIASPS2BF8 instruction.
407///
408/// \param __W
409/// A 128-bit vector of [16 x i8] used for writemask.
410/// \param __U
411/// A 16-bit mask indicating which elements to write.
412/// \param __A
413/// A 512-bit vector of [16 x i32] containing bias values.
414/// \param __B
415/// A 512-bit vector of [16 x float].
416/// \returns
417/// A 128-bit vector of [16 x i8] containing the converted values.
418static __inline__ __m128i __DEFAULT_FN_ATTRS512
419_mm512_mask_cvtbiasps_bf8(__m128i __W, __mmask16 __U, __m512i __A, __m512 __B) {
420 return (__m128i)__builtin_ia32_selectb_128(
421 (__mmask16)__U, (__v16qi)_mm512_cvtbiasps_bf8(__A, __B), (__v16qi)__W);
422}
423
424/// Convert packed single-precision (32-bit) floating-point elements in \a __B
425/// to packed BF8 (8-bit) floating-point elements using bias values from
426/// \a __A, and store the results in a 128-bit vector using zeromask \a __U.
427///
428/// \headerfile <immintrin.h>
429///
430/// This intrinsic corresponds to the \c VCVTBIASPS2BF8 instruction.
431///
432/// \param __U
433/// A 16-bit mask indicating which elements to write (zero otherwise).
434/// \param __A
435/// A 512-bit vector of [16 x i32] containing bias values.
436/// \param __B
437/// A 512-bit vector of [16 x float].
438/// \returns
439/// A 128-bit vector of [16 x i8] containing the converted values.
440static __inline__ __m128i __DEFAULT_FN_ATTRS512
441_mm512_maskz_cvtbiasps_bf8(__mmask16 __U, __m512i __A, __m512 __B) {
442 return (__m128i)__builtin_ia32_selectb_128(
443 (__mmask16)__U, (__v16qi)_mm512_cvtbiasps_bf8(__A, __B),
444 (__v16qi)_mm_setzero_si128());
445}
446
447/// Convert packed single-precision (32-bit) floating-point elements in \a __B
448/// to packed BF8 (8-bit) floating-point elements with saturation using bias
449/// values from \a __A, and store the results in a 128-bit vector.
450///
451/// \headerfile <immintrin.h>
452///
453/// This intrinsic corresponds to the \c VCVTBIASPS2BF8S instruction.
454///
455/// \param __A
456/// A 512-bit vector of [16 x i32] containing bias values.
457/// \param __B
458/// A 512-bit vector of [16 x float].
459/// \returns
460/// A 128-bit vector of [16 x i8] containing the converted values.
461static __inline__ __m128i __DEFAULT_FN_ATTRS512
462_mm512_cvts_biasps_bf8(__m512i __A, __m512 __B) {
463 return (__m128i)__builtin_ia32_vcvtbiasps2bf8s_512((__v16si)__A,
464 (__v16sf)__B);
465}
466
467/// Convert packed single-precision (32-bit) floating-point elements in \a __B
468/// to packed BF8 (8-bit) floating-point elements with saturation using bias
469/// values from \a __A, and store the results using writemask \a __U.
470///
471/// \headerfile <immintrin.h>
472///
473/// This intrinsic corresponds to the \c VCVTBIASPS2BF8S instruction.
474///
475/// \param __W
476/// A 128-bit vector of [16 x i8] used for writemask.
477/// \param __U
478/// A 16-bit mask indicating which elements to write.
479/// \param __A
480/// A 512-bit vector of [16 x i32] containing bias values.
481/// \param __B
482/// A 512-bit vector of [16 x float].
483/// \returns
484/// A 128-bit vector of [16 x i8] containing the converted values.
485static __inline__ __m128i __DEFAULT_FN_ATTRS512 _mm512_mask_cvts_biasps_bf8(
486 __m128i __W, __mmask16 __U, __m512i __A, __m512 __B) {
487 return (__m128i)__builtin_ia32_selectb_128(
488 (__mmask16)__U, (__v16qi)_mm512_cvts_biasps_bf8(__A, __B), (__v16qi)__W);
489}
490
491/// Convert packed single-precision (32-bit) floating-point elements in \a __B
492/// to packed BF8 (8-bit) floating-point elements with saturation using bias
493/// values from \a __A, and store the results using zeromask \a __U.
494///
495/// \headerfile <immintrin.h>
496///
497/// This intrinsic corresponds to the \c VCVTBIASPS2BF8S instruction.
498///
499/// \param __U
500/// A 16-bit mask indicating which elements to write (zero otherwise).
501/// \param __A
502/// A 512-bit vector of [16 x i32] containing bias values.
503/// \param __B
504/// A 512-bit vector of [16 x float].
505/// \returns
506/// A 128-bit vector of [16 x i8] containing the converted values.
507static __inline__ __m128i __DEFAULT_FN_ATTRS512
508_mm512_maskz_cvts_biasps_bf8(__mmask16 __U, __m512i __A, __m512 __B) {
509 return (__m128i)__builtin_ia32_selectb_128(
510 (__mmask16)__U, (__v16qi)_mm512_cvts_biasps_bf8(__A, __B),
511 (__v16qi)_mm_setzero_si128());
512}
513
514/// Convert packed single-precision (32-bit) floating-point elements in \a __B
515/// to packed HF8 (8-bit) floating-point elements using bias values from
516/// \a __A, and store the results in a 128-bit vector.
517///
518/// \headerfile <immintrin.h>
519///
520/// This intrinsic corresponds to the \c VCVTBIASPS2HF8 instruction.
521///
522/// \param __A
523/// A 512-bit vector of [16 x i32] containing bias values.
524/// \param __B
525/// A 512-bit vector of [16 x float].
526/// \returns
527/// A 128-bit vector of [16 x i8] containing the converted values.
528static __inline__ __m128i __DEFAULT_FN_ATTRS512
529_mm512_cvtbiasps_hf8(__m512i __A, __m512 __B) {
530 return (__m128i)__builtin_ia32_vcvtbiasps2hf8_512((__v16si)__A, (__v16sf)__B);
531}
532
533/// Convert packed single-precision (32-bit) floating-point elements in \a __B
534/// to packed HF8 (8-bit) floating-point elements using bias values from
535/// \a __A, and store the results in a 128-bit vector using writemask \a __U.
536///
537/// \headerfile <immintrin.h>
538///
539/// This intrinsic corresponds to the \c VCVTBIASPS2HF8 instruction.
540///
541/// \param __W
542/// A 128-bit vector of [16 x i8] used for writemask.
543/// \param __U
544/// A 16-bit mask indicating which elements to write.
545/// \param __A
546/// A 512-bit vector of [16 x i32] containing bias values.
547/// \param __B
548/// A 512-bit vector of [16 x float].
549/// \returns
550/// A 128-bit vector of [16 x i8] containing the converted values.
551static __inline__ __m128i __DEFAULT_FN_ATTRS512
552_mm512_mask_cvtbiasps_hf8(__m128i __W, __mmask16 __U, __m512i __A, __m512 __B) {
553 return (__m128i)__builtin_ia32_selectb_128(
554 (__mmask16)__U, (__v16qi)_mm512_cvtbiasps_hf8(__A, __B), (__v16qi)__W);
555}
556
557/// Convert packed single-precision (32-bit) floating-point elements in \a __B
558/// to packed HF8 (8-bit) floating-point elements using bias values from
559/// \a __A, and store the results in a 128-bit vector using zeromask \a __U.
560///
561/// \headerfile <immintrin.h>
562///
563/// This intrinsic corresponds to the \c VCVTBIASPS2HF8 instruction.
564///
565/// \param __U
566/// A 16-bit mask indicating which elements to write (zero otherwise).
567/// \param __A
568/// A 512-bit vector of [16 x i32] containing bias values.
569/// \param __B
570/// A 512-bit vector of [16 x float].
571/// \returns
572/// A 128-bit vector of [16 x i8] containing the converted values.
573static __inline__ __m128i __DEFAULT_FN_ATTRS512
574_mm512_maskz_cvtbiasps_hf8(__mmask16 __U, __m512i __A, __m512 __B) {
575 return (__m128i)__builtin_ia32_selectb_128(
576 (__mmask16)__U, (__v16qi)_mm512_cvtbiasps_hf8(__A, __B),
577 (__v16qi)_mm_setzero_si128());
578}
579
580/// Convert packed single-precision (32-bit) floating-point elements in \a __B
581/// to packed HF8 (8-bit) floating-point elements with saturation using bias
582/// values from \a __A, and store the results in a 128-bit vector.
583///
584/// \headerfile <immintrin.h>
585///
586/// This intrinsic corresponds to the \c VCVTBIASPS2HF8S instruction.
587///
588/// \param __A
589/// A 512-bit vector of [16 x i32] containing bias values.
590/// \param __B
591/// A 512-bit vector of [16 x float].
592/// \returns
593/// A 128-bit vector of [16 x i8] containing the converted values.
594static __inline__ __m128i __DEFAULT_FN_ATTRS512
595_mm512_cvts_biasps_hf8(__m512i __A, __m512 __B) {
596 return (__m128i)__builtin_ia32_vcvtbiasps2hf8s_512((__v16si)__A,
597 (__v16sf)__B);
598}
599
600/// Convert packed single-precision (32-bit) floating-point elements in \a __B
601/// to packed HF8 (8-bit) floating-point elements with saturation using bias
602/// values from \a __A, and store the results using writemask \a __U.
603///
604/// \headerfile <immintrin.h>
605///
606/// This intrinsic corresponds to the \c VCVTBIASPS2HF8S instruction.
607///
608/// \param __W
609/// A 128-bit vector of [16 x i8] used for writemask.
610/// \param __U
611/// A 16-bit mask indicating which elements to write.
612/// \param __A
613/// A 512-bit vector of [16 x i32] containing bias values.
614/// \param __B
615/// A 512-bit vector of [16 x float].
616/// \returns
617/// A 128-bit vector of [16 x i8] containing the converted values.
618static __inline__ __m128i __DEFAULT_FN_ATTRS512 _mm512_mask_cvts_biasps_hf8(
619 __m128i __W, __mmask16 __U, __m512i __A, __m512 __B) {
620 return (__m128i)__builtin_ia32_selectb_128(
621 (__mmask16)__U, (__v16qi)_mm512_cvts_biasps_hf8(__A, __B), (__v16qi)__W);
622}
623
624/// Convert packed single-precision (32-bit) floating-point elements in \a __B
625/// to packed HF8 (8-bit) floating-point elements with saturation using bias
626/// values from \a __A, and store the results using zeromask \a __U.
627///
628/// \headerfile <immintrin.h>
629///
630/// This intrinsic corresponds to the \c VCVTBIASPS2HF8S instruction.
631///
632/// \param __U
633/// A 16-bit mask indicating which elements to write (zero otherwise).
634/// \param __A
635/// A 512-bit vector of [16 x i32] containing bias values.
636/// \param __B
637/// A 512-bit vector of [16 x float].
638/// \returns
639/// A 128-bit vector of [16 x i8] containing the converted values.
640static __inline__ __m128i __DEFAULT_FN_ATTRS512
641_mm512_maskz_cvts_biasps_hf8(__mmask16 __U, __m512i __A, __m512 __B) {
642 return (__m128i)__builtin_ia32_selectb_128(
643 (__mmask16)__U, (__v16qi)_mm512_cvts_biasps_hf8(__A, __B),
644 (__v16qi)_mm_setzero_si128());
645}
646
647/// Convert packed BF8 (8-bit) floating-point elements in \a __A to packed
648/// single-precision (32-bit) floating-point elements, and store the results
649/// in a 512-bit vector.
650///
651/// \headerfile <immintrin.h>
652///
653/// This intrinsic corresponds to the \c VCVTBF82PS instruction.
654///
655/// \param __A
656/// A 128-bit vector of [16 x i8] containing BF8 values.
657/// \returns
658/// A 512-bit vector of [16 x float] containing the converted values.
659static __inline__ __m512 __DEFAULT_FN_ATTRS512 _mm512_cvtbf8_ps(__m128i __A) {
660 return (__m512)__builtin_ia32_vcvtbf82ps_512((__v16qi)__A);
661}
662
663/// Convert packed BF8 (8-bit) floating-point elements in \a __A to packed
664/// single-precision (32-bit) floating-point elements, and store the results
665/// in a 512-bit vector using writemask \a __U.
666///
667/// \headerfile <immintrin.h>
668///
669/// This intrinsic corresponds to the \c VCVTBF82PS instruction.
670///
671/// \param __W
672/// A 512-bit vector of [16 x float] used for writemask.
673/// \param __U
674/// A 16-bit mask indicating which elements to write.
675/// \param __A
676/// A 128-bit vector of [16 x i8] containing BF8 values.
677/// \returns
678/// A 512-bit vector of [16 x float] containing the converted values.
679static __inline__ __m512 __DEFAULT_FN_ATTRS512
680_mm512_mask_cvtbf8_ps(__m512 __W, __mmask16 __U, __m128i __A) {
681 return (__m512)__builtin_ia32_selectps_512(
682 (__mmask16)__U, (__v16sf)_mm512_cvtbf8_ps(__A), (__v16sf)__W);
683}
684
685/// Convert packed BF8 (8-bit) floating-point elements in \a __A to packed
686/// single-precision (32-bit) floating-point elements, and store the results
687/// in a 512-bit vector using zeromask \a __U.
688///
689/// \headerfile <immintrin.h>
690///
691/// This intrinsic corresponds to the \c VCVTBF82PS instruction.
692///
693/// \param __U
694/// A 16-bit mask indicating which elements to write (zero otherwise).
695/// \param __A
696/// A 128-bit vector of [16 x i8] containing BF8 values.
697/// \returns
698/// A 512-bit vector of [16 x float] containing the converted values.
699static __inline__ __m512 __DEFAULT_FN_ATTRS512
700_mm512_maskz_cvtbf8_ps(__mmask16 __U, __m128i __A) {
701 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
702 (__v16sf)_mm512_cvtbf8_ps(__A),
703 (__v16sf)_mm512_setzero_ps());
704}
705
706/// Convert packed HF8 (8-bit) floating-point elements in \a __A to packed
707/// single-precision (32-bit) floating-point elements, and store the results
708/// in a 512-bit vector.
709///
710/// \headerfile <immintrin.h>
711///
712/// This intrinsic corresponds to the \c VCVTHF82PS instruction.
713///
714/// \param __A
715/// A 128-bit vector of [16 x i8] containing HF8 values.
716/// \returns
717/// A 512-bit vector of [16 x float] containing the converted values.
718static __inline__ __m512 __DEFAULT_FN_ATTRS512 _mm512_cvthf8_ps(__m128i __A) {
719 return (__m512)__builtin_ia32_vcvthf82ps_512((__v16qi)__A);
720}
721
722/// Convert packed HF8 (8-bit) floating-point elements in \a __A to packed
723/// single-precision (32-bit) floating-point elements, and store the results
724/// in a 512-bit vector using writemask \a __U.
725///
726/// \headerfile <immintrin.h>
727///
728/// This intrinsic corresponds to the \c VCVTHF82PS instruction.
729///
730/// \param __W
731/// A 512-bit vector of [16 x float] used for writemask.
732/// \param __U
733/// A 16-bit mask indicating which elements to write.
734/// \param __A
735/// A 128-bit vector of [16 x i8] containing HF8 values.
736/// \returns
737/// A 512-bit vector of [16 x float] containing the converted values.
738static __inline__ __m512 __DEFAULT_FN_ATTRS512
739_mm512_mask_cvthf8_ps(__m512 __W, __mmask16 __U, __m128i __A) {
740 return (__m512)__builtin_ia32_selectps_512(
741 (__mmask16)__U, (__v16sf)_mm512_cvthf8_ps(__A), (__v16sf)__W);
742}
743
744/// Convert packed HF8 (8-bit) floating-point elements in \a __A to packed
745/// single-precision (32-bit) floating-point elements, and store the results
746/// in a 512-bit vector using zeromask \a __U.
747///
748/// \headerfile <immintrin.h>
749///
750/// This intrinsic corresponds to the \c VCVTHF82PS instruction.
751///
752/// \param __U
753/// A 16-bit mask indicating which elements to write (zero otherwise).
754/// \param __A
755/// A 128-bit vector of [16 x i8] containing HF8 values.
756/// \returns
757/// A 512-bit vector of [16 x float] containing the converted values.
758static __inline__ __m512 __DEFAULT_FN_ATTRS512
759_mm512_maskz_cvthf8_ps(__mmask16 __U, __m128i __A) {
760 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
761 (__v16sf)_mm512_cvthf8_ps(__A),
762 (__v16sf)_mm512_setzero_ps());
763}
764
765/// Convert packed BF8 (8-bit) floating-point elements in \a __A to packed
766/// BF6 (6-bit) floating-point elements with saturation, and store the
767/// results in a 512-bit vector.
768///
769/// \headerfile <immintrin.h>
770///
771/// This intrinsic corresponds to the \c VCVTBF82BF6S instruction.
772///
773/// \param __A
774/// A 512-bit vector of [64 x i8] containing BF8 values.
775/// \returns
776/// A 512-bit vector containing 64 converted packed BF6 values in the
777/// lower bits.
778static __inline__ __m512i __DEFAULT_FN_ATTRS512
779_mm512_cvts_bf8_bf6(__m512i __A) {
780 return (__m512i)__builtin_ia32_vcvtbf82bf6s_512((__v64qi)__A);
781}
782
783/// Convert packed HF8 (8-bit) floating-point elements in \a __A to packed
784/// HF6 (6-bit) floating-point elements with saturation, and store the
785/// results in a 512-bit vector.
786///
787/// \headerfile <immintrin.h>
788///
789/// This intrinsic corresponds to the \c VCVTHF82HF6S instruction.
790///
791/// \param __A
792/// A 512-bit vector of [64 x i8] containing HF8 values.
793/// \returns
794/// A 512-bit vector containing 64 converted packed HF6 values in the
795/// lower bits.
796static __inline__ __m512i __DEFAULT_FN_ATTRS512
797_mm512_cvts_hf8_hf6(__m512i __A) {
798 return (__m512i)__builtin_ia32_vcvthf82hf6s_512((__v64qi)__A);
799}
800
801/// Convert packed BF8 (8-bit) floating-point elements in \a __A to packed
802/// BF4 (4-bit) floating-point elements with saturation, and store the
803/// results in a 256-bit vector.
804///
805/// \headerfile <immintrin.h>
806///
807/// This intrinsic corresponds to the \c VCVTBF82BF4S instruction.
808///
809/// \param __A
810/// A 512-bit vector of [64 x i8] containing BF8 values.
811/// \returns
812/// A 256-bit vector containing 64 converted packed BF4 values.
813static __inline__ __m256i __DEFAULT_FN_ATTRS512
814_mm512_cvts_bf8_bf4(__m512i __A) {
815 return (__m256i)__builtin_ia32_vcvtbf82bf4s_512((__v64qi)__A);
816}
817
818/// Convert packed HF8 (8-bit) floating-point elements in \a __A to packed
819/// BF4 (4-bit) floating-point elements with saturation, and store the
820/// results in a 256-bit vector.
821///
822/// \headerfile <immintrin.h>
823///
824/// This intrinsic corresponds to the \c VCVTHF82BF4S instruction.
825///
826/// \param __A
827/// A 512-bit vector of [64 x i8] containing HF8 values.
828/// \returns
829/// A 256-bit vector containing 64 converted packed BF4 values.
830static __inline__ __m256i __DEFAULT_FN_ATTRS512
831_mm512_cvts_hf8_bf4(__m512i __A) {
832 return (__m256i)__builtin_ia32_vcvthf82bf4s_512((__v64qi)__A);
833}
834
835/// Convert packed BF4 (4-bit) floating-point elements in \a __A to packed
836/// HF8 (8-bit) floating-point elements, and store the results in a 512-bit
837/// vector.
838///
839/// \headerfile <immintrin.h>
840///
841/// This intrinsic corresponds to the \c VCVTBF42HF8 instruction.
842///
843/// \param __A
844/// A 256-bit vector containing 64 packed BF4 values.
845/// \returns
846/// A 512-bit vector of [64 x i8] containing the converted HF8 values.
847static __inline__ __m512i __DEFAULT_FN_ATTRS512 _mm512_cvtbf4_hf8(__m256i __A) {
848 return (__m512i)__builtin_ia32_vcvtbf42hf8_512((__v32qi)__A);
849}
850
851/// Convert packed BF4 (4-bit) floating-point elements in \a __A to packed
852/// HF8 (8-bit) floating-point elements, and store the results in a 512-bit
853/// vector using writemask \a __U.
854///
855/// \headerfile <immintrin.h>
856///
857/// This intrinsic corresponds to the \c VCVTBF42HF8 instruction.
858///
859/// \param __W
860/// A 512-bit vector of [64 x i8] used for writemask.
861/// \param __U
862/// A 64-bit mask indicating which elements to write.
863/// \param __A
864/// A 256-bit vector containing 64 packed BF4 values.
865/// \returns
866/// A 512-bit vector of [64 x i8] containing the converted HF8 values.
867static __inline__ __m512i __DEFAULT_FN_ATTRS512
868_mm512_mask_cvtbf4_hf8(__m512i __W, __mmask64 __U, __m256i __A) {
869 return (__m512i)__builtin_ia32_selectb_512(
870 __U, (__v64qi)_mm512_cvtbf4_hf8(__A), (__v64qi)__W);
871}
872
873/// Convert packed BF4 (4-bit) floating-point elements in \a __A to packed
874/// HF8 (8-bit) floating-point elements, and store the results in a 512-bit
875/// vector using zeromask \a __U.
876///
877/// \headerfile <immintrin.h>
878///
879/// This intrinsic corresponds to the \c VCVTBF42HF8 instruction.
880///
881/// \param __U
882/// A 64-bit mask indicating which elements to write (zero otherwise).
883/// \param __A
884/// A 256-bit vector containing 64 packed BF4 values.
885/// \returns
886/// A 512-bit vector of [64 x i8] containing the converted HF8 values.
887static __inline__ __m512i __DEFAULT_FN_ATTRS512
888_mm512_maskz_cvtbf4_hf8(__mmask64 __U, __m256i __A) {
889 return (__m512i)__builtin_ia32_selectb_512(
890 __U, (__v64qi)_mm512_cvtbf4_hf8(__A), (__v64qi)_mm512_setzero_si512());
891}
892
893/// Convert packed BF6 (6-bit) floating-point elements in \a __A to packed
894/// HF8 (8-bit) floating-point elements, and store the results in a 512-bit
895/// vector.
896///
897/// \headerfile <immintrin.h>
898///
899/// This intrinsic corresponds to the \c VCVTBF62HF8 instruction.
900///
901/// \param __A
902/// A 512-bit vector containing 64 packed BF6 values in the lower bits.
903/// \returns
904/// A 512-bit vector of [64 x i8] containing the converted HF8 values.
905static __inline__ __m512i __DEFAULT_FN_ATTRS512 _mm512_cvtbf6_hf8(__m512i __A) {
906 return (__m512i)__builtin_ia32_vcvtbf62hf8_512((__v64qi)__A);
907}
908
909/// Convert packed BF6 (6-bit) floating-point elements in \a __A to packed
910/// HF8 (8-bit) floating-point elements, and store the results in a 512-bit
911/// vector using writemask \a __U.
912///
913/// \headerfile <immintrin.h>
914///
915/// This intrinsic corresponds to the \c VCVTBF62HF8 instruction.
916///
917/// \param __W
918/// A 512-bit vector of [64 x i8] used for writemask.
919/// \param __U
920/// A 64-bit mask indicating which elements to write.
921/// \param __A
922/// A 512-bit vector containing 64 packed BF6 values in the lower bits.
923/// \returns
924/// A 512-bit vector of [64 x i8] containing the converted HF8 values.
925static __inline__ __m512i __DEFAULT_FN_ATTRS512
926_mm512_mask_cvtbf6_hf8(__m512i __W, __mmask64 __U, __m512i __A) {
927 return (__m512i)__builtin_ia32_selectb_512(
928 __U, (__v64qi)_mm512_cvtbf6_hf8(__A), (__v64qi)__W);
929}
930
931/// Convert packed BF6 (6-bit) floating-point elements in \a __A to packed
932/// HF8 (8-bit) floating-point elements, and store the results in a 512-bit
933/// vector using zeromask \a __U.
934///
935/// \headerfile <immintrin.h>
936///
937/// This intrinsic corresponds to the \c VCVTBF62HF8 instruction.
938///
939/// \param __U
940/// A 64-bit mask indicating which elements to write (zero otherwise).
941/// \param __A
942/// A 512-bit vector containing 64 packed BF6 values in the lower bits.
943/// \returns
944/// A 512-bit vector of [64 x i8] containing the converted HF8 values.
945static __inline__ __m512i __DEFAULT_FN_ATTRS512
946_mm512_maskz_cvtbf6_hf8(__mmask64 __U, __m512i __A) {
947 return (__m512i)__builtin_ia32_selectb_512(
948 __U, (__v64qi)_mm512_cvtbf6_hf8(__A), (__v64qi)_mm512_setzero_si512());
949}
950
951/// Convert packed HF6 (6-bit) floating-point elements in \a __A to packed
952/// HF8 (8-bit) floating-point elements, and store the results in a 512-bit
953/// vector.
954///
955/// \headerfile <immintrin.h>
956///
957/// This intrinsic corresponds to the \c VCVTHF62HF8 instruction.
958///
959/// \param __A
960/// A 512-bit vector containing 64 packed HF6 values in the lower bits.
961/// \returns
962/// A 512-bit vector of [64 x i8] containing the converted HF8 values.
963static __inline__ __m512i __DEFAULT_FN_ATTRS512 _mm512_cvthf6_hf8(__m512i __A) {
964 return (__m512i)__builtin_ia32_vcvthf62hf8_512((__v64qi)__A);
965}
966
967/// Convert packed HF6 (6-bit) floating-point elements in \a __A to packed
968/// HF8 (8-bit) floating-point elements, and store the results in a 512-bit
969/// vector using writemask \a __U.
970///
971/// \headerfile <immintrin.h>
972///
973/// This intrinsic corresponds to the \c VCVTHF62HF8 instruction.
974///
975/// \param __W
976/// A 512-bit vector of [64 x i8] used for writemask.
977/// \param __U
978/// A 64-bit mask indicating which elements to write.
979/// \param __A
980/// A 512-bit vector containing 64 packed HF6 values in the lower bits.
981/// \returns
982/// A 512-bit vector of [64 x i8] containing the converted HF8 values.
983static __inline__ __m512i __DEFAULT_FN_ATTRS512
984_mm512_mask_cvthf6_hf8(__m512i __W, __mmask64 __U, __m512i __A) {
985 return (__m512i)__builtin_ia32_selectb_512(
986 __U, (__v64qi)_mm512_cvthf6_hf8(__A), (__v64qi)__W);
987}
988
989/// Convert packed HF6 (6-bit) floating-point elements in \a __A to packed
990/// HF8 (8-bit) floating-point elements, and store the results in a 512-bit
991/// vector using zeromask \a __U.
992///
993/// \headerfile <immintrin.h>
994///
995/// This intrinsic corresponds to the \c VCVTHF62HF8 instruction.
996///
997/// \param __U
998/// A 64-bit mask indicating which elements to write (zero otherwise).
999/// \param __A
1000/// A 512-bit vector containing 64 packed HF6 values in the lower bits.
1001/// \returns
1002/// A 512-bit vector of [64 x i8] containing the converted HF8 values.
1003static __inline__ __m512i __DEFAULT_FN_ATTRS512
1004_mm512_maskz_cvthf6_hf8(__mmask64 __U, __m512i __A) {
1005 return (__m512i)__builtin_ia32_selectb_512(
1006 __U, (__v64qi)_mm512_cvthf6_hf8(__A), (__v64qi)_mm512_setzero_si512());
1007}
1008
1009/// Unpack bytes from \a A according to the immediate value \a imm, and store
1010/// the results in a 512-bit vector.
1011///
1012/// \headerfile <immintrin.h>
1013///
1014/// This intrinsic corresponds to the \c VUNPACKB instruction.
1015///
1016/// \param A
1017/// A 512-bit vector of [64 x i8].
1018/// \param imm
1019/// An 8-bit immediate selecting the packed element size, start offset, and
1020/// optional sign-extend for \c VUNPACKB. Compose it with
1021/// \c _MM_UNPACKB_SIZE, \c _MM_UNPACKB_START, and optionally
1022/// \c _MM_UNPACKB_SEXT. Omitting \c _MM_UNPACKB_SEXT zero-extends unpacked
1023/// elements to 8 bits. \n
1024/// Example:
1025/// <c>_MM_UNPACKB_SIZE(4) | _MM_UNPACKB_START(1) | _MM_UNPACKB_SEXT</c>
1026///
1027/// \see { _MM_UNPACKB_SIZE _MM_UNPACKB_START _MM_UNPACKB_SEXT }
1028/// \returns
1029/// A 512-bit vector of [64 x i8] containing the unpacked values.
1030#define _mm512_unpack_epi8(A, imm) \
1031 ((__m512i)__builtin_ia32_vunpackb512((__v64qi)(__m512i)(A), (int)(imm)))
1032
1033/// Unpack bytes from \a A according to the immediate value \a imm, and store
1034/// the results in a 512-bit vector using writemask \a U.
1035///
1036/// \headerfile <immintrin.h>
1037///
1038/// This intrinsic corresponds to the \c VUNPACKB instruction.
1039///
1040/// \param W
1041/// A 512-bit vector of [64 x i8] used for writemask.
1042/// \param U
1043/// A 64-bit mask indicating which elements to write.
1044/// \param A
1045/// A 512-bit vector of [64 x i8].
1046/// \param imm
1047/// An 8-bit immediate selecting the packed element size, start offset, and
1048/// optional sign-extend for \c VUNPACKB. Compose it with
1049/// \c _MM_UNPACKB_SIZE, \c _MM_UNPACKB_START, and optionally
1050/// \c _MM_UNPACKB_SEXT. Omitting \c _MM_UNPACKB_SEXT zero-extends unpacked
1051/// elements to 8 bits. \n
1052/// Example:
1053/// <c>_MM_UNPACKB_SIZE(4) | _MM_UNPACKB_START(1) | _MM_UNPACKB_SEXT</c>
1054///
1055/// \see { _MM_UNPACKB_SIZE _MM_UNPACKB_START _MM_UNPACKB_SEXT }
1056/// \returns
1057/// A 512-bit vector of [64 x i8] containing the unpacked values.
1058#define _mm512_mask_unpack_epi8(W, U, A, imm) \
1059 ((__m512i)__builtin_ia32_selectb_512( \
1060 (__mmask64)(U), (__v64qi)_mm512_unpack_epi8((A), (imm)), \
1061 (__v64qi)(__m512i)(W)))
1062
1063/// Unpack bytes from \a A according to the immediate value \a imm, and store
1064/// the results in a 512-bit vector using zeromask \a U.
1065///
1066/// \headerfile <immintrin.h>
1067///
1068/// This intrinsic corresponds to the \c VUNPACKB instruction.
1069///
1070/// \param U
1071/// A 64-bit mask indicating which elements to write (zero otherwise).
1072/// \param A
1073/// A 512-bit vector of [64 x i8].
1074/// \param imm
1075/// An 8-bit immediate selecting the packed element size, start offset, and
1076/// optional sign-extend for \c VUNPACKB. Compose it with
1077/// \c _MM_UNPACKB_SIZE, \c _MM_UNPACKB_START, and optionally
1078/// \c _MM_UNPACKB_SEXT. Omitting \c _MM_UNPACKB_SEXT zero-extends unpacked
1079/// elements to 8 bits. \n
1080/// Example:
1081/// <c>_MM_UNPACKB_SIZE(4) | _MM_UNPACKB_START(1) | _MM_UNPACKB_SEXT</c>
1082///
1083/// \see { _MM_UNPACKB_SIZE _MM_UNPACKB_START _MM_UNPACKB_SEXT }
1084/// \returns
1085/// A 512-bit vector of [64 x i8] containing the unpacked values.
1086#define _mm512_maskz_unpack_epi8(U, A, imm) \
1087 ((__m512i)__builtin_ia32_selectb_512( \
1088 (__mmask64)(U), (__v64qi)_mm512_unpack_epi8((A), (imm)), \
1089 (__v64qi)_mm512_setzero_si512()))
1090
1091/// Convert packed signed 32-bit integers in \a __A to packed 8-bit integers
1092/// with symmetric signed saturation (clamp to [-127, +127]), and store
1093/// the results in a 128-bit vector.
1094///
1095/// \headerfile <immintrin.h>
1096///
1097/// This intrinsic corresponds to the \c VPMOVSSDB instruction.
1098///
1099/// \param __A
1100/// A 512-bit vector of [16 x i32].
1101/// \returns
1102/// A 128-bit vector of [16 x i8] containing the converted values.
1103static __inline__ __m128i __DEFAULT_FN_ATTRS512
1104_mm512_cvtss_epi32_epi8(__m512i __A) {
1105 return (__m128i)__builtin_ia32_vpmovssdb512_mask(
1106 (__v16si)__A, (__v16qi)_mm_setzero_si128(), (__mmask16)-1);
1107}
1108
1109/// Convert packed signed 32-bit integers in \a __A to packed 8-bit integers
1110/// with symmetric signed saturation, using writemask \a __U.
1111///
1112/// \headerfile <immintrin.h>
1113///
1114/// This intrinsic corresponds to the \c VPMOVSSDB instruction.
1115///
1116/// \param __W
1117/// A 128-bit vector of [16 x i8] used for writemask.
1118/// \param __U
1119/// A 16-bit mask indicating which elements to write.
1120/// \param __A
1121/// A 512-bit vector of [16 x i32].
1122/// \returns
1123/// A 128-bit vector of [16 x i8] containing the converted values.
1124static __inline__ __m128i __DEFAULT_FN_ATTRS512
1125_mm512_mask_cvtss_epi32_epi8(__m128i __W, __mmask16 __U, __m512i __A) {
1126 return (__m128i)__builtin_ia32_vpmovssdb512_mask((__v16si)__A, (__v16qi)__W,
1127 __U);
1128}
1129
1130/// Convert packed signed 32-bit integers in \a __A to packed 8-bit integers
1131/// with symmetric signed saturation, using zeromask \a __U.
1132///
1133/// \headerfile <immintrin.h>
1134///
1135/// This intrinsic corresponds to the \c VPMOVSSDB instruction.
1136///
1137/// \param __U
1138/// A 16-bit mask indicating which elements to write (zero otherwise).
1139/// \param __A
1140/// A 512-bit vector of [16 x i32].
1141/// \returns
1142/// A 128-bit vector of [16 x i8] containing the converted values.
1143static __inline__ __m128i __DEFAULT_FN_ATTRS512
1144_mm512_maskz_cvtss_epi32_epi8(__mmask16 __U, __m512i __A) {
1145 return (__m128i)__builtin_ia32_vpmovssdb512_mask(
1146 (__v16si)__A, (__v16qi)_mm_setzero_si128(), __U);
1147}
1148
1149/// Truncate packed 32-bit integers in \a __A to packed 8-bit integers with
1150/// symmetric signed saturation, and store the results to memory at \a __P
1151/// using writemask \a __M (elements not selected by the mask are not written).
1152///
1153/// \headerfile <immintrin.h>
1154///
1155/// This intrinsic corresponds to the \c VPMOVSSDB instruction.
1156///
1157/// \param __P
1158/// Pointer to the destination memory.
1159/// \param __M
1160/// A 16-bit mask indicating which elements to write.
1161/// \param __A
1162/// A 512-bit vector of [16 x i32].
1163static __inline__ void __DEFAULT_FN_ATTRS512
1164_mm512_mask_cvtss_epi32_storeu_epi8(void *__P, __mmask16 __M, __m512i __A) {
1165 __builtin_ia32_vpmovssdb512mem_mask((__v16qi *)__P, (__v16si)__A, __M);
1166}
1167
1168#undef __DEFAULT_FN_ATTRS512
1169
1170#endif // __AVX10V2AUX_512INTRIN_H
1171#endif // __SSE2__
#define __DEFAULT_FN_ATTRS512
unsigned long long __mmask64
static __inline __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_setzero_ps(void)
unsigned short __mmask16
static __inline __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_setzero_si512(void)
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_setzero_si128(void)
Creates a 128-bit integer vector initialized to zero.
Definition emmintrin.h:3887
__inline unsigned int unsigned int unsigned int * __P
Definition bmi2intrin.h:25