xref: /aosp_15_r20/prebuilts/clang-tools/linux-x86/clang-headers/__wmmintrin_pclmul.h (revision bed243d3d9cd544cfb038bfa7be843dedc6e6bf7)
1*bed243d3SAndroid Build Coastguard Worker /*===---- __wmmintrin_pclmul.h - PCMUL intrinsics ---------------------------===
2*bed243d3SAndroid Build Coastguard Worker  *
3*bed243d3SAndroid Build Coastguard Worker  * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*bed243d3SAndroid Build Coastguard Worker  * See https://llvm.org/LICENSE.txt for license information.
5*bed243d3SAndroid Build Coastguard Worker  * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*bed243d3SAndroid Build Coastguard Worker  *
7*bed243d3SAndroid Build Coastguard Worker  *===-----------------------------------------------------------------------===
8*bed243d3SAndroid Build Coastguard Worker  */
9*bed243d3SAndroid Build Coastguard Worker 
10*bed243d3SAndroid Build Coastguard Worker #ifndef __WMMINTRIN_H
11*bed243d3SAndroid Build Coastguard Worker #error "Never use <__wmmintrin_pclmul.h> directly; include <wmmintrin.h> instead."
12*bed243d3SAndroid Build Coastguard Worker #endif
13*bed243d3SAndroid Build Coastguard Worker 
14*bed243d3SAndroid Build Coastguard Worker #ifndef __WMMINTRIN_PCLMUL_H
15*bed243d3SAndroid Build Coastguard Worker #define __WMMINTRIN_PCLMUL_H
16*bed243d3SAndroid Build Coastguard Worker 
17*bed243d3SAndroid Build Coastguard Worker /// Multiplies two 64-bit integer values, which are selected from source
18*bed243d3SAndroid Build Coastguard Worker ///    operands using the immediate-value operand. The multiplication is a
19*bed243d3SAndroid Build Coastguard Worker ///    carry-less multiplication, and the 128-bit integer product is stored in
20*bed243d3SAndroid Build Coastguard Worker ///    the destination.
21*bed243d3SAndroid Build Coastguard Worker ///
22*bed243d3SAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
23*bed243d3SAndroid Build Coastguard Worker ///
24*bed243d3SAndroid Build Coastguard Worker /// \code
25*bed243d3SAndroid Build Coastguard Worker /// __m128i _mm_clmulepi64_si128(__m128i X, __m128i Y, const int I);
26*bed243d3SAndroid Build Coastguard Worker /// \endcode
27*bed243d3SAndroid Build Coastguard Worker ///
28*bed243d3SAndroid Build Coastguard Worker /// This intrinsic corresponds to the <c> VPCLMULQDQ </c> instruction.
29*bed243d3SAndroid Build Coastguard Worker ///
30*bed243d3SAndroid Build Coastguard Worker /// \param X
31*bed243d3SAndroid Build Coastguard Worker ///    A 128-bit vector of [2 x i64] containing one of the source operands.
32*bed243d3SAndroid Build Coastguard Worker /// \param Y
33*bed243d3SAndroid Build Coastguard Worker ///    A 128-bit vector of [2 x i64] containing one of the source operands.
34*bed243d3SAndroid Build Coastguard Worker /// \param I
35*bed243d3SAndroid Build Coastguard Worker ///    An immediate value specifying which 64-bit values to select from the
36*bed243d3SAndroid Build Coastguard Worker ///    operands. Bit 0 is used to select a value from operand \a X, and bit
37*bed243d3SAndroid Build Coastguard Worker ///    4 is used to select a value from operand \a Y: \n
38*bed243d3SAndroid Build Coastguard Worker ///    Bit[0]=0 indicates that bits[63:0] of operand \a X are used. \n
39*bed243d3SAndroid Build Coastguard Worker ///    Bit[0]=1 indicates that bits[127:64] of operand \a X are used. \n
40*bed243d3SAndroid Build Coastguard Worker ///    Bit[4]=0 indicates that bits[63:0] of operand \a Y are used. \n
41*bed243d3SAndroid Build Coastguard Worker ///    Bit[4]=1 indicates that bits[127:64] of operand \a Y are used.
42*bed243d3SAndroid Build Coastguard Worker /// \returns The 128-bit integer vector containing the result of the carry-less
43*bed243d3SAndroid Build Coastguard Worker ///    multiplication of the selected 64-bit values.
44*bed243d3SAndroid Build Coastguard Worker #define _mm_clmulepi64_si128(X, Y, I) \
45*bed243d3SAndroid Build Coastguard Worker   ((__m128i)__builtin_ia32_pclmulqdq128((__v2di)(__m128i)(X), \
46*bed243d3SAndroid Build Coastguard Worker                                         (__v2di)(__m128i)(Y), (char)(I)))
47*bed243d3SAndroid Build Coastguard Worker 
48*bed243d3SAndroid Build Coastguard Worker #endif /* __WMMINTRIN_PCLMUL_H */
49