10b57cec5SDimitry Andric /*===------- avx512vpintersectintrin.h - 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 <avx512vp2intersect.h> directly; include <immintrin.h> instead." 260b57cec5SDimitry Andric #endif 270b57cec5SDimitry Andric 280b57cec5SDimitry Andric #ifndef _AVX512VP2INTERSECT_H 290b57cec5SDimitry Andric #define _AVX512VP2INTERSECT_H 300b57cec5SDimitry Andric 310b57cec5SDimitry Andric #define __DEFAULT_FN_ATTRS \ 32*5f757f3fSDimitry Andric __attribute__((__always_inline__, __nodebug__, \ 33*5f757f3fSDimitry Andric __target__("avx512vp2intersect,evex512"), \ 340b57cec5SDimitry Andric __min_vector_width__(512))) 350b57cec5SDimitry Andric 360b57cec5SDimitry Andric /// Store, in an even/odd pair of mask registers, the indicators of the 370b57cec5SDimitry Andric /// locations of value matches between dwords in operands __a and __b. 380b57cec5SDimitry Andric /// 390b57cec5SDimitry Andric /// \headerfile <x86intrin.h> 400b57cec5SDimitry Andric /// 410b57cec5SDimitry Andric /// This intrinsic corresponds to the <c> VP2INTERSECTD </c> instruction. 420b57cec5SDimitry Andric /// 430b57cec5SDimitry Andric /// \param __a 440b57cec5SDimitry Andric /// A 512-bit vector of [16 x i32]. 450b57cec5SDimitry Andric /// \param __b 460b57cec5SDimitry Andric /// A 512-bit vector of [16 x i32] 470b57cec5SDimitry Andric /// \param __m0 480b57cec5SDimitry Andric /// A pointer point to 16-bit mask 490b57cec5SDimitry Andric /// \param __m1 500b57cec5SDimitry Andric /// A pointer point to 16-bit mask 510b57cec5SDimitry Andric static __inline__ void __DEFAULT_FN_ATTRS 520b57cec5SDimitry Andric _mm512_2intersect_epi32(__m512i __a, __m512i __b, __mmask16 *__m0, __mmask16 *__m1) { 530b57cec5SDimitry Andric __builtin_ia32_vp2intersect_d_512((__v16si)__a, (__v16si)__b, __m0, __m1); 540b57cec5SDimitry Andric } 550b57cec5SDimitry Andric 560b57cec5SDimitry Andric /// Store, in an even/odd pair of mask registers, the indicators of the 570b57cec5SDimitry Andric /// locations of value matches between quadwords in operands __a and __b. 580b57cec5SDimitry Andric /// 590b57cec5SDimitry Andric /// \headerfile <x86intrin.h> 600b57cec5SDimitry Andric /// 610b57cec5SDimitry Andric /// This intrinsic corresponds to the <c> VP2INTERSECTQ </c> instruction. 620b57cec5SDimitry Andric /// 630b57cec5SDimitry Andric /// \param __a 640b57cec5SDimitry Andric /// A 512-bit vector of [8 x i64]. 650b57cec5SDimitry Andric /// \param __b 660b57cec5SDimitry Andric /// A 512-bit vector of [8 x i64] 670b57cec5SDimitry Andric /// \param __m0 680b57cec5SDimitry Andric /// A pointer point to 8-bit mask 690b57cec5SDimitry Andric /// \param __m1 700b57cec5SDimitry Andric /// A pointer point to 8-bit mask 710b57cec5SDimitry Andric static __inline__ void __DEFAULT_FN_ATTRS 720b57cec5SDimitry Andric _mm512_2intersect_epi64(__m512i __a, __m512i __b, __mmask8 *__m0, __mmask8 *__m1) { 730b57cec5SDimitry Andric __builtin_ia32_vp2intersect_q_512((__v8di)__a, (__v8di)__b, __m0, __m1); 740b57cec5SDimitry Andric } 750b57cec5SDimitry Andric 760b57cec5SDimitry Andric #undef __DEFAULT_FN_ATTRS 770b57cec5SDimitry Andric 780b57cec5SDimitry Andric #endif 79