blob: 04b7a47dd5ea53491f64c428802d2a2e666c41ce [file] [log] [blame]
Ben Murdoch097c5b22016-05-18 11:27:45 +01001/*===------------- avx512vbmivlintrin.h - VBMI intrinsics ------------------===
2 *
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 * THE SOFTWARE.
21 *
22 *===-----------------------------------------------------------------------===
23 */
24#ifndef __IMMINTRIN_H
25#error "Never use <avx512vbmivlintrin.h> directly; include <immintrin.h> instead."
26#endif
27
28#ifndef __VBMIVLINTRIN_H
29#define __VBMIVLINTRIN_H
30
31/* Define the default attributes for the functions in this file. */
32#define __DEFAULT_FN_ATTRS __attribute__(( __nodebug__, __target__("avx512vbmi,avx512vl")))
33
34
35static __inline__ __m128i __DEFAULT_FN_ATTRS
36_mm_mask2_permutex2var_epi8 (__m128i __A, __m128i __I, __mmask16 __U,
37 __m128i __B)
38{
39 return (__m128i) __builtin_ia32_vpermi2varqi128_mask ((__v16qi) __A,
40 (__v16qi) __I
41 /* idx */ ,
42 (__v16qi) __B,
43 (__mmask16)
44 __U);
45}
46
47static __inline__ __m256i __DEFAULT_FN_ATTRS
48_mm256_mask2_permutex2var_epi8 (__m256i __A, __m256i __I,
49 __mmask32 __U, __m256i __B)
50{
51 return (__m256i) __builtin_ia32_vpermi2varqi256_mask ((__v32qi) __A,
52 (__v32qi) __I
53 /* idx */ ,
54 (__v32qi) __B,
55 (__mmask32)
56 __U);
57}
58
59static __inline__ __m128i __DEFAULT_FN_ATTRS
60_mm_permutex2var_epi8 (__m128i __A, __m128i __I, __m128i __B)
61{
62 return (__m128i) __builtin_ia32_vpermt2varqi128_mask ((__v16qi) __I
63 /* idx */ ,
64 (__v16qi) __A,
65 (__v16qi) __B,
66 (__mmask16) -
67 1);
68}
69
70static __inline__ __m128i __DEFAULT_FN_ATTRS
71_mm_mask_permutex2var_epi8 (__m128i __A, __mmask16 __U, __m128i __I,
72 __m128i __B)
73{
74 return (__m128i) __builtin_ia32_vpermt2varqi128_mask ((__v16qi) __I
75 /* idx */ ,
76 (__v16qi) __A,
77 (__v16qi) __B,
78 (__mmask16)
79 __U);
80}
81
82static __inline__ __m128i __DEFAULT_FN_ATTRS
83_mm_maskz_permutex2var_epi8 (__mmask16 __U, __m128i __A, __m128i __I,
84 __m128i __B)
85{
86 return (__m128i) __builtin_ia32_vpermt2varqi128_maskz ((__v16qi) __I
87 /* idx */ ,
88 (__v16qi) __A,
89 (__v16qi) __B,
90 (__mmask16)
91 __U);
92}
93
94static __inline__ __m256i __DEFAULT_FN_ATTRS
95_mm256_permutex2var_epi8 (__m256i __A, __m256i __I, __m256i __B)
96{
97 return (__m256i) __builtin_ia32_vpermt2varqi256_mask ((__v32qi) __I
98 /* idx */ ,
99 (__v32qi) __A,
100 (__v32qi) __B,
101 (__mmask32) -
102 1);
103}
104
105static __inline__ __m256i __DEFAULT_FN_ATTRS
106_mm256_mask_permutex2var_epi8 (__m256i __A, __mmask32 __U,
107 __m256i __I, __m256i __B)
108{
109 return (__m256i) __builtin_ia32_vpermt2varqi256_mask ((__v32qi) __I
110 /* idx */ ,
111 (__v32qi) __A,
112 (__v32qi) __B,
113 (__mmask32)
114 __U);
115}
116
117static __inline__ __m256i __DEFAULT_FN_ATTRS
118_mm256_maskz_permutex2var_epi8 (__mmask32 __U, __m256i __A,
119 __m256i __I, __m256i __B)
120{
121 return (__m256i) __builtin_ia32_vpermt2varqi256_maskz ((__v32qi) __I
122 /* idx */ ,
123 (__v32qi) __A,
124 (__v32qi) __B,
125 (__mmask32)
126 __U);
127}
128
Ben Murdoch097c5b22016-05-18 11:27:45 +0100129
130#undef __DEFAULT_FN_ATTRS
131
132#endif