xref: /minix3/external/bsd/llvm/dist/clang/lib/Headers/avx512bwintrin.h (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc /*===------------- avx512bwintrin.h - AVX512BW intrinsics ------------------===
2*0a6a1f1dSLionel Sambuc  *
3*0a6a1f1dSLionel Sambuc  *
4*0a6a1f1dSLionel Sambuc  * Permission is hereby granted, free of charge, to any person obtaining a copy
5*0a6a1f1dSLionel Sambuc  * of this software and associated documentation files (the "Software"), to deal
6*0a6a1f1dSLionel Sambuc  * in the Software without restriction, including without limitation the rights
7*0a6a1f1dSLionel Sambuc  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8*0a6a1f1dSLionel Sambuc  * copies of the Software, and to permit persons to whom the Software is
9*0a6a1f1dSLionel Sambuc  * furnished to do so, subject to the following conditions:
10*0a6a1f1dSLionel Sambuc  *
11*0a6a1f1dSLionel Sambuc  * The above copyright notice and this permission notice shall be included in
12*0a6a1f1dSLionel Sambuc  * all copies or substantial portions of the Software.
13*0a6a1f1dSLionel Sambuc  *
14*0a6a1f1dSLionel Sambuc  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15*0a6a1f1dSLionel Sambuc  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16*0a6a1f1dSLionel Sambuc  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17*0a6a1f1dSLionel Sambuc  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18*0a6a1f1dSLionel Sambuc  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19*0a6a1f1dSLionel Sambuc  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20*0a6a1f1dSLionel Sambuc  * THE SOFTWARE.
21*0a6a1f1dSLionel Sambuc  *
22*0a6a1f1dSLionel Sambuc  *===-----------------------------------------------------------------------===
23*0a6a1f1dSLionel Sambuc  */
24*0a6a1f1dSLionel Sambuc 
25*0a6a1f1dSLionel Sambuc #ifndef __AVX512BWINTRIN_H
26*0a6a1f1dSLionel Sambuc #define __AVX512BWINTRIN_H
27*0a6a1f1dSLionel Sambuc 
28*0a6a1f1dSLionel Sambuc typedef unsigned int __mmask32;
29*0a6a1f1dSLionel Sambuc typedef unsigned long long __mmask64;
30*0a6a1f1dSLionel Sambuc typedef char __v64qi __attribute__ ((vector_size (64)));
31*0a6a1f1dSLionel Sambuc typedef short __v32hi __attribute__ ((__vector_size__ (64)));
32*0a6a1f1dSLionel Sambuc 
33*0a6a1f1dSLionel Sambuc 
34*0a6a1f1dSLionel Sambuc /* Integer compare */
35*0a6a1f1dSLionel Sambuc 
36*0a6a1f1dSLionel Sambuc static __inline__ __mmask64 __attribute__((__always_inline__, __nodebug__))
_mm512_cmpeq_epi8_mask(__m512i __a,__m512i __b)37*0a6a1f1dSLionel Sambuc _mm512_cmpeq_epi8_mask(__m512i __a, __m512i __b) {
38*0a6a1f1dSLionel Sambuc   return (__mmask64)__builtin_ia32_pcmpeqb512_mask((__v64qi)__a, (__v64qi)__b,
39*0a6a1f1dSLionel Sambuc                                                    (__mmask64)-1);
40*0a6a1f1dSLionel Sambuc }
41*0a6a1f1dSLionel Sambuc 
42*0a6a1f1dSLionel Sambuc static __inline__ __mmask64 __attribute__((__always_inline__, __nodebug__))
_mm512_mask_cmpeq_epi8_mask(__mmask64 __u,__m512i __a,__m512i __b)43*0a6a1f1dSLionel Sambuc _mm512_mask_cmpeq_epi8_mask(__mmask64 __u, __m512i __a, __m512i __b) {
44*0a6a1f1dSLionel Sambuc   return (__mmask64)__builtin_ia32_pcmpeqb512_mask((__v64qi)__a, (__v64qi)__b,
45*0a6a1f1dSLionel Sambuc                                                    __u);
46*0a6a1f1dSLionel Sambuc }
47*0a6a1f1dSLionel Sambuc 
48*0a6a1f1dSLionel Sambuc static __inline__ __mmask32 __attribute__((__always_inline__, __nodebug__))
_mm512_cmpeq_epi16_mask(__m512i __a,__m512i __b)49*0a6a1f1dSLionel Sambuc _mm512_cmpeq_epi16_mask(__m512i __a, __m512i __b) {
50*0a6a1f1dSLionel Sambuc   return (__mmask32)__builtin_ia32_pcmpeqw512_mask((__v32hi)__a, (__v32hi)__b,
51*0a6a1f1dSLionel Sambuc                                                    (__mmask32)-1);
52*0a6a1f1dSLionel Sambuc }
53*0a6a1f1dSLionel Sambuc 
54*0a6a1f1dSLionel Sambuc static __inline__ __mmask32 __attribute__((__always_inline__, __nodebug__))
_mm512_mask_cmpeq_epi16_mask(__mmask32 __u,__m512i __a,__m512i __b)55*0a6a1f1dSLionel Sambuc _mm512_mask_cmpeq_epi16_mask(__mmask32 __u, __m512i __a, __m512i __b) {
56*0a6a1f1dSLionel Sambuc   return (__mmask32)__builtin_ia32_pcmpeqw512_mask((__v32hi)__a, (__v32hi)__b,
57*0a6a1f1dSLionel Sambuc                                                    __u);
58*0a6a1f1dSLionel Sambuc }
59*0a6a1f1dSLionel Sambuc 
60*0a6a1f1dSLionel Sambuc #endif
61