67 lines · c
1/*===---- avx10_2copyintrin.h - AVX10.2 Copy intrinsics -------------------===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-exception6 *7 *===-----------------------------------------------------------------------===8 */9#ifndef __IMMINTRIN_H10#error \11 "Never use <avx10_2copyintrin.h> directly; include <immintrin.h> instead."12#endif // __IMMINTRIN_H13 14#ifndef __AVX10_2COPYINTRIN_H15#define __AVX10_2COPYINTRIN_H16 17/* Define the default attributes for the functions in this file. */18#define __DEFAULT_FN_ATTRS128 \19 __attribute__((__always_inline__, __nodebug__, __target__("avx10.2"), \20 __min_vector_width__(128)))21 22/// Constructs a 128-bit integer vector, setting the lower 32 bits to the23/// lower 32 bits of the parameter \a __A; the upper bits are zeoroed.24///25/// \code{.operation}26/// result[31:0] := __A[31:0]27/// result[MAX:32] := 028/// \endcode29///30/// \headerfile <immintrin.h>31///32/// This intrinsic corresponds to the <c> VMOVD </c> instruction.33///34/// \param __A35/// A 128-bit integer vector.36/// \returns A 128-bit integer vector. The lower 32 bits are copied from the37/// parameter \a __A; the upper bits are zeroed.38static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_move_epi32(__m128i __A) {39 return (__m128i)__builtin_shufflevector(40 (__v4si)__A, (__v4si)_mm_setzero_si128(), 0, 4, 4, 4);41}42 43/// Constructs a 128-bit integer vector, setting the lower 16 bits to the44/// lower 16 bits of the parameter \a __A; the upper bits are zeoroed.45///46/// \code{.operation}47/// result[15:0] := __A[15:0]48/// result[MAX:16] := 049/// \endcode50///51/// \headerfile <immintrin.h>52///53/// This intrinsic corresponds to the <c> VMOVW </c> instruction.54///55/// \param __A56/// A 128-bit integer vector.57/// \returns A 128-bit integer vector. The lower 16 bits are copied from the58/// parameter \a __A; the upper bits are zeroed.59static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_move_epi16(__m128i __A) {60 return (__m128i)__builtin_shufflevector(61 (__v8hi)__A, (__v8hi)_mm_setzero_si128(), 0, 8, 8, 8, 8, 8, 8, 8);62}63 64#undef __DEFAULT_FN_ATTRS12865 66#endif // __AVX10_2COPYINTRIN_H67