49 lines · c
1/*===---- __wmmintrin_pclmul.h - PCMUL 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 10#ifndef __WMMINTRIN_H11#error "Never use <__wmmintrin_pclmul.h> directly; include <wmmintrin.h> instead."12#endif13 14#ifndef __WMMINTRIN_PCLMUL_H15#define __WMMINTRIN_PCLMUL_H16 17/// Multiplies two 64-bit integer values, which are selected from source18/// operands using the immediate-value operand. The multiplication is a19/// carry-less multiplication, and the 128-bit integer product is stored in20/// the destination.21///22/// \headerfile <x86intrin.h>23///24/// \code25/// __m128i _mm_clmulepi64_si128(__m128i X, __m128i Y, const int I);26/// \endcode27///28/// This intrinsic corresponds to the <c> VPCLMULQDQ </c> instruction.29///30/// \param X31/// A 128-bit vector of [2 x i64] containing one of the source operands.32/// \param Y33/// A 128-bit vector of [2 x i64] containing one of the source operands.34/// \param I35/// An immediate value specifying which 64-bit values to select from the36/// operands. Bit 0 is used to select a value from operand \a X, and bit37/// 4 is used to select a value from operand \a Y: \n38/// Bit[0]=0 indicates that bits[63:0] of operand \a X are used. \n39/// Bit[0]=1 indicates that bits[127:64] of operand \a X are used. \n40/// Bit[4]=0 indicates that bits[63:0] of operand \a Y are used. \n41/// Bit[4]=1 indicates that bits[127:64] of operand \a Y are used.42/// \returns The 128-bit integer vector containing the result of the carry-less43/// multiplication of the selected 64-bit values.44#define _mm_clmulepi64_si128(X, Y, I) \45 ((__m128i)__builtin_ia32_pclmulqdq128((__v2di)(__m128i)(X), \46 (__v2di)(__m128i)(Y), (char)(I)))47 48#endif /* __WMMINTRIN_PCLMUL_H */49