avx512vp2intersectintrin.h revision 351280
1264790Sbapt/*===------- avx512vpintersectintrin.h - VP2INTERSECT intrinsics ------------===
2264790Sbapt *
3272955Srodrigc *
4264790Sbapt * Permission is hereby granted, free of charge, to any person obtaining a copy
5264790Sbapt * of this software and associated documentation files (the "Software"), to deal
6264790Sbapt * in the Software without restriction, including without limitation the rights
7264790Sbapt * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8264790Sbapt * copies of the Software, and to permit persons to whom the Software is
9264790Sbapt * furnished to do so, subject to the following conditions:
10264790Sbapt *
11264790Sbapt * The above copyright notice and this permission notice shall be included in
12264790Sbapt * all copies or substantial portions of the Software.
13264790Sbapt *
14264790Sbapt * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15264790Sbapt * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16264790Sbapt * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17264790Sbapt * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18264790Sbapt * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19264790Sbapt * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20264790Sbapt * THE SOFTWARE.
21264790Sbapt *
22264790Sbapt *===-----------------------------------------------------------------------===
23264790Sbapt */
24264790Sbapt#ifndef __IMMINTRIN_H
25264790Sbapt#error "Never use <avx512vp2intersect.h> directly; include <immintrin.h> instead."
26264790Sbapt#endif
27264790Sbapt
28264790Sbapt#ifndef _AVX512VP2INTERSECT_H
29264790Sbapt#define _AVX512VP2INTERSECT_H
30264790Sbapt
31264790Sbapt#define __DEFAULT_FN_ATTRS \
32264790Sbapt  __attribute__((__always_inline__, __nodebug__,  __target__("avx512vp2intersect"), \
33264790Sbapt                 __min_vector_width__(512)))
34264790Sbapt
35264790Sbapt/// Store, in an even/odd pair of mask registers, the indicators of the
36264790Sbapt/// locations of value matches between dwords in operands __a and __b.
37264790Sbapt///
38264790Sbapt/// \headerfile <x86intrin.h>
39264790Sbapt///
40264790Sbapt/// This intrinsic corresponds to the <c> VP2INTERSECTD </c> instruction.
41264790Sbapt///
42264790Sbapt/// \param __a
43264790Sbapt///    A 512-bit vector of [16 x i32].
44264790Sbapt/// \param __b
45264790Sbapt///    A 512-bit vector of [16 x i32]
46264790Sbapt/// \param __m0
47264790Sbapt///    A pointer point to 16-bit mask
48264790Sbapt/// \param __m1
49264790Sbapt///    A pointer point to 16-bit mask
50264790Sbaptstatic __inline__ void __DEFAULT_FN_ATTRS
51264790Sbapt_mm512_2intersect_epi32(__m512i __a, __m512i __b, __mmask16 *__m0, __mmask16 *__m1) {
52264790Sbapt  __builtin_ia32_vp2intersect_d_512((__v16si)__a, (__v16si)__b, __m0, __m1);
53264790Sbapt}
54264790Sbapt
55264790Sbapt/// Store, in an even/odd pair of mask registers, the indicators of the
56264790Sbapt/// locations of value matches between quadwords in operands __a and __b.
57264790Sbapt///
58264790Sbapt/// \headerfile <x86intrin.h>
59264790Sbapt///
60264790Sbapt/// This intrinsic corresponds to the <c> VP2INTERSECTQ </c> instruction.
61264790Sbapt///
62264790Sbapt/// \param __a
63264790Sbapt///    A 512-bit vector of [8 x i64].
64264790Sbapt/// \param __b
65264790Sbapt///    A 512-bit vector of [8 x i64]
66264790Sbapt/// \param __m0
67264790Sbapt///    A pointer point to 8-bit mask
68264790Sbapt/// \param __m1
69264790Sbapt///    A pointer point to 8-bit mask
70264790Sbaptstatic __inline__ void __DEFAULT_FN_ATTRS
71264790Sbapt_mm512_2intersect_epi64(__m512i __a, __m512i __b, __mmask8 *__m0, __mmask8 *__m1) {
72264790Sbapt  __builtin_ia32_vp2intersect_q_512((__v8di)__a, (__v8di)__b, __m0, __m1);
73264790Sbapt}
74264790Sbapt
75264790Sbapt#undef __DEFAULT_FN_ATTRS
76264790Sbapt
77264790Sbapt#endif
78264790Sbapt