Merge branch 'vendor/GCC50' - gcc 5.0 snapshot 1 FEB 2015
[dragonfly.git] / contrib / gcc-5.0 / gcc / config / i386 / avx512bwintrin.h
1 /* Copyright (C) 2014-2015 Free Software Foundation, Inc.
2
3    This file is part of GCC.
4
5    GCC is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 3, or (at your option)
8    any later version.
9
10    GCC is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14
15    Under Section 7 of GPL version 3, you are granted additional
16    permissions described in the GCC Runtime Library Exception, version
17    3.1, as published by the Free Software Foundation.
18
19    You should have received a copy of the GNU General Public License and
20    a copy of the GCC Runtime Library Exception along with this program;
21    see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
22    <http://www.gnu.org/licenses/>.  */
23
24 #ifndef _IMMINTRIN_H_INCLUDED
25 #error "Never use <avx512bwintrin.h> directly; include <immintrin.h> instead."
26 #endif
27
28 #ifndef _AVX512BWINTRIN_H_INCLUDED
29 #define _AVX512BWINTRIN_H_INCLUDED
30
31 #ifndef __AVX512BW__
32 #pragma GCC push_options
33 #pragma GCC target("avx512bw")
34 #define __DISABLE_AVX512BW__
35 #endif /* __AVX512BW__ */
36
37 /* Internal data types for implementing the intrinsics.  */
38 typedef short __v32hi __attribute__ ((__vector_size__ (64)));
39 typedef char __v64qi __attribute__ ((__vector_size__ (64)));
40
41 typedef unsigned long long __mmask64;
42
43 extern __inline __m512i
44 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
45 _mm512_setzero_qi (void)
46 {
47   return __extension__ (__m512i)(__v64qi){ 0, 0, 0, 0, 0, 0, 0, 0,
48                                            0, 0, 0, 0, 0, 0, 0, 0,
49                                            0, 0, 0, 0, 0, 0, 0, 0,
50                                            0, 0, 0, 0, 0, 0, 0, 0,
51                                            0, 0, 0, 0, 0, 0, 0, 0,
52                                            0, 0, 0, 0, 0, 0, 0, 0,
53                                            0, 0, 0, 0, 0, 0, 0, 0,
54                                            0, 0, 0, 0, 0, 0, 0, 0 };
55 }
56
57 extern __inline __m512i
58 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
59 _mm512_setzero_hi (void)
60 {
61   return __extension__ (__m512i)(__v32hi){ 0, 0, 0, 0, 0, 0, 0, 0,
62                                            0, 0, 0, 0, 0, 0, 0, 0,
63                                            0, 0, 0, 0, 0, 0, 0, 0,
64                                            0, 0, 0, 0, 0, 0, 0, 0 };
65 }
66
67 extern __inline __m512i
68 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
69 _mm512_mask_mov_epi16 (__m512i __W, __mmask32 __U, __m512i __A)
70 {
71   return (__m512i) __builtin_ia32_movdquhi512_mask ((__v32hi) __A,
72                                                     (__v32hi) __W,
73                                                     (__mmask32) __U);
74 }
75
76 extern __inline __m512i
77 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
78 _mm512_maskz_mov_epi16 (__mmask32 __U, __m512i __A)
79 {
80   return (__m512i) __builtin_ia32_movdquhi512_mask ((__v32hi) __A,
81                                                     (__v32hi)
82                                                     _mm512_setzero_hi (),
83                                                     (__mmask32) __U);
84 }
85
86 extern __inline __m512i
87 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
88 _mm512_mask_loadu_epi16 (__m512i __W, __mmask32 __U, void const *__P)
89 {
90   return (__m512i) __builtin_ia32_loaddquhi512_mask ((__v32hi *) __P,
91                                                      (__v32hi) __W,
92                                                      (__mmask32) __U);
93 }
94
95 extern __inline __m512i
96 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
97 _mm512_maskz_loadu_epi16 (__mmask32 __U, void const *__P)
98 {
99   return (__m512i) __builtin_ia32_loaddquhi512_mask ((__v32hi *) __P,
100                                                      (__v32hi)
101                                                      _mm512_setzero_hi (),
102                                                      (__mmask32) __U);
103 }
104
105 extern __inline void
106 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
107 _mm512_mask_storeu_epi16 (void *__P, __mmask32 __U, __m512i __A)
108 {
109   __builtin_ia32_storedquhi512_mask ((__v32hi *) __P,
110                                      (__v32hi) __A,
111                                      (__mmask32) __U);
112 }
113
114 extern __inline __m512i
115 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
116 _mm512_mask_mov_epi8 (__m512i __W, __mmask64 __U, __m512i __A)
117 {
118   return (__m512i) __builtin_ia32_movdquqi512_mask ((__v64qi) __A,
119                                                     (__v64qi) __W,
120                                                     (__mmask64) __U);
121 }
122
123 extern __inline __m512i
124 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
125 _mm512_maskz_mov_epi8 (__mmask64 __U, __m512i __A)
126 {
127   return (__m512i) __builtin_ia32_movdquqi512_mask ((__v64qi) __A,
128                                                     (__v64qi)
129                                                     _mm512_setzero_hi (),
130                                                     (__mmask64) __U);
131 }
132
133 extern __inline __mmask32
134 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
135 _mm512_kunpackw (__mmask32 __A, __mmask32 __B)
136 {
137   return (__mmask32) __builtin_ia32_kunpcksi ((__mmask32) __A,
138                                               (__mmask32) __B);
139 }
140
141 extern __inline __mmask64
142 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
143 _mm512_kunpackd (__mmask64 __A, __mmask64 __B)
144 {
145   return (__mmask64) __builtin_ia32_kunpckdi ((__mmask64) __A,
146                                               (__mmask64) __B);
147 }
148
149 extern __inline __m512i
150 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
151 _mm512_mask_loadu_epi8 (__m512i __W, __mmask64 __U, void const *__P)
152 {
153   return (__m512i) __builtin_ia32_loaddquqi512_mask ((__v64qi *) __P,
154                                                      (__v64qi) __W,
155                                                      (__mmask64) __U);
156 }
157
158 extern __inline __m512i
159 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
160 _mm512_maskz_loadu_epi8 (__mmask64 __U, void const *__P)
161 {
162   return (__m512i) __builtin_ia32_loaddquqi512_mask ((__v64qi *) __P,
163                                                      (__v64qi)
164                                                      _mm512_setzero_hi (),
165                                                      (__mmask64) __U);
166 }
167
168 extern __inline void
169 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
170 _mm512_mask_storeu_epi8 (void *__P, __mmask64 __U, __m512i __A)
171 {
172   __builtin_ia32_storedquqi512_mask ((__v64qi *) __P,
173                                      (__v64qi) __A,
174                                      (__mmask64) __U);
175 }
176
177 extern __inline __m512i
178 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
179 _mm512_sad_epu8 (__m512i __A, __m512i __B)
180 {
181   return (__m512i) __builtin_ia32_psadbw512 ((__v64qi) __A,
182                                              (__v64qi) __B);
183 }
184
185 extern __inline __m256i
186 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
187 _mm512_cvtepi16_epi8 (__m512i __A)
188 {
189   return (__m256i) __builtin_ia32_pmovwb512_mask ((__v32hi) __A,
190                                                   (__v32qi) _mm256_undefined_si256(),
191                                                   (__mmask32) -1);
192 }
193
194 extern __inline __m256i
195 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
196 _mm512_mask_cvtepi16_epi8 (__m256i __O, __mmask32 __M, __m512i __A)
197 {
198   return (__m256i) __builtin_ia32_pmovwb512_mask ((__v32hi) __A,
199                                                   (__v32qi) __O, __M);
200 }
201
202 extern __inline __m256i
203 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
204 _mm512_maskz_cvtepi16_epi8 (__mmask32 __M, __m512i __A)
205 {
206   return (__m256i) __builtin_ia32_pmovwb512_mask ((__v32hi) __A,
207                                                   (__v32qi)
208                                                   _mm256_setzero_si256 (),
209                                                   __M);
210 }
211
212 extern __inline __m256i
213 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
214 _mm512_cvtsepi16_epi8 (__m512i __A)
215 {
216   return (__m256i) __builtin_ia32_pmovswb512_mask ((__v32hi) __A,
217                                                    (__v32qi)_mm256_undefined_si256(),
218                                                    (__mmask32) -1);
219 }
220
221 extern __inline __m256i
222 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
223 _mm512_mask_cvtsepi16_epi8 (__m256i __O, __mmask32 __M, __m512i __A)
224 {
225   return (__m256i) __builtin_ia32_pmovswb512_mask ((__v32hi) __A,
226                                                    (__v32qi)__O,
227                                                    __M);
228 }
229
230 extern __inline __m256i
231 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
232 _mm512_maskz_cvtsepi16_epi8 (__mmask32 __M, __m512i __A)
233 {
234   return (__m256i) __builtin_ia32_pmovswb512_mask ((__v32hi) __A,
235                                                    (__v32qi)
236                                                    _mm256_setzero_si256 (),
237                                                    __M);
238 }
239
240 extern __inline __m256i
241 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
242 _mm512_cvtusepi16_epi8 (__m512i __A)
243 {
244   return (__m256i) __builtin_ia32_pmovuswb512_mask ((__v32hi) __A,
245                                                     (__v32qi)_mm256_undefined_si256(),
246                                                     (__mmask32) -1);
247 }
248
249 extern __inline __m256i
250 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
251 _mm512_mask_cvtusepi16_epi8 (__m256i __O, __mmask32 __M, __m512i __A)
252 {
253   return (__m256i) __builtin_ia32_pmovuswb512_mask ((__v32hi) __A,
254                                                     (__v32qi) __O,
255                                                     __M);
256 }
257
258 extern __inline __m256i
259 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
260 _mm512_maskz_cvtusepi16_epi8 (__mmask32 __M, __m512i __A)
261 {
262   return (__m256i) __builtin_ia32_pmovuswb512_mask ((__v32hi) __A,
263                                                     (__v32qi)
264                                                     _mm256_setzero_si256 (),
265                                                     __M);
266 }
267
268 extern __inline __m512i
269 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
270 _mm512_broadcastb_epi8 (__m128i __A)
271 {
272   return (__m512i) __builtin_ia32_pbroadcastb512_mask ((__v16qi) __A,
273                                                        (__v64qi)_mm512_undefined_si512(),
274                                                        (__mmask64) -
275                                                        1);
276 }
277
278 extern __inline __m512i
279 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
280 _mm512_mask_broadcastb_epi8 (__m512i __O, __mmask64 __M, __m128i __A)
281 {
282   return (__m512i) __builtin_ia32_pbroadcastb512_mask ((__v16qi) __A,
283                                                        (__v64qi) __O,
284                                                        __M);
285 }
286
287 extern __inline __m512i
288 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
289 _mm512_maskz_broadcastb_epi8 (__mmask64 __M, __m128i __A)
290 {
291   return (__m512i) __builtin_ia32_pbroadcastb512_mask ((__v16qi) __A,
292                                                        (__v64qi)
293                                                        _mm512_setzero_qi(),
294                                                        __M);
295 }
296
297 extern __inline __m512i
298 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
299 _mm512_mask_set1_epi8 (__m512i __O, __mmask64 __M, char __A)
300 {
301   return (__m512i) __builtin_ia32_pbroadcastb512_gpr_mask (__A,
302                                                            (__v64qi) __O,
303                                                            __M);
304 }
305
306 extern __inline __m512i
307 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
308 _mm512_maskz_set1_epi8 (__mmask64 __M, char __A)
309 {
310   return (__m512i) __builtin_ia32_pbroadcastb512_gpr_mask (__A,
311                                                            (__v64qi)
312                                                            _mm512_setzero_qi(),
313                                                            __M);
314 }
315
316 extern __inline __m512i
317 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
318 _mm512_broadcastw_epi16 (__m128i __A)
319 {
320   return (__m512i) __builtin_ia32_pbroadcastw512_mask ((__v8hi) __A,
321                                                        (__v32hi)_mm512_undefined_si512(),
322                                                        (__mmask32)-1);
323 }
324
325 extern __inline __m512i
326 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
327 _mm512_mask_broadcastw_epi16 (__m512i __O, __mmask32 __M, __m128i __A)
328 {
329   return (__m512i) __builtin_ia32_pbroadcastw512_mask ((__v8hi) __A,
330                                                        (__v32hi) __O,
331                                                        __M);
332 }
333
334 extern __inline __m512i
335 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
336 _mm512_maskz_broadcastw_epi16 (__mmask32 __M, __m128i __A)
337 {
338   return (__m512i) __builtin_ia32_pbroadcastw512_mask ((__v8hi) __A,
339                                                        (__v32hi)
340                                                        _mm512_setzero_hi(),
341                                                        __M);
342 }
343
344 extern __inline __m512i
345 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
346 _mm512_mask_set1_epi16 (__m512i __O, __mmask32 __M, short __A)
347 {
348   return (__m512i) __builtin_ia32_pbroadcastw512_gpr_mask (__A,
349                                                            (__v32hi) __O,
350                                                            __M);
351 }
352
353 extern __inline __m512i
354 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
355 _mm512_maskz_set1_epi16 (__mmask32 __M, short __A)
356 {
357   return (__m512i) __builtin_ia32_pbroadcastw512_gpr_mask (__A,
358                                                            (__v32hi)
359                                                            _mm512_setzero_hi(),
360                                                            __M);
361 }
362
363 extern __inline __m512i
364 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
365 _mm512_mulhrs_epi16 (__m512i __A, __m512i __B)
366 {
367   return (__m512i) __builtin_ia32_pmulhrsw512_mask ((__v32hi) __A,
368                                                     (__v32hi) __B,
369                                                     (__v32hi)
370                                                     _mm512_setzero_hi (),
371                                                     (__mmask32) -1);
372 }
373
374 extern __inline __m512i
375 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
376 _mm512_mask_mulhrs_epi16 (__m512i __W, __mmask32 __U, __m512i __A,
377                           __m512i __B)
378 {
379   return (__m512i) __builtin_ia32_pmulhrsw512_mask ((__v32hi) __A,
380                                                     (__v32hi) __B,
381                                                     (__v32hi) __W,
382                                                     (__mmask32) __U);
383 }
384
385 extern __inline __m512i
386 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
387 _mm512_maskz_mulhrs_epi16 (__mmask32 __U, __m512i __A, __m512i __B)
388 {
389   return (__m512i) __builtin_ia32_pmulhrsw512_mask ((__v32hi) __A,
390                                                     (__v32hi) __B,
391                                                     (__v32hi)
392                                                     _mm512_setzero_hi (),
393                                                     (__mmask32) __U);
394 }
395
396 extern __inline __m512i
397 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
398 _mm512_mulhi_epi16 (__m512i __A, __m512i __B)
399 {
400   return (__m512i) __builtin_ia32_pmulhw512_mask ((__v32hi) __A,
401                                                   (__v32hi) __B,
402                                                   (__v32hi)
403                                                   _mm512_setzero_hi (),
404                                                   (__mmask32) -1);
405 }
406
407 extern __inline __m512i
408 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
409 _mm512_mask_mulhi_epi16 (__m512i __W, __mmask32 __U, __m512i __A,
410                          __m512i __B)
411 {
412   return (__m512i) __builtin_ia32_pmulhw512_mask ((__v32hi) __A,
413                                                   (__v32hi) __B,
414                                                   (__v32hi) __W,
415                                                   (__mmask32) __U);
416 }
417
418 extern __inline __m512i
419 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
420 _mm512_maskz_mulhi_epi16 (__mmask32 __U, __m512i __A, __m512i __B)
421 {
422   return (__m512i) __builtin_ia32_pmulhw512_mask ((__v32hi) __A,
423                                                   (__v32hi) __B,
424                                                   (__v32hi)
425                                                   _mm512_setzero_hi (),
426                                                   (__mmask32) __U);
427 }
428
429 extern __inline __m512i
430 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
431 _mm512_mulhi_epu16 (__m512i __A, __m512i __B)
432 {
433   return (__m512i) __builtin_ia32_pmulhuw512_mask ((__v32hi) __A,
434                                                    (__v32hi) __B,
435                                                    (__v32hi)
436                                                    _mm512_setzero_hi (),
437                                                    (__mmask32) -1);
438 }
439
440 extern __inline __m512i
441 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
442 _mm512_mask_mulhi_epu16 (__m512i __W, __mmask32 __U, __m512i __A,
443                          __m512i __B)
444 {
445   return (__m512i) __builtin_ia32_pmulhuw512_mask ((__v32hi) __A,
446                                                    (__v32hi) __B,
447                                                    (__v32hi) __W,
448                                                    (__mmask32) __U);
449 }
450
451 extern __inline __m512i
452 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
453 _mm512_maskz_mulhi_epu16 (__mmask32 __U, __m512i __A, __m512i __B)
454 {
455   return (__m512i) __builtin_ia32_pmulhuw512_mask ((__v32hi) __A,
456                                                    (__v32hi) __B,
457                                                    (__v32hi)
458                                                    _mm512_setzero_hi (),
459                                                    (__mmask32) __U);
460 }
461
462 extern __inline __m512i
463 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
464 _mm512_mullo_epi16 (__m512i __A, __m512i __B)
465 {
466   return (__m512i) ((__v32hu) __A * (__v32hu) __B);
467 }
468
469 extern __inline __m512i
470 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
471 _mm512_mask_mullo_epi16 (__m512i __W, __mmask32 __U, __m512i __A,
472                          __m512i __B)
473 {
474   return (__m512i) __builtin_ia32_pmullw512_mask ((__v32hi) __A,
475                                                   (__v32hi) __B,
476                                                   (__v32hi) __W,
477                                                   (__mmask32) __U);
478 }
479
480 extern __inline __m512i
481 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
482 _mm512_maskz_mullo_epi16 (__mmask32 __U, __m512i __A, __m512i __B)
483 {
484   return (__m512i) __builtin_ia32_pmullw512_mask ((__v32hi) __A,
485                                                   (__v32hi) __B,
486                                                   (__v32hi)
487                                                   _mm512_setzero_hi (),
488                                                   (__mmask32) __U);
489 }
490
491 extern __inline __m512i
492 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
493 _mm512_cvtepi8_epi16 (__m256i __A)
494 {
495   return (__m512i) __builtin_ia32_pmovsxbw512_mask ((__v32qi) __A,
496                                                     (__v32hi)
497                                                     _mm512_setzero_hi (),
498                                                     (__mmask32) -1);
499 }
500
501 extern __inline __m512i
502 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
503 _mm512_mask_cvtepi8_epi16 (__m512i __W, __mmask32 __U, __m256i __A)
504 {
505   return (__m512i) __builtin_ia32_pmovsxbw512_mask ((__v32qi) __A,
506                                                     (__v32hi) __W,
507                                                     (__mmask32) __U);
508 }
509
510 extern __inline __m512i
511 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
512 _mm512_maskz_cvtepi8_epi16 (__mmask32 __U, __m256i __A)
513 {
514   return (__m512i) __builtin_ia32_pmovsxbw512_mask ((__v32qi) __A,
515                                                     (__v32hi)
516                                                     _mm512_setzero_hi(),
517                                                     (__mmask32) __U);
518 }
519
520 extern __inline __m512i
521 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
522 _mm512_cvtepu8_epi16 (__m256i __A)
523 {
524   return (__m512i) __builtin_ia32_pmovzxbw512_mask ((__v32qi) __A,
525                                                     (__v32hi)
526                                                     _mm512_setzero_hi (),
527                                                     (__mmask32) -1);
528 }
529
530 extern __inline __m512i
531 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
532 _mm512_mask_cvtepu8_epi16 (__m512i __W, __mmask32 __U, __m256i __A)
533 {
534   return (__m512i) __builtin_ia32_pmovzxbw512_mask ((__v32qi) __A,
535                                                     (__v32hi) __W,
536                                                     (__mmask32) __U);
537 }
538
539 extern __inline __m512i
540 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
541 _mm512_maskz_cvtepu8_epi16 (__mmask32 __U, __m256i __A)
542 {
543   return (__m512i) __builtin_ia32_pmovzxbw512_mask ((__v32qi) __A,
544                                                     (__v32hi)
545                                                     _mm512_setzero_hi(),
546                                                     (__mmask32) __U);
547 }
548
549 extern __inline __m512i
550 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
551 _mm512_permutexvar_epi16 (__m512i __A, __m512i __B)
552 {
553   return (__m512i) __builtin_ia32_permvarhi512_mask ((__v32hi) __B,
554                                                      (__v32hi) __A,
555                                                      (__v32hi)
556                                                      _mm512_setzero_hi (),
557                                                      (__mmask32) -1);
558 }
559
560 extern __inline __m512i
561 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
562 _mm512_maskz_permutexvar_epi16 (__mmask32 __M, __m512i __A,
563                                 __m512i __B)
564 {
565   return (__m512i) __builtin_ia32_permvarhi512_mask ((__v32hi) __B,
566                                                      (__v32hi) __A,
567                                                      (__v32hi)
568                                                      _mm512_setzero_hi(),
569                                                      (__mmask32) __M);
570 }
571
572 extern __inline __m512i
573 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
574 _mm512_mask_permutexvar_epi16 (__m512i __W, __mmask32 __M, __m512i __A,
575                                __m512i __B)
576 {
577   return (__m512i) __builtin_ia32_permvarhi512_mask ((__v32hi) __B,
578                                                      (__v32hi) __A,
579                                                      (__v32hi) __W,
580                                                      (__mmask32) __M);
581 }
582
583 extern __inline __m512i
584 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
585 _mm512_permutex2var_epi16 (__m512i __A, __m512i __I, __m512i __B)
586 {
587   return (__m512i) __builtin_ia32_vpermt2varhi512_mask ((__v32hi) __I
588                                                         /* idx */ ,
589                                                         (__v32hi) __A,
590                                                         (__v32hi) __B,
591                                                         (__mmask32) -
592                                                         1);
593 }
594
595 extern __inline __m512i
596 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
597 _mm512_mask_permutex2var_epi16 (__m512i __A, __mmask32 __U,
598                                 __m512i __I, __m512i __B)
599 {
600   return (__m512i) __builtin_ia32_vpermt2varhi512_mask ((__v32hi) __I
601                                                         /* idx */ ,
602                                                         (__v32hi) __A,
603                                                         (__v32hi) __B,
604                                                         (__mmask32)
605                                                         __U);
606 }
607
608 extern __inline __m512i
609 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
610 _mm512_mask2_permutex2var_epi16 (__m512i __A, __m512i __I,
611                                  __mmask32 __U, __m512i __B)
612 {
613   return (__m512i) __builtin_ia32_vpermi2varhi512_mask ((__v32hi) __A,
614                                                         (__v32hi) __I
615                                                         /* idx */ ,
616                                                         (__v32hi) __B,
617                                                         (__mmask32)
618                                                         __U);
619 }
620
621 extern __inline __m512i
622 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
623 _mm512_maskz_permutex2var_epi16 (__mmask32 __U, __m512i __A,
624                                  __m512i __I, __m512i __B)
625 {
626   return (__m512i) __builtin_ia32_vpermt2varhi512_maskz ((__v32hi) __I
627                                                          /* idx */ ,
628                                                          (__v32hi) __A,
629                                                          (__v32hi) __B,
630                                                          (__mmask32)
631                                                          __U);
632 }
633
634 extern __inline __m512i
635 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
636 _mm512_avg_epu8 (__m512i __A, __m512i __B)
637 {
638   return (__m512i) __builtin_ia32_pavgb512_mask ((__v64qi) __A,
639                                                  (__v64qi) __B,
640                                                  (__v64qi)
641                                                  _mm512_setzero_qi (),
642                                                  (__mmask64) -1);
643 }
644
645 extern __inline __m512i
646 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
647 _mm512_mask_avg_epu8 (__m512i __W, __mmask64 __U, __m512i __A,
648                       __m512i __B)
649 {
650   return (__m512i) __builtin_ia32_pavgb512_mask ((__v64qi) __A,
651                                                  (__v64qi) __B,
652                                                  (__v64qi) __W,
653                                                  (__mmask64) __U);
654 }
655
656 extern __inline __m512i
657 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
658 _mm512_maskz_avg_epu8 (__mmask64 __U, __m512i __A, __m512i __B)
659 {
660   return (__m512i) __builtin_ia32_pavgb512_mask ((__v64qi) __A,
661                                                  (__v64qi) __B,
662                                                  (__v64qi)
663                                                  _mm512_setzero_qi(),
664                                                  (__mmask64) __U);
665 }
666
667 extern __inline __m512i
668 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
669 _mm512_add_epi8 (__m512i __A, __m512i __B)
670 {
671   return (__m512i) ((__v64qu) __A + (__v64qu) __B);
672 }
673
674 extern __inline __m512i
675 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
676 _mm512_mask_add_epi8 (__m512i __W, __mmask64 __U, __m512i __A,
677                       __m512i __B)
678 {
679   return (__m512i) __builtin_ia32_paddb512_mask ((__v64qi) __A,
680                                                  (__v64qi) __B,
681                                                  (__v64qi) __W,
682                                                  (__mmask64) __U);
683 }
684
685 extern __inline __m512i
686 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
687 _mm512_maskz_add_epi8 (__mmask64 __U, __m512i __A, __m512i __B)
688 {
689   return (__m512i) __builtin_ia32_paddb512_mask ((__v64qi) __A,
690                                                  (__v64qi) __B,
691                                                  (__v64qi)
692                                                  _mm512_setzero_qi (),
693                                                  (__mmask64) __U);
694 }
695
696 extern __inline __m512i
697 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
698 _mm512_sub_epi8 (__m512i __A, __m512i __B)
699 {
700   return (__m512i) ((__v64qu) __A - (__v64qu) __B);
701 }
702
703 extern __inline __m512i
704 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
705 _mm512_mask_sub_epi8 (__m512i __W, __mmask64 __U, __m512i __A,
706                       __m512i __B)
707 {
708   return (__m512i) __builtin_ia32_psubb512_mask ((__v64qi) __A,
709                                                  (__v64qi) __B,
710                                                  (__v64qi) __W,
711                                                  (__mmask64) __U);
712 }
713
714 extern __inline __m512i
715 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
716 _mm512_maskz_sub_epi8 (__mmask64 __U, __m512i __A, __m512i __B)
717 {
718   return (__m512i) __builtin_ia32_psubb512_mask ((__v64qi) __A,
719                                                  (__v64qi) __B,
720                                                  (__v64qi)
721                                                  _mm512_setzero_qi (),
722                                                  (__mmask64) __U);
723 }
724
725 extern __inline __m512i
726 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
727 _mm512_avg_epu16 (__m512i __A, __m512i __B)
728 {
729   return (__m512i) __builtin_ia32_pavgw512_mask ((__v32hi) __A,
730                                                  (__v32hi) __B,
731                                                  (__v32hi)
732                                                  _mm512_setzero_hi (),
733                                                  (__mmask32) -1);
734 }
735
736 extern __inline __m512i
737 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
738 _mm512_mask_avg_epu16 (__m512i __W, __mmask32 __U, __m512i __A,
739                        __m512i __B)
740 {
741   return (__m512i) __builtin_ia32_pavgw512_mask ((__v32hi) __A,
742                                                  (__v32hi) __B,
743                                                  (__v32hi) __W,
744                                                  (__mmask32) __U);
745 }
746
747 extern __inline __m512i
748 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
749 _mm512_maskz_avg_epu16 (__mmask32 __U, __m512i __A, __m512i __B)
750 {
751   return (__m512i) __builtin_ia32_pavgw512_mask ((__v32hi) __A,
752                                                  (__v32hi) __B,
753                                                  (__v32hi)
754                                                  _mm512_setzero_hi(),
755                                                  (__mmask32) __U);
756 }
757
758 extern __inline __m512i
759 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
760 _mm512_subs_epi8 (__m512i __A, __m512i __B)
761 {
762   return (__m512i) __builtin_ia32_psubsb512_mask ((__v64qi) __A,
763                                                   (__v64qi) __B,
764                                                   (__v64qi)
765                                                   _mm512_setzero_qi (),
766                                                   (__mmask64) -1);
767 }
768
769 extern __inline __m512i
770 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
771 _mm512_mask_subs_epi8 (__m512i __W, __mmask64 __U, __m512i __A,
772                        __m512i __B)
773 {
774   return (__m512i) __builtin_ia32_psubsb512_mask ((__v64qi) __A,
775                                                   (__v64qi) __B,
776                                                   (__v64qi) __W,
777                                                   (__mmask64) __U);
778 }
779
780 extern __inline __m512i
781 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
782 _mm512_maskz_subs_epi8 (__mmask64 __U, __m512i __A, __m512i __B)
783 {
784   return (__m512i) __builtin_ia32_psubsb512_mask ((__v64qi) __A,
785                                                   (__v64qi) __B,
786                                                   (__v64qi)
787                                                   _mm512_setzero_qi (),
788                                                   (__mmask64) __U);
789 }
790
791 extern __inline __m512i
792 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
793 _mm512_subs_epu8 (__m512i __A, __m512i __B)
794 {
795   return (__m512i) __builtin_ia32_psubusb512_mask ((__v64qi) __A,
796                                                    (__v64qi) __B,
797                                                    (__v64qi)
798                                                    _mm512_setzero_qi (),
799                                                    (__mmask64) -1);
800 }
801
802 extern __inline __m512i
803 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
804 _mm512_mask_subs_epu8 (__m512i __W, __mmask64 __U, __m512i __A,
805                        __m512i __B)
806 {
807   return (__m512i) __builtin_ia32_psubusb512_mask ((__v64qi) __A,
808                                                    (__v64qi) __B,
809                                                    (__v64qi) __W,
810                                                    (__mmask64) __U);
811 }
812
813 extern __inline __m512i
814 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
815 _mm512_maskz_subs_epu8 (__mmask64 __U, __m512i __A, __m512i __B)
816 {
817   return (__m512i) __builtin_ia32_psubusb512_mask ((__v64qi) __A,
818                                                    (__v64qi) __B,
819                                                    (__v64qi)
820                                                    _mm512_setzero_qi (),
821                                                    (__mmask64) __U);
822 }
823
824 extern __inline __m512i
825 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
826 _mm512_adds_epi8 (__m512i __A, __m512i __B)
827 {
828   return (__m512i) __builtin_ia32_paddsb512_mask ((__v64qi) __A,
829                                                   (__v64qi) __B,
830                                                   (__v64qi)
831                                                   _mm512_setzero_qi (),
832                                                   (__mmask64) -1);
833 }
834
835 extern __inline __m512i
836 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
837 _mm512_mask_adds_epi8 (__m512i __W, __mmask64 __U, __m512i __A,
838                        __m512i __B)
839 {
840   return (__m512i) __builtin_ia32_paddsb512_mask ((__v64qi) __A,
841                                                   (__v64qi) __B,
842                                                   (__v64qi) __W,
843                                                   (__mmask64) __U);
844 }
845
846 extern __inline __m512i
847 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
848 _mm512_maskz_adds_epi8 (__mmask64 __U, __m512i __A, __m512i __B)
849 {
850   return (__m512i) __builtin_ia32_paddsb512_mask ((__v64qi) __A,
851                                                   (__v64qi) __B,
852                                                   (__v64qi)
853                                                   _mm512_setzero_qi (),
854                                                   (__mmask64) __U);
855 }
856
857 extern __inline __m512i
858 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
859 _mm512_adds_epu8 (__m512i __A, __m512i __B)
860 {
861   return (__m512i) __builtin_ia32_paddusb512_mask ((__v64qi) __A,
862                                                    (__v64qi) __B,
863                                                    (__v64qi)
864                                                    _mm512_setzero_qi (),
865                                                    (__mmask64) -1);
866 }
867
868 extern __inline __m512i
869 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
870 _mm512_mask_adds_epu8 (__m512i __W, __mmask64 __U, __m512i __A,
871                        __m512i __B)
872 {
873   return (__m512i) __builtin_ia32_paddusb512_mask ((__v64qi) __A,
874                                                    (__v64qi) __B,
875                                                    (__v64qi) __W,
876                                                    (__mmask64) __U);
877 }
878
879 extern __inline __m512i
880 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
881 _mm512_maskz_adds_epu8 (__mmask64 __U, __m512i __A, __m512i __B)
882 {
883   return (__m512i) __builtin_ia32_paddusb512_mask ((__v64qi) __A,
884                                                    (__v64qi) __B,
885                                                    (__v64qi)
886                                                    _mm512_setzero_qi (),
887                                                    (__mmask64) __U);
888 }
889
890 extern __inline __m512i
891 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
892 _mm512_sub_epi16 (__m512i __A, __m512i __B)
893 {
894   return (__m512i) ((__v32hu) __A - (__v32hu) __B);
895 }
896
897 extern __inline __m512i
898 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
899 _mm512_mask_sub_epi16 (__m512i __W, __mmask32 __U, __m512i __A,
900                        __m512i __B)
901 {
902   return (__m512i) __builtin_ia32_psubw512_mask ((__v32hi) __A,
903                                                  (__v32hi) __B,
904                                                  (__v32hi) __W,
905                                                  (__mmask32) __U);
906 }
907
908 extern __inline __m512i
909 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
910 _mm512_maskz_sub_epi16 (__mmask32 __U, __m512i __A, __m512i __B)
911 {
912   return (__m512i) __builtin_ia32_psubw512_mask ((__v32hi) __A,
913                                                  (__v32hi) __B,
914                                                  (__v32hi)
915                                                  _mm512_setzero_hi (),
916                                                  (__mmask32) __U);
917 }
918
919 extern __inline __m512i
920 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
921 _mm512_subs_epi16 (__m512i __A, __m512i __B)
922 {
923   return (__m512i) __builtin_ia32_psubsw512_mask ((__v32hi) __A,
924                                                   (__v32hi) __B,
925                                                   (__v32hi)
926                                                   _mm512_setzero_hi (),
927                                                   (__mmask32) -1);
928 }
929
930 extern __inline __m512i
931 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
932 _mm512_mask_subs_epi16 (__m512i __W, __mmask32 __U, __m512i __A,
933                         __m512i __B)
934 {
935   return (__m512i) __builtin_ia32_psubsw512_mask ((__v32hi) __A,
936                                                   (__v32hi) __B,
937                                                   (__v32hi) __W,
938                                                   (__mmask32) __U);
939 }
940
941 extern __inline __m512i
942 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
943 _mm512_maskz_subs_epi16 (__mmask32 __U, __m512i __A, __m512i __B)
944 {
945   return (__m512i) __builtin_ia32_psubsw512_mask ((__v32hi) __A,
946                                                   (__v32hi) __B,
947                                                   (__v32hi)
948                                                   _mm512_setzero_hi (),
949                                                   (__mmask32) __U);
950 }
951
952 extern __inline __m512i
953 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
954 _mm512_subs_epu16 (__m512i __A, __m512i __B)
955 {
956   return (__m512i) __builtin_ia32_psubusw512_mask ((__v32hi) __A,
957                                                    (__v32hi) __B,
958                                                    (__v32hi)
959                                                    _mm512_setzero_hi (),
960                                                    (__mmask32) -1);
961 }
962
963 extern __inline __m512i
964 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
965 _mm512_mask_subs_epu16 (__m512i __W, __mmask32 __U, __m512i __A,
966                         __m512i __B)
967 {
968   return (__m512i) __builtin_ia32_psubusw512_mask ((__v32hi) __A,
969                                                    (__v32hi) __B,
970                                                    (__v32hi) __W,
971                                                    (__mmask32) __U);
972 }
973
974 extern __inline __m512i
975 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
976 _mm512_maskz_subs_epu16 (__mmask32 __U, __m512i __A, __m512i __B)
977 {
978   return (__m512i) __builtin_ia32_psubusw512_mask ((__v32hi) __A,
979                                                    (__v32hi) __B,
980                                                    (__v32hi)
981                                                    _mm512_setzero_hi (),
982                                                    (__mmask32) __U);
983 }
984
985 extern __inline __m512i
986 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
987 _mm512_add_epi16 (__m512i __A, __m512i __B)
988 {
989   return (__m512i) ((__v32hu) __A + (__v32hu) __B);
990 }
991
992 extern __inline __m512i
993 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
994 _mm512_mask_add_epi16 (__m512i __W, __mmask32 __U, __m512i __A,
995                        __m512i __B)
996 {
997   return (__m512i) __builtin_ia32_paddw512_mask ((__v32hi) __A,
998                                                  (__v32hi) __B,
999                                                  (__v32hi) __W,
1000                                                  (__mmask32) __U);
1001 }
1002
1003 extern __inline __m512i
1004 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1005 _mm512_maskz_add_epi16 (__mmask32 __U, __m512i __A, __m512i __B)
1006 {
1007   return (__m512i) __builtin_ia32_paddw512_mask ((__v32hi) __A,
1008                                                  (__v32hi) __B,
1009                                                  (__v32hi)
1010                                                  _mm512_setzero_hi (),
1011                                                  (__mmask32) __U);
1012 }
1013
1014 extern __inline __m512i
1015 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1016 _mm512_adds_epi16 (__m512i __A, __m512i __B)
1017 {
1018   return (__m512i) __builtin_ia32_paddsw512_mask ((__v32hi) __A,
1019                                                   (__v32hi) __B,
1020                                                   (__v32hi)
1021                                                   _mm512_setzero_hi (),
1022                                                   (__mmask32) -1);
1023 }
1024
1025 extern __inline __m512i
1026 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1027 _mm512_mask_adds_epi16 (__m512i __W, __mmask32 __U, __m512i __A,
1028                         __m512i __B)
1029 {
1030   return (__m512i) __builtin_ia32_paddsw512_mask ((__v32hi) __A,
1031                                                   (__v32hi) __B,
1032                                                   (__v32hi) __W,
1033                                                   (__mmask32) __U);
1034 }
1035
1036 extern __inline __m512i
1037 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1038 _mm512_maskz_adds_epi16 (__mmask32 __U, __m512i __A, __m512i __B)
1039 {
1040   return (__m512i) __builtin_ia32_paddsw512_mask ((__v32hi) __A,
1041                                                   (__v32hi) __B,
1042                                                   (__v32hi)
1043                                                   _mm512_setzero_hi (),
1044                                                   (__mmask32) __U);
1045 }
1046
1047 extern __inline __m512i
1048 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1049 _mm512_adds_epu16 (__m512i __A, __m512i __B)
1050 {
1051   return (__m512i) __builtin_ia32_paddusw512_mask ((__v32hi) __A,
1052                                                    (__v32hi) __B,
1053                                                    (__v32hi)
1054                                                    _mm512_setzero_hi (),
1055                                                    (__mmask32) -1);
1056 }
1057
1058 extern __inline __m512i
1059 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1060 _mm512_mask_adds_epu16 (__m512i __W, __mmask32 __U, __m512i __A,
1061                         __m512i __B)
1062 {
1063   return (__m512i) __builtin_ia32_paddusw512_mask ((__v32hi) __A,
1064                                                    (__v32hi) __B,
1065                                                    (__v32hi) __W,
1066                                                    (__mmask32) __U);
1067 }
1068
1069 extern __inline __m512i
1070 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1071 _mm512_maskz_adds_epu16 (__mmask32 __U, __m512i __A, __m512i __B)
1072 {
1073   return (__m512i) __builtin_ia32_paddusw512_mask ((__v32hi) __A,
1074                                                    (__v32hi) __B,
1075                                                    (__v32hi)
1076                                                    _mm512_setzero_hi (),
1077                                                    (__mmask32) __U);
1078 }
1079
1080 extern __inline __m512i
1081 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1082 _mm512_srl_epi16 (__m512i __A, __m128i __B)
1083 {
1084   return (__m512i) __builtin_ia32_psrlw512_mask ((__v32hi) __A,
1085                                                  (__v8hi) __B,
1086                                                  (__v32hi)
1087                                                  _mm512_setzero_hi (),
1088                                                  (__mmask32) -1);
1089 }
1090
1091 extern __inline __m512i
1092 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1093 _mm512_mask_srl_epi16 (__m512i __W, __mmask32 __U, __m512i __A,
1094                        __m128i __B)
1095 {
1096   return (__m512i) __builtin_ia32_psrlw512_mask ((__v32hi) __A,
1097                                                  (__v8hi) __B,
1098                                                  (__v32hi) __W,
1099                                                  (__mmask32) __U);
1100 }
1101
1102 extern __inline __m512i
1103 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1104 _mm512_maskz_srl_epi16 (__mmask32 __U, __m512i __A, __m128i __B)
1105 {
1106   return (__m512i) __builtin_ia32_psrlw512_mask ((__v32hi) __A,
1107                                                  (__v8hi) __B,
1108                                                  (__v32hi)
1109                                                  _mm512_setzero_hi (),
1110                                                  (__mmask32) __U);
1111 }
1112
1113 extern __inline __m512i
1114 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1115 _mm512_packs_epi16 (__m512i __A, __m512i __B)
1116 {
1117   return (__m512i) __builtin_ia32_packsswb512_mask ((__v32hi) __A,
1118                                                     (__v32hi) __B,
1119                                                     (__v64qi)
1120                                                     _mm512_setzero_qi (),
1121                                                     (__mmask64) -1);
1122 }
1123
1124 extern __inline __m512i
1125 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1126 _mm512_sll_epi16 (__m512i __A, __m128i __B)
1127 {
1128   return (__m512i) __builtin_ia32_psllw512_mask ((__v32hi) __A,
1129                                                  (__v8hi) __B,
1130                                                  (__v32hi)
1131                                                  _mm512_setzero_hi (),
1132                                                  (__mmask32) -1);
1133 }
1134
1135 extern __inline __m512i
1136 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1137 _mm512_mask_sll_epi16 (__m512i __W, __mmask32 __U, __m512i __A,
1138                        __m128i __B)
1139 {
1140   return (__m512i) __builtin_ia32_psllw512_mask ((__v32hi) __A,
1141                                                  (__v8hi) __B,
1142                                                  (__v32hi) __W,
1143                                                  (__mmask32) __U);
1144 }
1145
1146 extern __inline __m512i
1147 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1148 _mm512_maskz_sll_epi16 (__mmask32 __U, __m512i __A, __m128i __B)
1149 {
1150   return (__m512i) __builtin_ia32_psllw512_mask ((__v32hi) __A,
1151                                                  (__v8hi) __B,
1152                                                  (__v32hi)
1153                                                  _mm512_setzero_hi (),
1154                                                  (__mmask32) __U);
1155 }
1156
1157 extern __inline __m512i
1158 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1159 _mm512_maddubs_epi16 (__m512i __X, __m512i __Y)
1160 {
1161   return (__m512i) __builtin_ia32_pmaddubsw512_mask ((__v64qi) __X,
1162                                                      (__v64qi) __Y,
1163                                                      (__v32hi)
1164                                                      _mm512_setzero_hi (),
1165                                                      (__mmask32) -1);
1166 }
1167
1168 extern __inline __m512i
1169 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1170 _mm512_mask_maddubs_epi16 (__m512i __W, __mmask32 __U, __m512i __X,
1171                            __m512i __Y)
1172 {
1173   return (__m512i) __builtin_ia32_pmaddubsw512_mask ((__v64qi) __X,
1174                                                      (__v64qi) __Y,
1175                                                      (__v32hi) __W,
1176                                                      (__mmask32) __U);
1177 }
1178
1179 extern __inline __m512i
1180 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1181 _mm512_maskz_maddubs_epi16 (__mmask32 __U, __m512i __X, __m512i __Y)
1182 {
1183   return (__m512i) __builtin_ia32_pmaddubsw512_mask ((__v64qi) __X,
1184                                                      (__v64qi) __Y,
1185                                                      (__v32hi)
1186                                                      _mm512_setzero_hi (),
1187                                                      (__mmask32) __U);
1188 }
1189
1190 extern __inline __m512i
1191 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1192 _mm512_madd_epi16 (__m512i __A, __m512i __B)
1193 {
1194   return (__m512i) __builtin_ia32_pmaddwd512_mask ((__v32hi) __A,
1195                                                    (__v32hi) __B,
1196                                                    (__v16si)
1197                                                    _mm512_setzero_si512 (),
1198                                                    (__mmask16) -1);
1199 }
1200
1201 extern __inline __m512i
1202 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1203 _mm512_mask_madd_epi16 (__m512i __W, __mmask16 __U, __m512i __A,
1204                         __m512i __B)
1205 {
1206   return (__m512i) __builtin_ia32_pmaddwd512_mask ((__v32hi) __A,
1207                                                    (__v32hi) __B,
1208                                                    (__v16si) __W,
1209                                                    (__mmask16) __U);
1210 }
1211
1212 extern __inline __m512i
1213 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1214 _mm512_maskz_madd_epi16 (__mmask16 __U, __m512i __A, __m512i __B)
1215 {
1216   return (__m512i) __builtin_ia32_pmaddwd512_mask ((__v32hi) __A,
1217                                                    (__v32hi) __B,
1218                                                    (__v16si)
1219                                                    _mm512_setzero_si512 (),
1220                                                    (__mmask16) __U);
1221 }
1222
1223 extern __inline __m512i
1224 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1225 _mm512_unpackhi_epi8 (__m512i __A, __m512i __B)
1226 {
1227   return (__m512i) __builtin_ia32_punpckhbw512_mask ((__v64qi) __A,
1228                                                      (__v64qi) __B,
1229                                                      (__v64qi)
1230                                                      _mm512_setzero_qi (),
1231                                                      (__mmask64) -1);
1232 }
1233
1234 extern __inline __m512i
1235 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1236 _mm512_mask_unpackhi_epi8 (__m512i __W, __mmask64 __U, __m512i __A,
1237                            __m512i __B)
1238 {
1239   return (__m512i) __builtin_ia32_punpckhbw512_mask ((__v64qi) __A,
1240                                                      (__v64qi) __B,
1241                                                      (__v64qi) __W,
1242                                                      (__mmask64) __U);
1243 }
1244
1245 extern __inline __m512i
1246 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1247 _mm512_maskz_unpackhi_epi8 (__mmask64 __U, __m512i __A, __m512i __B)
1248 {
1249   return (__m512i) __builtin_ia32_punpckhbw512_mask ((__v64qi) __A,
1250                                                      (__v64qi) __B,
1251                                                      (__v64qi)
1252                                                      _mm512_setzero_qi(),
1253                                                      (__mmask64) __U);
1254 }
1255
1256 extern __inline __m512i
1257 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1258 _mm512_unpackhi_epi16 (__m512i __A, __m512i __B)
1259 {
1260   return (__m512i) __builtin_ia32_punpckhwd512_mask ((__v32hi) __A,
1261                                                      (__v32hi) __B,
1262                                                      (__v32hi)
1263                                                      _mm512_setzero_hi (),
1264                                                      (__mmask32) -1);
1265 }
1266
1267 extern __inline __m512i
1268 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1269 _mm512_mask_unpackhi_epi16 (__m512i __W, __mmask32 __U, __m512i __A,
1270                             __m512i __B)
1271 {
1272   return (__m512i) __builtin_ia32_punpckhwd512_mask ((__v32hi) __A,
1273                                                      (__v32hi) __B,
1274                                                      (__v32hi) __W,
1275                                                      (__mmask32) __U);
1276 }
1277
1278 extern __inline __m512i
1279 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1280 _mm512_maskz_unpackhi_epi16 (__mmask32 __U, __m512i __A, __m512i __B)
1281 {
1282   return (__m512i) __builtin_ia32_punpckhwd512_mask ((__v32hi) __A,
1283                                                      (__v32hi) __B,
1284                                                      (__v32hi)
1285                                                      _mm512_setzero_hi(),
1286                                                      (__mmask32) __U);
1287 }
1288
1289 extern __inline __m512i
1290 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1291 _mm512_unpacklo_epi8 (__m512i __A, __m512i __B)
1292 {
1293   return (__m512i) __builtin_ia32_punpcklbw512_mask ((__v64qi) __A,
1294                                                      (__v64qi) __B,
1295                                                      (__v64qi)
1296                                                      _mm512_setzero_qi (),
1297                                                      (__mmask64) -1);
1298 }
1299
1300 extern __inline __m512i
1301 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1302 _mm512_mask_unpacklo_epi8 (__m512i __W, __mmask64 __U, __m512i __A,
1303                            __m512i __B)
1304 {
1305   return (__m512i) __builtin_ia32_punpcklbw512_mask ((__v64qi) __A,
1306                                                      (__v64qi) __B,
1307                                                      (__v64qi) __W,
1308                                                      (__mmask64) __U);
1309 }
1310
1311 extern __inline __m512i
1312 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1313 _mm512_maskz_unpacklo_epi8 (__mmask64 __U, __m512i __A, __m512i __B)
1314 {
1315   return (__m512i) __builtin_ia32_punpcklbw512_mask ((__v64qi) __A,
1316                                                      (__v64qi) __B,
1317                                                      (__v64qi)
1318                                                      _mm512_setzero_qi(),
1319                                                      (__mmask64) __U);
1320 }
1321
1322 extern __inline __m512i
1323 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1324 _mm512_unpacklo_epi16 (__m512i __A, __m512i __B)
1325 {
1326   return (__m512i) __builtin_ia32_punpcklwd512_mask ((__v32hi) __A,
1327                                                      (__v32hi) __B,
1328                                                      (__v32hi)
1329                                                      _mm512_setzero_hi (),
1330                                                      (__mmask32) -1);
1331 }
1332
1333 extern __inline __m512i
1334 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1335 _mm512_mask_unpacklo_epi16 (__m512i __W, __mmask32 __U, __m512i __A,
1336                             __m512i __B)
1337 {
1338   return (__m512i) __builtin_ia32_punpcklwd512_mask ((__v32hi) __A,
1339                                                      (__v32hi) __B,
1340                                                      (__v32hi) __W,
1341                                                      (__mmask32) __U);
1342 }
1343
1344 extern __inline __m512i
1345 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1346 _mm512_maskz_unpacklo_epi16 (__mmask32 __U, __m512i __A, __m512i __B)
1347 {
1348   return (__m512i) __builtin_ia32_punpcklwd512_mask ((__v32hi) __A,
1349                                                      (__v32hi) __B,
1350                                                      (__v32hi)
1351                                                      _mm512_setzero_hi(),
1352                                                      (__mmask32) __U);
1353 }
1354
1355 extern __inline __mmask64
1356 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1357 _mm512_cmpeq_epu8_mask (__m512i __A, __m512i __B)
1358 {
1359   return (__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi) __A,
1360                                                     (__v64qi) __B, 0,
1361                                                     (__mmask64) -1);
1362 }
1363
1364 extern __inline __mmask64
1365 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1366 _mm512_cmpeq_epi8_mask (__m512i __A, __m512i __B)
1367 {
1368   return (__mmask64) __builtin_ia32_pcmpeqb512_mask ((__v64qi) __A,
1369                                                      (__v64qi) __B,
1370                                                      (__mmask64) -1);
1371 }
1372
1373 extern __inline __mmask64
1374 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1375 _mm512_mask_cmpeq_epu8_mask (__mmask64 __U, __m512i __A, __m512i __B)
1376 {
1377   return (__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi) __A,
1378                                                     (__v64qi) __B, 0,
1379                                                     __U);
1380 }
1381
1382 extern __inline __mmask64
1383 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1384 _mm512_mask_cmpeq_epi8_mask (__mmask64 __U, __m512i __A, __m512i __B)
1385 {
1386   return (__mmask64) __builtin_ia32_pcmpeqb512_mask ((__v64qi) __A,
1387                                                      (__v64qi) __B,
1388                                                      __U);
1389 }
1390
1391 extern __inline __mmask32
1392 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1393 _mm512_cmpeq_epu16_mask (__m512i __A, __m512i __B)
1394 {
1395   return (__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi) __A,
1396                                                     (__v32hi) __B, 0,
1397                                                     (__mmask32) -1);
1398 }
1399
1400 extern __inline __mmask32
1401 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1402 _mm512_cmpeq_epi16_mask (__m512i __A, __m512i __B)
1403 {
1404   return (__mmask32) __builtin_ia32_pcmpeqw512_mask ((__v32hi) __A,
1405                                                      (__v32hi) __B,
1406                                                      (__mmask32) -1);
1407 }
1408
1409 extern __inline __mmask32
1410 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1411 _mm512_mask_cmpeq_epu16_mask (__mmask32 __U, __m512i __A, __m512i __B)
1412 {
1413   return (__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi) __A,
1414                                                     (__v32hi) __B, 0,
1415                                                     __U);
1416 }
1417
1418 extern __inline __mmask32
1419 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1420 _mm512_mask_cmpeq_epi16_mask (__mmask32 __U, __m512i __A, __m512i __B)
1421 {
1422   return (__mmask32) __builtin_ia32_pcmpeqw512_mask ((__v32hi) __A,
1423                                                      (__v32hi) __B,
1424                                                      __U);
1425 }
1426
1427 extern __inline __mmask64
1428 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1429 _mm512_cmpgt_epu8_mask (__m512i __A, __m512i __B)
1430 {
1431   return (__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi) __A,
1432                                                     (__v64qi) __B, 6,
1433                                                     (__mmask64) -1);
1434 }
1435
1436 extern __inline __mmask64
1437 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1438 _mm512_cmpgt_epi8_mask (__m512i __A, __m512i __B)
1439 {
1440   return (__mmask64) __builtin_ia32_pcmpgtb512_mask ((__v64qi) __A,
1441                                                      (__v64qi) __B,
1442                                                      (__mmask64) -1);
1443 }
1444
1445 extern __inline __mmask64
1446 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1447 _mm512_mask_cmpgt_epu8_mask (__mmask64 __U, __m512i __A, __m512i __B)
1448 {
1449   return (__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi) __A,
1450                                                     (__v64qi) __B, 6,
1451                                                     __U);
1452 }
1453
1454 extern __inline __mmask64
1455 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1456 _mm512_mask_cmpgt_epi8_mask (__mmask64 __U, __m512i __A, __m512i __B)
1457 {
1458   return (__mmask64) __builtin_ia32_pcmpgtb512_mask ((__v64qi) __A,
1459                                                      (__v64qi) __B,
1460                                                      __U);
1461 }
1462
1463 extern __inline __mmask32
1464 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1465 _mm512_cmpgt_epu16_mask (__m512i __A, __m512i __B)
1466 {
1467   return (__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi) __A,
1468                                                     (__v32hi) __B, 6,
1469                                                     (__mmask32) -1);
1470 }
1471
1472 extern __inline __mmask32
1473 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1474 _mm512_cmpgt_epi16_mask (__m512i __A, __m512i __B)
1475 {
1476   return (__mmask32) __builtin_ia32_pcmpgtw512_mask ((__v32hi) __A,
1477                                                      (__v32hi) __B,
1478                                                      (__mmask32) -1);
1479 }
1480
1481 extern __inline __mmask32
1482 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1483 _mm512_mask_cmpgt_epu16_mask (__mmask32 __U, __m512i __A, __m512i __B)
1484 {
1485   return (__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi) __A,
1486                                                     (__v32hi) __B, 6,
1487                                                     __U);
1488 }
1489
1490 extern __inline __mmask32
1491 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1492 _mm512_mask_cmpgt_epi16_mask (__mmask32 __U, __m512i __A, __m512i __B)
1493 {
1494   return (__mmask32) __builtin_ia32_pcmpgtw512_mask ((__v32hi) __A,
1495                                                      (__v32hi) __B,
1496                                                      __U);
1497 }
1498
1499 extern __inline __mmask64
1500 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1501 _mm512_movepi8_mask (__m512i __A)
1502 {
1503   return (__mmask64) __builtin_ia32_cvtb2mask512 ((__v64qi) __A);
1504 }
1505
1506 extern __inline __mmask32
1507 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1508 _mm512_movepi16_mask (__m512i __A)
1509 {
1510   return (__mmask32) __builtin_ia32_cvtw2mask512 ((__v32hi) __A);
1511 }
1512
1513 extern __inline __m512i
1514 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1515 _mm512_movm_epi8 (__mmask64 __A)
1516 {
1517   return (__m512i) __builtin_ia32_cvtmask2b512 (__A);
1518 }
1519
1520 extern __inline __m512i
1521 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1522 _mm512_movm_epi16 (__mmask32 __A)
1523 {
1524   return (__m512i) __builtin_ia32_cvtmask2w512 (__A);
1525 }
1526
1527 extern __inline __mmask64
1528 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1529 _mm512_test_epi8_mask (__m512i __A, __m512i __B)
1530 {
1531   return (__mmask64) __builtin_ia32_ptestmb512 ((__v64qi) __A,
1532                                                 (__v64qi) __B,
1533                                                 (__mmask64) -1);
1534 }
1535
1536 extern __inline __mmask64
1537 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1538 _mm512_mask_test_epi8_mask (__mmask64 __U, __m512i __A, __m512i __B)
1539 {
1540   return (__mmask64) __builtin_ia32_ptestmb512 ((__v64qi) __A,
1541                                                 (__v64qi) __B, __U);
1542 }
1543
1544 extern __inline __mmask32
1545 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1546 _mm512_test_epi16_mask (__m512i __A, __m512i __B)
1547 {
1548   return (__mmask32) __builtin_ia32_ptestmw512 ((__v32hi) __A,
1549                                                 (__v32hi) __B,
1550                                                 (__mmask32) -1);
1551 }
1552
1553 extern __inline __mmask32
1554 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1555 _mm512_mask_test_epi16_mask (__mmask32 __U, __m512i __A, __m512i __B)
1556 {
1557   return (__mmask32) __builtin_ia32_ptestmw512 ((__v32hi) __A,
1558                                                 (__v32hi) __B, __U);
1559 }
1560
1561 extern __inline __mmask64
1562 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1563 _mm512_testn_epi8_mask (__m512i __A, __m512i __B)
1564 {
1565   return (__mmask64) __builtin_ia32_ptestnmb512 ((__v64qi) __A,
1566                                                  (__v64qi) __B,
1567                                                  (__mmask64) -1);
1568 }
1569
1570 extern __inline __mmask64
1571 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1572 _mm512_mask_testn_epi8_mask (__mmask64 __U, __m512i __A, __m512i __B)
1573 {
1574   return (__mmask64) __builtin_ia32_ptestnmb512 ((__v64qi) __A,
1575                                                  (__v64qi) __B, __U);
1576 }
1577
1578 extern __inline __mmask32
1579 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1580 _mm512_testn_epi16_mask (__m512i __A, __m512i __B)
1581 {
1582   return (__mmask32) __builtin_ia32_ptestnmw512 ((__v32hi) __A,
1583                                                  (__v32hi) __B,
1584                                                  (__mmask32) -1);
1585 }
1586
1587 extern __inline __mmask32
1588 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1589 _mm512_mask_testn_epi16_mask (__mmask32 __U, __m512i __A, __m512i __B)
1590 {
1591   return (__mmask32) __builtin_ia32_ptestnmw512 ((__v32hi) __A,
1592                                                  (__v32hi) __B, __U);
1593 }
1594
1595 extern __inline __m512i
1596 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1597 _mm512_shuffle_epi8 (__m512i __A, __m512i __B)
1598 {
1599   return (__m512i) __builtin_ia32_pshufb512_mask ((__v64qi) __A,
1600                                                   (__v64qi) __B,
1601                                                   (__v64qi)
1602                                                   _mm512_setzero_qi (),
1603                                                   (__mmask64) -1);
1604 }
1605
1606 extern __inline __m512i
1607 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1608 _mm512_mask_shuffle_epi8 (__m512i __W, __mmask64 __U, __m512i __A,
1609                           __m512i __B)
1610 {
1611   return (__m512i) __builtin_ia32_pshufb512_mask ((__v64qi) __A,
1612                                                   (__v64qi) __B,
1613                                                   (__v64qi) __W,
1614                                                   (__mmask64) __U);
1615 }
1616
1617 extern __inline __m512i
1618 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1619 _mm512_maskz_shuffle_epi8 (__mmask64 __U, __m512i __A, __m512i __B)
1620 {
1621   return (__m512i) __builtin_ia32_pshufb512_mask ((__v64qi) __A,
1622                                                   (__v64qi) __B,
1623                                                   (__v64qi)
1624                                                   _mm512_setzero_qi (),
1625                                                   (__mmask64) __U);
1626 }
1627
1628 extern __inline __m512i
1629 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1630 _mm512_min_epu16 (__m512i __A, __m512i __B)
1631 {
1632   return (__m512i) __builtin_ia32_pminuw512_mask ((__v32hi) __A,
1633                                                   (__v32hi) __B,
1634                                                   (__v32hi)
1635                                                   _mm512_setzero_hi (),
1636                                                   (__mmask32) -1);
1637 }
1638
1639 extern __inline __m512i
1640 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1641 _mm512_maskz_min_epu16 (__mmask32 __M, __m512i __A, __m512i __B)
1642 {
1643   return (__m512i) __builtin_ia32_pminuw512_mask ((__v32hi) __A,
1644                                                   (__v32hi) __B,
1645                                                   (__v32hi)
1646                                                   _mm512_setzero_hi(),
1647                                                   (__mmask32) __M);
1648 }
1649
1650 extern __inline __m512i
1651 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1652 _mm512_mask_min_epu16 (__m512i __W, __mmask32 __M, __m512i __A,
1653                        __m512i __B)
1654 {
1655   return (__m512i) __builtin_ia32_pminuw512_mask ((__v32hi) __A,
1656                                                   (__v32hi) __B,
1657                                                   (__v32hi) __W,
1658                                                   (__mmask32) __M);
1659 }
1660
1661 extern __inline __m512i
1662 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1663 _mm512_min_epi16 (__m512i __A, __m512i __B)
1664 {
1665   return (__m512i) __builtin_ia32_pminsw512_mask ((__v32hi) __A,
1666                                                   (__v32hi) __B,
1667                                                   (__v32hi)
1668                                                   _mm512_setzero_hi (),
1669                                                   (__mmask32) -1);
1670 }
1671
1672 extern __inline __m512i
1673 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1674 _mm512_maskz_min_epi16 (__mmask32 __M, __m512i __A, __m512i __B)
1675 {
1676   return (__m512i) __builtin_ia32_pminsw512_mask ((__v32hi) __A,
1677                                                   (__v32hi) __B,
1678                                                   (__v32hi)
1679                                                   _mm512_setzero_hi(),
1680                                                   (__mmask32) __M);
1681 }
1682
1683 extern __inline __m512i
1684 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1685 _mm512_mask_min_epi16 (__m512i __W, __mmask32 __M, __m512i __A,
1686                        __m512i __B)
1687 {
1688   return (__m512i) __builtin_ia32_pminsw512_mask ((__v32hi) __A,
1689                                                   (__v32hi) __B,
1690                                                   (__v32hi) __W,
1691                                                   (__mmask32) __M);
1692 }
1693
1694 extern __inline __m512i
1695 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1696 _mm512_max_epu8 (__m512i __A, __m512i __B)
1697 {
1698   return (__m512i) __builtin_ia32_pmaxub512_mask ((__v64qi) __A,
1699                                                   (__v64qi) __B,
1700                                                   (__v64qi)
1701                                                   _mm512_setzero_qi (),
1702                                                   (__mmask64) -1);
1703 }
1704
1705 extern __inline __m512i
1706 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1707 _mm512_maskz_max_epu8 (__mmask64 __M, __m512i __A, __m512i __B)
1708 {
1709   return (__m512i) __builtin_ia32_pmaxub512_mask ((__v64qi) __A,
1710                                                   (__v64qi) __B,
1711                                                   (__v64qi)
1712                                                   _mm512_setzero_qi(),
1713                                                   (__mmask64) __M);
1714 }
1715
1716 extern __inline __m512i
1717 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1718 _mm512_mask_max_epu8 (__m512i __W, __mmask64 __M, __m512i __A,
1719                       __m512i __B)
1720 {
1721   return (__m512i) __builtin_ia32_pmaxub512_mask ((__v64qi) __A,
1722                                                   (__v64qi) __B,
1723                                                   (__v64qi) __W,
1724                                                   (__mmask64) __M);
1725 }
1726
1727 extern __inline __m512i
1728 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1729 _mm512_max_epi8 (__m512i __A, __m512i __B)
1730 {
1731   return (__m512i) __builtin_ia32_pmaxsb512_mask ((__v64qi) __A,
1732                                                   (__v64qi) __B,
1733                                                   (__v64qi)
1734                                                   _mm512_setzero_qi (),
1735                                                   (__mmask64) -1);
1736 }
1737
1738 extern __inline __m512i
1739 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1740 _mm512_maskz_max_epi8 (__mmask64 __M, __m512i __A, __m512i __B)
1741 {
1742   return (__m512i) __builtin_ia32_pmaxsb512_mask ((__v64qi) __A,
1743                                                   (__v64qi) __B,
1744                                                   (__v64qi)
1745                                                   _mm512_setzero_qi(),
1746                                                   (__mmask64) __M);
1747 }
1748
1749 extern __inline __m512i
1750 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1751 _mm512_mask_max_epi8 (__m512i __W, __mmask64 __M, __m512i __A,
1752                       __m512i __B)
1753 {
1754   return (__m512i) __builtin_ia32_pmaxsb512_mask ((__v64qi) __A,
1755                                                   (__v64qi) __B,
1756                                                   (__v64qi) __W,
1757                                                   (__mmask64) __M);
1758 }
1759
1760 extern __inline __m512i
1761 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1762 _mm512_min_epu8 (__m512i __A, __m512i __B)
1763 {
1764   return (__m512i) __builtin_ia32_pminub512_mask ((__v64qi) __A,
1765                                                   (__v64qi) __B,
1766                                                   (__v64qi)
1767                                                   _mm512_setzero_qi (),
1768                                                   (__mmask64) -1);
1769 }
1770
1771 extern __inline __m512i
1772 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1773 _mm512_maskz_min_epu8 (__mmask64 __M, __m512i __A, __m512i __B)
1774 {
1775   return (__m512i) __builtin_ia32_pminub512_mask ((__v64qi) __A,
1776                                                   (__v64qi) __B,
1777                                                   (__v64qi)
1778                                                   _mm512_setzero_qi(),
1779                                                   (__mmask64) __M);
1780 }
1781
1782 extern __inline __m512i
1783 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1784 _mm512_mask_min_epu8 (__m512i __W, __mmask64 __M, __m512i __A,
1785                       __m512i __B)
1786 {
1787   return (__m512i) __builtin_ia32_pminub512_mask ((__v64qi) __A,
1788                                                   (__v64qi) __B,
1789                                                   (__v64qi) __W,
1790                                                   (__mmask64) __M);
1791 }
1792
1793 extern __inline __m512i
1794 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1795 _mm512_min_epi8 (__m512i __A, __m512i __B)
1796 {
1797   return (__m512i) __builtin_ia32_pminsb512_mask ((__v64qi) __A,
1798                                                   (__v64qi) __B,
1799                                                   (__v64qi)
1800                                                   _mm512_setzero_qi (),
1801                                                   (__mmask64) -1);
1802 }
1803
1804 extern __inline __m512i
1805 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1806 _mm512_maskz_min_epi8 (__mmask64 __M, __m512i __A, __m512i __B)
1807 {
1808   return (__m512i) __builtin_ia32_pminsb512_mask ((__v64qi) __A,
1809                                                   (__v64qi) __B,
1810                                                   (__v64qi)
1811                                                   _mm512_setzero_qi(),
1812                                                   (__mmask64) __M);
1813 }
1814
1815 extern __inline __m512i
1816 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1817 _mm512_mask_min_epi8 (__m512i __W, __mmask64 __M, __m512i __A,
1818                       __m512i __B)
1819 {
1820   return (__m512i) __builtin_ia32_pminsb512_mask ((__v64qi) __A,
1821                                                   (__v64qi) __B,
1822                                                   (__v64qi) __W,
1823                                                   (__mmask64) __M);
1824 }
1825
1826 extern __inline __m512i
1827 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1828 _mm512_max_epi16 (__m512i __A, __m512i __B)
1829 {
1830   return (__m512i) __builtin_ia32_pmaxsw512_mask ((__v32hi) __A,
1831                                                   (__v32hi) __B,
1832                                                   (__v32hi)
1833                                                   _mm512_setzero_hi (),
1834                                                   (__mmask32) -1);
1835 }
1836
1837 extern __inline __m512i
1838 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1839 _mm512_maskz_max_epi16 (__mmask32 __M, __m512i __A, __m512i __B)
1840 {
1841   return (__m512i) __builtin_ia32_pmaxsw512_mask ((__v32hi) __A,
1842                                                   (__v32hi) __B,
1843                                                   (__v32hi)
1844                                                   _mm512_setzero_hi(),
1845                                                   (__mmask32) __M);
1846 }
1847
1848 extern __inline __m512i
1849 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1850 _mm512_mask_max_epi16 (__m512i __W, __mmask32 __M, __m512i __A,
1851                        __m512i __B)
1852 {
1853   return (__m512i) __builtin_ia32_pmaxsw512_mask ((__v32hi) __A,
1854                                                   (__v32hi) __B,
1855                                                   (__v32hi) __W,
1856                                                   (__mmask32) __M);
1857 }
1858
1859 extern __inline __m512i
1860 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1861 _mm512_max_epu16 (__m512i __A, __m512i __B)
1862 {
1863   return (__m512i) __builtin_ia32_pmaxuw512_mask ((__v32hi) __A,
1864                                                   (__v32hi) __B,
1865                                                   (__v32hi)
1866                                                   _mm512_setzero_hi (),
1867                                                   (__mmask32) -1);
1868 }
1869
1870 extern __inline __m512i
1871 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1872 _mm512_maskz_max_epu16 (__mmask32 __M, __m512i __A, __m512i __B)
1873 {
1874   return (__m512i) __builtin_ia32_pmaxuw512_mask ((__v32hi) __A,
1875                                                   (__v32hi) __B,
1876                                                   (__v32hi)
1877                                                   _mm512_setzero_hi(),
1878                                                   (__mmask32) __M);
1879 }
1880
1881 extern __inline __m512i
1882 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1883 _mm512_mask_max_epu16 (__m512i __W, __mmask32 __M, __m512i __A,
1884                        __m512i __B)
1885 {
1886   return (__m512i) __builtin_ia32_pmaxuw512_mask ((__v32hi) __A,
1887                                                   (__v32hi) __B,
1888                                                   (__v32hi) __W,
1889                                                   (__mmask32) __M);
1890 }
1891
1892 extern __inline __m512i
1893 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1894 _mm512_sra_epi16 (__m512i __A, __m128i __B)
1895 {
1896   return (__m512i) __builtin_ia32_psraw512_mask ((__v32hi) __A,
1897                                                  (__v8hi) __B,
1898                                                  (__v32hi)
1899                                                  _mm512_setzero_hi (),
1900                                                  (__mmask32) -1);
1901 }
1902
1903 extern __inline __m512i
1904 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1905 _mm512_mask_sra_epi16 (__m512i __W, __mmask32 __U, __m512i __A,
1906                        __m128i __B)
1907 {
1908   return (__m512i) __builtin_ia32_psraw512_mask ((__v32hi) __A,
1909                                                  (__v8hi) __B,
1910                                                  (__v32hi) __W,
1911                                                  (__mmask32) __U);
1912 }
1913
1914 extern __inline __m512i
1915 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1916 _mm512_maskz_sra_epi16 (__mmask32 __U, __m512i __A, __m128i __B)
1917 {
1918   return (__m512i) __builtin_ia32_psraw512_mask ((__v32hi) __A,
1919                                                  (__v8hi) __B,
1920                                                  (__v32hi)
1921                                                  _mm512_setzero_hi (),
1922                                                  (__mmask32) __U);
1923 }
1924
1925 extern __inline __m512i
1926 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1927 _mm512_srav_epi16 (__m512i __A, __m512i __B)
1928 {
1929   return (__m512i) __builtin_ia32_psrav32hi_mask ((__v32hi) __A,
1930                                                   (__v32hi) __B,
1931                                                   (__v32hi)
1932                                                   _mm512_setzero_hi (),
1933                                                   (__mmask32) -1);
1934 }
1935
1936 extern __inline __m512i
1937 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1938 _mm512_mask_srav_epi16 (__m512i __W, __mmask32 __U, __m512i __A,
1939                         __m512i __B)
1940 {
1941   return (__m512i) __builtin_ia32_psrav32hi_mask ((__v32hi) __A,
1942                                                   (__v32hi) __B,
1943                                                   (__v32hi) __W,
1944                                                   (__mmask32) __U);
1945 }
1946
1947 extern __inline __m512i
1948 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1949 _mm512_maskz_srav_epi16 (__mmask32 __U, __m512i __A, __m512i __B)
1950 {
1951   return (__m512i) __builtin_ia32_psrav32hi_mask ((__v32hi) __A,
1952                                                   (__v32hi) __B,
1953                                                   (__v32hi)
1954                                                   _mm512_setzero_hi (),
1955                                                   (__mmask32) __U);
1956 }
1957
1958 extern __inline __m512i
1959 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1960 _mm512_srlv_epi16 (__m512i __A, __m512i __B)
1961 {
1962   return (__m512i) __builtin_ia32_psrlv32hi_mask ((__v32hi) __A,
1963                                                   (__v32hi) __B,
1964                                                   (__v32hi)
1965                                                   _mm512_setzero_hi (),
1966                                                   (__mmask32) -1);
1967 }
1968
1969 extern __inline __m512i
1970 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1971 _mm512_mask_srlv_epi16 (__m512i __W, __mmask32 __U, __m512i __A,
1972                         __m512i __B)
1973 {
1974   return (__m512i) __builtin_ia32_psrlv32hi_mask ((__v32hi) __A,
1975                                                   (__v32hi) __B,
1976                                                   (__v32hi) __W,
1977                                                   (__mmask32) __U);
1978 }
1979
1980 extern __inline __m512i
1981 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1982 _mm512_maskz_srlv_epi16 (__mmask32 __U, __m512i __A, __m512i __B)
1983 {
1984   return (__m512i) __builtin_ia32_psrlv32hi_mask ((__v32hi) __A,
1985                                                   (__v32hi) __B,
1986                                                   (__v32hi)
1987                                                   _mm512_setzero_hi (),
1988                                                   (__mmask32) __U);
1989 }
1990
1991 extern __inline __m512i
1992 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
1993 _mm512_sllv_epi16 (__m512i __A, __m512i __B)
1994 {
1995   return (__m512i) __builtin_ia32_psllv32hi_mask ((__v32hi) __A,
1996                                                   (__v32hi) __B,
1997                                                   (__v32hi)
1998                                                   _mm512_setzero_hi (),
1999                                                   (__mmask32) -1);
2000 }
2001
2002 extern __inline __m512i
2003 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2004 _mm512_mask_sllv_epi16 (__m512i __W, __mmask32 __U, __m512i __A,
2005                         __m512i __B)
2006 {
2007   return (__m512i) __builtin_ia32_psllv32hi_mask ((__v32hi) __A,
2008                                                   (__v32hi) __B,
2009                                                   (__v32hi) __W,
2010                                                   (__mmask32) __U);
2011 }
2012
2013 extern __inline __m512i
2014 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2015 _mm512_maskz_sllv_epi16 (__mmask32 __U, __m512i __A, __m512i __B)
2016 {
2017   return (__m512i) __builtin_ia32_psllv32hi_mask ((__v32hi) __A,
2018                                                   (__v32hi) __B,
2019                                                   (__v32hi)
2020                                                   _mm512_setzero_hi (),
2021                                                   (__mmask32) __U);
2022 }
2023
2024 extern __inline __m512i
2025 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2026 _mm512_mask_packs_epi16 (__m512i __W, __mmask64 __M, __m512i __A,
2027                          __m512i __B)
2028 {
2029   return (__m512i) __builtin_ia32_packsswb512_mask ((__v32hi) __A,
2030                                                     (__v32hi) __B,
2031                                                     (__v64qi) __W,
2032                                                     (__mmask64) __M);
2033 }
2034
2035 extern __inline __m512i
2036 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2037 _mm512_maskz_packs_epi16 (__mmask64 __M, __m512i __A, __m512i __B)
2038 {
2039   return (__m512i) __builtin_ia32_packsswb512_mask ((__v32hi) __A,
2040                                                     (__v32hi) __B,
2041                                                     (__v64qi)
2042                                                     _mm512_setzero_qi(),
2043                                                     __M);
2044 }
2045
2046 extern __inline __m512i
2047 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2048 _mm512_packus_epi16 (__m512i __A, __m512i __B)
2049 {
2050   return (__m512i) __builtin_ia32_packuswb512_mask ((__v32hi) __A,
2051                                                     (__v32hi) __B,
2052                                                     (__v64qi)
2053                                                     _mm512_setzero_qi (),
2054                                                     (__mmask64) -1);
2055 }
2056
2057 extern __inline __m512i
2058 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2059 _mm512_mask_packus_epi16 (__m512i __W, __mmask64 __M, __m512i __A,
2060                           __m512i __B)
2061 {
2062   return (__m512i) __builtin_ia32_packuswb512_mask ((__v32hi) __A,
2063                                                     (__v32hi) __B,
2064                                                     (__v64qi) __W,
2065                                                     (__mmask64) __M);
2066 }
2067
2068 extern __inline __m512i
2069 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2070 _mm512_maskz_packus_epi16 (__mmask64 __M, __m512i __A, __m512i __B)
2071 {
2072   return (__m512i) __builtin_ia32_packuswb512_mask ((__v32hi) __A,
2073                                                     (__v32hi) __B,
2074                                                     (__v64qi)
2075                                                     _mm512_setzero_qi(),
2076                                                     (__mmask64) __M);
2077 }
2078
2079 extern __inline __m512i
2080 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2081 _mm512_abs_epi8 (__m512i __A)
2082 {
2083   return (__m512i) __builtin_ia32_pabsb512_mask ((__v64qi) __A,
2084                                                  (__v64qi)
2085                                                  _mm512_setzero_qi (),
2086                                                  (__mmask64) -1);
2087 }
2088
2089 extern __inline __m512i
2090 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2091 _mm512_mask_abs_epi8 (__m512i __W, __mmask64 __U, __m512i __A)
2092 {
2093   return (__m512i) __builtin_ia32_pabsb512_mask ((__v64qi) __A,
2094                                                  (__v64qi) __W,
2095                                                  (__mmask64) __U);
2096 }
2097
2098 extern __inline __m512i
2099 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2100 _mm512_maskz_abs_epi8 (__mmask64 __U, __m512i __A)
2101 {
2102   return (__m512i) __builtin_ia32_pabsb512_mask ((__v64qi) __A,
2103                                                  (__v64qi)
2104                                                  _mm512_setzero_qi (),
2105                                                  (__mmask64) __U);
2106 }
2107
2108 extern __inline __m512i
2109 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2110 _mm512_abs_epi16 (__m512i __A)
2111 {
2112   return (__m512i) __builtin_ia32_pabsw512_mask ((__v32hi) __A,
2113                                                  (__v32hi)
2114                                                  _mm512_setzero_hi (),
2115                                                  (__mmask32) -1);
2116 }
2117
2118 extern __inline __m512i
2119 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2120 _mm512_mask_abs_epi16 (__m512i __W, __mmask32 __U, __m512i __A)
2121 {
2122   return (__m512i) __builtin_ia32_pabsw512_mask ((__v32hi) __A,
2123                                                  (__v32hi) __W,
2124                                                  (__mmask32) __U);
2125 }
2126
2127 extern __inline __m512i
2128 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2129 _mm512_maskz_abs_epi16 (__mmask32 __U, __m512i __A)
2130 {
2131   return (__m512i) __builtin_ia32_pabsw512_mask ((__v32hi) __A,
2132                                                  (__v32hi)
2133                                                  _mm512_setzero_hi (),
2134                                                  (__mmask32) __U);
2135 }
2136
2137 extern __inline __mmask64
2138 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2139 _mm512_mask_cmpneq_epu8_mask (__mmask64 __M, __m512i __X, __m512i __Y)
2140 {
2141   return (__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi) __X,
2142                                                    (__v64qi) __Y, 4,
2143                                                    (__mmask64) __M);
2144 }
2145
2146 extern __inline __mmask64
2147 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2148 _mm512_mask_cmplt_epu8_mask (__mmask64 __M, __m512i __X, __m512i __Y)
2149 {
2150   return (__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi) __X,
2151                                                    (__v64qi) __Y, 1,
2152                                                    (__mmask64) __M);
2153 }
2154
2155 extern __inline __mmask64
2156 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2157 _mm512_mask_cmpge_epu8_mask (__mmask64 __M, __m512i __X, __m512i __Y)
2158 {
2159   return (__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi) __X,
2160                                                    (__v64qi) __Y, 5,
2161                                                    (__mmask64) __M);
2162 }
2163
2164 extern __inline __mmask64
2165 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2166 _mm512_mask_cmple_epu8_mask (__mmask64 __M, __m512i __X, __m512i __Y)
2167 {
2168   return (__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi) __X,
2169                                                    (__v64qi) __Y, 2,
2170                                                    (__mmask64) __M);
2171 }
2172
2173 extern __inline __mmask32
2174 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2175 _mm512_mask_cmpneq_epu16_mask (__mmask32 __M, __m512i __X, __m512i __Y)
2176 {
2177   return (__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi) __X,
2178                                                    (__v32hi) __Y, 4,
2179                                                    (__mmask32) __M);
2180 }
2181
2182 extern __inline __mmask32
2183 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2184 _mm512_mask_cmplt_epu16_mask (__mmask32 __M, __m512i __X, __m512i __Y)
2185 {
2186   return (__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi) __X,
2187                                                    (__v32hi) __Y, 1,
2188                                                    (__mmask32) __M);
2189 }
2190
2191 extern __inline __mmask32
2192 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2193 _mm512_mask_cmpge_epu16_mask (__mmask32 __M, __m512i __X, __m512i __Y)
2194 {
2195   return (__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi) __X,
2196                                                    (__v32hi) __Y, 5,
2197                                                    (__mmask32) __M);
2198 }
2199
2200 extern __inline __mmask32
2201 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2202 _mm512_mask_cmple_epu16_mask (__mmask32 __M, __m512i __X, __m512i __Y)
2203 {
2204   return (__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi) __X,
2205                                                    (__v32hi) __Y, 2,
2206                                                    (__mmask32) __M);
2207 }
2208
2209 extern __inline __mmask64
2210 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2211 _mm512_mask_cmpneq_epi8_mask (__mmask64 __M, __m512i __X, __m512i __Y)
2212 {
2213   return (__mmask64) __builtin_ia32_cmpb512_mask ((__v64qi) __X,
2214                                                   (__v64qi) __Y, 4,
2215                                                   (__mmask64) __M);
2216 }
2217
2218 extern __inline __mmask64
2219 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2220 _mm512_mask_cmplt_epi8_mask (__mmask64 __M, __m512i __X, __m512i __Y)
2221 {
2222   return (__mmask64) __builtin_ia32_cmpb512_mask ((__v64qi) __X,
2223                                                   (__v64qi) __Y, 1,
2224                                                   (__mmask64) __M);
2225 }
2226
2227 extern __inline __mmask64
2228 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2229 _mm512_mask_cmpge_epi8_mask (__mmask64 __M, __m512i __X, __m512i __Y)
2230 {
2231   return (__mmask64) __builtin_ia32_cmpb512_mask ((__v64qi) __X,
2232                                                   (__v64qi) __Y, 5,
2233                                                   (__mmask64) __M);
2234 }
2235
2236 extern __inline __mmask64
2237 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2238 _mm512_mask_cmple_epi8_mask (__mmask64 __M, __m512i __X, __m512i __Y)
2239 {
2240   return (__mmask64) __builtin_ia32_cmpb512_mask ((__v64qi) __X,
2241                                                   (__v64qi) __Y, 2,
2242                                                   (__mmask64) __M);
2243 }
2244
2245 extern __inline __mmask32
2246 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2247 _mm512_mask_cmpneq_epi16_mask (__mmask32 __M, __m512i __X, __m512i __Y)
2248 {
2249   return (__mmask32) __builtin_ia32_cmpw512_mask ((__v32hi) __X,
2250                                                   (__v32hi) __Y, 4,
2251                                                   (__mmask32) __M);
2252 }
2253
2254 extern __inline __mmask32
2255 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2256 _mm512_mask_cmplt_epi16_mask (__mmask32 __M, __m512i __X, __m512i __Y)
2257 {
2258   return (__mmask32) __builtin_ia32_cmpw512_mask ((__v32hi) __X,
2259                                                   (__v32hi) __Y, 1,
2260                                                   (__mmask32) __M);
2261 }
2262
2263 extern __inline __mmask32
2264 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2265 _mm512_mask_cmpge_epi16_mask (__mmask32 __M, __m512i __X, __m512i __Y)
2266 {
2267   return (__mmask32) __builtin_ia32_cmpw512_mask ((__v32hi) __X,
2268                                                   (__v32hi) __Y, 5,
2269                                                   (__mmask32) __M);
2270 }
2271
2272 extern __inline __mmask32
2273 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2274 _mm512_mask_cmple_epi16_mask (__mmask32 __M, __m512i __X, __m512i __Y)
2275 {
2276   return (__mmask32) __builtin_ia32_cmpw512_mask ((__v32hi) __X,
2277                                                   (__v32hi) __Y, 2,
2278                                                   (__mmask32) __M);
2279 }
2280
2281 extern __inline __mmask64
2282 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2283 _mm512_cmpneq_epu8_mask (__m512i __X, __m512i __Y)
2284 {
2285   return (__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi) __X,
2286                                                    (__v64qi) __Y, 4,
2287                                                    (__mmask64) - 1);
2288 }
2289
2290 extern __inline __mmask64
2291 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2292 _mm512_cmplt_epu8_mask (__m512i __X, __m512i __Y)
2293 {
2294   return (__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi) __X,
2295                                                    (__v64qi) __Y, 1,
2296                                                    (__mmask64) - 1);
2297 }
2298
2299 extern __inline __mmask64
2300 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2301 _mm512_cmpge_epu8_mask (__m512i __X, __m512i __Y)
2302 {
2303   return (__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi) __X,
2304                                                    (__v64qi) __Y, 5,
2305                                                    (__mmask64) - 1);
2306 }
2307
2308 extern __inline __mmask64
2309 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2310 _mm512_cmple_epu8_mask (__m512i __X, __m512i __Y)
2311 {
2312   return (__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi) __X,
2313                                                    (__v64qi) __Y, 2,
2314                                                    (__mmask64) - 1);
2315 }
2316
2317 extern __inline __mmask32
2318 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2319 _mm512_cmpneq_epu16_mask (__m512i __X, __m512i __Y)
2320 {
2321   return (__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi) __X,
2322                                                    (__v32hi) __Y, 4,
2323                                                    (__mmask32) - 1);
2324 }
2325
2326 extern __inline __mmask32
2327 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2328 _mm512_cmplt_epu16_mask (__m512i __X, __m512i __Y)
2329 {
2330   return (__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi) __X,
2331                                                    (__v32hi) __Y, 1,
2332                                                    (__mmask32) - 1);
2333 }
2334
2335 extern __inline __mmask32
2336 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2337 _mm512_cmpge_epu16_mask (__m512i __X, __m512i __Y)
2338 {
2339   return (__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi) __X,
2340                                                    (__v32hi) __Y, 5,
2341                                                    (__mmask32) - 1);
2342 }
2343
2344 extern __inline __mmask32
2345 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2346 _mm512_cmple_epu16_mask (__m512i __X, __m512i __Y)
2347 {
2348   return (__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi) __X,
2349                                                    (__v32hi) __Y, 2,
2350                                                    (__mmask32) - 1);
2351 }
2352
2353 extern __inline __mmask64
2354 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2355 _mm512_cmpneq_epi8_mask (__m512i __X, __m512i __Y)
2356 {
2357   return (__mmask64) __builtin_ia32_cmpb512_mask ((__v64qi) __X,
2358                                                   (__v64qi) __Y, 4,
2359                                                   (__mmask64) - 1);
2360 }
2361
2362 extern __inline __mmask64
2363 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2364 _mm512_cmplt_epi8_mask (__m512i __X, __m512i __Y)
2365 {
2366   return (__mmask64) __builtin_ia32_cmpb512_mask ((__v64qi) __X,
2367                                                   (__v64qi) __Y, 1,
2368                                                   (__mmask64) - 1);
2369 }
2370
2371 extern __inline __mmask64
2372 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2373 _mm512_cmpge_epi8_mask (__m512i __X, __m512i __Y)
2374 {
2375   return (__mmask64) __builtin_ia32_cmpb512_mask ((__v64qi) __X,
2376                                                   (__v64qi) __Y, 5,
2377                                                   (__mmask64) - 1);
2378 }
2379
2380 extern __inline __mmask64
2381 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2382 _mm512_cmple_epi8_mask (__m512i __X, __m512i __Y)
2383 {
2384   return (__mmask64) __builtin_ia32_cmpb512_mask ((__v64qi) __X,
2385                                                   (__v64qi) __Y, 2,
2386                                                   (__mmask64) - 1);
2387 }
2388
2389 extern __inline __mmask32
2390 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2391 _mm512_cmpneq_epi16_mask (__m512i __X, __m512i __Y)
2392 {
2393   return (__mmask32) __builtin_ia32_cmpw512_mask ((__v32hi) __X,
2394                                                   (__v32hi) __Y, 4,
2395                                                   (__mmask32) - 1);
2396 }
2397
2398 extern __inline __mmask32
2399 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2400 _mm512_cmplt_epi16_mask (__m512i __X, __m512i __Y)
2401 {
2402   return (__mmask32) __builtin_ia32_cmpw512_mask ((__v32hi) __X,
2403                                                   (__v32hi) __Y, 1,
2404                                                   (__mmask32) - 1);
2405 }
2406
2407 extern __inline __mmask32
2408 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2409 _mm512_cmpge_epi16_mask (__m512i __X, __m512i __Y)
2410 {
2411   return (__mmask32) __builtin_ia32_cmpw512_mask ((__v32hi) __X,
2412                                                   (__v32hi) __Y, 5,
2413                                                   (__mmask32) - 1);
2414 }
2415
2416 extern __inline __mmask32
2417 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2418 _mm512_cmple_epi16_mask (__m512i __X, __m512i __Y)
2419 {
2420   return (__mmask32) __builtin_ia32_cmpw512_mask ((__v32hi) __X,
2421                                                   (__v32hi) __Y, 2,
2422                                                   (__mmask32) - 1);
2423 }
2424
2425 #ifdef __OPTIMIZE__
2426 extern __inline __m512i
2427 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2428 _mm512_alignr_epi8 (__m512i __A, __m512i __B, const int __N)
2429 {
2430   return (__m512i) __builtin_ia32_palignr512 ((__v8di) __A,
2431                                               (__v8di) __B, __N * 8);
2432 }
2433
2434 extern __inline __m512i
2435 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2436 _mm512_mask_alignr_epi8 (__m512i __W, __mmask64 __U, __m512i __A,
2437                          __m512i __B, const int __N)
2438 {
2439   return (__m512i) __builtin_ia32_palignr512_mask ((__v8di) __A,
2440                                                    (__v8di) __B,
2441                                                    __N * 8,
2442                                                    (__v8di) __W,
2443                                                    (__mmask64) __U);
2444 }
2445
2446 extern __inline __m512i
2447 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2448 _mm512_maskz_alignr_epi8 (__mmask64 __U, __m512i __A, __m512i __B,
2449                           const int __N)
2450 {
2451   return (__m512i) __builtin_ia32_palignr512_mask ((__v8di) __A,
2452                                                    (__v8di) __B,
2453                                                    __N * 8,
2454                                                    (__v8di)
2455                                                    _mm512_setzero_si512 (),
2456                                                    (__mmask64) __U);
2457 }
2458
2459 extern __inline __m512i
2460 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2461 _mm512_dbsad_epu8 (__m512i __A, __m512i __B, const int __imm)
2462 {
2463   return (__m512i) __builtin_ia32_dbpsadbw512_mask ((__v64qi) __A,
2464                                                     (__v64qi) __B,
2465                                                     __imm,
2466                                                     (__v32hi)
2467                                                     _mm512_setzero_hi (),
2468                                                     (__mmask32) -1);
2469 }
2470
2471 extern __inline __m512i
2472 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2473 _mm512_mask_dbsad_epu8 (__m512i __W, __mmask32 __U, __m512i __A,
2474                         __m512i __B, const int __imm)
2475 {
2476   return (__m512i) __builtin_ia32_dbpsadbw512_mask ((__v64qi) __A,
2477                                                     (__v64qi) __B,
2478                                                     __imm,
2479                                                     (__v32hi) __W,
2480                                                     (__mmask32) __U);
2481 }
2482
2483 extern __inline __m512i
2484 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2485 _mm512_maskz_dbsad_epu8 (__mmask32 __U, __m512i __A, __m512i __B,
2486                          const int __imm)
2487 {
2488   return (__m512i) __builtin_ia32_dbpsadbw512_mask ((__v64qi) __A,
2489                                                     (__v64qi) __B,
2490                                                     __imm,
2491                                                     (__v32hi)
2492                                                     _mm512_setzero_hi(),
2493                                                     (__mmask32) __U);
2494 }
2495
2496 extern __inline __m512i
2497 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2498 _mm512_srli_epi16 (__m512i __A, const int __imm)
2499 {
2500   return (__m512i) __builtin_ia32_psrlwi512_mask ((__v32hi) __A, __imm,
2501                                                   (__v32hi)
2502                                                   _mm512_setzero_hi (),
2503                                                   (__mmask32) -1);
2504 }
2505
2506 extern __inline __m512i
2507 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2508 _mm512_mask_srli_epi16 (__m512i __W, __mmask32 __U, __m512i __A,
2509                         const int __imm)
2510 {
2511   return (__m512i) __builtin_ia32_psrlwi512_mask ((__v32hi) __A, __imm,
2512                                                   (__v32hi) __W,
2513                                                   (__mmask32) __U);
2514 }
2515
2516 extern __inline __m512i
2517 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2518 _mm512_maskz_srli_epi16 (__mmask32 __U, __m512i __A, const int __imm)
2519 {
2520   return (__m512i) __builtin_ia32_psrlwi512_mask ((__v32hi) __A, __imm,
2521                                                   (__v32hi)
2522                                                   _mm512_setzero_hi (),
2523                                                   (__mmask32) __U);
2524 }
2525
2526 extern __inline __m512i
2527 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2528 _mm512_slli_epi16 (__m512i __A, const int __B)
2529 {
2530   return (__m512i) __builtin_ia32_psllwi512_mask ((__v32hi) __A, __B,
2531                                                   (__v32hi)
2532                                                   _mm512_setzero_hi (),
2533                                                   (__mmask32) -1);
2534 }
2535
2536 extern __inline __m512i
2537 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2538 _mm512_mask_slli_epi16 (__m512i __W, __mmask32 __U, __m512i __A,
2539                         const int __B)
2540 {
2541   return (__m512i) __builtin_ia32_psllwi512_mask ((__v32hi) __A, __B,
2542                                                   (__v32hi) __W,
2543                                                   (__mmask32) __U);
2544 }
2545
2546 extern __inline __m512i
2547 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2548 _mm512_maskz_slli_epi16 (__mmask32 __U, __m512i __A, const int __B)
2549 {
2550   return (__m512i) __builtin_ia32_psllwi512_mask ((__v32hi) __A, __B,
2551                                                   (__v32hi)
2552                                                   _mm512_setzero_hi (),
2553                                                   (__mmask32) __U);
2554 }
2555
2556 extern __inline __m512i
2557 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2558 _mm512_shufflehi_epi16 (__m512i __A, const int __imm)
2559 {
2560   return (__m512i) __builtin_ia32_pshufhw512_mask ((__v32hi) __A,
2561                                                    __imm,
2562                                                    (__v32hi)
2563                                                    _mm512_setzero_hi (),
2564                                                    (__mmask32) -1);
2565 }
2566
2567 extern __inline __m512i
2568 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2569 _mm512_mask_shufflehi_epi16 (__m512i __W, __mmask32 __U, __m512i __A,
2570                              const int __imm)
2571 {
2572   return (__m512i) __builtin_ia32_pshufhw512_mask ((__v32hi) __A,
2573                                                    __imm,
2574                                                    (__v32hi) __W,
2575                                                    (__mmask32) __U);
2576 }
2577
2578 extern __inline __m512i
2579 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2580 _mm512_maskz_shufflehi_epi16 (__mmask32 __U, __m512i __A,
2581                               const int __imm)
2582 {
2583   return (__m512i) __builtin_ia32_pshufhw512_mask ((__v32hi) __A,
2584                                                    __imm,
2585                                                    (__v32hi)
2586                                                    _mm512_setzero_hi (),
2587                                                    (__mmask32) __U);
2588 }
2589
2590 extern __inline __m512i
2591 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2592 _mm512_shufflelo_epi16 (__m512i __A, const int __imm)
2593 {
2594   return (__m512i) __builtin_ia32_pshuflw512_mask ((__v32hi) __A,
2595                                                    __imm,
2596                                                    (__v32hi)
2597                                                    _mm512_setzero_hi (),
2598                                                    (__mmask32) -1);
2599 }
2600
2601 extern __inline __m512i
2602 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2603 _mm512_mask_shufflelo_epi16 (__m512i __W, __mmask32 __U, __m512i __A,
2604                              const int __imm)
2605 {
2606   return (__m512i) __builtin_ia32_pshuflw512_mask ((__v32hi) __A,
2607                                                    __imm,
2608                                                    (__v32hi) __W,
2609                                                    (__mmask32) __U);
2610 }
2611
2612 extern __inline __m512i
2613 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2614 _mm512_maskz_shufflelo_epi16 (__mmask32 __U, __m512i __A,
2615                               const int __imm)
2616 {
2617   return (__m512i) __builtin_ia32_pshuflw512_mask ((__v32hi) __A,
2618                                                    __imm,
2619                                                    (__v32hi)
2620                                                    _mm512_setzero_hi (),
2621                                                    (__mmask32) __U);
2622 }
2623
2624 extern __inline __m512i
2625 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2626 _mm512_srai_epi16 (__m512i __A, const int __imm)
2627 {
2628   return (__m512i) __builtin_ia32_psrawi512_mask ((__v32hi) __A, __imm,
2629                                                   (__v32hi)
2630                                                   _mm512_setzero_hi (),
2631                                                   (__mmask32) -1);
2632 }
2633
2634 extern __inline __m512i
2635 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2636 _mm512_mask_srai_epi16 (__m512i __W, __mmask32 __U, __m512i __A,
2637                         const int __imm)
2638 {
2639   return (__m512i) __builtin_ia32_psrawi512_mask ((__v32hi) __A, __imm,
2640                                                   (__v32hi) __W,
2641                                                   (__mmask32) __U);
2642 }
2643
2644 extern __inline __m512i
2645 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2646 _mm512_maskz_srai_epi16 (__mmask32 __U, __m512i __A, const int __imm)
2647 {
2648   return (__m512i) __builtin_ia32_psrawi512_mask ((__v32hi) __A, __imm,
2649                                                   (__v32hi)
2650                                                   _mm512_setzero_hi (),
2651                                                   (__mmask32) __U);
2652 }
2653
2654 extern __inline __m512i
2655 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2656 _mm512_mask_blend_epi16 (__mmask32 __U, __m512i __A, __m512i __W)
2657 {
2658   return (__m512i) __builtin_ia32_blendmw_512_mask ((__v32hi) __A,
2659                                                     (__v32hi) __W,
2660                                                     (__mmask32) __U);
2661 }
2662
2663 extern __inline __m512i
2664 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2665 _mm512_mask_blend_epi8 (__mmask64 __U, __m512i __A, __m512i __W)
2666 {
2667   return (__m512i) __builtin_ia32_blendmb_512_mask ((__v64qi) __A,
2668                                                     (__v64qi) __W,
2669                                                     (__mmask64) __U);
2670 }
2671
2672 extern __inline __mmask32
2673 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2674 _mm512_mask_cmp_epi16_mask (__mmask32 __U, __m512i __X, __m512i __Y,
2675                             const int __P)
2676 {
2677   return (__mmask32) __builtin_ia32_cmpw512_mask ((__v32hi) __X,
2678                                                   (__v32hi) __Y, __P,
2679                                                   (__mmask32) __U);
2680 }
2681
2682 extern __inline __mmask32
2683 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2684 _mm512_cmp_epi16_mask (__m512i __X, __m512i __Y, const int __P)
2685 {
2686   return (__mmask32) __builtin_ia32_cmpw512_mask ((__v32hi) __X,
2687                                                   (__v32hi) __Y, __P,
2688                                                   (__mmask32) -1);
2689 }
2690
2691 extern __inline __mmask64
2692 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2693 _mm512_mask_cmp_epi8_mask (__mmask32 __U, __m512i __X, __m512i __Y,
2694                            const int __P)
2695 {
2696   return (__mmask64) __builtin_ia32_cmpb512_mask ((__v64qi) __X,
2697                                                   (__v64qi) __Y, __P,
2698                                                   (__mmask64) __U);
2699 }
2700
2701 extern __inline __mmask64
2702 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2703 _mm512_cmp_epi8_mask (__m512i __X, __m512i __Y, const int __P)
2704 {
2705   return (__mmask64) __builtin_ia32_cmpb512_mask ((__v64qi) __X,
2706                                                   (__v64qi) __Y, __P,
2707                                                   (__mmask64) -1);
2708 }
2709
2710 extern __inline __mmask32
2711 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2712 _mm512_mask_cmp_epu16_mask (__mmask32 __U, __m512i __X, __m512i __Y,
2713                             const int __P)
2714 {
2715   return (__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi) __X,
2716                                                    (__v32hi) __Y, __P,
2717                                                    (__mmask32) __U);
2718 }
2719
2720 extern __inline __mmask32
2721 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2722 _mm512_cmp_epu16_mask (__m512i __X, __m512i __Y, const int __P)
2723 {
2724   return (__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi) __X,
2725                                                    (__v32hi) __Y, __P,
2726                                                    (__mmask32) -1);
2727 }
2728
2729 extern __inline __mmask64
2730 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2731 _mm512_mask_cmp_epu8_mask (__mmask32 __U, __m512i __X, __m512i __Y,
2732                            const int __P)
2733 {
2734   return (__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi) __X,
2735                                                    (__v64qi) __Y, __P,
2736                                                    (__mmask64) __U);
2737 }
2738
2739 extern __inline __mmask64
2740 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2741 _mm512_cmp_epu8_mask (__m512i __X, __m512i __Y, const int __P)
2742 {
2743   return (__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi) __X,
2744                                                    (__v64qi) __Y, __P,
2745                                                    (__mmask64) -1);
2746 }
2747
2748 extern __inline __m512i
2749 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2750 _mm512_packs_epi32 (__m512i __A, __m512i __B)
2751 {
2752   return (__m512i) __builtin_ia32_packssdw512_mask ((__v16si) __A,
2753                                                     (__v16si) __B,
2754                                                     (__v32hi)
2755                                                     _mm512_setzero_hi (),
2756                                                     (__mmask32) -1);
2757 }
2758
2759 extern __inline __m512i
2760 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2761 _mm512_maskz_packs_epi32 (__mmask32 __M, __m512i __A, __m512i __B)
2762 {
2763   return (__m512i) __builtin_ia32_packssdw512_mask ((__v16si) __A,
2764                                                     (__v16si) __B,
2765                                                     (__v32hi)
2766                                                     _mm512_setzero_hi(),
2767                                                     __M);
2768 }
2769
2770 extern __inline __m512i
2771 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2772 _mm512_mask_packs_epi32 (__m512i __W, __mmask32 __M, __m512i __A,
2773                          __m512i __B)
2774 {
2775   return (__m512i) __builtin_ia32_packssdw512_mask ((__v16si) __A,
2776                                                     (__v16si) __B,
2777                                                     (__v32hi) __W,
2778                                                     __M);
2779 }
2780
2781 extern __inline __m512i
2782 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2783 _mm512_packus_epi32 (__m512i __A, __m512i __B)
2784 {
2785   return (__m512i) __builtin_ia32_packusdw512_mask ((__v16si) __A,
2786                                                     (__v16si) __B,
2787                                                     (__v32hi)
2788                                                     _mm512_setzero_hi (),
2789                                                     (__mmask32) -1);
2790 }
2791
2792 extern __inline __m512i
2793 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2794 _mm512_maskz_packus_epi32 (__mmask32 __M, __m512i __A, __m512i __B)
2795 {
2796   return (__m512i) __builtin_ia32_packusdw512_mask ((__v16si) __A,
2797                                                     (__v16si) __B,
2798                                                     (__v32hi)
2799                                                     _mm512_setzero_hi(),
2800                                                     __M);
2801 }
2802
2803 extern __inline __m512i
2804 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2805 _mm512_mask_packus_epi32 (__m512i __W, __mmask32 __M, __m512i __A,
2806                           __m512i __B)
2807 {
2808   return (__m512i) __builtin_ia32_packusdw512_mask ((__v16si) __A,
2809                                                     (__v16si) __B,
2810                                                     (__v32hi) __W,
2811                                                     __M);
2812 }
2813
2814 extern __inline __m512i
2815 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2816 _mm512_bslli_epi128 (__m512i __A, const int __N)
2817 {
2818   return (__m512i) __builtin_ia32_pslldq512 (__A, __N * 8);
2819 }
2820
2821 extern __inline __m512i
2822 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
2823 _mm512_bsrli_epi128 (__m512i __A, const int __N)
2824 {
2825   return (__m512i) __builtin_ia32_psrldq512 (__A, __N * 8);
2826 }
2827
2828 #else
2829 #define _mm512_alignr_epi8(X, Y, N)                                                 \
2830   ((__m512i) __builtin_ia32_palignr512 ((__v8di)(__m512i)(X),                       \
2831                                         (__v8di)(__m512i)(Y),                       \
2832                                         (int)(N * 8)))
2833
2834 #define _mm512_mask_alignr_epi8(W, U, X, Y, N)                                      \
2835   ((__m512i) __builtin_ia32_palignr512_mask ((__v8di)(__m512i)(X),                  \
2836                                             (__v8di)(__m512i)(Y), (int)(N * 8),     \
2837                                             (__v8di)(__m512i)(W), (__mmask64)(U)))
2838
2839 #define _mm512_maskz_alignr_epi8(U, X, Y, N)                                        \
2840   ((__m512i) __builtin_ia32_palignr512_mask ((__v8di)(__m512i)(X),                  \
2841                                             (__v8di)(__m512i)(Y), (int)(N * 8),     \
2842                                             (__v8di)(__m512i)_mm512_setzero_si512 (),   \
2843                                             (__mmask64)(U)))
2844
2845 #define _mm512_dbsad_epu8(X, Y, C)                                                  \
2846   ((__m512i) __builtin_ia32_dbpsadbw512_mask ((__v64qi)(__m512i) (X),               \
2847                                               (__v64qi)(__m512i) (Y), (int) (C),    \
2848                                               (__v32hi)(__m512i)_mm512_setzero_si512 (),\
2849                                               (__mmask32)-1))
2850
2851 #define _mm512_mask_dbsad_epu8(W, U, X, Y, C)                                       \
2852   ((__m512i) __builtin_ia32_dbpsadbw512_mask ((__v64qi)(__m512i) (X),               \
2853                                               (__v64qi)(__m512i) (Y), (int) (C),    \
2854                                               (__v32hi)(__m512i)(W),                \
2855                                               (__mmask32)(U)))
2856
2857 #define _mm512_maskz_dbsad_epu8(U, X, Y, C)                                         \
2858   ((__m512i) __builtin_ia32_dbpsadbw512_mask ((__v64qi)(__m512i) (X),               \
2859                                               (__v64qi)(__m512i) (Y), (int) (C),    \
2860                                               (__v32hi)(__m512i)_mm512_setzero_si512 (),\
2861                                               (__mmask32)(U)))
2862
2863 #define _mm512_srli_epi16(A, B)                                         \
2864   ((__m512i) __builtin_ia32_psrlwi512_mask ((__v32hi)(__m512i)(A),      \
2865     (int)(B), (__v32hi)_mm512_setzero_hi(), (__mmask32)-1))
2866
2867 #define _mm512_mask_srli_epi16(W, U, A, B)                              \
2868   ((__m512i) __builtin_ia32_psrlwi512_mask ((__v32hi)(__m512i)(A),      \
2869     (int)(B), (__v32hi)(__m512i)(W), (__mmask32)(U)))
2870
2871 #define _mm512_maskz_srli_epi16(U, A, B)                                \
2872   ((__m512i) __builtin_ia32_psrlwi512_mask ((__v32hi)(__m512i)(A),      \
2873     (int)(B), (__v32hi)_mm512_setzero_hi(), (__mmask32)(U)))
2874
2875 #define _mm512_slli_epi16(X, C)                                            \
2876   ((__m512i)__builtin_ia32_psllwi512_mask ((__v32hi)(__m512i)(X), (int)(C),\
2877     (__v32hi)(__m512i)_mm512_setzero_hi(),\
2878     (__mmask32)-1))
2879
2880 #define _mm512_mask_slli_epi16(W, U, X, C)                                 \
2881   ((__m512i)__builtin_ia32_psllwi512_mask ((__v32hi)(__m512i)(X), (int)(C),\
2882     (__v32hi)(__m512i)(W),\
2883     (__mmask32)(U)))
2884
2885 #define _mm512_maskz_slli_epi16(U, X, C)                                   \
2886   ((__m512i)__builtin_ia32_psllwi512_mask ((__v32hi)(__m512i)(X), (int)(C),\
2887     (__v32hi)(__m512i)_mm512_setzero_hi(),\
2888     (__mmask32)(U)))
2889
2890 #define _mm512_shufflehi_epi16(A, B)                                                \
2891   ((__m512i) __builtin_ia32_pshufhw512_mask ((__v32hi)(__m512i)(A), (int)(B),       \
2892                                              (__v32hi)(__m512i)_mm512_setzero_hi(), \
2893                                              (__mmask32)-1))
2894
2895 #define _mm512_mask_shufflehi_epi16(W, U, A, B)                                     \
2896   ((__m512i) __builtin_ia32_pshufhw512_mask ((__v32hi)(__m512i)(A), (int)(B),       \
2897                                              (__v32hi)(__m512i)(W),                 \
2898                                              (__mmask32)(U)))
2899
2900 #define _mm512_maskz_shufflehi_epi16(U, A, B)                                       \
2901   ((__m512i) __builtin_ia32_pshufhw512_mask ((__v32hi)(__m512i)(A), (int)(B),       \
2902                                              (__v32hi)(__m512i)_mm512_setzero_hi(), \
2903                                              (__mmask32)(U)))
2904
2905 #define _mm512_shufflelo_epi16(A, B)                                                \
2906   ((__m512i) __builtin_ia32_pshuflw512_mask ((__v32hi)(__m512i)(A), (int)(B),       \
2907                                              (__v32hi)(__m512i)_mm512_setzero_hi(), \
2908                                              (__mmask32)-1))
2909
2910 #define _mm512_mask_shufflelo_epi16(W, U, A, B)                                     \
2911   ((__m512i) __builtin_ia32_pshuflw512_mask ((__v32hi)(__m512i)(A), (int)(B),       \
2912                                              (__v32hi)(__m512i)(W),                 \
2913                                              (__mmask32)(U)))
2914
2915 #define _mm512_maskz_shufflelo_epi16(U, A, B)                                       \
2916   ((__m512i) __builtin_ia32_pshuflw512_mask ((__v32hi)(__m512i)(A), (int)(B),       \
2917                                              (__v32hi)(__m512i)_mm512_setzero_hi(), \
2918                                              (__mmask32)(U)))
2919
2920 #define _mm512_srai_epi16(A, B)                                         \
2921   ((__m512i) __builtin_ia32_psrawi512_mask ((__v32hi)(__m512i)(A),      \
2922     (int)(B), (__v32hi)_mm512_setzero_hi(), (__mmask32)-1))
2923
2924 #define _mm512_mask_srai_epi16(W, U, A, B)                              \
2925   ((__m512i) __builtin_ia32_psrawi512_mask ((__v32hi)(__m512i)(A),      \
2926     (int)(B), (__v32hi)(__m512i)(W), (__mmask32)(U)))
2927
2928 #define _mm512_maskz_srai_epi16(U, A, B)                                \
2929   ((__m512i) __builtin_ia32_psrawi512_mask ((__v32hi)(__m512i)(A),      \
2930     (int)(B), (__v32hi)_mm512_setzero_hi(), (__mmask32)(U)))
2931
2932 #define _mm512_mask_blend_epi16(__U, __A, __W)                        \
2933   ((__m512i) __builtin_ia32_blendmw_512_mask ((__v32hi) (__A),        \
2934                                                     (__v32hi) (__W),  \
2935                                                     (__mmask32) (__U)))
2936
2937 #define _mm512_mask_blend_epi8(__U, __A, __W)                         \
2938   ((__m512i) __builtin_ia32_blendmb_512_mask ((__v64qi) (__A),        \
2939                                                     (__v64qi) (__W),  \
2940                                                     (__mmask64) (__U)))
2941
2942 #define _mm512_cmp_epi16_mask(X, Y, P)                          \
2943   ((__mmask32) __builtin_ia32_cmpw512_mask ((__v32hi)(__m512i)(X),      \
2944                                             (__v32hi)(__m512i)(Y), (int)(P),\
2945                                             (__mmask32)(-1)))
2946
2947 #define _mm512_cmp_epi8_mask(X, Y, P)                           \
2948   ((__mmask64) __builtin_ia32_cmpb512_mask ((__v64qi)(__m512i)(X),      \
2949                                             (__v64qi)(__m512i)(Y), (int)(P),\
2950                                             (__mmask64)(-1)))
2951
2952 #define _mm512_cmp_epu16_mask(X, Y, P)                          \
2953   ((__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi)(__m512i)(X),     \
2954                                             (__v32hi)(__m512i)(Y), (int)(P),\
2955                                             (__mmask32)(-1)))
2956
2957 #define _mm512_cmp_epu8_mask(X, Y, P)                           \
2958   ((__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi)(__m512i)(X),     \
2959                                             (__v64qi)(__m512i)(Y), (int)(P),\
2960                                             (__mmask64)(-1)))
2961
2962 #define _mm512_mask_cmp_epi16_mask(M, X, Y, P)                          \
2963   ((__mmask32) __builtin_ia32_cmpw512_mask ((__v32hi)(__m512i)(X),      \
2964                                             (__v32hi)(__m512i)(Y), (int)(P),\
2965                                             (__mmask32)(M)))
2966
2967 #define _mm512_mask_cmp_epi8_mask(M, X, Y, P)                           \
2968   ((__mmask64) __builtin_ia32_cmpb512_mask ((__v64qi)(__m512i)(X),      \
2969                                             (__v64qi)(__m512i)(Y), (int)(P),\
2970                                             (__mmask64)(M)))
2971
2972 #define _mm512_mask_cmp_epu16_mask(M, X, Y, P)                          \
2973   ((__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi)(__m512i)(X),     \
2974                                             (__v32hi)(__m512i)(Y), (int)(P),\
2975                                             (__mmask32)(M)))
2976
2977 #define _mm512_mask_cmp_epu8_mask(M, X, Y, P)                           \
2978   ((__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi)(__m512i)(X),     \
2979                                             (__v64qi)(__m512i)(Y), (int)(P),\
2980                                             (__mmask64)(M)))
2981
2982 #define _mm512_bslli_epi128(A, N)                                         \
2983   ((__m512i)__builtin_ia32_pslldq512 ((__m512i)(A), (int)(N) * 8))
2984
2985 #define _mm512_bsrli_epi128(A, N)                                         \
2986   ((__m512i)__builtin_ia32_psrldq512 ((__m512i)(A), (int)(N) * 8))
2987
2988 #endif
2989
2990 #ifdef __DISABLE_AVX512BW__
2991 #undef __DISABLE_AVX512BW__
2992 #pragma GCC pop_options
2993 #endif /* __DISABLE_AVX512BW__ */
2994
2995 #endif /* _AVX512BWINTRIN_H_INCLUDED */