clang 24.0.0git
avx10v2auxintrin.h
Go to the documentation of this file.
1/*===---------------- avx10v2auxintrin.h - AVX10V2AUX ---------------------===
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 "Never use <avx10v2auxintrin.h> directly; include <immintrin.h> instead."
11#endif // __IMMINTRIN_H
12
13#ifdef __SSE2__
14
15#ifndef __AVX10V2AUXINTRIN_H
16#define __AVX10V2AUXINTRIN_H
17
18/* Define the default attributes for the functions in this file. */
19#define __DEFAULT_FN_ATTRS128 \
20 __attribute__((__always_inline__, __nodebug__, __target__("avx10v2aux"), \
21 __min_vector_width__(128)))
22#define __DEFAULT_FN_ATTRS256 \
23 __attribute__((__always_inline__, __nodebug__, __target__("avx10v2aux"), \
24 __min_vector_width__(256)))
25
26/// Convert packed single-precision (32-bit) floating-point elements in \a __A
27/// to packed BF8 (8-bit) floating-point elements, and store the results in
28/// a 128-bit vector.
29///
30/// \headerfile <immintrin.h>
31///
32/// This intrinsic corresponds to the \c VCVTPS2BF8 instruction.
33///
34/// \param __A
35/// A 128-bit vector of [4 x float].
36/// \returns
37/// A 128-bit vector of [16 x i8]. The lower 4 bytes contain the converted
38/// values; the upper bytes are zeroed.
39static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_cvtps_bf8(__m128 __A) {
40 return (__m128i)__builtin_ia32_vcvtps2bf8_128_mask(
41 (__v4sf)__A, (__v16qi)_mm_undefined_si128(), (__mmask8)-1);
42}
43
44/// Convert packed single-precision (32-bit) floating-point elements in \a __A
45/// to packed BF8 (8-bit) floating-point elements, and store the results in
46/// a 128-bit vector using writemask \a __U.
47///
48/// \headerfile <immintrin.h>
49///
50/// This intrinsic corresponds to the \c VCVTPS2BF8 instruction.
51///
52/// \param __W
53/// A 128-bit vector of [16 x i8] used for writemask.
54/// \param __U
55/// A 8-bit mask indicating which elements to write.
56/// \param __A
57/// A 128-bit vector of [4 x float].
58/// \returns
59/// A 128-bit vector of [16 x i8]. The lower 4 bytes contain the converted
60/// values, or the corresponding bytes of \a __W where the mask bit is clear;
61/// the upper bytes are zeroed.
62static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_mask_cvtps_bf8(__m128i __W,
63 __mmask8 __U,
64 __m128 __A) {
65 return (__m128i)__builtin_ia32_vcvtps2bf8_128_mask((__v4sf)__A, (__v16qi)__W,
66 (__mmask8)__U);
67}
68
69/// Convert packed single-precision (32-bit) floating-point elements in \a __A
70/// to packed BF8 (8-bit) floating-point elements, and store the results in
71/// a 128-bit vector using zeromask \a __U.
72///
73/// \headerfile <immintrin.h>
74///
75/// This intrinsic corresponds to the \c VCVTPS2BF8 instruction.
76///
77/// \param __U
78/// A 8-bit mask indicating which elements to write (zero otherwise).
79/// \param __A
80/// A 128-bit vector of [4 x float].
81/// \returns
82/// A 128-bit vector of [16 x i8]. The lower 4 bytes contain the converted
83/// values, or zero where the mask bit is clear; the upper bytes are zeroed.
84static __inline__ __m128i __DEFAULT_FN_ATTRS128
85_mm_maskz_cvtps_bf8(__mmask8 __U, __m128 __A) {
86 return (__m128i)__builtin_ia32_vcvtps2bf8_128_mask(
87 (__v4sf)__A, (__v16qi)_mm_setzero_si128(), (__mmask8)__U);
88}
89
90/// Convert packed single-precision (32-bit) floating-point elements in \a __A
91/// to packed BF8 (8-bit) floating-point elements, and store the results in
92/// a 128-bit vector.
93///
94/// \headerfile <immintrin.h>
95///
96/// This intrinsic corresponds to the \c VCVTPS2BF8 instruction.
97///
98/// \param __A
99/// A 256-bit vector of [8 x float].
100/// \returns
101/// A 128-bit vector of [16 x i8]. The lower 8 bytes contain the converted
102/// values; the upper bytes are zeroed.
103static __inline__ __m128i __DEFAULT_FN_ATTRS256 _mm256_cvtps_bf8(__m256 __A) {
104 return (__m128i)__builtin_ia32_vcvtps2bf8_256_mask(
105 (__v8sf)__A, (__v16qi)_mm_undefined_si128(), (__mmask8)-1);
106}
107
108/// Convert packed single-precision (32-bit) floating-point elements in \a __A
109/// to packed BF8 (8-bit) floating-point elements, and store the results in
110/// a 128-bit vector using writemask \a __U.
111///
112/// \headerfile <immintrin.h>
113///
114/// This intrinsic corresponds to the \c VCVTPS2BF8 instruction.
115///
116/// \param __W
117/// A 128-bit vector of [16 x i8] used for writemask.
118/// \param __U
119/// A 8-bit mask indicating which elements to write.
120/// \param __A
121/// A 256-bit vector of [8 x float].
122/// \returns
123/// A 128-bit vector of [16 x i8]. The lower 8 bytes contain the converted
124/// values, or the corresponding bytes of \a __W where the mask bit is clear;
125/// the upper bytes are zeroed.
126static __inline__ __m128i __DEFAULT_FN_ATTRS256
127_mm256_mask_cvtps_bf8(__m128i __W, __mmask8 __U, __m256 __A) {
128 return (__m128i)__builtin_ia32_vcvtps2bf8_256_mask((__v8sf)__A, (__v16qi)__W,
129 (__mmask8)__U);
130}
131
132/// Convert packed single-precision (32-bit) floating-point elements in \a __A
133/// to packed BF8 (8-bit) floating-point elements, and store the results in
134/// a 128-bit vector using zeromask \a __U.
135///
136/// \headerfile <immintrin.h>
137///
138/// This intrinsic corresponds to the \c VCVTPS2BF8 instruction.
139///
140/// \param __U
141/// A 8-bit mask indicating which elements to write (zero otherwise).
142/// \param __A
143/// A 256-bit vector of [8 x float].
144/// \returns
145/// A 128-bit vector of [16 x i8]. The lower 8 bytes contain the converted
146/// values, or zero where the mask bit is clear; the upper bytes are zeroed.
147static __inline__ __m128i __DEFAULT_FN_ATTRS256
148_mm256_maskz_cvtps_bf8(__mmask8 __U, __m256 __A) {
149 return (__m128i)__builtin_ia32_vcvtps2bf8_256_mask(
150 (__v8sf)__A, (__v16qi)_mm_setzero_si128(), (__mmask8)__U);
151}
152
153/// Convert packed single-precision (32-bit) floating-point elements in \a __A
154/// to packed BF8 (8-bit) floating-point elements with saturation, and store
155/// the results in a 128-bit vector.
156///
157/// \headerfile <immintrin.h>
158///
159/// This intrinsic corresponds to the \c VCVTPS2BF8S instruction.
160///
161/// \param __A
162/// A 128-bit vector of [4 x float].
163/// \returns
164/// A 128-bit vector of [16 x i8] containing the converted values.
165static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_cvts_ps_bf8(__m128 __A) {
166 return (__m128i)__builtin_ia32_vcvtps2bf8s_128_mask(
167 (__v4sf)__A, (__v16qi)_mm_undefined_si128(), (__mmask8)-1);
168}
169
170/// Convert packed single-precision (32-bit) floating-point elements in \a __A
171/// to packed BF8 (8-bit) floating-point elements with saturation, and store
172/// the results in a 128-bit vector using writemask \a __U.
173///
174/// \headerfile <immintrin.h>
175///
176/// This intrinsic corresponds to the \c VCVTPS2BF8S instruction.
177///
178/// \param __W
179/// A 128-bit vector of [16 x i8] used for writemask.
180/// \param __U
181/// A 8-bit mask indicating which elements to write.
182/// \param __A
183/// A 128-bit vector of [4 x float].
184/// \returns
185/// A 128-bit vector of [16 x i8]. The lower 4 bytes contain the converted
186/// values, or the corresponding bytes of \a __W where the mask bit is clear;
187/// the upper bytes are zeroed.
188static __inline__ __m128i __DEFAULT_FN_ATTRS128
189_mm_mask_cvts_ps_bf8(__m128i __W, __mmask8 __U, __m128 __A) {
190 return (__m128i)__builtin_ia32_vcvtps2bf8s_128_mask((__v4sf)__A, (__v16qi)__W,
191 (__mmask8)__U);
192}
193
194/// Convert packed single-precision (32-bit) floating-point elements in \a __A
195/// to packed BF8 (8-bit) floating-point elements with saturation, and store
196/// the results in a 128-bit vector using zeromask \a __U.
197///
198/// \headerfile <immintrin.h>
199///
200/// This intrinsic corresponds to the \c VCVTPS2BF8S instruction.
201///
202/// \param __U
203/// A 8-bit mask indicating which elements to write (zero otherwise).
204/// \param __A
205/// A 128-bit vector of [4 x float].
206/// \returns
207/// A 128-bit vector of [16 x i8]. The lower 4 bytes contain the converted
208/// values, or zero where the mask bit is clear; the upper bytes are zeroed.
209static __inline__ __m128i __DEFAULT_FN_ATTRS128
210_mm_maskz_cvts_ps_bf8(__mmask8 __U, __m128 __A) {
211 return (__m128i)__builtin_ia32_vcvtps2bf8s_128_mask(
212 (__v4sf)__A, (__v16qi)_mm_setzero_si128(), (__mmask8)__U);
213}
214
215/// Convert packed single-precision (32-bit) floating-point elements in \a __A
216/// to packed BF8 (8-bit) floating-point elements with saturation, and store
217/// the results in a 128-bit vector.
218///
219/// \headerfile <immintrin.h>
220///
221/// This intrinsic corresponds to the \c VCVTPS2BF8S instruction.
222///
223/// \param __A
224/// A 256-bit vector of [8 x float].
225/// \returns
226/// A 128-bit vector of [16 x i8] containing the converted values.
227static __inline__ __m128i __DEFAULT_FN_ATTRS256 _mm256_cvts_ps_bf8(__m256 __A) {
228 return (__m128i)__builtin_ia32_vcvtps2bf8s_256_mask(
229 (__v8sf)__A, (__v16qi)_mm_undefined_si128(), (__mmask8)-1);
230}
231
232/// Convert packed single-precision (32-bit) floating-point elements in \a __A
233/// to packed BF8 (8-bit) floating-point elements with saturation, and store
234/// the results in a 128-bit vector using writemask \a __U.
235///
236/// \headerfile <immintrin.h>
237///
238/// This intrinsic corresponds to the \c VCVTPS2BF8S instruction.
239///
240/// \param __W
241/// A 128-bit vector of [16 x i8] used for writemask.
242/// \param __U
243/// A 8-bit mask indicating which elements to write.
244/// \param __A
245/// A 256-bit vector of [8 x float].
246/// \returns
247/// A 128-bit vector of [16 x i8]. The lower 8 bytes contain the converted
248/// values, or the corresponding bytes of \a __W where the mask bit is clear;
249/// the upper bytes are zeroed.
250static __inline__ __m128i __DEFAULT_FN_ATTRS256
251_mm256_mask_cvts_ps_bf8(__m128i __W, __mmask8 __U, __m256 __A) {
252 return (__m128i)__builtin_ia32_vcvtps2bf8s_256_mask((__v8sf)__A, (__v16qi)__W,
253 (__mmask8)__U);
254}
255
256/// Convert packed single-precision (32-bit) floating-point elements in \a __A
257/// to packed BF8 (8-bit) floating-point elements with saturation, and store
258/// the results in a 128-bit vector using zeromask \a __U.
259///
260/// \headerfile <immintrin.h>
261///
262/// This intrinsic corresponds to the \c VCVTPS2BF8S instruction.
263///
264/// \param __U
265/// A 8-bit mask indicating which elements to write (zero otherwise).
266/// \param __A
267/// A 256-bit vector of [8 x float].
268/// \returns
269/// A 128-bit vector of [16 x i8]. The lower 8 bytes contain the converted
270/// values, or zero where the mask bit is clear; the upper bytes are zeroed.
271static __inline__ __m128i __DEFAULT_FN_ATTRS256
272_mm256_maskz_cvts_ps_bf8(__mmask8 __U, __m256 __A) {
273 return (__m128i)__builtin_ia32_vcvtps2bf8s_256_mask(
274 (__v8sf)__A, (__v16qi)_mm_setzero_si128(), (__mmask8)__U);
275}
276
277/// Convert packed single-precision (32-bit) floating-point elements in \a __A
278/// to packed HF8 (8-bit) floating-point elements, and store the results in
279/// a 128-bit vector.
280///
281/// \headerfile <immintrin.h>
282///
283/// This intrinsic corresponds to the \c VCVTPS2HF8 instruction.
284///
285/// \param __A
286/// A 128-bit vector of [4 x float].
287/// \returns
288/// A 128-bit vector of [16 x i8] containing the converted values.
289static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_cvtps_hf8(__m128 __A) {
290 return (__m128i)__builtin_ia32_vcvtps2hf8_128_mask(
291 (__v4sf)__A, (__v16qi)_mm_undefined_si128(), (__mmask8)-1);
292}
293
294/// Convert packed single-precision (32-bit) floating-point elements in \a __A
295/// to packed HF8 (8-bit) floating-point elements, and store the results in
296/// a 128-bit vector using writemask \a __U.
297///
298/// \headerfile <immintrin.h>
299///
300/// This intrinsic corresponds to the \c VCVTPS2HF8 instruction.
301///
302/// \param __W
303/// A 128-bit vector of [16 x i8] used for writemask.
304/// \param __U
305/// A 8-bit mask indicating which elements to write.
306/// \param __A
307/// A 128-bit vector of [4 x float].
308/// \returns
309/// A 128-bit vector of [16 x i8]. The lower 4 bytes contain the converted
310/// values, or the corresponding bytes of \a __W where the mask bit is clear;
311/// the upper bytes are zeroed.
312static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_mask_cvtps_hf8(__m128i __W,
313 __mmask8 __U,
314 __m128 __A) {
315 return (__m128i)__builtin_ia32_vcvtps2hf8_128_mask((__v4sf)__A, (__v16qi)__W,
316 (__mmask8)__U);
317}
318
319/// Convert packed single-precision (32-bit) floating-point elements in \a __A
320/// to packed HF8 (8-bit) floating-point elements, and store the results in
321/// a 128-bit vector using zeromask \a __U.
322///
323/// \headerfile <immintrin.h>
324///
325/// This intrinsic corresponds to the \c VCVTPS2HF8 instruction.
326///
327/// \param __U
328/// A 8-bit mask indicating which elements to write (zero otherwise).
329/// \param __A
330/// A 128-bit vector of [4 x float].
331/// \returns
332/// A 128-bit vector of [16 x i8]. The lower 4 bytes contain the converted
333/// values, or zero where the mask bit is clear; the upper bytes are zeroed.
334static __inline__ __m128i __DEFAULT_FN_ATTRS128
335_mm_maskz_cvtps_hf8(__mmask8 __U, __m128 __A) {
336 return (__m128i)__builtin_ia32_vcvtps2hf8_128_mask(
337 (__v4sf)__A, (__v16qi)_mm_setzero_si128(), (__mmask8)__U);
338}
339
340/// Convert packed single-precision (32-bit) floating-point elements in \a __A
341/// to packed HF8 (8-bit) floating-point elements, and store the results in
342/// a 128-bit vector.
343///
344/// \headerfile <immintrin.h>
345///
346/// This intrinsic corresponds to the \c VCVTPS2HF8 instruction.
347///
348/// \param __A
349/// A 256-bit vector of [8 x float].
350/// \returns
351/// A 128-bit vector of [16 x i8] containing the converted values.
352static __inline__ __m128i __DEFAULT_FN_ATTRS256 _mm256_cvtps_hf8(__m256 __A) {
353 return (__m128i)__builtin_ia32_vcvtps2hf8_256_mask(
354 (__v8sf)__A, (__v16qi)_mm_undefined_si128(), (__mmask8)-1);
355}
356
357/// Convert packed single-precision (32-bit) floating-point elements in \a __A
358/// to packed HF8 (8-bit) floating-point elements, and store the results in
359/// a 128-bit vector using writemask \a __U.
360///
361/// \headerfile <immintrin.h>
362///
363/// This intrinsic corresponds to the \c VCVTPS2HF8 instruction.
364///
365/// \param __W
366/// A 128-bit vector of [16 x i8] used for writemask.
367/// \param __U
368/// A 8-bit mask indicating which elements to write.
369/// \param __A
370/// A 256-bit vector of [8 x float].
371/// \returns
372/// A 128-bit vector of [16 x i8]. The lower 8 bytes contain the converted
373/// values, or the corresponding bytes of \a __W where the mask bit is clear;
374/// the upper bytes are zeroed.
375static __inline__ __m128i __DEFAULT_FN_ATTRS256
376_mm256_mask_cvtps_hf8(__m128i __W, __mmask8 __U, __m256 __A) {
377 return (__m128i)__builtin_ia32_vcvtps2hf8_256_mask((__v8sf)__A, (__v16qi)__W,
378 (__mmask8)__U);
379}
380
381/// Convert packed single-precision (32-bit) floating-point elements in \a __A
382/// to packed HF8 (8-bit) floating-point elements, and store the results in
383/// a 128-bit vector using zeromask \a __U.
384///
385/// \headerfile <immintrin.h>
386///
387/// This intrinsic corresponds to the \c VCVTPS2HF8 instruction.
388///
389/// \param __U
390/// A 8-bit mask indicating which elements to write (zero otherwise).
391/// \param __A
392/// A 256-bit vector of [8 x float].
393/// \returns
394/// A 128-bit vector of [16 x i8]. The lower 8 bytes contain the converted
395/// values, or zero where the mask bit is clear; the upper bytes are zeroed.
396static __inline__ __m128i __DEFAULT_FN_ATTRS256
397_mm256_maskz_cvtps_hf8(__mmask8 __U, __m256 __A) {
398 return (__m128i)__builtin_ia32_vcvtps2hf8_256_mask(
399 (__v8sf)__A, (__v16qi)_mm_setzero_si128(), (__mmask8)__U);
400}
401
402/// Convert packed single-precision (32-bit) floating-point elements in \a __A
403/// to packed HF8 (8-bit) floating-point elements with saturation, and store
404/// the results in a 128-bit vector.
405///
406/// \headerfile <immintrin.h>
407///
408/// This intrinsic corresponds to the \c VCVTPS2HF8S instruction.
409///
410/// \param __A
411/// A 128-bit vector of [4 x float].
412/// \returns
413/// A 128-bit vector of [16 x i8] containing the converted values.
414static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_cvts_ps_hf8(__m128 __A) {
415 return (__m128i)__builtin_ia32_vcvtps2hf8s_128_mask(
416 (__v4sf)__A, (__v16qi)_mm_undefined_si128(), (__mmask8)-1);
417}
418
419/// Convert packed single-precision (32-bit) floating-point elements in \a __A
420/// to packed HF8 (8-bit) floating-point elements with saturation, and store
421/// the results in a 128-bit vector using writemask \a __U.
422///
423/// \headerfile <immintrin.h>
424///
425/// This intrinsic corresponds to the \c VCVTPS2HF8S instruction.
426///
427/// \param __W
428/// A 128-bit vector of [16 x i8] used for writemask.
429/// \param __U
430/// A 8-bit mask indicating which elements to write.
431/// \param __A
432/// A 128-bit vector of [4 x float].
433/// \returns
434/// A 128-bit vector of [16 x i8]. The lower 4 bytes contain the converted
435/// values, or the corresponding bytes of \a __W where the mask bit is clear;
436/// the upper bytes are zeroed.
437static __inline__ __m128i __DEFAULT_FN_ATTRS128
438_mm_mask_cvts_ps_hf8(__m128i __W, __mmask8 __U, __m128 __A) {
439 return (__m128i)__builtin_ia32_vcvtps2hf8s_128_mask((__v4sf)__A, (__v16qi)__W,
440 (__mmask8)__U);
441}
442
443/// Convert packed single-precision (32-bit) floating-point elements in \a __A
444/// to packed HF8 (8-bit) floating-point elements with saturation, and store
445/// the results in a 128-bit vector using zeromask \a __U.
446///
447/// \headerfile <immintrin.h>
448///
449/// This intrinsic corresponds to the \c VCVTPS2HF8S instruction.
450///
451/// \param __U
452/// A 8-bit mask indicating which elements to write (zero otherwise).
453/// \param __A
454/// A 128-bit vector of [4 x float].
455/// \returns
456/// A 128-bit vector of [16 x i8]. The lower 4 bytes contain the converted
457/// values, or zero where the mask bit is clear; the upper bytes are zeroed.
458static __inline__ __m128i __DEFAULT_FN_ATTRS128
459_mm_maskz_cvts_ps_hf8(__mmask8 __U, __m128 __A) {
460 return (__m128i)__builtin_ia32_vcvtps2hf8s_128_mask(
461 (__v4sf)__A, (__v16qi)_mm_setzero_si128(), (__mmask8)__U);
462}
463
464/// Convert packed single-precision (32-bit) floating-point elements in \a __A
465/// to packed HF8 (8-bit) floating-point elements with saturation, and store
466/// the results in a 128-bit vector.
467///
468/// \headerfile <immintrin.h>
469///
470/// This intrinsic corresponds to the \c VCVTPS2HF8S instruction.
471///
472/// \param __A
473/// A 256-bit vector of [8 x float].
474/// \returns
475/// A 128-bit vector of [16 x i8] containing the converted values.
476static __inline__ __m128i __DEFAULT_FN_ATTRS256 _mm256_cvts_ps_hf8(__m256 __A) {
477 return (__m128i)__builtin_ia32_vcvtps2hf8s_256_mask(
478 (__v8sf)__A, (__v16qi)_mm_undefined_si128(), (__mmask8)-1);
479}
480
481/// Convert packed single-precision (32-bit) floating-point elements in \a __A
482/// to packed HF8 (8-bit) floating-point elements with saturation, and store
483/// the results in a 128-bit vector using writemask \a __U.
484///
485/// \headerfile <immintrin.h>
486///
487/// This intrinsic corresponds to the \c VCVTPS2HF8S instruction.
488///
489/// \param __W
490/// A 128-bit vector of [16 x i8] used for writemask.
491/// \param __U
492/// A 8-bit mask indicating which elements to write.
493/// \param __A
494/// A 256-bit vector of [8 x float].
495/// \returns
496/// A 128-bit vector of [16 x i8]. The lower 8 bytes contain the converted
497/// values, or the corresponding bytes of \a __W where the mask bit is clear;
498/// the upper bytes are zeroed.
499static __inline__ __m128i __DEFAULT_FN_ATTRS256
500_mm256_mask_cvts_ps_hf8(__m128i __W, __mmask8 __U, __m256 __A) {
501 return (__m128i)__builtin_ia32_vcvtps2hf8s_256_mask((__v8sf)__A, (__v16qi)__W,
502 (__mmask8)__U);
503}
504
505/// Convert packed single-precision (32-bit) floating-point elements in \a __A
506/// to packed HF8 (8-bit) floating-point elements with saturation, and store
507/// the results in a 128-bit vector using zeromask \a __U.
508///
509/// \headerfile <immintrin.h>
510///
511/// This intrinsic corresponds to the \c VCVTPS2HF8S instruction.
512///
513/// \param __U
514/// A 8-bit mask indicating which elements to write (zero otherwise).
515/// \param __A
516/// A 256-bit vector of [8 x float].
517/// \returns
518/// A 128-bit vector of [16 x i8]. The lower 8 bytes contain the converted
519/// values, or zero where the mask bit is clear; the upper bytes are zeroed.
520static __inline__ __m128i __DEFAULT_FN_ATTRS256
521_mm256_maskz_cvts_ps_hf8(__mmask8 __U, __m256 __A) {
522 return (__m128i)__builtin_ia32_vcvtps2hf8s_256_mask(
523 (__v8sf)__A, (__v16qi)_mm_setzero_si128(), (__mmask8)__U);
524}
525
526/// Convert packed single-precision (32-bit) floating-point elements in \a __A
527/// to packed HF8 (8-bit) floating-point elements using round-to-odd, and
528/// store the results in a 128-bit vector.
529///
530/// \headerfile <immintrin.h>
531///
532/// This intrinsic corresponds to the \c VCVTROPS2HF8 instruction.
533///
534/// \param __A
535/// A 128-bit vector of [4 x float].
536/// \returns
537/// A 128-bit vector of [16 x i8] containing the converted values.
538static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_cvtrops_hf8(__m128 __A) {
539 return (__m128i)__builtin_ia32_vcvtrops2hf8_128_mask(
540 (__v4sf)__A, (__v16qi)_mm_undefined_si128(), (__mmask8)-1);
541}
542
543/// Convert packed single-precision (32-bit) floating-point elements in \a __A
544/// to packed HF8 (8-bit) floating-point elements using round-to-odd, and
545/// store the results in a 128-bit vector using writemask \a __U.
546///
547/// \headerfile <immintrin.h>
548///
549/// This intrinsic corresponds to the \c VCVTROPS2HF8 instruction.
550///
551/// \param __W
552/// A 128-bit vector of [16 x i8] used for writemask.
553/// \param __U
554/// A 8-bit mask indicating which elements to write.
555/// \param __A
556/// A 128-bit vector of [4 x float].
557/// \returns
558/// A 128-bit vector of [16 x i8]. The lower 4 bytes contain the converted
559/// values, or the corresponding bytes of \a __W where the mask bit is clear;
560/// the upper bytes are zeroed.
561static __inline__ __m128i __DEFAULT_FN_ATTRS128
562_mm_mask_cvtrops_hf8(__m128i __W, __mmask8 __U, __m128 __A) {
563 return (__m128i)__builtin_ia32_vcvtrops2hf8_128_mask(
564 (__v4sf)__A, (__v16qi)__W, (__mmask8)__U);
565}
566
567/// Convert packed single-precision (32-bit) floating-point elements in \a __A
568/// to packed HF8 (8-bit) floating-point elements using round-to-odd, and
569/// store the results in a 128-bit vector using zeromask \a __U.
570///
571/// \headerfile <immintrin.h>
572///
573/// This intrinsic corresponds to the \c VCVTROPS2HF8 instruction.
574///
575/// \param __U
576/// A 8-bit mask indicating which elements to write (zero otherwise).
577/// \param __A
578/// A 128-bit vector of [4 x float].
579/// \returns
580/// A 128-bit vector of [16 x i8]. The lower 4 bytes contain the converted
581/// values, or zero where the mask bit is clear; the upper bytes are zeroed.
582static __inline__ __m128i __DEFAULT_FN_ATTRS128
583_mm_maskz_cvtrops_hf8(__mmask8 __U, __m128 __A) {
584 return (__m128i)__builtin_ia32_vcvtrops2hf8_128_mask(
585 (__v4sf)__A, (__v16qi)_mm_setzero_si128(), (__mmask8)__U);
586}
587
588/// Convert packed single-precision (32-bit) floating-point elements in \a __A
589/// to packed HF8 (8-bit) floating-point elements using round-to-odd, and
590/// store the results in a 128-bit vector.
591///
592/// \headerfile <immintrin.h>
593///
594/// This intrinsic corresponds to the \c VCVTROPS2HF8 instruction.
595///
596/// \param __A
597/// A 256-bit vector of [8 x float].
598/// \returns
599/// A 128-bit vector of [16 x i8] containing the converted values.
600static __inline__ __m128i __DEFAULT_FN_ATTRS256 _mm256_cvtrops_hf8(__m256 __A) {
601 return (__m128i)__builtin_ia32_vcvtrops2hf8_256_mask(
602 (__v8sf)__A, (__v16qi)_mm_undefined_si128(), (__mmask8)-1);
603}
604
605/// Convert packed single-precision (32-bit) floating-point elements in \a __A
606/// to packed HF8 (8-bit) floating-point elements using round-to-odd, and
607/// store the results in a 128-bit vector using writemask \a __U.
608///
609/// \headerfile <immintrin.h>
610///
611/// This intrinsic corresponds to the \c VCVTROPS2HF8 instruction.
612///
613/// \param __W
614/// A 128-bit vector of [16 x i8] used for writemask.
615/// \param __U
616/// A 8-bit mask indicating which elements to write.
617/// \param __A
618/// A 256-bit vector of [8 x float].
619/// \returns
620/// A 128-bit vector of [16 x i8]. The lower 8 bytes contain the converted
621/// values, or the corresponding bytes of \a __W where the mask bit is clear;
622/// the upper bytes are zeroed.
623static __inline__ __m128i __DEFAULT_FN_ATTRS256
624_mm256_mask_cvtrops_hf8(__m128i __W, __mmask8 __U, __m256 __A) {
625 return (__m128i)__builtin_ia32_vcvtrops2hf8_256_mask(
626 (__v8sf)__A, (__v16qi)__W, (__mmask8)__U);
627}
628
629/// Convert packed single-precision (32-bit) floating-point elements in \a __A
630/// to packed HF8 (8-bit) floating-point elements using round-to-odd, and
631/// store the results in a 128-bit vector using zeromask \a __U.
632///
633/// \headerfile <immintrin.h>
634///
635/// This intrinsic corresponds to the \c VCVTROPS2HF8 instruction.
636///
637/// \param __U
638/// A 8-bit mask indicating which elements to write (zero otherwise).
639/// \param __A
640/// A 256-bit vector of [8 x float].
641/// \returns
642/// A 128-bit vector of [16 x i8]. The lower 8 bytes contain the converted
643/// values, or zero where the mask bit is clear; the upper bytes are zeroed.
644static __inline__ __m128i __DEFAULT_FN_ATTRS256
645_mm256_maskz_cvtrops_hf8(__mmask8 __U, __m256 __A) {
646 return (__m128i)__builtin_ia32_vcvtrops2hf8_256_mask(
647 (__v8sf)__A, (__v16qi)_mm_setzero_si128(), (__mmask8)__U);
648}
649
650/// Convert packed single-precision (32-bit) floating-point elements in \a __A
651/// to packed HF8 (8-bit) floating-point elements using round-to-odd with
652/// saturation, and store the results in a 128-bit vector.
653///
654/// \headerfile <immintrin.h>
655///
656/// This intrinsic corresponds to the \c VCVTROPS2HF8S instruction.
657///
658/// \param __A
659/// A 128-bit vector of [4 x float].
660/// \returns
661/// A 128-bit vector of [16 x i8] containing the converted values.
662static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_cvts_rops_hf8(__m128 __A) {
663 return (__m128i)__builtin_ia32_vcvtrops2hf8s_128_mask(
664 (__v4sf)__A, (__v16qi)_mm_undefined_si128(), (__mmask8)-1);
665}
666
667/// Convert packed single-precision (32-bit) floating-point elements in \a __A
668/// to packed HF8 (8-bit) floating-point elements using round-to-odd with
669/// saturation, and store the results using writemask \a __U.
670///
671/// \headerfile <immintrin.h>
672///
673/// This intrinsic corresponds to the \c VCVTROPS2HF8S instruction.
674///
675/// \param __W
676/// A 128-bit vector of [16 x i8] used for writemask.
677/// \param __U
678/// A 8-bit mask indicating which elements to write.
679/// \param __A
680/// A 128-bit vector of [4 x float].
681/// \returns
682/// A 128-bit vector of [16 x i8]. The lower 4 bytes contain the converted
683/// values, or the corresponding bytes of \a __W where the mask bit is clear;
684/// the upper bytes are zeroed.
685static __inline__ __m128i __DEFAULT_FN_ATTRS128
686_mm_mask_cvts_rops_hf8(__m128i __W, __mmask8 __U, __m128 __A) {
687 return (__m128i)__builtin_ia32_vcvtrops2hf8s_128_mask(
688 (__v4sf)__A, (__v16qi)__W, (__mmask8)__U);
689}
690
691/// Convert packed single-precision (32-bit) floating-point elements in \a __A
692/// to packed HF8 (8-bit) floating-point elements using round-to-odd with
693/// saturation, and store the results using zeromask \a __U.
694///
695/// \headerfile <immintrin.h>
696///
697/// This intrinsic corresponds to the \c VCVTROPS2HF8S instruction.
698///
699/// \param __U
700/// A 8-bit mask indicating which elements to write (zero otherwise).
701/// \param __A
702/// A 128-bit vector of [4 x float].
703/// \returns
704/// A 128-bit vector of [16 x i8]. The lower 4 bytes contain the converted
705/// values, or zero where the mask bit is clear; the upper bytes are zeroed.
706static __inline__ __m128i __DEFAULT_FN_ATTRS128
707_mm_maskz_cvts_rops_hf8(__mmask8 __U, __m128 __A) {
708 return (__m128i)__builtin_ia32_vcvtrops2hf8s_128_mask(
709 (__v4sf)__A, (__v16qi)_mm_setzero_si128(), (__mmask8)__U);
710}
711
712/// Convert packed single-precision (32-bit) floating-point elements in \a __A
713/// to packed HF8 (8-bit) floating-point elements using round-to-odd with
714/// saturation, and store the results in a 128-bit vector.
715///
716/// \headerfile <immintrin.h>
717///
718/// This intrinsic corresponds to the \c VCVTROPS2HF8S instruction.
719///
720/// \param __A
721/// A 256-bit vector of [8 x float].
722/// \returns
723/// A 128-bit vector of [16 x i8] containing the converted values.
724static __inline__ __m128i __DEFAULT_FN_ATTRS256
725_mm256_cvts_rops_hf8(__m256 __A) {
726 return (__m128i)__builtin_ia32_vcvtrops2hf8s_256_mask(
727 (__v8sf)__A, (__v16qi)_mm_undefined_si128(), (__mmask8)-1);
728}
729
730/// Convert packed single-precision (32-bit) floating-point elements in \a __A
731/// to packed HF8 (8-bit) floating-point elements using round-to-odd with
732/// saturation, and store the results using writemask \a __U.
733///
734/// \headerfile <immintrin.h>
735///
736/// This intrinsic corresponds to the \c VCVTROPS2HF8S instruction.
737///
738/// \param __W
739/// A 128-bit vector of [16 x i8] used for writemask.
740/// \param __U
741/// A 8-bit mask indicating which elements to write.
742/// \param __A
743/// A 256-bit vector of [8 x float].
744/// \returns
745/// A 128-bit vector of [16 x i8]. The lower 8 bytes contain the converted
746/// values, or the corresponding bytes of \a __W where the mask bit is clear;
747/// the upper bytes are zeroed.
748static __inline__ __m128i __DEFAULT_FN_ATTRS256
749_mm256_mask_cvts_rops_hf8(__m128i __W, __mmask8 __U, __m256 __A) {
750 return (__m128i)__builtin_ia32_vcvtrops2hf8s_256_mask(
751 (__v8sf)__A, (__v16qi)__W, (__mmask8)__U);
752}
753
754/// Convert packed single-precision (32-bit) floating-point elements in \a __A
755/// to packed HF8 (8-bit) floating-point elements using round-to-odd with
756/// saturation, and store the results using zeromask \a __U.
757///
758/// \headerfile <immintrin.h>
759///
760/// This intrinsic corresponds to the \c VCVTROPS2HF8S instruction.
761///
762/// \param __U
763/// A 8-bit mask indicating which elements to write (zero otherwise).
764/// \param __A
765/// A 256-bit vector of [8 x float].
766/// \returns
767/// A 128-bit vector of [16 x i8]. The lower 8 bytes contain the converted
768/// values, or zero where the mask bit is clear; the upper bytes are zeroed.
769static __inline__ __m128i __DEFAULT_FN_ATTRS256
770_mm256_maskz_cvts_rops_hf8(__mmask8 __U, __m256 __A) {
771 return (__m128i)__builtin_ia32_vcvtrops2hf8s_256_mask(
772 (__v8sf)__A, (__v16qi)_mm_setzero_si128(), (__mmask8)__U);
773}
774
775/// Convert packed single-precision (32-bit) floating-point elements in \a __B
776/// to packed BF8 (8-bit) floating-point elements using bias values from
777/// \a __A, and store the results in a 128-bit vector.
778///
779/// \headerfile <immintrin.h>
780///
781/// This intrinsic corresponds to the \c VCVTBIASPS2BF8 instruction.
782///
783/// \param __A
784/// A 128-bit vector of [4 x i32] containing bias values.
785/// \param __B
786/// A 128-bit vector of [4 x float].
787/// \returns
788/// A 128-bit vector of [16 x i8] containing the converted values.
789static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_cvtbiasps_bf8(__m128i __A,
790 __m128 __B) {
791 return (__m128i)__builtin_ia32_vcvtbiasps2bf8_128_mask(
792 (__v4si)__A, (__v4sf)__B, (__v16qi)_mm_undefined_si128(), (__mmask8)-1);
793}
794
795/// Convert packed single-precision (32-bit) floating-point elements in \a __B
796/// to packed BF8 (8-bit) floating-point elements using bias values from
797/// \a __A, and store the results using writemask \a __U.
798///
799/// \headerfile <immintrin.h>
800///
801/// This intrinsic corresponds to the \c VCVTBIASPS2BF8 instruction.
802///
803/// \param __W
804/// A 128-bit vector of [16 x i8] used for writemask.
805/// \param __U
806/// A 8-bit mask indicating which elements to write.
807/// \param __A
808/// A 128-bit vector of [4 x i32] containing bias values.
809/// \param __B
810/// A 128-bit vector of [4 x float].
811/// \returns
812/// A 128-bit vector of [16 x i8]. The lower 4 bytes contain the converted
813/// values, or the corresponding bytes of \a __W where the mask bit is clear;
814/// the upper bytes are zeroed.
815static __inline__ __m128i __DEFAULT_FN_ATTRS128
816_mm_mask_cvtbiasps_bf8(__m128i __W, __mmask8 __U, __m128i __A, __m128 __B) {
817 return (__m128i)__builtin_ia32_vcvtbiasps2bf8_128_mask(
818 (__v4si)__A, (__v4sf)__B, (__v16qi)__W, (__mmask8)__U);
819}
820
821/// Convert packed single-precision (32-bit) floating-point elements in \a __B
822/// to packed BF8 (8-bit) floating-point elements using bias values from
823/// \a __A, and store the results using zeromask \a __U.
824///
825/// \headerfile <immintrin.h>
826///
827/// This intrinsic corresponds to the \c VCVTBIASPS2BF8 instruction.
828///
829/// \param __U
830/// A 8-bit mask indicating which elements to write (zero otherwise).
831/// \param __A
832/// A 128-bit vector of [4 x i32] containing bias values.
833/// \param __B
834/// A 128-bit vector of [4 x float].
835/// \returns
836/// A 128-bit vector of [16 x i8]. The lower 4 bytes contain the converted
837/// values, or zero where the mask bit is clear; the upper bytes are zeroed.
838static __inline__ __m128i __DEFAULT_FN_ATTRS128
839_mm_maskz_cvtbiasps_bf8(__mmask8 __U, __m128i __A, __m128 __B) {
840 return (__m128i)__builtin_ia32_vcvtbiasps2bf8_128_mask(
841 (__v4si)__A, (__v4sf)__B, (__v16qi)_mm_setzero_si128(), (__mmask8)__U);
842}
843
844/// Convert packed single-precision (32-bit) floating-point elements in \a __B
845/// to packed BF8 (8-bit) floating-point elements using bias values from
846/// \a __A, and store the results in a 128-bit vector.
847///
848/// \headerfile <immintrin.h>
849///
850/// This intrinsic corresponds to the \c VCVTBIASPS2BF8 instruction.
851///
852/// \param __A
853/// A 256-bit vector of [8 x i32] containing bias values.
854/// \param __B
855/// A 256-bit vector of [8 x float].
856/// \returns
857/// A 128-bit vector of [16 x i8] containing the converted values.
858static __inline__ __m128i __DEFAULT_FN_ATTRS256
859_mm256_cvtbiasps_bf8(__m256i __A, __m256 __B) {
860 return (__m128i)__builtin_ia32_vcvtbiasps2bf8_256_mask(
861 (__v8si)__A, (__v8sf)__B, (__v16qi)_mm_undefined_si128(), (__mmask8)-1);
862}
863
864/// Convert packed single-precision (32-bit) floating-point elements in \a __B
865/// to packed BF8 (8-bit) floating-point elements using bias values from
866/// \a __A, and store the results using writemask \a __U.
867///
868/// \headerfile <immintrin.h>
869///
870/// This intrinsic corresponds to the \c VCVTBIASPS2BF8 instruction.
871///
872/// \param __W
873/// A 128-bit vector of [16 x i8] used for writemask.
874/// \param __U
875/// A 8-bit mask indicating which elements to write.
876/// \param __A
877/// A 256-bit vector of [8 x i32] containing bias values.
878/// \param __B
879/// A 256-bit vector of [8 x float].
880/// \returns
881/// A 128-bit vector of [16 x i8]. The lower 8 bytes contain the converted
882/// values, or the corresponding bytes of \a __W where the mask bit is clear;
883/// the upper bytes are zeroed.
884static __inline__ __m128i __DEFAULT_FN_ATTRS256
885_mm256_mask_cvtbiasps_bf8(__m128i __W, __mmask8 __U, __m256i __A, __m256 __B) {
886 return (__m128i)__builtin_ia32_vcvtbiasps2bf8_256_mask(
887 (__v8si)__A, (__v8sf)__B, (__v16qi)__W, (__mmask8)__U);
888}
889
890/// Convert packed single-precision (32-bit) floating-point elements in \a __B
891/// to packed BF8 (8-bit) floating-point elements using bias values from
892/// \a __A, and store the results using zeromask \a __U.
893///
894/// \headerfile <immintrin.h>
895///
896/// This intrinsic corresponds to the \c VCVTBIASPS2BF8 instruction.
897///
898/// \param __U
899/// A 8-bit mask indicating which elements to write (zero otherwise).
900/// \param __A
901/// A 256-bit vector of [8 x i32] containing bias values.
902/// \param __B
903/// A 256-bit vector of [8 x float].
904/// \returns
905/// A 128-bit vector of [16 x i8]. The lower 8 bytes contain the converted
906/// values, or zero where the mask bit is clear; the upper bytes are zeroed.
907static __inline__ __m128i __DEFAULT_FN_ATTRS256
908_mm256_maskz_cvtbiasps_bf8(__mmask8 __U, __m256i __A, __m256 __B) {
909 return (__m128i)__builtin_ia32_vcvtbiasps2bf8_256_mask(
910 (__v8si)__A, (__v8sf)__B, (__v16qi)_mm_setzero_si128(), (__mmask8)__U);
911}
912
913/// Convert packed single-precision (32-bit) floating-point elements in \a __B
914/// to packed BF8 (8-bit) floating-point elements with saturation using bias
915/// values from \a __A, and store the results in a 128-bit vector.
916///
917/// \headerfile <immintrin.h>
918///
919/// This intrinsic corresponds to the \c VCVTBIASPS2BF8S instruction.
920///
921/// \param __A
922/// A 128-bit vector of [4 x i32] containing bias values.
923/// \param __B
924/// A 128-bit vector of [4 x float].
925/// \returns
926/// A 128-bit vector of [16 x i8] containing the converted values.
927static __inline__ __m128i __DEFAULT_FN_ATTRS128
928_mm_cvts_biasps_bf8(__m128i __A, __m128 __B) {
929 return (__m128i)__builtin_ia32_vcvtbiasps2bf8s_128_mask(
930 (__v4si)__A, (__v4sf)__B, (__v16qi)_mm_undefined_si128(), (__mmask8)-1);
931}
932
933/// Convert packed single-precision (32-bit) floating-point elements in \a __B
934/// to packed BF8 (8-bit) floating-point elements with saturation using bias
935/// values from \a __A, and store the results using writemask \a __U.
936///
937/// \headerfile <immintrin.h>
938///
939/// This intrinsic corresponds to the \c VCVTBIASPS2BF8S instruction.
940///
941/// \param __W
942/// A 128-bit vector of [16 x i8] used for writemask.
943/// \param __U
944/// A 8-bit mask indicating which elements to write.
945/// \param __A
946/// A 128-bit vector of [4 x i32] containing bias values.
947/// \param __B
948/// A 128-bit vector of [4 x float].
949/// \returns
950/// A 128-bit vector of [16 x i8]. The lower 4 bytes contain the converted
951/// values, or the corresponding bytes of \a __W where the mask bit is clear;
952/// the upper bytes are zeroed.
953static __inline__ __m128i __DEFAULT_FN_ATTRS128
954_mm_mask_cvts_biasps_bf8(__m128i __W, __mmask8 __U, __m128i __A, __m128 __B) {
955 return (__m128i)__builtin_ia32_vcvtbiasps2bf8s_128_mask(
956 (__v4si)__A, (__v4sf)__B, (__v16qi)__W, (__mmask8)__U);
957}
958
959/// Convert packed single-precision (32-bit) floating-point elements in \a __B
960/// to packed BF8 (8-bit) floating-point elements with saturation using bias
961/// values from \a __A, and store the results using zeromask \a __U.
962///
963/// \headerfile <immintrin.h>
964///
965/// This intrinsic corresponds to the \c VCVTBIASPS2BF8S instruction.
966///
967/// \param __U
968/// A 8-bit mask indicating which elements to write (zero otherwise).
969/// \param __A
970/// A 128-bit vector of [4 x i32] containing bias values.
971/// \param __B
972/// A 128-bit vector of [4 x float].
973/// \returns
974/// A 128-bit vector of [16 x i8]. The lower 4 bytes contain the converted
975/// values, or zero where the mask bit is clear; the upper bytes are zeroed.
976static __inline__ __m128i __DEFAULT_FN_ATTRS128
977_mm_maskz_cvts_biasps_bf8(__mmask8 __U, __m128i __A, __m128 __B) {
978 return (__m128i)__builtin_ia32_vcvtbiasps2bf8s_128_mask(
979 (__v4si)__A, (__v4sf)__B, (__v16qi)_mm_setzero_si128(), (__mmask8)__U);
980}
981
982/// Convert packed single-precision (32-bit) floating-point elements in \a __B
983/// to packed BF8 (8-bit) floating-point elements with saturation using bias
984/// values from \a __A, and store the results in a 128-bit vector.
985///
986/// \headerfile <immintrin.h>
987///
988/// This intrinsic corresponds to the \c VCVTBIASPS2BF8S instruction.
989///
990/// \param __A
991/// A 256-bit vector of [8 x i32] containing bias values.
992/// \param __B
993/// A 256-bit vector of [8 x float].
994/// \returns
995/// A 128-bit vector of [16 x i8] containing the converted values.
996static __inline__ __m128i __DEFAULT_FN_ATTRS256
997_mm256_cvts_biasps_bf8(__m256i __A, __m256 __B) {
998 return (__m128i)__builtin_ia32_vcvtbiasps2bf8s_256_mask(
999 (__v8si)__A, (__v8sf)__B, (__v16qi)_mm_undefined_si128(), (__mmask8)-1);
1000}
1001
1002/// Convert packed single-precision (32-bit) floating-point elements in \a __B
1003/// to packed BF8 (8-bit) floating-point elements with saturation using bias
1004/// values from \a __A, and store the results using writemask \a __U.
1005///
1006/// \headerfile <immintrin.h>
1007///
1008/// This intrinsic corresponds to the \c VCVTBIASPS2BF8S instruction.
1009///
1010/// \param __W
1011/// A 128-bit vector of [16 x i8] used for writemask.
1012/// \param __U
1013/// A 8-bit mask indicating which elements to write.
1014/// \param __A
1015/// A 256-bit vector of [8 x i32] containing bias values.
1016/// \param __B
1017/// A 256-bit vector of [8 x float].
1018/// \returns
1019/// A 128-bit vector of [16 x i8]. The lower 8 bytes contain the converted
1020/// values, or the corresponding bytes of \a __W where the mask bit is clear;
1021/// the upper bytes are zeroed.
1022static __inline__ __m128i __DEFAULT_FN_ATTRS256 _mm256_mask_cvts_biasps_bf8(
1023 __m128i __W, __mmask8 __U, __m256i __A, __m256 __B) {
1024 return (__m128i)__builtin_ia32_vcvtbiasps2bf8s_256_mask(
1025 (__v8si)__A, (__v8sf)__B, (__v16qi)__W, (__mmask8)__U);
1026}
1027
1028/// Convert packed single-precision (32-bit) floating-point elements in \a __B
1029/// to packed BF8 (8-bit) floating-point elements with saturation using bias
1030/// values from \a __A, and store the results using zeromask \a __U.
1031///
1032/// \headerfile <immintrin.h>
1033///
1034/// This intrinsic corresponds to the \c VCVTBIASPS2BF8S instruction.
1035///
1036/// \param __U
1037/// A 8-bit mask indicating which elements to write (zero otherwise).
1038/// \param __A
1039/// A 256-bit vector of [8 x i32] containing bias values.
1040/// \param __B
1041/// A 256-bit vector of [8 x float].
1042/// \returns
1043/// A 128-bit vector of [16 x i8]. The lower 8 bytes contain the converted
1044/// values, or zero where the mask bit is clear; the upper bytes are zeroed.
1045static __inline__ __m128i __DEFAULT_FN_ATTRS256
1046_mm256_maskz_cvts_biasps_bf8(__mmask8 __U, __m256i __A, __m256 __B) {
1047 return (__m128i)__builtin_ia32_vcvtbiasps2bf8s_256_mask(
1048 (__v8si)__A, (__v8sf)__B, (__v16qi)_mm_setzero_si128(), (__mmask8)__U);
1049}
1050
1051/// Convert packed single-precision (32-bit) floating-point elements in \a __B
1052/// to packed HF8 (8-bit) floating-point elements using bias values from
1053/// \a __A, and store the results in a 128-bit vector.
1054///
1055/// \headerfile <immintrin.h>
1056///
1057/// This intrinsic corresponds to the \c VCVTBIASPS2HF8 instruction.
1058///
1059/// \param __A
1060/// A 128-bit vector of [4 x i32] containing bias values.
1061/// \param __B
1062/// A 128-bit vector of [4 x float].
1063/// \returns
1064/// A 128-bit vector of [16 x i8] containing the converted values.
1065static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_cvtbiasps_hf8(__m128i __A,
1066 __m128 __B) {
1067 return (__m128i)__builtin_ia32_vcvtbiasps2hf8_128_mask(
1068 (__v4si)__A, (__v4sf)__B, (__v16qi)_mm_undefined_si128(), (__mmask8)-1);
1069}
1070
1071/// Convert packed single-precision (32-bit) floating-point elements in \a __B
1072/// to packed HF8 (8-bit) floating-point elements using bias values from
1073/// \a __A, and store the results using writemask \a __U.
1074///
1075/// \headerfile <immintrin.h>
1076///
1077/// This intrinsic corresponds to the \c VCVTBIASPS2HF8 instruction.
1078///
1079/// \param __W
1080/// A 128-bit vector of [16 x i8] used for writemask.
1081/// \param __U
1082/// A 8-bit mask indicating which elements to write.
1083/// \param __A
1084/// A 128-bit vector of [4 x i32] containing bias values.
1085/// \param __B
1086/// A 128-bit vector of [4 x float].
1087/// \returns
1088/// A 128-bit vector of [16 x i8]. The lower 4 bytes contain the converted
1089/// values, or the corresponding bytes of \a __W where the mask bit is clear;
1090/// the upper bytes are zeroed.
1091static __inline__ __m128i __DEFAULT_FN_ATTRS128
1092_mm_mask_cvtbiasps_hf8(__m128i __W, __mmask8 __U, __m128i __A, __m128 __B) {
1093 return (__m128i)__builtin_ia32_vcvtbiasps2hf8_128_mask(
1094 (__v4si)__A, (__v4sf)__B, (__v16qi)__W, (__mmask8)__U);
1095}
1096
1097/// Convert packed single-precision (32-bit) floating-point elements in \a __B
1098/// to packed HF8 (8-bit) floating-point elements using bias values from
1099/// \a __A, and store the results using zeromask \a __U.
1100///
1101/// \headerfile <immintrin.h>
1102///
1103/// This intrinsic corresponds to the \c VCVTBIASPS2HF8 instruction.
1104///
1105/// \param __U
1106/// A 8-bit mask indicating which elements to write (zero otherwise).
1107/// \param __A
1108/// A 128-bit vector of [4 x i32] containing bias values.
1109/// \param __B
1110/// A 128-bit vector of [4 x float].
1111/// \returns
1112/// A 128-bit vector of [16 x i8]. The lower 4 bytes contain the converted
1113/// values, or zero where the mask bit is clear; the upper bytes are zeroed.
1114static __inline__ __m128i __DEFAULT_FN_ATTRS128
1115_mm_maskz_cvtbiasps_hf8(__mmask8 __U, __m128i __A, __m128 __B) {
1116 return (__m128i)__builtin_ia32_vcvtbiasps2hf8_128_mask(
1117 (__v4si)__A, (__v4sf)__B, (__v16qi)_mm_setzero_si128(), (__mmask8)__U);
1118}
1119
1120/// Convert packed single-precision (32-bit) floating-point elements in \a __B
1121/// to packed HF8 (8-bit) floating-point elements using bias values from
1122/// \a __A, and store the results in a 128-bit vector.
1123///
1124/// \headerfile <immintrin.h>
1125///
1126/// This intrinsic corresponds to the \c VCVTBIASPS2HF8 instruction.
1127///
1128/// \param __A
1129/// A 256-bit vector of [8 x i32] containing bias values.
1130/// \param __B
1131/// A 256-bit vector of [8 x float].
1132/// \returns
1133/// A 128-bit vector of [16 x i8] containing the converted values.
1134static __inline__ __m128i __DEFAULT_FN_ATTRS256
1135_mm256_cvtbiasps_hf8(__m256i __A, __m256 __B) {
1136 return (__m128i)__builtin_ia32_vcvtbiasps2hf8_256_mask(
1137 (__v8si)__A, (__v8sf)__B, (__v16qi)_mm_undefined_si128(), (__mmask8)-1);
1138}
1139
1140/// Convert packed single-precision (32-bit) floating-point elements in \a __B
1141/// to packed HF8 (8-bit) floating-point elements using bias values from
1142/// \a __A, and store the results using writemask \a __U.
1143///
1144/// \headerfile <immintrin.h>
1145///
1146/// This intrinsic corresponds to the \c VCVTBIASPS2HF8 instruction.
1147///
1148/// \param __W
1149/// A 128-bit vector of [16 x i8] used for writemask.
1150/// \param __U
1151/// A 8-bit mask indicating which elements to write.
1152/// \param __A
1153/// A 256-bit vector of [8 x i32] containing bias values.
1154/// \param __B
1155/// A 256-bit vector of [8 x float].
1156/// \returns
1157/// A 128-bit vector of [16 x i8]. The lower 8 bytes contain the converted
1158/// values, or the corresponding bytes of \a __W where the mask bit is clear;
1159/// the upper bytes are zeroed.
1160static __inline__ __m128i __DEFAULT_FN_ATTRS256
1161_mm256_mask_cvtbiasps_hf8(__m128i __W, __mmask8 __U, __m256i __A, __m256 __B) {
1162 return (__m128i)__builtin_ia32_vcvtbiasps2hf8_256_mask(
1163 (__v8si)__A, (__v8sf)__B, (__v16qi)__W, (__mmask8)__U);
1164}
1165
1166/// Convert packed single-precision (32-bit) floating-point elements in \a __B
1167/// to packed HF8 (8-bit) floating-point elements using bias values from
1168/// \a __A, and store the results using zeromask \a __U.
1169///
1170/// \headerfile <immintrin.h>
1171///
1172/// This intrinsic corresponds to the \c VCVTBIASPS2HF8 instruction.
1173///
1174/// \param __U
1175/// A 8-bit mask indicating which elements to write (zero otherwise).
1176/// \param __A
1177/// A 256-bit vector of [8 x i32] containing bias values.
1178/// \param __B
1179/// A 256-bit vector of [8 x float].
1180/// \returns
1181/// A 128-bit vector of [16 x i8]. The lower 8 bytes contain the converted
1182/// values, or zero where the mask bit is clear; the upper bytes are zeroed.
1183static __inline__ __m128i __DEFAULT_FN_ATTRS256
1184_mm256_maskz_cvtbiasps_hf8(__mmask8 __U, __m256i __A, __m256 __B) {
1185 return (__m128i)__builtin_ia32_vcvtbiasps2hf8_256_mask(
1186 (__v8si)__A, (__v8sf)__B, (__v16qi)_mm_setzero_si128(), (__mmask8)__U);
1187}
1188
1189/// Convert packed single-precision (32-bit) floating-point elements in \a __B
1190/// to packed HF8 (8-bit) floating-point elements with saturation using bias
1191/// values from \a __A, and store the results in a 128-bit vector.
1192///
1193/// \headerfile <immintrin.h>
1194///
1195/// This intrinsic corresponds to the \c VCVTBIASPS2HF8S instruction.
1196///
1197/// \param __A
1198/// A 128-bit vector of [4 x i32] containing bias values.
1199/// \param __B
1200/// A 128-bit vector of [4 x float].
1201/// \returns
1202/// A 128-bit vector of [16 x i8] containing the converted values.
1203static __inline__ __m128i __DEFAULT_FN_ATTRS128
1204_mm_cvts_biasps_hf8(__m128i __A, __m128 __B) {
1205 return (__m128i)__builtin_ia32_vcvtbiasps2hf8s_128_mask(
1206 (__v4si)__A, (__v4sf)__B, (__v16qi)_mm_undefined_si128(), (__mmask8)-1);
1207}
1208
1209/// Convert packed single-precision (32-bit) floating-point elements in \a __B
1210/// to packed HF8 (8-bit) floating-point elements with saturation using bias
1211/// values from \a __A, and store the results using writemask \a __U.
1212///
1213/// \headerfile <immintrin.h>
1214///
1215/// This intrinsic corresponds to the \c VCVTBIASPS2HF8S instruction.
1216///
1217/// \param __W
1218/// A 128-bit vector of [16 x i8] used for writemask.
1219/// \param __U
1220/// A 8-bit mask indicating which elements to write.
1221/// \param __A
1222/// A 128-bit vector of [4 x i32] containing bias values.
1223/// \param __B
1224/// A 128-bit vector of [4 x float].
1225/// \returns
1226/// A 128-bit vector of [16 x i8]. The lower 4 bytes contain the converted
1227/// values, or the corresponding bytes of \a __W where the mask bit is clear;
1228/// the upper bytes are zeroed.
1229static __inline__ __m128i __DEFAULT_FN_ATTRS128
1230_mm_mask_cvts_biasps_hf8(__m128i __W, __mmask8 __U, __m128i __A, __m128 __B) {
1231 return (__m128i)__builtin_ia32_vcvtbiasps2hf8s_128_mask(
1232 (__v4si)__A, (__v4sf)__B, (__v16qi)__W, (__mmask8)__U);
1233}
1234
1235/// Convert packed single-precision (32-bit) floating-point elements in \a __B
1236/// to packed HF8 (8-bit) floating-point elements with saturation using bias
1237/// values from \a __A, and store the results using zeromask \a __U.
1238///
1239/// \headerfile <immintrin.h>
1240///
1241/// This intrinsic corresponds to the \c VCVTBIASPS2HF8S instruction.
1242///
1243/// \param __U
1244/// A 8-bit mask indicating which elements to write (zero otherwise).
1245/// \param __A
1246/// A 128-bit vector of [4 x i32] containing bias values.
1247/// \param __B
1248/// A 128-bit vector of [4 x float].
1249/// \returns
1250/// A 128-bit vector of [16 x i8]. The lower 4 bytes contain the converted
1251/// values, or zero where the mask bit is clear; the upper bytes are zeroed.
1252static __inline__ __m128i __DEFAULT_FN_ATTRS128
1253_mm_maskz_cvts_biasps_hf8(__mmask8 __U, __m128i __A, __m128 __B) {
1254 return (__m128i)__builtin_ia32_vcvtbiasps2hf8s_128_mask(
1255 (__v4si)__A, (__v4sf)__B, (__v16qi)_mm_setzero_si128(), (__mmask8)__U);
1256}
1257
1258/// Convert packed single-precision (32-bit) floating-point elements in \a __B
1259/// to packed HF8 (8-bit) floating-point elements with saturation using bias
1260/// values from \a __A, and store the results in a 128-bit vector.
1261///
1262/// \headerfile <immintrin.h>
1263///
1264/// This intrinsic corresponds to the \c VCVTBIASPS2HF8S instruction.
1265///
1266/// \param __A
1267/// A 256-bit vector of [8 x i32] containing bias values.
1268/// \param __B
1269/// A 256-bit vector of [8 x float].
1270/// \returns
1271/// A 128-bit vector of [16 x i8] containing the converted values.
1272static __inline__ __m128i __DEFAULT_FN_ATTRS256
1273_mm256_cvts_biasps_hf8(__m256i __A, __m256 __B) {
1274 return (__m128i)__builtin_ia32_vcvtbiasps2hf8s_256_mask(
1275 (__v8si)__A, (__v8sf)__B, (__v16qi)_mm_undefined_si128(), (__mmask8)-1);
1276}
1277
1278/// Convert packed single-precision (32-bit) floating-point elements in \a __B
1279/// to packed HF8 (8-bit) floating-point elements with saturation using bias
1280/// values from \a __A, and store the results using writemask \a __U.
1281///
1282/// \headerfile <immintrin.h>
1283///
1284/// This intrinsic corresponds to the \c VCVTBIASPS2HF8S instruction.
1285///
1286/// \param __W
1287/// A 128-bit vector of [16 x i8] used for writemask.
1288/// \param __U
1289/// A 8-bit mask indicating which elements to write.
1290/// \param __A
1291/// A 256-bit vector of [8 x i32] containing bias values.
1292/// \param __B
1293/// A 256-bit vector of [8 x float].
1294/// \returns
1295/// A 128-bit vector of [16 x i8]. The lower 8 bytes contain the converted
1296/// values, or the corresponding bytes of \a __W where the mask bit is clear;
1297/// the upper bytes are zeroed.
1298static __inline__ __m128i __DEFAULT_FN_ATTRS256 _mm256_mask_cvts_biasps_hf8(
1299 __m128i __W, __mmask8 __U, __m256i __A, __m256 __B) {
1300 return (__m128i)__builtin_ia32_vcvtbiasps2hf8s_256_mask(
1301 (__v8si)__A, (__v8sf)__B, (__v16qi)__W, (__mmask8)__U);
1302}
1303
1304/// Convert packed single-precision (32-bit) floating-point elements in \a __B
1305/// to packed HF8 (8-bit) floating-point elements with saturation using bias
1306/// values from \a __A, and store the results using zeromask \a __U.
1307///
1308/// \headerfile <immintrin.h>
1309///
1310/// This intrinsic corresponds to the \c VCVTBIASPS2HF8S instruction.
1311///
1312/// \param __U
1313/// A 8-bit mask indicating which elements to write (zero otherwise).
1314/// \param __A
1315/// A 256-bit vector of [8 x i32] containing bias values.
1316/// \param __B
1317/// A 256-bit vector of [8 x float].
1318/// \returns
1319/// A 128-bit vector of [16 x i8]. The lower 8 bytes contain the converted
1320/// values, or zero where the mask bit is clear; the upper bytes are zeroed.
1321static __inline__ __m128i __DEFAULT_FN_ATTRS256
1322_mm256_maskz_cvts_biasps_hf8(__mmask8 __U, __m256i __A, __m256 __B) {
1323 return (__m128i)__builtin_ia32_vcvtbiasps2hf8s_256_mask(
1324 (__v8si)__A, (__v8sf)__B, (__v16qi)_mm_setzero_si128(), (__mmask8)__U);
1325}
1326
1327/// Convert packed BF8 (8-bit) floating-point elements in \a __A to packed
1328/// single-precision (32-bit) floating-point elements, and store the results
1329/// in a 128-bit vector.
1330///
1331/// \headerfile <immintrin.h>
1332///
1333/// This intrinsic corresponds to the \c VCVTBF82PS instruction.
1334///
1335/// \param __A
1336/// A 128-bit vector of [16 x i8] containing BF8 values.
1337/// \returns
1338/// A 128-bit vector of [4 x float] containing the converted values.
1339static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_cvtbf8_ps(__m128i __A) {
1340 return (__m128)__builtin_ia32_vcvtbf82ps_128((__v16qi)__A);
1341}
1342
1343/// Convert packed BF8 (8-bit) floating-point elements in \a __A to packed
1344/// single-precision (32-bit) floating-point elements, and store the results
1345/// using writemask \a __U.
1346///
1347/// \headerfile <immintrin.h>
1348///
1349/// This intrinsic corresponds to the \c VCVTBF82PS instruction.
1350///
1351/// \param __W
1352/// A 128-bit vector of [4 x float] used for writemask.
1353/// \param __U
1354/// A 8-bit mask indicating which elements to write.
1355/// \param __A
1356/// A 128-bit vector of [16 x i8] containing BF8 values.
1357/// \returns
1358/// A 128-bit vector of [4 x float] containing the converted values.
1359static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_mask_cvtbf8_ps(__m128 __W,
1360 __mmask8 __U,
1361 __m128i __A) {
1362 return (__m128)__builtin_ia32_selectps_128(
1363 (__mmask8)__U, (__v4sf)_mm_cvtbf8_ps(__A), (__v4sf)__W);
1364}
1365
1366/// Convert packed BF8 (8-bit) floating-point elements in \a __A to packed
1367/// single-precision (32-bit) floating-point elements, and store the results
1368/// using zeromask \a __U.
1369///
1370/// \headerfile <immintrin.h>
1371///
1372/// This intrinsic corresponds to the \c VCVTBF82PS instruction.
1373///
1374/// \param __U
1375/// A 8-bit mask indicating which elements to write (zero otherwise).
1376/// \param __A
1377/// A 128-bit vector of [16 x i8] containing BF8 values.
1378/// \returns
1379/// A 128-bit vector of [4 x float] containing the converted values.
1380static __inline__ __m128 __DEFAULT_FN_ATTRS128
1381_mm_maskz_cvtbf8_ps(__mmask8 __U, __m128i __A) {
1382 return (__m128)__builtin_ia32_selectps_128(
1383 (__mmask8)__U, (__v4sf)_mm_cvtbf8_ps(__A), (__v4sf)_mm_setzero_ps());
1384}
1385
1386/// Convert packed BF8 (8-bit) floating-point elements in \a __A to packed
1387/// single-precision (32-bit) floating-point elements, and store the results
1388/// in a 256-bit vector.
1389///
1390/// \headerfile <immintrin.h>
1391///
1392/// This intrinsic corresponds to the \c VCVTBF82PS instruction.
1393///
1394/// \param __A
1395/// A 128-bit vector of [16 x i8] containing BF8 values.
1396/// \returns
1397/// A 256-bit vector of [8 x float] containing the converted values.
1398static __inline__ __m256 __DEFAULT_FN_ATTRS256 _mm256_cvtbf8_ps(__m128i __A) {
1399 return (__m256)__builtin_ia32_vcvtbf82ps_256((__v16qi)__A);
1400}
1401
1402/// Convert packed BF8 (8-bit) floating-point elements in \a __A to packed
1403/// single-precision (32-bit) floating-point elements, and store the results
1404/// using writemask \a __U.
1405///
1406/// \headerfile <immintrin.h>
1407///
1408/// This intrinsic corresponds to the \c VCVTBF82PS instruction.
1409///
1410/// \param __W
1411/// A 256-bit vector of [8 x float] used for writemask.
1412/// \param __U
1413/// A 8-bit mask indicating which elements to write.
1414/// \param __A
1415/// A 128-bit vector of [16 x i8] containing BF8 values.
1416/// \returns
1417/// A 256-bit vector of [8 x float] containing the converted values.
1418static __inline__ __m256 __DEFAULT_FN_ATTRS256
1419_mm256_mask_cvtbf8_ps(__m256 __W, __mmask8 __U, __m128i __A) {
1420 return (__m256)__builtin_ia32_selectps_256(
1421 (__mmask8)__U, (__v8sf)_mm256_cvtbf8_ps(__A), (__v8sf)__W);
1422}
1423
1424/// Convert packed BF8 (8-bit) floating-point elements in \a __A to packed
1425/// single-precision (32-bit) floating-point elements, and store the results
1426/// using zeromask \a __U.
1427///
1428/// \headerfile <immintrin.h>
1429///
1430/// This intrinsic corresponds to the \c VCVTBF82PS instruction.
1431///
1432/// \param __U
1433/// A 8-bit mask indicating which elements to write (zero otherwise).
1434/// \param __A
1435/// A 128-bit vector of [16 x i8] containing BF8 values.
1436/// \returns
1437/// A 256-bit vector of [8 x float] containing the converted values.
1438static __inline__ __m256 __DEFAULT_FN_ATTRS256
1439_mm256_maskz_cvtbf8_ps(__mmask8 __U, __m128i __A) {
1440 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
1441 (__v8sf)_mm256_cvtbf8_ps(__A),
1442 (__v8sf)_mm256_setzero_ps());
1443}
1444
1445/// Convert packed HF8 (8-bit) floating-point elements in \a __A to packed
1446/// single-precision (32-bit) floating-point elements, and store the results
1447/// in a 128-bit vector.
1448///
1449/// \headerfile <immintrin.h>
1450///
1451/// This intrinsic corresponds to the \c VCVTHF82PS instruction.
1452///
1453/// \param __A
1454/// A 128-bit vector of [16 x i8] containing HF8 values.
1455/// \returns
1456/// A 128-bit vector of [4 x float] containing the converted values.
1457static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_cvthf8_ps(__m128i __A) {
1458 return (__m128)__builtin_ia32_vcvthf82ps_128((__v16qi)__A);
1459}
1460
1461/// Convert packed HF8 (8-bit) floating-point elements in \a __A to packed
1462/// single-precision (32-bit) floating-point elements, and store the results
1463/// using writemask \a __U.
1464///
1465/// \headerfile <immintrin.h>
1466///
1467/// This intrinsic corresponds to the \c VCVTHF82PS instruction.
1468///
1469/// \param __W
1470/// A 128-bit vector of [4 x float] used for writemask.
1471/// \param __U
1472/// A 8-bit mask indicating which elements to write.
1473/// \param __A
1474/// A 128-bit vector of [16 x i8] containing HF8 values.
1475/// \returns
1476/// A 128-bit vector of [4 x float] containing the converted values.
1477static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_mask_cvthf8_ps(__m128 __W,
1478 __mmask8 __U,
1479 __m128i __A) {
1480 return (__m128)__builtin_ia32_selectps_128(
1481 (__mmask8)__U, (__v4sf)_mm_cvthf8_ps(__A), (__v4sf)__W);
1482}
1483
1484/// Convert packed HF8 (8-bit) floating-point elements in \a __A to packed
1485/// single-precision (32-bit) floating-point elements, and store the results
1486/// using zeromask \a __U.
1487///
1488/// \headerfile <immintrin.h>
1489///
1490/// This intrinsic corresponds to the \c VCVTHF82PS instruction.
1491///
1492/// \param __U
1493/// A 8-bit mask indicating which elements to write (zero otherwise).
1494/// \param __A
1495/// A 128-bit vector of [16 x i8] containing HF8 values.
1496/// \returns
1497/// A 128-bit vector of [4 x float] containing the converted values.
1498static __inline__ __m128 __DEFAULT_FN_ATTRS128
1499_mm_maskz_cvthf8_ps(__mmask8 __U, __m128i __A) {
1500 return (__m128)__builtin_ia32_selectps_128(
1501 (__mmask8)__U, (__v4sf)_mm_cvthf8_ps(__A), (__v4sf)_mm_setzero_ps());
1502}
1503
1504/// Convert packed HF8 (8-bit) floating-point elements in \a __A to packed
1505/// single-precision (32-bit) floating-point elements, and store the results
1506/// in a 256-bit vector.
1507///
1508/// \headerfile <immintrin.h>
1509///
1510/// This intrinsic corresponds to the \c VCVTHF82PS instruction.
1511///
1512/// \param __A
1513/// A 128-bit vector of [16 x i8] containing HF8 values.
1514/// \returns
1515/// A 256-bit vector of [8 x float] containing the converted values.
1516static __inline__ __m256 __DEFAULT_FN_ATTRS256 _mm256_cvthf8_ps(__m128i __A) {
1517 return (__m256)__builtin_ia32_vcvthf82ps_256((__v16qi)__A);
1518}
1519
1520/// Convert packed HF8 (8-bit) floating-point elements in \a __A to packed
1521/// single-precision (32-bit) floating-point elements, and store the results
1522/// using writemask \a __U.
1523///
1524/// \headerfile <immintrin.h>
1525///
1526/// This intrinsic corresponds to the \c VCVTHF82PS instruction.
1527///
1528/// \param __W
1529/// A 256-bit vector of [8 x float] used for writemask.
1530/// \param __U
1531/// A 8-bit mask indicating which elements to write.
1532/// \param __A
1533/// A 128-bit vector of [16 x i8] containing HF8 values.
1534/// \returns
1535/// A 256-bit vector of [8 x float] containing the converted values.
1536static __inline__ __m256 __DEFAULT_FN_ATTRS256
1537_mm256_mask_cvthf8_ps(__m256 __W, __mmask8 __U, __m128i __A) {
1538 return (__m256)__builtin_ia32_selectps_256(
1539 (__mmask8)__U, (__v8sf)_mm256_cvthf8_ps(__A), (__v8sf)__W);
1540}
1541
1542/// Convert packed HF8 (8-bit) floating-point elements in \a __A to packed
1543/// single-precision (32-bit) floating-point elements, and store the results
1544/// using zeromask \a __U.
1545///
1546/// \headerfile <immintrin.h>
1547///
1548/// This intrinsic corresponds to the \c VCVTHF82PS instruction.
1549///
1550/// \param __U
1551/// A 8-bit mask indicating which elements to write (zero otherwise).
1552/// \param __A
1553/// A 128-bit vector of [16 x i8] containing HF8 values.
1554/// \returns
1555/// A 256-bit vector of [8 x float] containing the converted values.
1556static __inline__ __m256 __DEFAULT_FN_ATTRS256
1557_mm256_maskz_cvthf8_ps(__mmask8 __U, __m128i __A) {
1558 return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
1559 (__v8sf)_mm256_cvthf8_ps(__A),
1560 (__v8sf)_mm256_setzero_ps());
1561}
1562
1563/// Convert packed BF8 (8-bit) floating-point elements in \a __A to packed
1564/// BF6 (6-bit) floating-point elements with saturation, and store the
1565/// results in a 128-bit vector.
1566///
1567/// \headerfile <immintrin.h>
1568///
1569/// This intrinsic corresponds to the \c VCVTBF82BF6S instruction.
1570///
1571/// \param __A
1572/// A 128-bit vector of [16 x i8] containing BF8 values.
1573/// \returns
1574/// A 128-bit vector containing 16 converted packed BF6 values in the
1575/// lower bits.
1576static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_cvts_bf8_bf6(__m128i __A) {
1577 return (__m128i)__builtin_ia32_vcvtbf82bf6s_128((__v16qi)__A);
1578}
1579
1580/// Convert packed BF8 (8-bit) floating-point elements in \a __A to packed
1581/// BF6 (6-bit) floating-point elements with saturation, and store the
1582/// results in a 256-bit vector.
1583///
1584/// \headerfile <immintrin.h>
1585///
1586/// This intrinsic corresponds to the \c VCVTBF82BF6S instruction.
1587///
1588/// \param __A
1589/// A 256-bit vector of [32 x i8] containing BF8 values.
1590/// \returns
1591/// A 256-bit vector containing 32 converted packed BF6 values in the
1592/// lower bits.
1593static __inline__ __m256i __DEFAULT_FN_ATTRS256
1594_mm256_cvts_bf8_bf6(__m256i __A) {
1595 return (__m256i)__builtin_ia32_vcvtbf82bf6s_256((__v32qi)__A);
1596}
1597
1598/// Convert packed HF8 (8-bit) floating-point elements in \a __A to packed
1599/// HF6 (6-bit) floating-point elements with saturation, and store the
1600/// results in a 128-bit vector.
1601///
1602/// \headerfile <immintrin.h>
1603///
1604/// This intrinsic corresponds to the \c VCVTHF82HF6S instruction.
1605///
1606/// \param __A
1607/// A 128-bit vector of [16 x i8] containing HF8 values.
1608/// \returns
1609/// A 128-bit vector containing 16 converted packed HF6 values in the
1610/// lower bits.
1611static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_cvts_hf8_hf6(__m128i __A) {
1612 return (__m128i)__builtin_ia32_vcvthf82hf6s_128((__v16qi)__A);
1613}
1614
1615/// Convert packed HF8 (8-bit) floating-point elements in \a __A to packed
1616/// HF6 (6-bit) floating-point elements with saturation, and store the
1617/// results in a 256-bit vector.
1618///
1619/// \headerfile <immintrin.h>
1620///
1621/// This intrinsic corresponds to the \c VCVTHF82HF6S instruction.
1622///
1623/// \param __A
1624/// A 256-bit vector of [32 x i8] containing HF8 values.
1625/// \returns
1626/// A 256-bit vector containing 32 converted packed HF6 values in the
1627/// lower bits.
1628static __inline__ __m256i __DEFAULT_FN_ATTRS256
1629_mm256_cvts_hf8_hf6(__m256i __A) {
1630 return (__m256i)__builtin_ia32_vcvthf82hf6s_256((__v32qi)__A);
1631}
1632
1633/// Convert packed BF8 (8-bit) floating-point elements in \a __A to packed
1634/// BF4 (4-bit) floating-point elements with saturation, and store the
1635/// results in a 128-bit vector.
1636///
1637/// \headerfile <immintrin.h>
1638///
1639/// This intrinsic corresponds to the \c VCVTBF82BF4S instruction.
1640///
1641/// \param __A
1642/// A 128-bit vector of [16 x i8] containing BF8 values.
1643/// \returns
1644/// A 128-bit vector containing 16 converted packed BF4 values in the
1645/// lower bits.
1646static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_cvts_bf8_bf4(__m128i __A) {
1647 return (__m128i)__builtin_ia32_vcvtbf82bf4s_128((__v16qi)__A);
1648}
1649
1650/// Convert packed BF8 (8-bit) floating-point elements in \a __A to packed
1651/// BF4 (4-bit) floating-point elements with saturation, and store the
1652/// results in a 128-bit vector.
1653///
1654/// \headerfile <immintrin.h>
1655///
1656/// This intrinsic corresponds to the \c VCVTBF82BF4S instruction.
1657///
1658/// \param __A
1659/// A 256-bit vector of [32 x i8] containing BF8 values.
1660/// \returns
1661/// A 128-bit vector containing 32 converted packed BF4 values.
1662static __inline__ __m128i __DEFAULT_FN_ATTRS256
1663_mm256_cvts_bf8_bf4(__m256i __A) {
1664 return (__m128i)__builtin_ia32_vcvtbf82bf4s_256((__v32qi)__A);
1665}
1666
1667/// Convert packed HF8 (8-bit) floating-point elements in \a __A to packed
1668/// BF4 (4-bit) floating-point elements with saturation, and store the
1669/// results in a 128-bit vector.
1670///
1671/// \headerfile <immintrin.h>
1672///
1673/// This intrinsic corresponds to the \c VCVTHF82BF4S instruction.
1674///
1675/// \param __A
1676/// A 128-bit vector of [16 x i8] containing HF8 values.
1677/// \returns
1678/// A 128-bit vector containing 16 converted packed BF4 values in the
1679/// lower bits.
1680static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_cvts_hf8_bf4(__m128i __A) {
1681 return (__m128i)__builtin_ia32_vcvthf82bf4s_128((__v16qi)__A);
1682}
1683
1684/// Convert packed HF8 (8-bit) floating-point elements in \a __A to packed
1685/// BF4 (4-bit) floating-point elements with saturation, and store the
1686/// results in a 128-bit vector.
1687///
1688/// \headerfile <immintrin.h>
1689///
1690/// This intrinsic corresponds to the \c VCVTHF82BF4S instruction.
1691///
1692/// \param __A
1693/// A 256-bit vector of [32 x i8] containing HF8 values.
1694/// \returns
1695/// A 128-bit vector containing 32 converted packed BF4 values.
1696static __inline__ __m128i __DEFAULT_FN_ATTRS256
1697_mm256_cvts_hf8_bf4(__m256i __A) {
1698 return (__m128i)__builtin_ia32_vcvthf82bf4s_256((__v32qi)__A);
1699}
1700
1701/// Convert packed BF4 (4-bit) floating-point elements in \a __A to packed
1702/// HF8 (8-bit) floating-point elements, and store the results in a 128-bit
1703/// vector.
1704///
1705/// \headerfile <immintrin.h>
1706///
1707/// This intrinsic corresponds to the \c VCVTBF42HF8 instruction.
1708///
1709/// \param __A
1710/// A 128-bit vector containing 16 packed BF4 values in the lower bits.
1711/// \returns
1712/// A 128-bit vector of [16 x i8] containing the converted HF8 values.
1713static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_cvtbf4_hf8(__m128i __A) {
1714 return (__m128i)__builtin_ia32_vcvtbf42hf8_128((__v16qi)__A);
1715}
1716
1717/// Convert packed BF4 (4-bit) floating-point elements in \a __A to packed
1718/// HF8 (8-bit) floating-point elements, and store the results using
1719/// writemask \a __U.
1720///
1721/// \headerfile <immintrin.h>
1722///
1723/// This intrinsic corresponds to the \c VCVTBF42HF8 instruction.
1724///
1725/// \param __W
1726/// A 128-bit vector of [16 x i8] used for writemask.
1727/// \param __U
1728/// A 16-bit mask indicating which elements to write.
1729/// \param __A
1730/// A 128-bit vector containing 16 packed BF4 values in the lower bits.
1731/// \returns
1732/// A 128-bit vector of [16 x i8] containing the converted HF8 values.
1733static __inline__ __m128i __DEFAULT_FN_ATTRS128
1734_mm_mask_cvtbf4_hf8(__m128i __W, __mmask16 __U, __m128i __A) {
1735 return (__m128i)__builtin_ia32_selectb_128(__U, (__v16qi)_mm_cvtbf4_hf8(__A),
1736 (__v16qi)__W);
1737}
1738
1739/// Convert packed BF4 (4-bit) floating-point elements in \a __A to packed
1740/// HF8 (8-bit) floating-point elements, and store the results using
1741/// zeromask \a __U.
1742///
1743/// \headerfile <immintrin.h>
1744///
1745/// This intrinsic corresponds to the \c VCVTBF42HF8 instruction.
1746///
1747/// \param __U
1748/// A 16-bit mask indicating which elements to write (zero otherwise).
1749/// \param __A
1750/// A 128-bit vector containing 16 packed BF4 values in the lower bits.
1751/// \returns
1752/// A 128-bit vector of [16 x i8] containing the converted HF8 values.
1753static __inline__ __m128i __DEFAULT_FN_ATTRS128
1754_mm_maskz_cvtbf4_hf8(__mmask16 __U, __m128i __A) {
1755 return (__m128i)__builtin_ia32_selectb_128(__U, (__v16qi)_mm_cvtbf4_hf8(__A),
1756 (__v16qi)_mm_setzero_si128());
1757}
1758
1759/// Convert packed BF4 (4-bit) floating-point elements in \a __A to packed
1760/// HF8 (8-bit) floating-point elements, and store the results in a 256-bit
1761/// vector.
1762///
1763/// \headerfile <immintrin.h>
1764///
1765/// This intrinsic corresponds to the \c VCVTBF42HF8 instruction.
1766///
1767/// \param __A
1768/// A 128-bit vector containing 32 packed BF4 values.
1769/// \returns
1770/// A 256-bit vector of [32 x i8] containing the converted HF8 values.
1771static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_cvtbf4_hf8(__m128i __A) {
1772 return (__m256i)__builtin_ia32_vcvtbf42hf8_256((__v16qi)__A);
1773}
1774
1775/// Convert packed BF4 (4-bit) floating-point elements in \a __A to packed
1776/// HF8 (8-bit) floating-point elements, and store the results using
1777/// writemask \a __U.
1778///
1779/// \headerfile <immintrin.h>
1780///
1781/// This intrinsic corresponds to the \c VCVTBF42HF8 instruction.
1782///
1783/// \param __W
1784/// A 256-bit vector of [32 x i8] used for writemask.
1785/// \param __U
1786/// A 32-bit mask indicating which elements to write.
1787/// \param __A
1788/// A 128-bit vector containing 32 packed BF4 values.
1789/// \returns
1790/// A 256-bit vector of [32 x i8] containing the converted HF8 values.
1791static __inline__ __m256i __DEFAULT_FN_ATTRS256
1792_mm256_mask_cvtbf4_hf8(__m256i __W, __mmask32 __U, __m128i __A) {
1793 return (__m256i)__builtin_ia32_selectb_256(
1794 __U, (__v32qi)_mm256_cvtbf4_hf8(__A), (__v32qi)__W);
1795}
1796
1797/// Convert packed BF4 (4-bit) floating-point elements in \a __A to packed
1798/// HF8 (8-bit) floating-point elements, and store the results using
1799/// zeromask \a __U.
1800///
1801/// \headerfile <immintrin.h>
1802///
1803/// This intrinsic corresponds to the \c VCVTBF42HF8 instruction.
1804///
1805/// \param __U
1806/// A 32-bit mask indicating which elements to write (zero otherwise).
1807/// \param __A
1808/// A 128-bit vector containing 32 packed BF4 values.
1809/// \returns
1810/// A 256-bit vector of [32 x i8] containing the converted HF8 values.
1811static __inline__ __m256i __DEFAULT_FN_ATTRS256
1812_mm256_maskz_cvtbf4_hf8(__mmask32 __U, __m128i __A) {
1813 return (__m256i)__builtin_ia32_selectb_256(
1814 __U, (__v32qi)_mm256_cvtbf4_hf8(__A), (__v32qi)_mm256_setzero_si256());
1815}
1816
1817/// Convert packed BF6 (6-bit) floating-point elements in \a __A to packed
1818/// HF8 (8-bit) floating-point elements, and store the results in a 128-bit
1819/// vector.
1820///
1821/// \headerfile <immintrin.h>
1822///
1823/// This intrinsic corresponds to the \c VCVTBF62HF8 instruction.
1824///
1825/// \param __A
1826/// A 128-bit vector containing 16 packed BF6 values in the lower bits.
1827/// \returns
1828/// A 128-bit vector of [16 x i8] containing the converted HF8 values.
1829static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_cvtbf6_hf8(__m128i __A) {
1830 return (__m128i)__builtin_ia32_vcvtbf62hf8_128((__v16qi)__A);
1831}
1832
1833/// Convert packed BF6 (6-bit) floating-point elements in \a __A to packed
1834/// HF8 (8-bit) floating-point elements, and store the results using
1835/// writemask \a __U.
1836///
1837/// \headerfile <immintrin.h>
1838///
1839/// This intrinsic corresponds to the \c VCVTBF62HF8 instruction.
1840///
1841/// \param __W
1842/// A 128-bit vector of [16 x i8] used for writemask.
1843/// \param __U
1844/// A 16-bit mask indicating which elements to write.
1845/// \param __A
1846/// A 128-bit vector containing 16 packed BF6 values in the lower bits.
1847/// \returns
1848/// A 128-bit vector of [16 x i8] containing the converted HF8 values.
1849static __inline__ __m128i __DEFAULT_FN_ATTRS128
1850_mm_mask_cvtbf6_hf8(__m128i __W, __mmask16 __U, __m128i __A) {
1851 return (__m128i)__builtin_ia32_selectb_128(__U, (__v16qi)_mm_cvtbf6_hf8(__A),
1852 (__v16qi)__W);
1853}
1854
1855/// Convert packed BF6 (6-bit) floating-point elements in \a __A to packed
1856/// HF8 (8-bit) floating-point elements, and store the results using
1857/// zeromask \a __U.
1858///
1859/// \headerfile <immintrin.h>
1860///
1861/// This intrinsic corresponds to the \c VCVTBF62HF8 instruction.
1862///
1863/// \param __U
1864/// A 16-bit mask indicating which elements to write (zero otherwise).
1865/// \param __A
1866/// A 128-bit vector containing 16 packed BF6 values in the lower bits.
1867/// \returns
1868/// A 128-bit vector of [16 x i8] containing the converted HF8 values.
1869static __inline__ __m128i __DEFAULT_FN_ATTRS128
1870_mm_maskz_cvtbf6_hf8(__mmask16 __U, __m128i __A) {
1871 return (__m128i)__builtin_ia32_selectb_128(__U, (__v16qi)_mm_cvtbf6_hf8(__A),
1872 (__v16qi)_mm_setzero_si128());
1873}
1874
1875/// Convert packed BF6 (6-bit) floating-point elements in \a __A to packed
1876/// HF8 (8-bit) floating-point elements, and store the results in a 256-bit
1877/// vector.
1878///
1879/// \headerfile <immintrin.h>
1880///
1881/// This intrinsic corresponds to the \c VCVTBF62HF8 instruction.
1882///
1883/// \param __A
1884/// A 256-bit vector containing 32 packed BF6 values in the lower bits.
1885/// \returns
1886/// A 256-bit vector of [32 x i8] containing the converted HF8 values.
1887static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_cvtbf6_hf8(__m256i __A) {
1888 return (__m256i)__builtin_ia32_vcvtbf62hf8_256((__v32qi)__A);
1889}
1890
1891/// Convert packed BF6 (6-bit) floating-point elements in \a __A to packed
1892/// HF8 (8-bit) floating-point elements, and store the results using
1893/// writemask \a __U.
1894///
1895/// \headerfile <immintrin.h>
1896///
1897/// This intrinsic corresponds to the \c VCVTBF62HF8 instruction.
1898///
1899/// \param __W
1900/// A 256-bit vector of [32 x i8] used for writemask.
1901/// \param __U
1902/// A 32-bit mask indicating which elements to write.
1903/// \param __A
1904/// A 256-bit vector containing 32 packed BF6 values in the lower bits.
1905/// \returns
1906/// A 256-bit vector of [32 x i8] containing the converted HF8 values.
1907static __inline__ __m256i __DEFAULT_FN_ATTRS256
1908_mm256_mask_cvtbf6_hf8(__m256i __W, __mmask32 __U, __m256i __A) {
1909 return (__m256i)__builtin_ia32_selectb_256(
1910 __U, (__v32qi)_mm256_cvtbf6_hf8(__A), (__v32qi)__W);
1911}
1912
1913/// Convert packed BF6 (6-bit) floating-point elements in \a __A to packed
1914/// HF8 (8-bit) floating-point elements, and store the results using
1915/// zeromask \a __U.
1916///
1917/// \headerfile <immintrin.h>
1918///
1919/// This intrinsic corresponds to the \c VCVTBF62HF8 instruction.
1920///
1921/// \param __U
1922/// A 32-bit mask indicating which elements to write (zero otherwise).
1923/// \param __A
1924/// A 256-bit vector containing 32 packed BF6 values in the lower bits.
1925/// \returns
1926/// A 256-bit vector of [32 x i8] containing the converted HF8 values.
1927static __inline__ __m256i __DEFAULT_FN_ATTRS256
1928_mm256_maskz_cvtbf6_hf8(__mmask32 __U, __m256i __A) {
1929 return (__m256i)__builtin_ia32_selectb_256(
1930 __U, (__v32qi)_mm256_cvtbf6_hf8(__A), (__v32qi)_mm256_setzero_si256());
1931}
1932
1933/// Convert packed HF6 (6-bit) floating-point elements in \a __A to packed
1934/// HF8 (8-bit) floating-point elements, and store the results in a 128-bit
1935/// vector.
1936///
1937/// \headerfile <immintrin.h>
1938///
1939/// This intrinsic corresponds to the \c VCVTHF62HF8 instruction.
1940///
1941/// \param __A
1942/// A 128-bit vector containing 16 packed HF6 values in the lower bits.
1943/// \returns
1944/// A 128-bit vector of [16 x i8] containing the converted HF8 values.
1945static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_cvthf6_hf8(__m128i __A) {
1946 return (__m128i)__builtin_ia32_vcvthf62hf8_128((__v16qi)__A);
1947}
1948
1949/// Convert packed HF6 (6-bit) floating-point elements in \a __A to packed
1950/// HF8 (8-bit) floating-point elements, and store the results using
1951/// writemask \a __U.
1952///
1953/// \headerfile <immintrin.h>
1954///
1955/// This intrinsic corresponds to the \c VCVTHF62HF8 instruction.
1956///
1957/// \param __W
1958/// A 128-bit vector of [16 x i8] used for writemask.
1959/// \param __U
1960/// A 16-bit mask indicating which elements to write.
1961/// \param __A
1962/// A 128-bit vector containing 16 packed HF6 values in the lower bits.
1963/// \returns
1964/// A 128-bit vector of [16 x i8] containing the converted HF8 values.
1965static __inline__ __m128i __DEFAULT_FN_ATTRS128
1966_mm_mask_cvthf6_hf8(__m128i __W, __mmask16 __U, __m128i __A) {
1967 return (__m128i)__builtin_ia32_selectb_128(__U, (__v16qi)_mm_cvthf6_hf8(__A),
1968 (__v16qi)__W);
1969}
1970
1971/// Convert packed HF6 (6-bit) floating-point elements in \a __A to packed
1972/// HF8 (8-bit) floating-point elements, and store the results using
1973/// zeromask \a __U.
1974///
1975/// \headerfile <immintrin.h>
1976///
1977/// This intrinsic corresponds to the \c VCVTHF62HF8 instruction.
1978///
1979/// \param __U
1980/// A 16-bit mask indicating which elements to write (zero otherwise).
1981/// \param __A
1982/// A 128-bit vector containing 16 packed HF6 values in the lower bits.
1983/// \returns
1984/// A 128-bit vector of [16 x i8] containing the converted HF8 values.
1985static __inline__ __m128i __DEFAULT_FN_ATTRS128
1986_mm_maskz_cvthf6_hf8(__mmask16 __U, __m128i __A) {
1987 return (__m128i)__builtin_ia32_selectb_128(__U, (__v16qi)_mm_cvthf6_hf8(__A),
1988 (__v16qi)_mm_setzero_si128());
1989}
1990
1991/// Convert packed HF6 (6-bit) floating-point elements in \a __A to packed
1992/// HF8 (8-bit) floating-point elements, and store the results in a 256-bit
1993/// vector.
1994///
1995/// \headerfile <immintrin.h>
1996///
1997/// This intrinsic corresponds to the \c VCVTHF62HF8 instruction.
1998///
1999/// \param __A
2000/// A 256-bit vector containing 32 packed HF6 values in the lower bits.
2001/// \returns
2002/// A 256-bit vector of [32 x i8] containing the converted HF8 values.
2003static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_cvthf6_hf8(__m256i __A) {
2004 return (__m256i)__builtin_ia32_vcvthf62hf8_256((__v32qi)__A);
2005}
2006
2007/// Convert packed HF6 (6-bit) floating-point elements in \a __A to packed
2008/// HF8 (8-bit) floating-point elements, and store the results using
2009/// writemask \a __U.
2010///
2011/// \headerfile <immintrin.h>
2012///
2013/// This intrinsic corresponds to the \c VCVTHF62HF8 instruction.
2014///
2015/// \param __W
2016/// A 256-bit vector of [32 x i8] used for writemask.
2017/// \param __U
2018/// A 32-bit mask indicating which elements to write.
2019/// \param __A
2020/// A 256-bit vector containing 32 packed HF6 values in the lower bits.
2021/// \returns
2022/// A 256-bit vector of [32 x i8] containing the converted HF8 values.
2023static __inline__ __m256i __DEFAULT_FN_ATTRS256
2024_mm256_mask_cvthf6_hf8(__m256i __W, __mmask32 __U, __m256i __A) {
2025 return (__m256i)__builtin_ia32_selectb_256(
2026 __U, (__v32qi)_mm256_cvthf6_hf8(__A), (__v32qi)__W);
2027}
2028
2029/// Convert packed HF6 (6-bit) floating-point elements in \a __A to packed
2030/// HF8 (8-bit) floating-point elements, and store the results using
2031/// zeromask \a __U.
2032///
2033/// \headerfile <immintrin.h>
2034///
2035/// This intrinsic corresponds to the \c VCVTHF62HF8 instruction.
2036///
2037/// \param __U
2038/// A 32-bit mask indicating which elements to write (zero otherwise).
2039/// \param __A
2040/// A 256-bit vector containing 32 packed HF6 values in the lower bits.
2041/// \returns
2042/// A 256-bit vector of [32 x i8] containing the converted HF8 values.
2043static __inline__ __m256i __DEFAULT_FN_ATTRS256
2044_mm256_maskz_cvthf6_hf8(__mmask32 __U, __m256i __A) {
2045 return (__m256i)__builtin_ia32_selectb_256(
2046 __U, (__v32qi)_mm256_cvthf6_hf8(__A), (__v32qi)_mm256_setzero_si256());
2047}
2048
2049/// Compose the \c size field of the immediate operand of \c VUNPACKB, which
2050/// selects the size in bits of the packed source elements.
2051///
2052/// \headerfile <immintrin.h>
2053///
2054/// \param n
2055/// The packed element size in bits, in the range [2, 7].
2056/// \returns
2057/// Bits [4:2] of the immediate operand.
2058#define _MM_UNPACKB_SIZE(n) (((n) & 0x7) << 2)
2059
2060/// Compose the \c start field of the immediate operand of \c VUNPACKB, which
2061/// selects which block of packed elements is extracted from the source.
2062///
2063/// \headerfile <immintrin.h>
2064///
2065/// \param s
2066/// The starting offset, in the range [0, 3]. The permitted values depend on
2067/// the element size; only offsets that allow a full extraction are valid.
2068/// \returns
2069/// Bits [1:0] of the immediate operand.
2070#define _MM_UNPACKB_START(s) (((s) & 0x3) << 0)
2071
2072/// The \c sign-extend field of the immediate operand of \c VUNPACKB,
2073/// requesting that unpacked elements be sign-extended to 8 bits instead of
2074/// zero-extended.
2075///
2076/// \headerfile <immintrin.h>
2077#define _MM_UNPACKB_SEXT (1 << 5)
2078
2079/// Unpack bytes from \a A according to the immediate value \a imm, and store
2080/// the results in a 128-bit vector.
2081///
2082/// \headerfile <immintrin.h>
2083///
2084/// This intrinsic corresponds to the \c VUNPACKB instruction.
2085///
2086/// \param A
2087/// A 128-bit vector of [16 x i8].
2088/// \param imm
2089/// An 8-bit immediate selecting the packed element size, start offset, and
2090/// optional sign-extend for \c VUNPACKB. Compose it with
2091/// \c _MM_UNPACKB_SIZE, \c _MM_UNPACKB_START, and optionally
2092/// \c _MM_UNPACKB_SEXT. Omitting \c _MM_UNPACKB_SEXT zero-extends unpacked
2093/// elements to 8 bits. \n
2094/// Example:
2095/// <c>_MM_UNPACKB_SIZE(4) | _MM_UNPACKB_START(1) | _MM_UNPACKB_SEXT</c>
2096///
2097/// \see { _MM_UNPACKB_SIZE _MM_UNPACKB_START _MM_UNPACKB_SEXT }
2098/// \returns
2099/// A 128-bit vector of [16 x i8] containing the unpacked values.
2100#define _mm_unpack_epi8(A, imm) \
2101 ((__m128i)__builtin_ia32_vunpackb128((__v16qi)(__m128i)(A), (int)(imm)))
2102
2103/// Unpack bytes from \a A according to the immediate value \a imm, and store
2104/// the results in a 128-bit vector using writemask \a U.
2105///
2106/// \headerfile <immintrin.h>
2107///
2108/// This intrinsic corresponds to the \c VUNPACKB instruction.
2109///
2110/// \param W
2111/// A 128-bit vector of [16 x i8] used for writemask.
2112/// \param U
2113/// A 16-bit mask indicating which elements to write.
2114/// \param A
2115/// A 128-bit vector of [16 x i8].
2116/// \param imm
2117/// An 8-bit immediate selecting the packed element size, start offset, and
2118/// optional sign-extend for \c VUNPACKB. Compose it with
2119/// \c _MM_UNPACKB_SIZE, \c _MM_UNPACKB_START, and optionally
2120/// \c _MM_UNPACKB_SEXT. Omitting \c _MM_UNPACKB_SEXT zero-extends unpacked
2121/// elements to 8 bits. \n
2122/// Example:
2123/// <c>_MM_UNPACKB_SIZE(4) | _MM_UNPACKB_START(1) | _MM_UNPACKB_SEXT</c>
2124///
2125/// \see { _MM_UNPACKB_SIZE _MM_UNPACKB_START _MM_UNPACKB_SEXT }
2126/// \returns
2127/// A 128-bit vector of [16 x i8] containing the unpacked values.
2128#define _mm_mask_unpack_epi8(W, U, A, imm) \
2129 ((__m128i)__builtin_ia32_selectb_128((__mmask16)(U), \
2130 (__v16qi)_mm_unpack_epi8((A), (imm)), \
2131 (__v16qi)(__m128i)(W)))
2132
2133/// Unpack bytes from \a A according to the immediate value \a imm, and store
2134/// the results in a 128-bit vector using zeromask \a U.
2135///
2136/// \headerfile <immintrin.h>
2137///
2138/// This intrinsic corresponds to the \c VUNPACKB instruction.
2139///
2140/// \param U
2141/// A 16-bit mask indicating which elements to write (zero otherwise).
2142/// \param A
2143/// A 128-bit vector of [16 x i8].
2144/// \param imm
2145/// An 8-bit immediate selecting the packed element size, start offset, and
2146/// optional sign-extend for \c VUNPACKB. Compose it with
2147/// \c _MM_UNPACKB_SIZE, \c _MM_UNPACKB_START, and optionally
2148/// \c _MM_UNPACKB_SEXT. Omitting \c _MM_UNPACKB_SEXT zero-extends unpacked
2149/// elements to 8 bits. \n
2150/// Example:
2151/// <c>_MM_UNPACKB_SIZE(4) | _MM_UNPACKB_START(1) | _MM_UNPACKB_SEXT</c>
2152///
2153/// \see { _MM_UNPACKB_SIZE _MM_UNPACKB_START _MM_UNPACKB_SEXT }
2154/// \returns
2155/// A 128-bit vector of [16 x i8] containing the unpacked values.
2156#define _mm_maskz_unpack_epi8(U, A, imm) \
2157 ((__m128i)__builtin_ia32_selectb_128((__mmask16)(U), \
2158 (__v16qi)_mm_unpack_epi8((A), (imm)), \
2159 (__v16qi)_mm_setzero_si128()))
2160
2161/// Unpack bytes from \a A according to the immediate value \a imm, and store
2162/// the results in a 256-bit vector.
2163///
2164/// \headerfile <immintrin.h>
2165///
2166/// This intrinsic corresponds to the \c VUNPACKB instruction.
2167///
2168/// \param A
2169/// A 256-bit vector of [32 x i8].
2170/// \param imm
2171/// An 8-bit immediate selecting the packed element size, start offset, and
2172/// optional sign-extend for \c VUNPACKB. Compose it with
2173/// \c _MM_UNPACKB_SIZE, \c _MM_UNPACKB_START, and optionally
2174/// \c _MM_UNPACKB_SEXT. Omitting \c _MM_UNPACKB_SEXT zero-extends unpacked
2175/// elements to 8 bits. \n
2176/// Example:
2177/// <c>_MM_UNPACKB_SIZE(4) | _MM_UNPACKB_START(1) | _MM_UNPACKB_SEXT</c>
2178///
2179/// \see { _MM_UNPACKB_SIZE _MM_UNPACKB_START _MM_UNPACKB_SEXT }
2180/// \returns
2181/// A 256-bit vector of [32 x i8] containing the unpacked values.
2182#define _mm256_unpack_epi8(A, imm) \
2183 ((__m256i)__builtin_ia32_vunpackb256((__v32qi)(__m256i)(A), (int)(imm)))
2184
2185/// Unpack bytes from \a A according to the immediate value \a imm, and store
2186/// the results in a 256-bit vector using writemask \a U.
2187///
2188/// \headerfile <immintrin.h>
2189///
2190/// This intrinsic corresponds to the \c VUNPACKB instruction.
2191///
2192/// \param W
2193/// A 256-bit vector of [32 x i8] used for writemask.
2194/// \param U
2195/// A 32-bit mask indicating which elements to write.
2196/// \param A
2197/// A 256-bit vector of [32 x i8].
2198/// \param imm
2199/// An 8-bit immediate selecting the packed element size, start offset, and
2200/// optional sign-extend for \c VUNPACKB. Compose it with
2201/// \c _MM_UNPACKB_SIZE, \c _MM_UNPACKB_START, and optionally
2202/// \c _MM_UNPACKB_SEXT. Omitting \c _MM_UNPACKB_SEXT zero-extends unpacked
2203/// elements to 8 bits. \n
2204/// Example:
2205/// <c>_MM_UNPACKB_SIZE(4) | _MM_UNPACKB_START(1) | _MM_UNPACKB_SEXT</c>
2206///
2207/// \see { _MM_UNPACKB_SIZE _MM_UNPACKB_START _MM_UNPACKB_SEXT }
2208/// \returns
2209/// A 256-bit vector of [32 x i8] containing the unpacked values.
2210#define _mm256_mask_unpack_epi8(W, U, A, imm) \
2211 ((__m256i)__builtin_ia32_selectb_256( \
2212 (__mmask32)(U), (__v32qi)_mm256_unpack_epi8((A), (imm)), \
2213 (__v32qi)(__m256i)(W)))
2214
2215/// Unpack bytes from \a A according to the immediate value \a imm, and store
2216/// the results in a 256-bit vector using zeromask \a U.
2217///
2218/// \headerfile <immintrin.h>
2219///
2220/// This intrinsic corresponds to the \c VUNPACKB instruction.
2221///
2222/// \param U
2223/// A 32-bit mask indicating which elements to write (zero otherwise).
2224/// \param A
2225/// A 256-bit vector of [32 x i8].
2226/// \param imm
2227/// An 8-bit immediate selecting the packed element size, start offset, and
2228/// optional sign-extend for \c VUNPACKB. Compose it with
2229/// \c _MM_UNPACKB_SIZE, \c _MM_UNPACKB_START, and optionally
2230/// \c _MM_UNPACKB_SEXT. Omitting \c _MM_UNPACKB_SEXT zero-extends unpacked
2231/// elements to 8 bits. \n
2232/// Example:
2233/// <c>_MM_UNPACKB_SIZE(4) | _MM_UNPACKB_START(1) | _MM_UNPACKB_SEXT</c>
2234///
2235/// \see { _MM_UNPACKB_SIZE _MM_UNPACKB_START _MM_UNPACKB_SEXT }
2236/// \returns
2237/// A 256-bit vector of [32 x i8] containing the unpacked values.
2238#define _mm256_maskz_unpack_epi8(U, A, imm) \
2239 ((__m256i)__builtin_ia32_selectb_256( \
2240 (__mmask32)(U), (__v32qi)_mm256_unpack_epi8((A), (imm)), \
2241 (__v32qi)_mm256_setzero_si256()))
2242
2243/// Convert packed signed 32-bit integers in \a __A to packed 8-bit integers
2244/// with symmetric signed saturation (clamp to [-127, +127]), and store
2245/// the results in a 128-bit vector.
2246///
2247/// \headerfile <immintrin.h>
2248///
2249/// This intrinsic corresponds to the \c VPMOVSSDB instruction.
2250///
2251/// \param __A
2252/// A 128-bit vector of [4 x i32].
2253/// \returns
2254/// A 128-bit vector of [16 x i8]. The lower 4 bytes contain the converted
2255/// values; the upper bytes are zeroed.
2256static __inline__ __m128i __DEFAULT_FN_ATTRS128
2257_mm_cvtss_epi32_epi8(__m128i __A) {
2258 return (__m128i)__builtin_ia32_vpmovssdb128_mask(
2259 (__v4si)__A, (__v16qi)_mm_setzero_si128(), (__mmask8)-1);
2260}
2261
2262/// Convert packed signed 32-bit integers in \a __A to packed 8-bit integers
2263/// with symmetric signed saturation, using writemask \a __U.
2264///
2265/// \headerfile <immintrin.h>
2266///
2267/// This intrinsic corresponds to the \c VPMOVSSDB instruction.
2268///
2269/// \param __W
2270/// A 128-bit vector of [16 x i8] used for writemask.
2271/// \param __U
2272/// A 8-bit mask indicating which elements to write.
2273/// \param __A
2274/// A 128-bit vector of [4 x i32].
2275/// \returns
2276/// A 128-bit vector of [16 x i8] containing the converted values.
2277static __inline__ __m128i __DEFAULT_FN_ATTRS128
2278_mm_mask_cvtss_epi32_epi8(__m128i __W, __mmask8 __U, __m128i __A) {
2279 return (__m128i)__builtin_ia32_vpmovssdb128_mask((__v4si)__A, (__v16qi)__W,
2280 __U);
2281}
2282
2283/// Convert packed signed 32-bit integers in \a __A to packed 8-bit integers
2284/// with symmetric signed saturation, using zeromask \a __U.
2285///
2286/// \headerfile <immintrin.h>
2287///
2288/// This intrinsic corresponds to the \c VPMOVSSDB instruction.
2289///
2290/// \param __U
2291/// A 8-bit mask indicating which elements to write (zero otherwise).
2292/// \param __A
2293/// A 128-bit vector of [4 x i32].
2294/// \returns
2295/// A 128-bit vector of [16 x i8] containing the converted values.
2296static __inline__ __m128i __DEFAULT_FN_ATTRS128
2297_mm_maskz_cvtss_epi32_epi8(__mmask8 __U, __m128i __A) {
2298 return (__m128i)__builtin_ia32_vpmovssdb128_mask(
2299 (__v4si)__A, (__v16qi)_mm_setzero_si128(), __U);
2300}
2301
2302/// Convert packed signed 32-bit integers in \a __A to packed 8-bit integers
2303/// with symmetric signed saturation (clamp to [-127, +127]), and store
2304/// the results in a 128-bit vector.
2305///
2306/// \headerfile <immintrin.h>
2307///
2308/// This intrinsic corresponds to the \c VPMOVSSDB instruction.
2309///
2310/// \param __A
2311/// A 256-bit vector of [8 x i32].
2312/// \returns
2313/// A 128-bit vector of [16 x i8]. The lower 8 bytes contain the converted
2314/// values; the upper bytes are zeroed.
2315static __inline__ __m128i __DEFAULT_FN_ATTRS256
2316_mm256_cvtss_epi32_epi8(__m256i __A) {
2317 return (__m128i)__builtin_ia32_vpmovssdb256_mask(
2318 (__v8si)__A, (__v16qi)_mm_setzero_si128(), (__mmask8)-1);
2319}
2320
2321/// Convert packed signed 32-bit integers in \a __A to packed 8-bit integers
2322/// with symmetric signed saturation, using writemask \a __U.
2323///
2324/// \headerfile <immintrin.h>
2325///
2326/// This intrinsic corresponds to the \c VPMOVSSDB instruction.
2327///
2328/// \param __W
2329/// A 128-bit vector of [16 x i8] used for writemask.
2330/// \param __U
2331/// A 8-bit mask indicating which elements to write.
2332/// \param __A
2333/// A 256-bit vector of [8 x i32].
2334/// \returns
2335/// A 128-bit vector of [16 x i8] containing the converted values.
2336static __inline__ __m128i __DEFAULT_FN_ATTRS256
2337_mm256_mask_cvtss_epi32_epi8(__m128i __W, __mmask8 __U, __m256i __A) {
2338 return (__m128i)__builtin_ia32_vpmovssdb256_mask((__v8si)__A, (__v16qi)__W,
2339 __U);
2340}
2341
2342/// Convert packed signed 32-bit integers in \a __A to packed 8-bit integers
2343/// with symmetric signed saturation, using zeromask \a __U.
2344///
2345/// \headerfile <immintrin.h>
2346///
2347/// This intrinsic corresponds to the \c VPMOVSSDB instruction.
2348///
2349/// \param __U
2350/// A 8-bit mask indicating which elements to write (zero otherwise).
2351/// \param __A
2352/// A 256-bit vector of [8 x i32].
2353/// \returns
2354/// A 128-bit vector of [16 x i8] containing the converted values.
2355static __inline__ __m128i __DEFAULT_FN_ATTRS256
2356_mm256_maskz_cvtss_epi32_epi8(__mmask8 __U, __m256i __A) {
2357 return (__m128i)__builtin_ia32_vpmovssdb256_mask(
2358 (__v8si)__A, (__v16qi)_mm_setzero_si128(), __U);
2359}
2360
2361/// Truncate packed 32-bit integers in \a __A to packed 8-bit integers with
2362/// symmetric signed saturation, and store the results to memory at \a __P
2363/// using writemask \a __M (elements not selected by the mask are not written).
2364///
2365/// \headerfile <immintrin.h>
2366///
2367/// This intrinsic corresponds to the \c VPMOVSSDB instruction.
2368///
2369/// \param __P
2370/// Pointer to the destination memory.
2371/// \param __M
2372/// A 8-bit mask indicating which elements to write.
2373/// \param __A
2374/// A 128-bit vector of [4 x i32].
2375static __inline__ void __DEFAULT_FN_ATTRS128
2376_mm_mask_cvtss_epi32_storeu_epi8(void *__P, __mmask8 __M, __m128i __A) {
2377 __builtin_ia32_vpmovssdb128mem_mask((__v16qi *)__P, (__v4si)__A, __M);
2378}
2379
2380/// Truncate packed 32-bit integers in \a __A to packed 8-bit integers with
2381/// symmetric signed saturation, and store the results to memory at \a __P
2382/// using writemask \a __M (elements not selected by the mask are not written).
2383///
2384/// \headerfile <immintrin.h>
2385///
2386/// This intrinsic corresponds to the \c VPMOVSSDB instruction.
2387///
2388/// \param __P
2389/// Pointer to the destination memory.
2390/// \param __M
2391/// A 8-bit mask indicating which elements to write.
2392/// \param __A
2393/// A 256-bit vector of [8 x i32].
2394static __inline__ void __DEFAULT_FN_ATTRS256
2395_mm256_mask_cvtss_epi32_storeu_epi8(void *__P, __mmask8 __M, __m256i __A) {
2396 __builtin_ia32_vpmovssdb256mem_mask((__v16qi *)__P, (__v8si)__A, __M);
2397}
2398
2399#undef __DEFAULT_FN_ATTRS128
2400#undef __DEFAULT_FN_ATTRS256
2401
2402#endif // __AVX10V2AUXINTRIN_H
2403#endif // __SSE2__
#define __DEFAULT_FN_ATTRS128
#define __DEFAULT_FN_ATTRS256
unsigned int __mmask32
unsigned char __mmask8
unsigned short __mmask16
static __inline __m256 __DEFAULT_FN_ATTRS_CONSTEXPR _mm256_setzero_ps(void)
Constructs a 256-bit floating-point vector of [8 x float] with all vector elements initialized to zer...
Definition avxintrin.h:4283
static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR _mm256_setzero_si256(void)
Constructs a 256-bit integer vector initialized to zero.
Definition avxintrin.h:4295
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_setzero_si128(void)
Creates a 128-bit integer vector initialized to zero.
Definition emmintrin.h:3887
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_undefined_si128(void)
Generates a 128-bit vector of [4 x i32] with unspecified content.
Definition emmintrin.h:3502
__inline unsigned int unsigned int unsigned int * __P
Definition bmi2intrin.h:25
static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_setzero_ps(void)
Constructs a 128-bit floating-point vector of [4 x float] initialized to zero.
Definition xmmintrin.h:2000