1 /*===-------------- avxneconvertintrin.h - AVXNECONVERT --------------------===
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
7 *===-----------------------------------------------------------------------===
12 "Never use <avxneconvertintrin.h> directly; include <immintrin.h> instead."
13 #endif // __IMMINTRIN_H
17 #ifndef __AVXNECONVERTINTRIN_H
18 #define __AVXNECONVERTINTRIN_H
20 /* Define the default attributes for the functions in this file. */
21 #define __DEFAULT_FN_ATTRS128 \
22 __attribute__((__always_inline__, __nodebug__, __target__("avxneconvert"), \
23 __min_vector_width__(128)))
24 #define __DEFAULT_FN_ATTRS256 \
25 __attribute__((__always_inline__, __nodebug__, __target__("avxneconvert"), \
26 __min_vector_width__(256)))
28 /// Convert scalar BF16 (16-bit) floating-point element
29 /// stored at memory locations starting at location \a __A to a
30 /// single-precision (32-bit) floating-point, broadcast it to packed
31 /// single-precision (32-bit) floating-point elements, and store the results in
34 /// \headerfile <x86intrin.h>
37 /// _mm_bcstnebf16_ps(const void *__A);
40 /// This intrinsic corresponds to the \c VBCSTNEBF162PS instruction.
43 /// A pointer to a 16-bit memory location. The address of the memory
44 /// location does not have to be aligned.
46 /// A 128-bit vector of [4 x float].
49 /// b := Convert_BF16_To_FP32(MEM[__A+15:__A])
56 static __inline__ __m128 __DEFAULT_FN_ATTRS128
57 _mm_bcstnebf16_ps(const void *__A
) {
58 return (__m128
)__builtin_ia32_vbcstnebf162ps128((const __bf16
*)__A
);
61 /// Convert scalar BF16 (16-bit) floating-point element
62 /// stored at memory locations starting at location \a __A to a
63 /// single-precision (32-bit) floating-point, broadcast it to packed
64 /// single-precision (32-bit) floating-point elements, and store the results in
67 /// \headerfile <x86intrin.h>
70 /// _mm256_bcstnebf16_ps(const void *__A);
73 /// This intrinsic corresponds to the \c VBCSTNEBF162PS instruction.
76 /// A pointer to a 16-bit memory location. The address of the memory
77 /// location does not have to be aligned.
79 /// A 256-bit vector of [8 x float].
82 /// b := Convert_BF16_To_FP32(MEM[__A+15:__A])
89 static __inline__ __m256 __DEFAULT_FN_ATTRS256
90 _mm256_bcstnebf16_ps(const void *__A
) {
91 return (__m256
)__builtin_ia32_vbcstnebf162ps256((const __bf16
*)__A
);
94 /// Convert scalar half-precision (16-bit) floating-point element
95 /// stored at memory locations starting at location \a __A to a
96 /// single-precision (32-bit) floating-point, broadcast it to packed
97 /// single-precision (32-bit) floating-point elements, and store the results in
100 /// \headerfile <x86intrin.h>
103 /// _mm_bcstnesh_ps(const void *__A);
106 /// This intrinsic corresponds to the \c VBCSTNESH2PS instruction.
109 /// A pointer to a 16-bit memory location. The address of the memory
110 /// location does not have to be aligned.
112 /// A 128-bit vector of [4 x float].
114 /// \code{.operation}
115 /// b := Convert_FP16_To_FP32(MEM[__A+15:__A])
120 /// dst[MAX:128] := 0
122 static __inline__ __m128 __DEFAULT_FN_ATTRS128
123 _mm_bcstnesh_ps(const void *__A
) {
124 return (__m128
)__builtin_ia32_vbcstnesh2ps128((const _Float16
*)__A
);
127 /// Convert scalar half-precision (16-bit) floating-point element
128 /// stored at memory locations starting at location \a __A to a
129 /// single-precision (32-bit) floating-point, broadcast it to packed
130 /// single-precision (32-bit) floating-point elements, and store the results in
133 /// \headerfile <x86intrin.h>
136 /// _mm256_bcstnesh_ps(const void *__A);
139 /// This intrinsic corresponds to the \c VBCSTNESH2PS instruction.
142 /// A pointer to a 16-bit memory location. The address of the memory
143 /// location does not have to be aligned.
145 /// A 256-bit vector of [8 x float].
147 /// \code{.operation}
148 /// b := Convert_FP16_To_FP32(MEM[__A+15:__A])
153 /// dst[MAX:256] := 0
155 static __inline__ __m256 __DEFAULT_FN_ATTRS256
156 _mm256_bcstnesh_ps(const void *__A
) {
157 return (__m256
)__builtin_ia32_vbcstnesh2ps256((const _Float16
*)__A
);
160 /// Convert packed BF16 (16-bit) floating-point even-indexed elements
161 /// stored at memory locations starting at location \a __A to packed
162 /// single-precision (32-bit) floating-point elements, and store the results in
165 /// \headerfile <x86intrin.h>
168 /// _mm_cvtneebf16_ps(const __m128bh *__A);
171 /// This intrinsic corresponds to the \c VCVTNEEBF162PS instruction.
174 /// A pointer to a 128-bit memory location containing 8 consecutive
175 /// BF16 (16-bit) floating-point values.
177 /// A 128-bit vector of [4 x float].
179 /// \code{.operation}
184 /// dst[m+31:m] := Convert_BF16_To_FP32(MEM[__A+i+15:__A+i])
186 /// dst[MAX:128] := 0
188 static __inline__ __m128 __DEFAULT_FN_ATTRS128
189 _mm_cvtneebf16_ps(const __m128bh
*__A
) {
190 return (__m128
)__builtin_ia32_vcvtneebf162ps128((const __v8bf
*)__A
);
193 /// Convert packed BF16 (16-bit) floating-point even-indexed elements
194 /// stored at memory locations starting at location \a __A to packed
195 /// single-precision (32-bit) floating-point elements, and store the results in
198 /// \headerfile <x86intrin.h>
201 /// _mm256_cvtneebf16_ps(const __m256bh *__A);
204 /// This intrinsic corresponds to the \c VCVTNEEBF162PS instruction.
207 /// A pointer to a 256-bit memory location containing 16 consecutive
208 /// BF16 (16-bit) floating-point values.
210 /// A 256-bit vector of [8 x float].
212 /// \code{.operation}
217 /// dst[m+31:m] := Convert_BF16_To_FP32(MEM[__A+i+15:__A+i])
219 /// dst[MAX:256] := 0
221 static __inline__ __m256 __DEFAULT_FN_ATTRS256
222 _mm256_cvtneebf16_ps(const __m256bh
*__A
) {
223 return (__m256
)__builtin_ia32_vcvtneebf162ps256((const __v16bf
*)__A
);
226 /// Convert packed half-precision (16-bit) floating-point even-indexed elements
227 /// stored at memory locations starting at location \a __A to packed
228 /// single-precision (32-bit) floating-point elements, and store the results in
231 /// \headerfile <x86intrin.h>
234 /// _mm_cvtneeph_ps(const __m128h *__A);
237 /// This intrinsic corresponds to the \c VCVTNEEPH2PS instruction.
240 /// A pointer to a 128-bit memory location containing 8 consecutive
241 /// half-precision (16-bit) floating-point values.
243 /// A 128-bit vector of [4 x float].
245 /// \code{.operation}
250 /// dst[m+31:m] := Convert_FP16_To_FP32(MEM[__A+i+15:__A+i])
252 /// dst[MAX:128] := 0
254 static __inline__ __m128 __DEFAULT_FN_ATTRS128
255 _mm_cvtneeph_ps(const __m128h
*__A
) {
256 return (__m128
)__builtin_ia32_vcvtneeph2ps128((const __v8hf
*)__A
);
259 /// Convert packed half-precision (16-bit) floating-point even-indexed elements
260 /// stored at memory locations starting at location \a __A to packed
261 /// single-precision (32-bit) floating-point elements, and store the results in
264 /// \headerfile <x86intrin.h>
267 /// _mm256_cvtneeph_ps(const __m256h *__A);
270 /// This intrinsic corresponds to the \c VCVTNEEPH2PS instruction.
273 /// A pointer to a 256-bit memory location containing 16 consecutive
274 /// half-precision (16-bit) floating-point values.
276 /// A 256-bit vector of [8 x float].
278 /// \code{.operation}
283 /// dst[m+31:m] := Convert_FP16_To_FP32(MEM[__A+i+15:__A+i])
285 /// dst[MAX:256] := 0
287 static __inline__ __m256 __DEFAULT_FN_ATTRS256
288 _mm256_cvtneeph_ps(const __m256h
*__A
) {
289 return (__m256
)__builtin_ia32_vcvtneeph2ps256((const __v16hf
*)__A
);
292 /// Convert packed BF16 (16-bit) floating-point odd-indexed elements
293 /// stored at memory locations starting at location \a __A to packed
294 /// single-precision (32-bit) floating-point elements, and store the results in
297 /// \headerfile <x86intrin.h>
300 /// _mm_cvtneobf16_ps(const __m128bh *__A);
303 /// This intrinsic corresponds to the \c VCVTNEOBF162PS instruction.
306 /// A pointer to a 128-bit memory location containing 8 consecutive
307 /// BF16 (16-bit) floating-point values.
309 /// A 128-bit vector of [4 x float].
311 /// \code{.operation}
316 /// dst[m+31:m] := Convert_BF16_To_FP32(MEM[__A+i+15:__A+i])
318 /// dst[MAX:128] := 0
320 static __inline__ __m128 __DEFAULT_FN_ATTRS128
321 _mm_cvtneobf16_ps(const __m128bh
*__A
) {
322 return (__m128
)__builtin_ia32_vcvtneobf162ps128((const __v8bf
*)__A
);
325 /// Convert packed BF16 (16-bit) floating-point odd-indexed elements
326 /// stored at memory locations starting at location \a __A to packed
327 /// single-precision (32-bit) floating-point elements, and store the results in
330 /// \headerfile <x86intrin.h>
333 /// _mm256_cvtneobf16_ps(const __m256bh *__A);
336 /// This intrinsic corresponds to the \c VCVTNEOBF162PS instruction.
339 /// A pointer to a 256-bit memory location containing 16 consecutive
340 /// BF16 (16-bit) floating-point values.
342 /// A 256-bit vector of [8 x float].
344 /// \code{.operation}
349 /// dst[m+31:m] := Convert_BF16_To_FP32(MEM[__A+i+15:__A+i])
351 /// dst[MAX:256] := 0
353 static __inline__ __m256 __DEFAULT_FN_ATTRS256
354 _mm256_cvtneobf16_ps(const __m256bh
*__A
) {
355 return (__m256
)__builtin_ia32_vcvtneobf162ps256((const __v16bf
*)__A
);
358 /// Convert packed half-precision (16-bit) floating-point odd-indexed elements
359 /// stored at memory locations starting at location \a __A to packed
360 /// single-precision (32-bit) floating-point elements, and store the results in
363 /// \headerfile <x86intrin.h>
366 /// _mm_cvtneoph_ps(const __m128h *__A);
369 /// This intrinsic corresponds to the \c VCVTNEOPH2PS instruction.
372 /// A pointer to a 128-bit memory location containing 8 consecutive
373 /// half-precision (16-bit) floating-point values.
375 /// A 128-bit vector of [4 x float].
377 /// \code{.operation}
382 /// dst[m+31:m] := Convert_FP16_To_FP32(MEM[__A+i+15:__A+i])
384 /// dst[MAX:128] := 0
386 static __inline__ __m128 __DEFAULT_FN_ATTRS128
387 _mm_cvtneoph_ps(const __m128h
*__A
) {
388 return (__m128
)__builtin_ia32_vcvtneoph2ps128((const __v8hf
*)__A
);
391 /// Convert packed half-precision (16-bit) floating-point odd-indexed elements
392 /// stored at memory locations starting at location \a __A to packed
393 /// single-precision (32-bit) floating-point elements, and store the results in
396 /// \headerfile <x86intrin.h>
399 /// _mm256_cvtneoph_ps(const __m256h *__A);
402 /// This intrinsic corresponds to the \c VCVTNEOPH2PS instruction.
405 /// A pointer to a 256-bit memory location containing 16 consecutive
406 /// half-precision (16-bit) floating-point values.
408 /// A 256-bit vector of [8 x float].
410 /// \code{.operation}
415 /// dst[m+31:m] := Convert_FP16_To_FP32(MEM[__A+i+15:__A+i])
417 /// dst[MAX:256] := 0
419 static __inline__ __m256 __DEFAULT_FN_ATTRS256
420 _mm256_cvtneoph_ps(const __m256h
*__A
) {
421 return (__m256
)__builtin_ia32_vcvtneoph2ps256((const __v16hf
*)__A
);
424 /// Convert packed single-precision (32-bit) floating-point elements in \a __A
425 /// to packed BF16 (16-bit) floating-point elements, and store the results in \a
428 /// \headerfile <x86intrin.h>
431 /// _mm_cvtneps_avx_pbh(__m128 __A);
434 /// This intrinsic corresponds to the \c VCVTNEPS2BF16 instruction.
437 /// A 128-bit vector of [4 x float].
439 /// A 128-bit vector of [8 x bfloat].
441 /// \code{.operation}
443 /// dst.word[j] := Convert_FP32_To_BF16(__A.fp32[j])
445 /// dst[MAX:128] := 0
447 static __inline__ __m128bh __DEFAULT_FN_ATTRS128
448 _mm_cvtneps_avx_pbh(__m128 __A
) {
449 return (__m128bh
)__builtin_ia32_vcvtneps2bf16128((__v4sf
)__A
);
452 /// Convert packed single-precision (32-bit) floating-point elements in \a __A
453 /// to packed BF16 (16-bit) floating-point elements, and store the results in \a
456 /// \headerfile <x86intrin.h>
459 /// _mm256_cvtneps_avx_pbh(__m256 __A);
462 /// This intrinsic corresponds to the \c VCVTNEPS2BF16 instruction.
465 /// A 256-bit vector of [8 x float].
467 /// A 128-bit vector of [8 x bfloat].
469 /// \code{.operation}
471 /// dst.word[j] := Convert_FP32_To_BF16(a.fp32[j])
473 /// dst[MAX:128] := 0
475 static __inline__ __m128bh __DEFAULT_FN_ATTRS256
476 _mm256_cvtneps_avx_pbh(__m256 __A
) {
477 return (__m128bh
)__builtin_ia32_vcvtneps2bf16256((__v8sf
)__A
);
480 #undef __DEFAULT_FN_ATTRS128
481 #undef __DEFAULT_FN_ATTRS256
483 #endif // __AVXNECONVERTINTRIN_H