avx512vp2intersectintrin.h revision 351350
11573Srgrimes/*===------- avx512vpintersectintrin.h - VP2INTERSECT intrinsics ------------===
21573Srgrimes *
31573Srgrimes *
41573Srgrimes * Permission is hereby granted, free of charge, to any person obtaining a copy
51573Srgrimes * of this software and associated documentation files (the "Software"), to deal
61573Srgrimes * in the Software without restriction, including without limitation the rights
71573Srgrimes * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
81573Srgrimes * copies of the Software, and to permit persons to whom the Software is
91573Srgrimes * furnished to do so, subject to the following conditions:
101573Srgrimes *
111573Srgrimes * The above copyright notice and this permission notice shall be included in
121573Srgrimes * all copies or substantial portions of the Software.
131573Srgrimes *
141573Srgrimes * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
151573Srgrimes * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
161573Srgrimes * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
171573Srgrimes * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
181573Srgrimes * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
191573Srgrimes * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
201573Srgrimes * THE SOFTWARE.
211573Srgrimes *
221573Srgrimes *===-----------------------------------------------------------------------===
231573Srgrimes */
241573Srgrimes#ifndef __IMMINTRIN_H
251573Srgrimes#error "Never use <avx512vp2intersect.h> directly; include <immintrin.h> instead."
261573Srgrimes#endif
271573Srgrimes
281573Srgrimes#ifndef _AVX512VP2INTERSECT_H
291573Srgrimes#define _AVX512VP2INTERSECT_H
30136582Sobrien
311573Srgrimes#define __DEFAULT_FN_ATTRS \
321573Srgrimes  __attribute__((__always_inline__, __nodebug__,  __target__("avx512vp2intersect"), \
3390046Sobrien                 __min_vector_width__(512)))
3490046Sobrien
351573Srgrimes/// Store, in an even/odd pair of mask registers, the indicators of the
3671579Sdeischen/// locations of value matches between dwords in operands __a and __b.
371573Srgrimes///
381573Srgrimes/// \headerfile <x86intrin.h>
391573Srgrimes///
401573Srgrimes/// This intrinsic corresponds to the <c> VP2INTERSECTD </c> instruction.
411573Srgrimes///
4238845Sjb/// \param __a
4393399Smarkm///    A 512-bit vector of [16 x i32].
44209620Smarcel/// \param __b
451573Srgrimes///    A 512-bit vector of [16 x i32]
4693399Smarkm/// \param __m0
4771579Sdeischen///    A pointer point to 16-bit mask
481573Srgrimes/// \param __m1
4971579Sdeischen///    A pointer point to 16-bit mask
501573Srgrimesstatic __inline__ void __DEFAULT_FN_ATTRS
5193399Smarkm_mm512_2intersect_epi32(__m512i __a, __m512i __b, __mmask16 *__m0, __mmask16 *__m1) {
5293399Smarkm  __builtin_ia32_vp2intersect_d_512((__v16si)__a, (__v16si)__b, __m0, __m1);
53209878Snwhitehorn}
54115665Sobrien
55209878Snwhitehorn/// Store, in an even/odd pair of mask registers, the indicators of the
56209878Snwhitehorn/// locations of value matches between quadwords in operands __a and __b.
5715634Speter///
58115665Sobrien/// \headerfile <x86intrin.h>
5915634Speter///
601573Srgrimes/// This intrinsic corresponds to the <c> VP2INTERSECTQ </c> instruction.
611573Srgrimes///
621573Srgrimes/// \param __a
631573Srgrimes///    A 512-bit vector of [8 x i64].
64209620Smarcel/// \param __b
65209620Smarcel///    A 512-bit vector of [8 x i64]
661573Srgrimes/// \param __m0
6756698Sjasone///    A pointer point to 8-bit mask
681573Srgrimes/// \param __m1
6990046Sobrien///    A pointer point to 8-bit mask
7090046Sobrienstatic __inline__ void __DEFAULT_FN_ATTRS
711573Srgrimes_mm512_2intersect_epi64(__m512i __a, __m512i __b, __mmask8 *__m0, __mmask8 *__m1) {
721573Srgrimes  __builtin_ia32_vp2intersect_q_512((__v8di)__a, (__v8di)__b, __m0, __m1);
731573Srgrimes}
741573Srgrimes
751573Srgrimes#undef __DEFAULT_FN_ATTRS
761573Srgrimes
7790046Sobrien#endif
781573Srgrimes