================ @@ -0,0 +1,2336 @@ +/*===------------ avx10_2_v2auxintrin.h - AVX10_2_V2AUX -------------------=== + * + * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. + * See https://llvm.org/LICENSE.txt for license information. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + * + *===-----------------------------------------------------------------------=== + */ +#ifndef __IMMINTRIN_H +#error \ + "Never use <avx10_2_v2auxintrin.h> directly; include <immintrin.h> instead." +#endif // __IMMINTRIN_H + +#ifdef __SSE2__ + +#ifndef __AVX10_2_V2AUXINTRIN_H +#define __AVX10_2_V2AUXINTRIN_H + +/* Define the default attributes for the functions in this file. */ +#define __DEFAULT_FN_ATTRS128 \ + __attribute__((__always_inline__, __nodebug__, __target__("avx10v2aux"), \ + __min_vector_width__(128))) +#define __DEFAULT_FN_ATTRS256 \ + __attribute__((__always_inline__, __nodebug__, __target__("avx10v2aux"), \ + __min_vector_width__(256))) + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed BF8 (8-bit) floating-point elements, and store the results in +/// a 128-bit vector. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTPS2BF8 instruction. +/// +/// \param __A +/// A 128-bit vector of [4 x float]. +/// \returns +/// A 128-bit vector of [16 x i8]. The lower 4 bytes contain the converted +/// values; the upper bytes are zeroed. +static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_cvtps_bf8(__m128 __A) { + return (__m128i)__builtin_ia32_vcvtps2bf8_128((__v4sf)__A); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed BF8 (8-bit) floating-point elements, and store the results in +/// a 128-bit vector using writemask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTPS2BF8 instruction. +/// +/// \param __W +/// A 128-bit vector of [16 x i8] used for writemask. +/// \param __U +/// A 8-bit mask indicating which elements to write. +/// \param __A +/// A 128-bit vector of [4 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_mask_cvtps_bf8(__m128i __W, + __mmask8 __U, + __m128 __A) { + return (__m128i)__builtin_ia32_selectb_128( + (__mmask16)__U, (__v16qi)_mm_cvtps_bf8(__A), (__v16qi)__W); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed BF8 (8-bit) floating-point elements, and store the results in +/// a 128-bit vector using zeromask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTPS2BF8 instruction. +/// +/// \param __U +/// A 8-bit mask indicating which elements to write (zero otherwise). +/// \param __A +/// A 128-bit vector of [4 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS128 +_mm_maskz_cvtps_bf8(__mmask8 __U, __m128 __A) { + return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, + (__v16qi)_mm_cvtps_bf8(__A), + (__v16qi)_mm_setzero_si128()); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed BF8 (8-bit) floating-point elements, and store the results in +/// a 128-bit vector. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTPS2BF8 instruction. +/// +/// \param __A +/// A 256-bit vector of [8 x float]. +/// \returns +/// A 128-bit vector of [16 x i8]. The lower 8 bytes contain the converted +/// values; the upper bytes are zeroed. +static __inline__ __m128i __DEFAULT_FN_ATTRS256 _mm256_cvtps_bf8(__m256 __A) { + return (__m128i)__builtin_ia32_vcvtps2bf8_256((__v8sf)__A); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed BF8 (8-bit) floating-point elements, and store the results in +/// a 128-bit vector using writemask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTPS2BF8 instruction. +/// +/// \param __W +/// A 128-bit vector of [16 x i8] used for writemask. +/// \param __U +/// A 8-bit mask indicating which elements to write. +/// \param __A +/// A 256-bit vector of [8 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS256 +_mm256_mask_cvtps_bf8(__m128i __W, __mmask8 __U, __m256 __A) { + return (__m128i)__builtin_ia32_selectb_128( + (__mmask16)__U, (__v16qi)_mm256_cvtps_bf8(__A), (__v16qi)__W); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed BF8 (8-bit) floating-point elements, and store the results in +/// a 128-bit vector using zeromask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTPS2BF8 instruction. +/// +/// \param __U +/// A 8-bit mask indicating which elements to write (zero otherwise). +/// \param __A +/// A 256-bit vector of [8 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS256 +_mm256_maskz_cvtps_bf8(__mmask8 __U, __m256 __A) { + return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, + (__v16qi)_mm256_cvtps_bf8(__A), + (__v16qi)_mm_setzero_si128()); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed BF8 (8-bit) floating-point elements with saturation, and store +/// the results in a 128-bit vector. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTPS2BF8S instruction. +/// +/// \param __A +/// A 128-bit vector of [4 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_cvts_ps_bf8(__m128 __A) { + return (__m128i)__builtin_ia32_vcvtps2bf8s_128((__v4sf)__A); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed BF8 (8-bit) floating-point elements with saturation, and store +/// the results in a 128-bit vector using writemask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTPS2BF8S instruction. +/// +/// \param __W +/// A 128-bit vector of [16 x i8] used for writemask. +/// \param __U +/// A 8-bit mask indicating which elements to write. +/// \param __A +/// A 128-bit vector of [4 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS128 +_mm_mask_cvts_ps_bf8(__m128i __W, __mmask8 __U, __m128 __A) { + return (__m128i)__builtin_ia32_selectb_128( + (__mmask16)__U, (__v16qi)_mm_cvts_ps_bf8(__A), (__v16qi)__W); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed BF8 (8-bit) floating-point elements with saturation, and store +/// the results in a 128-bit vector using zeromask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTPS2BF8S instruction. +/// +/// \param __U +/// A 8-bit mask indicating which elements to write (zero otherwise). +/// \param __A +/// A 128-bit vector of [4 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS128 +_mm_maskz_cvts_ps_bf8(__mmask8 __U, __m128 __A) { + return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, + (__v16qi)_mm_cvts_ps_bf8(__A), + (__v16qi)_mm_setzero_si128()); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed BF8 (8-bit) floating-point elements with saturation, and store +/// the results in a 128-bit vector. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTPS2BF8S instruction. +/// +/// \param __A +/// A 256-bit vector of [8 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS256 _mm256_cvts_ps_bf8(__m256 __A) { + return (__m128i)__builtin_ia32_vcvtps2bf8s_256((__v8sf)__A); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed BF8 (8-bit) floating-point elements with saturation, and store +/// the results in a 128-bit vector using writemask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTPS2BF8S instruction. +/// +/// \param __W +/// A 128-bit vector of [16 x i8] used for writemask. +/// \param __U +/// A 8-bit mask indicating which elements to write. +/// \param __A +/// A 256-bit vector of [8 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS256 +_mm256_mask_cvts_ps_bf8(__m128i __W, __mmask8 __U, __m256 __A) { + return (__m128i)__builtin_ia32_selectb_128( + (__mmask16)__U, (__v16qi)_mm256_cvts_ps_bf8(__A), (__v16qi)__W); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed BF8 (8-bit) floating-point elements with saturation, and store +/// the results in a 128-bit vector using zeromask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTPS2BF8S instruction. +/// +/// \param __U +/// A 8-bit mask indicating which elements to write (zero otherwise). +/// \param __A +/// A 256-bit vector of [8 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS256 +_mm256_maskz_cvts_ps_bf8(__mmask8 __U, __m256 __A) { + return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, + (__v16qi)_mm256_cvts_ps_bf8(__A), + (__v16qi)_mm_setzero_si128()); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed HF8 (8-bit) floating-point elements, and store the results in +/// a 128-bit vector. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTPS2HF8 instruction. +/// +/// \param __A +/// A 128-bit vector of [4 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_cvtps_hf8(__m128 __A) { + return (__m128i)__builtin_ia32_vcvtps2hf8_128((__v4sf)__A); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed HF8 (8-bit) floating-point elements, and store the results in +/// a 128-bit vector using writemask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTPS2HF8 instruction. +/// +/// \param __W +/// A 128-bit vector of [16 x i8] used for writemask. +/// \param __U +/// A 8-bit mask indicating which elements to write. +/// \param __A +/// A 128-bit vector of [4 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_mask_cvtps_hf8(__m128i __W, + __mmask8 __U, + __m128 __A) { + return (__m128i)__builtin_ia32_selectb_128( + (__mmask16)__U, (__v16qi)_mm_cvtps_hf8(__A), (__v16qi)__W); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed HF8 (8-bit) floating-point elements, and store the results in +/// a 128-bit vector using zeromask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTPS2HF8 instruction. +/// +/// \param __U +/// A 8-bit mask indicating which elements to write (zero otherwise). +/// \param __A +/// A 128-bit vector of [4 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS128 +_mm_maskz_cvtps_hf8(__mmask8 __U, __m128 __A) { + return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, + (__v16qi)_mm_cvtps_hf8(__A), + (__v16qi)_mm_setzero_si128()); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed HF8 (8-bit) floating-point elements, and store the results in +/// a 128-bit vector. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTPS2HF8 instruction. +/// +/// \param __A +/// A 256-bit vector of [8 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS256 _mm256_cvtps_hf8(__m256 __A) { + return (__m128i)__builtin_ia32_vcvtps2hf8_256((__v8sf)__A); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed HF8 (8-bit) floating-point elements, and store the results in +/// a 128-bit vector using writemask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTPS2HF8 instruction. +/// +/// \param __W +/// A 128-bit vector of [16 x i8] used for writemask. +/// \param __U +/// A 8-bit mask indicating which elements to write. +/// \param __A +/// A 256-bit vector of [8 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS256 +_mm256_mask_cvtps_hf8(__m128i __W, __mmask8 __U, __m256 __A) { + return (__m128i)__builtin_ia32_selectb_128( + (__mmask16)__U, (__v16qi)_mm256_cvtps_hf8(__A), (__v16qi)__W); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed HF8 (8-bit) floating-point elements, and store the results in +/// a 128-bit vector using zeromask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTPS2HF8 instruction. +/// +/// \param __U +/// A 8-bit mask indicating which elements to write (zero otherwise). +/// \param __A +/// A 256-bit vector of [8 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS256 +_mm256_maskz_cvtps_hf8(__mmask8 __U, __m256 __A) { + return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, + (__v16qi)_mm256_cvtps_hf8(__A), + (__v16qi)_mm_setzero_si128()); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed HF8 (8-bit) floating-point elements with saturation, and store +/// the results in a 128-bit vector. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTPS2HF8S instruction. +/// +/// \param __A +/// A 128-bit vector of [4 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_cvts_ps_hf8(__m128 __A) { + return (__m128i)__builtin_ia32_vcvtps2hf8s_128((__v4sf)__A); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed HF8 (8-bit) floating-point elements with saturation, and store +/// the results in a 128-bit vector using writemask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTPS2HF8S instruction. +/// +/// \param __W +/// A 128-bit vector of [16 x i8] used for writemask. +/// \param __U +/// A 8-bit mask indicating which elements to write. +/// \param __A +/// A 128-bit vector of [4 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS128 +_mm_mask_cvts_ps_hf8(__m128i __W, __mmask8 __U, __m128 __A) { + return (__m128i)__builtin_ia32_selectb_128( + (__mmask16)__U, (__v16qi)_mm_cvts_ps_hf8(__A), (__v16qi)__W); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed HF8 (8-bit) floating-point elements with saturation, and store +/// the results in a 128-bit vector using zeromask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTPS2HF8S instruction. +/// +/// \param __U +/// A 8-bit mask indicating which elements to write (zero otherwise). +/// \param __A +/// A 128-bit vector of [4 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS128 +_mm_maskz_cvts_ps_hf8(__mmask8 __U, __m128 __A) { + return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, + (__v16qi)_mm_cvts_ps_hf8(__A), + (__v16qi)_mm_setzero_si128()); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed HF8 (8-bit) floating-point elements with saturation, and store +/// the results in a 128-bit vector. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTPS2HF8S instruction. +/// +/// \param __A +/// A 256-bit vector of [8 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS256 _mm256_cvts_ps_hf8(__m256 __A) { + return (__m128i)__builtin_ia32_vcvtps2hf8s_256((__v8sf)__A); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed HF8 (8-bit) floating-point elements with saturation, and store +/// the results in a 128-bit vector using writemask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTPS2HF8S instruction. +/// +/// \param __W +/// A 128-bit vector of [16 x i8] used for writemask. +/// \param __U +/// A 8-bit mask indicating which elements to write. +/// \param __A +/// A 256-bit vector of [8 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS256 +_mm256_mask_cvts_ps_hf8(__m128i __W, __mmask8 __U, __m256 __A) { + return (__m128i)__builtin_ia32_selectb_128( + (__mmask16)__U, (__v16qi)_mm256_cvts_ps_hf8(__A), (__v16qi)__W); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed HF8 (8-bit) floating-point elements with saturation, and store +/// the results in a 128-bit vector using zeromask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTPS2HF8S instruction. +/// +/// \param __U +/// A 8-bit mask indicating which elements to write (zero otherwise). +/// \param __A +/// A 256-bit vector of [8 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS256 +_mm256_maskz_cvts_ps_hf8(__mmask8 __U, __m256 __A) { + return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, + (__v16qi)_mm256_cvts_ps_hf8(__A), + (__v16qi)_mm_setzero_si128()); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed HF8 (8-bit) floating-point elements using round-to-odd, and +/// store the results in a 128-bit vector. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTROPS2HF8 instruction. +/// +/// \param __A +/// A 128-bit vector of [4 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_cvtrops_hf8(__m128 __A) { + return (__m128i)__builtin_ia32_vcvtrops2hf8_128((__v4sf)__A); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed HF8 (8-bit) floating-point elements using round-to-odd, and +/// store the results in a 128-bit vector using writemask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTROPS2HF8 instruction. +/// +/// \param __W +/// A 128-bit vector of [16 x i8] used for writemask. +/// \param __U +/// A 8-bit mask indicating which elements to write. +/// \param __A +/// A 128-bit vector of [4 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS128 +_mm_mask_cvtrops_hf8(__m128i __W, __mmask8 __U, __m128 __A) { + return (__m128i)__builtin_ia32_selectb_128( + (__mmask16)__U, (__v16qi)_mm_cvtrops_hf8(__A), (__v16qi)__W); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed HF8 (8-bit) floating-point elements using round-to-odd, and +/// store the results in a 128-bit vector using zeromask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTROPS2HF8 instruction. +/// +/// \param __U +/// A 8-bit mask indicating which elements to write (zero otherwise). +/// \param __A +/// A 128-bit vector of [4 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS128 +_mm_maskz_cvtrops_hf8(__mmask8 __U, __m128 __A) { + return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, + (__v16qi)_mm_cvtrops_hf8(__A), + (__v16qi)_mm_setzero_si128()); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed HF8 (8-bit) floating-point elements using round-to-odd, and +/// store the results in a 128-bit vector. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTROPS2HF8 instruction. +/// +/// \param __A +/// A 256-bit vector of [8 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS256 _mm256_cvtrops_hf8(__m256 __A) { + return (__m128i)__builtin_ia32_vcvtrops2hf8_256((__v8sf)__A); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed HF8 (8-bit) floating-point elements using round-to-odd, and +/// store the results in a 128-bit vector using writemask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTROPS2HF8 instruction. +/// +/// \param __W +/// A 128-bit vector of [16 x i8] used for writemask. +/// \param __U +/// A 8-bit mask indicating which elements to write. +/// \param __A +/// A 256-bit vector of [8 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS256 +_mm256_mask_cvtrops_hf8(__m128i __W, __mmask8 __U, __m256 __A) { + return (__m128i)__builtin_ia32_selectb_128( + (__mmask16)__U, (__v16qi)_mm256_cvtrops_hf8(__A), (__v16qi)__W); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed HF8 (8-bit) floating-point elements using round-to-odd, and +/// store the results in a 128-bit vector using zeromask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTROPS2HF8 instruction. +/// +/// \param __U +/// A 8-bit mask indicating which elements to write (zero otherwise). +/// \param __A +/// A 256-bit vector of [8 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS256 +_mm256_maskz_cvtrops_hf8(__mmask8 __U, __m256 __A) { + return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, + (__v16qi)_mm256_cvtrops_hf8(__A), + (__v16qi)_mm_setzero_si128()); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed HF8 (8-bit) floating-point elements using round-to-odd with +/// saturation, and store the results in a 128-bit vector. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTROPS2HF8S instruction. +/// +/// \param __A +/// A 128-bit vector of [4 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_cvts_rops_hf8(__m128 __A) { + return (__m128i)__builtin_ia32_vcvtrops2hf8s_128((__v4sf)__A); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed HF8 (8-bit) floating-point elements using round-to-odd with +/// saturation, and store the results using writemask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTROPS2HF8S instruction. +/// +/// \param __W +/// A 128-bit vector of [16 x i8] used for writemask. +/// \param __U +/// A 8-bit mask indicating which elements to write. +/// \param __A +/// A 128-bit vector of [4 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS128 +_mm_mask_cvts_rops_hf8(__m128i __W, __mmask8 __U, __m128 __A) { + return (__m128i)__builtin_ia32_selectb_128( + (__mmask16)__U, (__v16qi)_mm_cvts_rops_hf8(__A), (__v16qi)__W); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed HF8 (8-bit) floating-point elements using round-to-odd with +/// saturation, and store the results using zeromask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTROPS2HF8S instruction. +/// +/// \param __U +/// A 8-bit mask indicating which elements to write (zero otherwise). +/// \param __A +/// A 128-bit vector of [4 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS128 +_mm_maskz_cvts_rops_hf8(__mmask8 __U, __m128 __A) { + return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, + (__v16qi)_mm_cvts_rops_hf8(__A), + (__v16qi)_mm_setzero_si128()); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed HF8 (8-bit) floating-point elements using round-to-odd with +/// saturation, and store the results in a 128-bit vector. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTROPS2HF8S instruction. +/// +/// \param __A +/// A 256-bit vector of [8 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS256 +_mm256_cvts_rops_hf8(__m256 __A) { + return (__m128i)__builtin_ia32_vcvtrops2hf8s_256((__v8sf)__A); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed HF8 (8-bit) floating-point elements using round-to-odd with +/// saturation, and store the results using writemask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTROPS2HF8S instruction. +/// +/// \param __W +/// A 128-bit vector of [16 x i8] used for writemask. +/// \param __U +/// A 8-bit mask indicating which elements to write. +/// \param __A +/// A 256-bit vector of [8 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS256 +_mm256_mask_cvts_rops_hf8(__m128i __W, __mmask8 __U, __m256 __A) { + return (__m128i)__builtin_ia32_selectb_128( + (__mmask16)__U, (__v16qi)_mm256_cvts_rops_hf8(__A), (__v16qi)__W); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __A +/// to packed HF8 (8-bit) floating-point elements using round-to-odd with +/// saturation, and store the results using zeromask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTROPS2HF8S instruction. +/// +/// \param __U +/// A 8-bit mask indicating which elements to write (zero otherwise). +/// \param __A +/// A 256-bit vector of [8 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS256 +_mm256_maskz_cvts_rops_hf8(__mmask8 __U, __m256 __A) { + return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, + (__v16qi)_mm256_cvts_rops_hf8(__A), + (__v16qi)_mm_setzero_si128()); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __B +/// to packed BF8 (8-bit) floating-point elements using bias values from +/// \a __A, and store the results in a 128-bit vector. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTBIASPS2BF8 instruction. +/// +/// \param __A +/// A 128-bit vector of [16 x i8] containing bias values. +/// \param __B +/// A 128-bit vector of [4 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_cvtbiasps_bf8(__m128i __A, + __m128 __B) { + return (__m128i)__builtin_ia32_vcvtbiasps2bf8_128((__v16qi)__A, (__v4sf)__B); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __B +/// to packed BF8 (8-bit) floating-point elements using bias values from +/// \a __A, and store the results using writemask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTBIASPS2BF8 instruction. +/// +/// \param __W +/// A 128-bit vector of [16 x i8] used for writemask. +/// \param __U +/// A 8-bit mask indicating which elements to write. +/// \param __A +/// A 128-bit vector of [16 x i8] containing bias values. +/// \param __B +/// A 128-bit vector of [4 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS128 +_mm_mask_cvtbiasps_bf8(__m128i __W, __mmask8 __U, __m128i __A, __m128 __B) { + return (__m128i)__builtin_ia32_selectb_128( + (__mmask16)__U, (__v16qi)_mm_cvtbiasps_bf8(__A, __B), (__v16qi)__W); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __B +/// to packed BF8 (8-bit) floating-point elements using bias values from +/// \a __A, and store the results using zeromask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTBIASPS2BF8 instruction. +/// +/// \param __U +/// A 8-bit mask indicating which elements to write (zero otherwise). +/// \param __A +/// A 128-bit vector of [16 x i8] containing bias values. +/// \param __B +/// A 128-bit vector of [4 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS128 +_mm_maskz_cvtbiasps_bf8(__mmask8 __U, __m128i __A, __m128 __B) { + return (__m128i)__builtin_ia32_selectb_128( + (__mmask16)__U, (__v16qi)_mm_cvtbiasps_bf8(__A, __B), + (__v16qi)_mm_setzero_si128()); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __B +/// to packed BF8 (8-bit) floating-point elements using bias values from +/// \a __A, and store the results in a 128-bit vector. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTBIASPS2BF8 instruction. +/// +/// \param __A +/// A 256-bit vector of [32 x i8] containing bias values. +/// \param __B +/// A 256-bit vector of [8 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS256 +_mm256_cvtbiasps_bf8(__m256i __A, __m256 __B) { + return (__m128i)__builtin_ia32_vcvtbiasps2bf8_256((__v32qi)__A, (__v8sf)__B); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __B +/// to packed BF8 (8-bit) floating-point elements using bias values from +/// \a __A, and store the results using writemask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTBIASPS2BF8 instruction. +/// +/// \param __W +/// A 128-bit vector of [16 x i8] used for writemask. +/// \param __U +/// A 8-bit mask indicating which elements to write. +/// \param __A +/// A 256-bit vector of [32 x i8] containing bias values. +/// \param __B +/// A 256-bit vector of [8 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS256 +_mm256_mask_cvtbiasps_bf8(__m128i __W, __mmask8 __U, __m256i __A, __m256 __B) { + return (__m128i)__builtin_ia32_selectb_128( + (__mmask16)__U, (__v16qi)_mm256_cvtbiasps_bf8(__A, __B), (__v16qi)__W); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __B +/// to packed BF8 (8-bit) floating-point elements using bias values from +/// \a __A, and store the results using zeromask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTBIASPS2BF8 instruction. +/// +/// \param __U +/// A 8-bit mask indicating which elements to write (zero otherwise). +/// \param __A +/// A 256-bit vector of [32 x i8] containing bias values. +/// \param __B +/// A 256-bit vector of [8 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS256 +_mm256_maskz_cvtbiasps_bf8(__mmask8 __U, __m256i __A, __m256 __B) { + return (__m128i)__builtin_ia32_selectb_128( + (__mmask16)__U, (__v16qi)_mm256_cvtbiasps_bf8(__A, __B), + (__v16qi)_mm_setzero_si128()); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __B +/// to packed BF8 (8-bit) floating-point elements with saturation using bias +/// values from \a __A, and store the results in a 128-bit vector. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTBIASPS2BF8S instruction. +/// +/// \param __A +/// A 128-bit vector of [16 x i8] containing bias values. +/// \param __B +/// A 128-bit vector of [4 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS128 +_mm_cvts_biasps_bf8(__m128i __A, __m128 __B) { + return (__m128i)__builtin_ia32_vcvtbiasps2bf8s_128((__v16qi)__A, (__v4sf)__B); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __B +/// to packed BF8 (8-bit) floating-point elements with saturation using bias +/// values from \a __A, and store the results using writemask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTBIASPS2BF8S instruction. +/// +/// \param __W +/// A 128-bit vector of [16 x i8] used for writemask. +/// \param __U +/// A 8-bit mask indicating which elements to write. +/// \param __A +/// A 128-bit vector of [16 x i8] containing bias values. +/// \param __B +/// A 128-bit vector of [4 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS128 +_mm_mask_cvts_biasps_bf8(__m128i __W, __mmask8 __U, __m128i __A, __m128 __B) { + return (__m128i)__builtin_ia32_selectb_128( + (__mmask16)__U, (__v16qi)_mm_cvts_biasps_bf8(__A, __B), (__v16qi)__W); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __B +/// to packed BF8 (8-bit) floating-point elements with saturation using bias +/// values from \a __A, and store the results using zeromask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTBIASPS2BF8S instruction. +/// +/// \param __U +/// A 8-bit mask indicating which elements to write (zero otherwise). +/// \param __A +/// A 128-bit vector of [16 x i8] containing bias values. +/// \param __B +/// A 128-bit vector of [4 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS128 +_mm_maskz_cvts_biasps_bf8(__mmask8 __U, __m128i __A, __m128 __B) { + return (__m128i)__builtin_ia32_selectb_128( + (__mmask16)__U, (__v16qi)_mm_cvts_biasps_bf8(__A, __B), + (__v16qi)_mm_setzero_si128()); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __B +/// to packed BF8 (8-bit) floating-point elements with saturation using bias +/// values from \a __A, and store the results in a 128-bit vector. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTBIASPS2BF8S instruction. +/// +/// \param __A +/// A 256-bit vector of [32 x i8] containing bias values. +/// \param __B +/// A 256-bit vector of [8 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS256 +_mm256_cvts_biasps_bf8(__m256i __A, __m256 __B) { + return (__m128i)__builtin_ia32_vcvtbiasps2bf8s_256((__v32qi)__A, (__v8sf)__B); +} + +/// Convert packed single-precision (32-bit) floating-point elements in \a __B +/// to packed BF8 (8-bit) floating-point elements with saturation using bias +/// values from \a __A, and store the results using writemask \a __U. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the \c VCVTBIASPS2BF8S instruction. +/// +/// \param __W +/// A 128-bit vector of [16 x i8] used for writemask. +/// \param __U +/// A 8-bit mask indicating which elements to write. +/// \param __A +/// A 256-bit vector of [32 x i8] containing bias values. +/// \param __B +/// A 256-bit vector of [8 x float]. +/// \returns +/// A 128-bit vector of [16 x i8] containing the converted values. +static __inline__ __m128i __DEFAULT_FN_ATTRS256 _mm256_mask_cvts_biasps_bf8( + __m128i __W, __mmask8 __U, __m256i __A, __m256 __B) { + return (__m128i)__builtin_ia32_selectb_128( + (__mmask16)__U, (__v16qi)_mm256_cvts_biasps_bf8(__A, __B), (__v16qi)__W); ---------------- e-kud wrote:
__mmask8 is casted to __mmask16. https://github.com/llvm/llvm-project/pull/206888 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
