xref: /freebsd/contrib/llvm-project/clang/lib/Headers/avx512vlvp2intersectintrin.h (revision 5f757f3ff9144b609b3c433dfd370cc6bdc191ad)
10b57cec5SDimitry Andric /*===------ avx512vlvp2intersectintrin.h - VL VP2INTERSECT intrinsics ------===
20b57cec5SDimitry Andric  *
30b57cec5SDimitry Andric  *
40b57cec5SDimitry Andric  * Permission is hereby granted, free of charge, to any person obtaining a copy
50b57cec5SDimitry Andric  * of this software and associated documentation files (the "Software"), to deal
60b57cec5SDimitry Andric  * in the Software without restriction, including without limitation the rights
70b57cec5SDimitry Andric  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
80b57cec5SDimitry Andric  * copies of the Software, and to permit persons to whom the Software is
90b57cec5SDimitry Andric  * furnished to do so, subject to the following conditions:
100b57cec5SDimitry Andric  *
110b57cec5SDimitry Andric  * The above copyright notice and this permission notice shall be included in
120b57cec5SDimitry Andric  * all copies or substantial portions of the Software.
130b57cec5SDimitry Andric  *
140b57cec5SDimitry Andric  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
150b57cec5SDimitry Andric  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
160b57cec5SDimitry Andric  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
170b57cec5SDimitry Andric  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
180b57cec5SDimitry Andric  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
190b57cec5SDimitry Andric  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
200b57cec5SDimitry Andric  * THE SOFTWARE.
210b57cec5SDimitry Andric  *
220b57cec5SDimitry Andric  *===-----------------------------------------------------------------------===
230b57cec5SDimitry Andric  */
240b57cec5SDimitry Andric #ifndef __IMMINTRIN_H
250b57cec5SDimitry Andric #error "Never use <avx512vlvp2intersectintrin.h> directly; include <immintrin.h> instead."
260b57cec5SDimitry Andric #endif
270b57cec5SDimitry Andric 
280b57cec5SDimitry Andric #ifndef _AVX512VLVP2INTERSECT_H
290b57cec5SDimitry Andric #define _AVX512VLVP2INTERSECT_H
300b57cec5SDimitry Andric 
310b57cec5SDimitry Andric #define __DEFAULT_FN_ATTRS128                                                  \
32*5f757f3fSDimitry Andric   __attribute__((__always_inline__, __nodebug__,                               \
33*5f757f3fSDimitry Andric                  __target__("avx512vl,avx512vp2intersect,no-evex512"),         \
340b57cec5SDimitry Andric                  __min_vector_width__(128)))
350b57cec5SDimitry Andric 
360b57cec5SDimitry Andric #define __DEFAULT_FN_ATTRS256                                                  \
37*5f757f3fSDimitry Andric   __attribute__((__always_inline__, __nodebug__,                               \
38*5f757f3fSDimitry Andric                  __target__("avx512vl,avx512vp2intersect,no-evex512"),         \
390b57cec5SDimitry Andric                  __min_vector_width__(256)))
400b57cec5SDimitry Andric /// Store, in an even/odd pair of mask registers, the indicators of the
410b57cec5SDimitry Andric /// locations of value matches between dwords in operands __a and __b.
420b57cec5SDimitry Andric ///
430b57cec5SDimitry Andric /// \headerfile <x86intrin.h>
440b57cec5SDimitry Andric ///
450b57cec5SDimitry Andric /// This intrinsic corresponds to the <c> VP2INTERSECTD </c> instruction.
460b57cec5SDimitry Andric ///
470b57cec5SDimitry Andric /// \param __a
480b57cec5SDimitry Andric ///    A 256-bit vector of [8 x i32].
490b57cec5SDimitry Andric /// \param __b
500b57cec5SDimitry Andric ///    A 256-bit vector of [8 x i32]
510b57cec5SDimitry Andric /// \param __m0
520b57cec5SDimitry Andric ///    A pointer point to 8-bit mask
530b57cec5SDimitry Andric /// \param __m1
540b57cec5SDimitry Andric ///    A pointer point to 8-bit mask
550b57cec5SDimitry Andric static __inline__ void __DEFAULT_FN_ATTRS256
560b57cec5SDimitry Andric _mm256_2intersect_epi32(__m256i __a, __m256i __b, __mmask8 *__m0, __mmask8 *__m1) {
570b57cec5SDimitry Andric   __builtin_ia32_vp2intersect_d_256((__v8si)__a, (__v8si)__b, __m0, __m1);
580b57cec5SDimitry Andric }
590b57cec5SDimitry Andric 
600b57cec5SDimitry Andric /// Store, in an even/odd pair of mask registers, the indicators of the
610b57cec5SDimitry Andric /// locations of value matches between quadwords in operands __a and __b.
620b57cec5SDimitry Andric ///
630b57cec5SDimitry Andric /// \headerfile <x86intrin.h>
640b57cec5SDimitry Andric ///
650b57cec5SDimitry Andric /// This intrinsic corresponds to the <c> VP2INTERSECTQ </c> instruction.
660b57cec5SDimitry Andric ///
670b57cec5SDimitry Andric /// \param __a
680b57cec5SDimitry Andric ///    A 256-bit vector of [4 x i64].
690b57cec5SDimitry Andric /// \param __b
700b57cec5SDimitry Andric ///    A 256-bit vector of [4 x i64]
710b57cec5SDimitry Andric /// \param __m0
720b57cec5SDimitry Andric ///    A pointer point to 8-bit mask
730b57cec5SDimitry Andric /// \param __m1
740b57cec5SDimitry Andric ///    A pointer point to 8-bit mask
750b57cec5SDimitry Andric static __inline__ void __DEFAULT_FN_ATTRS256
760b57cec5SDimitry Andric _mm256_2intersect_epi64(__m256i __a, __m256i __b, __mmask8 *__m0, __mmask8 *__m1) {
770b57cec5SDimitry Andric   __builtin_ia32_vp2intersect_q_256((__v4di)__a, (__v4di)__b, __m0, __m1);
780b57cec5SDimitry Andric }
790b57cec5SDimitry Andric 
800b57cec5SDimitry Andric /// Store, in an even/odd pair of mask registers, the indicators of the
810b57cec5SDimitry Andric /// locations of value matches between dwords in operands __a and __b.
820b57cec5SDimitry Andric ///
830b57cec5SDimitry Andric /// \headerfile <x86intrin.h>
840b57cec5SDimitry Andric ///
850b57cec5SDimitry Andric /// This intrinsic corresponds to the <c> VP2INTERSECTD </c> instruction.
860b57cec5SDimitry Andric ///
870b57cec5SDimitry Andric /// \param __a
880b57cec5SDimitry Andric ///    A 128-bit vector of [4 x i32].
890b57cec5SDimitry Andric /// \param __b
900b57cec5SDimitry Andric ///    A 128-bit vector of [4 x i32]
910b57cec5SDimitry Andric /// \param __m0
920b57cec5SDimitry Andric ///    A pointer point to 8-bit mask
930b57cec5SDimitry Andric /// \param __m1
940b57cec5SDimitry Andric ///    A pointer point to 8-bit mask
950b57cec5SDimitry Andric static __inline__ void __DEFAULT_FN_ATTRS128
960b57cec5SDimitry Andric _mm_2intersect_epi32(__m128i __a, __m128i __b, __mmask8 *__m0, __mmask8 *__m1) {
970b57cec5SDimitry Andric   __builtin_ia32_vp2intersect_d_128((__v4si)__a, (__v4si)__b, __m0, __m1);
980b57cec5SDimitry Andric }
990b57cec5SDimitry Andric 
1000b57cec5SDimitry Andric /// Store, in an even/odd pair of mask registers, the indicators of the
1010b57cec5SDimitry Andric /// locations of value matches between quadwords in operands __a and __b.
1020b57cec5SDimitry Andric ///
1030b57cec5SDimitry Andric /// \headerfile <x86intrin.h>
1040b57cec5SDimitry Andric ///
1050b57cec5SDimitry Andric /// This intrinsic corresponds to the <c> VP2INTERSECTQ </c> instruction.
1060b57cec5SDimitry Andric ///
1070b57cec5SDimitry Andric /// \param __a
1080b57cec5SDimitry Andric ///    A 128-bit vector of [2 x i64].
1090b57cec5SDimitry Andric /// \param __b
1100b57cec5SDimitry Andric ///    A 128-bit vector of [2 x i64]
1110b57cec5SDimitry Andric /// \param __m0
1120b57cec5SDimitry Andric ///    A pointer point to 8-bit mask
1130b57cec5SDimitry Andric /// \param __m1
1140b57cec5SDimitry Andric ///    A pointer point to 8-bit mask
1150b57cec5SDimitry Andric static __inline__ void __DEFAULT_FN_ATTRS128
1160b57cec5SDimitry Andric _mm_2intersect_epi64(__m128i __a, __m128i __b, __mmask8 *__m0, __mmask8 *__m1) {
1170b57cec5SDimitry Andric   __builtin_ia32_vp2intersect_q_128((__v2di)__a, (__v2di)__b, __m0, __m1);
1180b57cec5SDimitry Andric }
1190b57cec5SDimitry Andric 
1200b57cec5SDimitry Andric #undef __DEFAULT_FN_ATTRS128
1210b57cec5SDimitry Andric #undef __DEFAULT_FN_ATTRS256
1220b57cec5SDimitry Andric 
1230b57cec5SDimitry Andric #endif
124