1 /* Copyright (C) 2007-2015 Free Software Foundation, Inc.
3 This file is part of GCC.
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)
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.
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.
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/>. */
24 #ifndef _X86INTRIN_H_INCLUDED
25 # error "Never use <xopintrin.h> directly; include <x86intrin.h> instead."
28 #ifndef _XOPMMINTRIN_H_INCLUDED
29 #define _XOPMMINTRIN_H_INCLUDED
31 #include <fma4intrin.h>
34 #pragma GCC push_options
35 #pragma GCC target("xop")
36 #define __DISABLE_XOP__
39 /* Integer multiply/add intructions. */
40 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
41 _mm_maccs_epi16(__m128i __A
, __m128i __B
, __m128i __C
)
43 return (__m128i
) __builtin_ia32_vpmacssww ((__v8hi
)__A
,(__v8hi
)__B
, (__v8hi
)__C
);
46 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
47 _mm_macc_epi16(__m128i __A
, __m128i __B
, __m128i __C
)
49 return (__m128i
) __builtin_ia32_vpmacsww ((__v8hi
)__A
, (__v8hi
)__B
, (__v8hi
)__C
);
52 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
53 _mm_maccsd_epi16(__m128i __A
, __m128i __B
, __m128i __C
)
55 return (__m128i
) __builtin_ia32_vpmacsswd ((__v8hi
)__A
, (__v8hi
)__B
, (__v4si
)__C
);
58 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
59 _mm_maccd_epi16(__m128i __A
, __m128i __B
, __m128i __C
)
61 return (__m128i
) __builtin_ia32_vpmacswd ((__v8hi
)__A
, (__v8hi
)__B
, (__v4si
)__C
);
64 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
65 _mm_maccs_epi32(__m128i __A
, __m128i __B
, __m128i __C
)
67 return (__m128i
) __builtin_ia32_vpmacssdd ((__v4si
)__A
, (__v4si
)__B
, (__v4si
)__C
);
70 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
71 _mm_macc_epi32(__m128i __A
, __m128i __B
, __m128i __C
)
73 return (__m128i
) __builtin_ia32_vpmacsdd ((__v4si
)__A
, (__v4si
)__B
, (__v4si
)__C
);
76 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
77 _mm_maccslo_epi32(__m128i __A
, __m128i __B
, __m128i __C
)
79 return (__m128i
) __builtin_ia32_vpmacssdql ((__v4si
)__A
, (__v4si
)__B
, (__v2di
)__C
);
82 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
83 _mm_macclo_epi32(__m128i __A
, __m128i __B
, __m128i __C
)
85 return (__m128i
) __builtin_ia32_vpmacsdql ((__v4si
)__A
, (__v4si
)__B
, (__v2di
)__C
);
88 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
89 _mm_maccshi_epi32(__m128i __A
, __m128i __B
, __m128i __C
)
91 return (__m128i
) __builtin_ia32_vpmacssdqh ((__v4si
)__A
, (__v4si
)__B
, (__v2di
)__C
);
94 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
95 _mm_macchi_epi32(__m128i __A
, __m128i __B
, __m128i __C
)
97 return (__m128i
) __builtin_ia32_vpmacsdqh ((__v4si
)__A
, (__v4si
)__B
, (__v2di
)__C
);
100 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
101 _mm_maddsd_epi16(__m128i __A
, __m128i __B
, __m128i __C
)
103 return (__m128i
) __builtin_ia32_vpmadcsswd ((__v8hi
)__A
,(__v8hi
)__B
,(__v4si
)__C
);
106 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
107 _mm_maddd_epi16(__m128i __A
, __m128i __B
, __m128i __C
)
109 return (__m128i
) __builtin_ia32_vpmadcswd ((__v8hi
)__A
,(__v8hi
)__B
,(__v4si
)__C
);
112 /* Packed Integer Horizontal Add and Subtract */
113 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
114 _mm_haddw_epi8(__m128i __A
)
116 return (__m128i
) __builtin_ia32_vphaddbw ((__v16qi
)__A
);
119 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
120 _mm_haddd_epi8(__m128i __A
)
122 return (__m128i
) __builtin_ia32_vphaddbd ((__v16qi
)__A
);
125 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
126 _mm_haddq_epi8(__m128i __A
)
128 return (__m128i
) __builtin_ia32_vphaddbq ((__v16qi
)__A
);
131 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
132 _mm_haddd_epi16(__m128i __A
)
134 return (__m128i
) __builtin_ia32_vphaddwd ((__v8hi
)__A
);
137 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
138 _mm_haddq_epi16(__m128i __A
)
140 return (__m128i
) __builtin_ia32_vphaddwq ((__v8hi
)__A
);
143 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
144 _mm_haddq_epi32(__m128i __A
)
146 return (__m128i
) __builtin_ia32_vphadddq ((__v4si
)__A
);
149 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
150 _mm_haddw_epu8(__m128i __A
)
152 return (__m128i
) __builtin_ia32_vphaddubw ((__v16qi
)__A
);
155 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
156 _mm_haddd_epu8(__m128i __A
)
158 return (__m128i
) __builtin_ia32_vphaddubd ((__v16qi
)__A
);
161 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
162 _mm_haddq_epu8(__m128i __A
)
164 return (__m128i
) __builtin_ia32_vphaddubq ((__v16qi
)__A
);
167 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
168 _mm_haddd_epu16(__m128i __A
)
170 return (__m128i
) __builtin_ia32_vphadduwd ((__v8hi
)__A
);
173 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
174 _mm_haddq_epu16(__m128i __A
)
176 return (__m128i
) __builtin_ia32_vphadduwq ((__v8hi
)__A
);
179 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
180 _mm_haddq_epu32(__m128i __A
)
182 return (__m128i
) __builtin_ia32_vphaddudq ((__v4si
)__A
);
185 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
186 _mm_hsubw_epi8(__m128i __A
)
188 return (__m128i
) __builtin_ia32_vphsubbw ((__v16qi
)__A
);
191 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
192 _mm_hsubd_epi16(__m128i __A
)
194 return (__m128i
) __builtin_ia32_vphsubwd ((__v8hi
)__A
);
197 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
198 _mm_hsubq_epi32(__m128i __A
)
200 return (__m128i
) __builtin_ia32_vphsubdq ((__v4si
)__A
);
203 /* Vector conditional move and permute */
205 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
206 _mm_cmov_si128(__m128i __A
, __m128i __B
, __m128i __C
)
208 return (__m128i
) __builtin_ia32_vpcmov (__A
, __B
, __C
);
211 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
212 _mm_perm_epi8(__m128i __A
, __m128i __B
, __m128i __C
)
214 return (__m128i
) __builtin_ia32_vpperm ((__v16qi
)__A
, (__v16qi
)__B
, (__v16qi
)__C
);
217 /* Packed Integer Rotates and Shifts
218 Rotates - Non-Immediate form */
220 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
221 _mm_rot_epi8(__m128i __A
, __m128i __B
)
223 return (__m128i
) __builtin_ia32_vprotb ((__v16qi
)__A
, (__v16qi
)__B
);
226 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
227 _mm_rot_epi16(__m128i __A
, __m128i __B
)
229 return (__m128i
) __builtin_ia32_vprotw ((__v8hi
)__A
, (__v8hi
)__B
);
232 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
233 _mm_rot_epi32(__m128i __A
, __m128i __B
)
235 return (__m128i
) __builtin_ia32_vprotd ((__v4si
)__A
, (__v4si
)__B
);
238 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
239 _mm_rot_epi64(__m128i __A
, __m128i __B
)
241 return (__m128i
) __builtin_ia32_vprotq ((__v2di
)__A
, (__v2di
)__B
);
244 /* Rotates - Immediate form */
247 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
248 _mm_roti_epi8(__m128i __A
, const int __B
)
250 return (__m128i
) __builtin_ia32_vprotbi ((__v16qi
)__A
, __B
);
253 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
254 _mm_roti_epi16(__m128i __A
, const int __B
)
256 return (__m128i
) __builtin_ia32_vprotwi ((__v8hi
)__A
, __B
);
259 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
260 _mm_roti_epi32(__m128i __A
, const int __B
)
262 return (__m128i
) __builtin_ia32_vprotdi ((__v4si
)__A
, __B
);
265 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
266 _mm_roti_epi64(__m128i __A
, const int __B
)
268 return (__m128i
) __builtin_ia32_vprotqi ((__v2di
)__A
, __B
);
271 #define _mm_roti_epi8(A, N) \
272 ((__m128i) __builtin_ia32_vprotbi ((__v16qi)(__m128i)(A), (int)(N)))
273 #define _mm_roti_epi16(A, N) \
274 ((__m128i) __builtin_ia32_vprotwi ((__v8hi)(__m128i)(A), (int)(N)))
275 #define _mm_roti_epi32(A, N) \
276 ((__m128i) __builtin_ia32_vprotdi ((__v4si)(__m128i)(A), (int)(N)))
277 #define _mm_roti_epi64(A, N) \
278 ((__m128i) __builtin_ia32_vprotqi ((__v2di)(__m128i)(A), (int)(N)))
283 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
284 _mm_shl_epi8(__m128i __A
, __m128i __B
)
286 return (__m128i
) __builtin_ia32_vpshlb ((__v16qi
)__A
, (__v16qi
)__B
);
289 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
290 _mm_shl_epi16(__m128i __A
, __m128i __B
)
292 return (__m128i
) __builtin_ia32_vpshlw ((__v8hi
)__A
, (__v8hi
)__B
);
295 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
296 _mm_shl_epi32(__m128i __A
, __m128i __B
)
298 return (__m128i
) __builtin_ia32_vpshld ((__v4si
)__A
, (__v4si
)__B
);
301 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
302 _mm_shl_epi64(__m128i __A
, __m128i __B
)
304 return (__m128i
) __builtin_ia32_vpshlq ((__v2di
)__A
, (__v2di
)__B
);
308 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
309 _mm_sha_epi8(__m128i __A
, __m128i __B
)
311 return (__m128i
) __builtin_ia32_vpshab ((__v16qi
)__A
, (__v16qi
)__B
);
314 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
315 _mm_sha_epi16(__m128i __A
, __m128i __B
)
317 return (__m128i
) __builtin_ia32_vpshaw ((__v8hi
)__A
, (__v8hi
)__B
);
320 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
321 _mm_sha_epi32(__m128i __A
, __m128i __B
)
323 return (__m128i
) __builtin_ia32_vpshad ((__v4si
)__A
, (__v4si
)__B
);
326 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
327 _mm_sha_epi64(__m128i __A
, __m128i __B
)
329 return (__m128i
) __builtin_ia32_vpshaq ((__v2di
)__A
, (__v2di
)__B
);
332 /* Compare and Predicate Generation
333 pcom (integer, unsinged bytes) */
335 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
336 _mm_comlt_epu8(__m128i __A
, __m128i __B
)
338 return (__m128i
) __builtin_ia32_vpcomltub ((__v16qi
)__A
, (__v16qi
)__B
);
341 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
342 _mm_comle_epu8(__m128i __A
, __m128i __B
)
344 return (__m128i
) __builtin_ia32_vpcomleub ((__v16qi
)__A
, (__v16qi
)__B
);
347 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
348 _mm_comgt_epu8(__m128i __A
, __m128i __B
)
350 return (__m128i
) __builtin_ia32_vpcomgtub ((__v16qi
)__A
, (__v16qi
)__B
);
353 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
354 _mm_comge_epu8(__m128i __A
, __m128i __B
)
356 return (__m128i
) __builtin_ia32_vpcomgeub ((__v16qi
)__A
, (__v16qi
)__B
);
359 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
360 _mm_comeq_epu8(__m128i __A
, __m128i __B
)
362 return (__m128i
) __builtin_ia32_vpcomequb ((__v16qi
)__A
, (__v16qi
)__B
);
365 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
366 _mm_comneq_epu8(__m128i __A
, __m128i __B
)
368 return (__m128i
) __builtin_ia32_vpcomnequb ((__v16qi
)__A
, (__v16qi
)__B
);
371 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
372 _mm_comfalse_epu8(__m128i __A
, __m128i __B
)
374 return (__m128i
) __builtin_ia32_vpcomfalseub ((__v16qi
)__A
, (__v16qi
)__B
);
377 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
378 _mm_comtrue_epu8(__m128i __A
, __m128i __B
)
380 return (__m128i
) __builtin_ia32_vpcomtrueub ((__v16qi
)__A
, (__v16qi
)__B
);
383 /*pcom (integer, unsinged words) */
385 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
386 _mm_comlt_epu16(__m128i __A
, __m128i __B
)
388 return (__m128i
) __builtin_ia32_vpcomltuw ((__v8hi
)__A
, (__v8hi
)__B
);
391 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
392 _mm_comle_epu16(__m128i __A
, __m128i __B
)
394 return (__m128i
) __builtin_ia32_vpcomleuw ((__v8hi
)__A
, (__v8hi
)__B
);
397 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
398 _mm_comgt_epu16(__m128i __A
, __m128i __B
)
400 return (__m128i
) __builtin_ia32_vpcomgtuw ((__v8hi
)__A
, (__v8hi
)__B
);
403 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
404 _mm_comge_epu16(__m128i __A
, __m128i __B
)
406 return (__m128i
) __builtin_ia32_vpcomgeuw ((__v8hi
)__A
, (__v8hi
)__B
);
409 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
410 _mm_comeq_epu16(__m128i __A
, __m128i __B
)
412 return (__m128i
) __builtin_ia32_vpcomequw ((__v8hi
)__A
, (__v8hi
)__B
);
415 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
416 _mm_comneq_epu16(__m128i __A
, __m128i __B
)
418 return (__m128i
) __builtin_ia32_vpcomnequw ((__v8hi
)__A
, (__v8hi
)__B
);
421 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
422 _mm_comfalse_epu16(__m128i __A
, __m128i __B
)
424 return (__m128i
) __builtin_ia32_vpcomfalseuw ((__v8hi
)__A
, (__v8hi
)__B
);
427 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
428 _mm_comtrue_epu16(__m128i __A
, __m128i __B
)
430 return (__m128i
) __builtin_ia32_vpcomtrueuw ((__v8hi
)__A
, (__v8hi
)__B
);
433 /*pcom (integer, unsinged double words) */
435 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
436 _mm_comlt_epu32(__m128i __A
, __m128i __B
)
438 return (__m128i
) __builtin_ia32_vpcomltud ((__v4si
)__A
, (__v4si
)__B
);
441 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
442 _mm_comle_epu32(__m128i __A
, __m128i __B
)
444 return (__m128i
) __builtin_ia32_vpcomleud ((__v4si
)__A
, (__v4si
)__B
);
447 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
448 _mm_comgt_epu32(__m128i __A
, __m128i __B
)
450 return (__m128i
) __builtin_ia32_vpcomgtud ((__v4si
)__A
, (__v4si
)__B
);
453 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
454 _mm_comge_epu32(__m128i __A
, __m128i __B
)
456 return (__m128i
) __builtin_ia32_vpcomgeud ((__v4si
)__A
, (__v4si
)__B
);
459 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
460 _mm_comeq_epu32(__m128i __A
, __m128i __B
)
462 return (__m128i
) __builtin_ia32_vpcomequd ((__v4si
)__A
, (__v4si
)__B
);
465 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
466 _mm_comneq_epu32(__m128i __A
, __m128i __B
)
468 return (__m128i
) __builtin_ia32_vpcomnequd ((__v4si
)__A
, (__v4si
)__B
);
471 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
472 _mm_comfalse_epu32(__m128i __A
, __m128i __B
)
474 return (__m128i
) __builtin_ia32_vpcomfalseud ((__v4si
)__A
, (__v4si
)__B
);
477 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
478 _mm_comtrue_epu32(__m128i __A
, __m128i __B
)
480 return (__m128i
) __builtin_ia32_vpcomtrueud ((__v4si
)__A
, (__v4si
)__B
);
483 /*pcom (integer, unsinged quad words) */
485 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
486 _mm_comlt_epu64(__m128i __A
, __m128i __B
)
488 return (__m128i
) __builtin_ia32_vpcomltuq ((__v2di
)__A
, (__v2di
)__B
);
491 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
492 _mm_comle_epu64(__m128i __A
, __m128i __B
)
494 return (__m128i
) __builtin_ia32_vpcomleuq ((__v2di
)__A
, (__v2di
)__B
);
497 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
498 _mm_comgt_epu64(__m128i __A
, __m128i __B
)
500 return (__m128i
) __builtin_ia32_vpcomgtuq ((__v2di
)__A
, (__v2di
)__B
);
503 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
504 _mm_comge_epu64(__m128i __A
, __m128i __B
)
506 return (__m128i
) __builtin_ia32_vpcomgeuq ((__v2di
)__A
, (__v2di
)__B
);
509 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
510 _mm_comeq_epu64(__m128i __A
, __m128i __B
)
512 return (__m128i
) __builtin_ia32_vpcomequq ((__v2di
)__A
, (__v2di
)__B
);
515 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
516 _mm_comneq_epu64(__m128i __A
, __m128i __B
)
518 return (__m128i
) __builtin_ia32_vpcomnequq ((__v2di
)__A
, (__v2di
)__B
);
521 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
522 _mm_comfalse_epu64(__m128i __A
, __m128i __B
)
524 return (__m128i
) __builtin_ia32_vpcomfalseuq ((__v2di
)__A
, (__v2di
)__B
);
527 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
528 _mm_comtrue_epu64(__m128i __A
, __m128i __B
)
530 return (__m128i
) __builtin_ia32_vpcomtrueuq ((__v2di
)__A
, (__v2di
)__B
);
533 /*pcom (integer, signed bytes) */
535 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
536 _mm_comlt_epi8(__m128i __A
, __m128i __B
)
538 return (__m128i
) __builtin_ia32_vpcomltb ((__v16qi
)__A
, (__v16qi
)__B
);
541 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
542 _mm_comle_epi8(__m128i __A
, __m128i __B
)
544 return (__m128i
) __builtin_ia32_vpcomleb ((__v16qi
)__A
, (__v16qi
)__B
);
547 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
548 _mm_comgt_epi8(__m128i __A
, __m128i __B
)
550 return (__m128i
) __builtin_ia32_vpcomgtb ((__v16qi
)__A
, (__v16qi
)__B
);
553 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
554 _mm_comge_epi8(__m128i __A
, __m128i __B
)
556 return (__m128i
) __builtin_ia32_vpcomgeb ((__v16qi
)__A
, (__v16qi
)__B
);
559 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
560 _mm_comeq_epi8(__m128i __A
, __m128i __B
)
562 return (__m128i
) __builtin_ia32_vpcomeqb ((__v16qi
)__A
, (__v16qi
)__B
);
565 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
566 _mm_comneq_epi8(__m128i __A
, __m128i __B
)
568 return (__m128i
) __builtin_ia32_vpcomneqb ((__v16qi
)__A
, (__v16qi
)__B
);
571 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
572 _mm_comfalse_epi8(__m128i __A
, __m128i __B
)
574 return (__m128i
) __builtin_ia32_vpcomfalseb ((__v16qi
)__A
, (__v16qi
)__B
);
577 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
578 _mm_comtrue_epi8(__m128i __A
, __m128i __B
)
580 return (__m128i
) __builtin_ia32_vpcomtrueb ((__v16qi
)__A
, (__v16qi
)__B
);
583 /*pcom (integer, signed words) */
585 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
586 _mm_comlt_epi16(__m128i __A
, __m128i __B
)
588 return (__m128i
) __builtin_ia32_vpcomltw ((__v8hi
)__A
, (__v8hi
)__B
);
591 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
592 _mm_comle_epi16(__m128i __A
, __m128i __B
)
594 return (__m128i
) __builtin_ia32_vpcomlew ((__v8hi
)__A
, (__v8hi
)__B
);
597 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
598 _mm_comgt_epi16(__m128i __A
, __m128i __B
)
600 return (__m128i
) __builtin_ia32_vpcomgtw ((__v8hi
)__A
, (__v8hi
)__B
);
603 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
604 _mm_comge_epi16(__m128i __A
, __m128i __B
)
606 return (__m128i
) __builtin_ia32_vpcomgew ((__v8hi
)__A
, (__v8hi
)__B
);
609 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
610 _mm_comeq_epi16(__m128i __A
, __m128i __B
)
612 return (__m128i
) __builtin_ia32_vpcomeqw ((__v8hi
)__A
, (__v8hi
)__B
);
615 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
616 _mm_comneq_epi16(__m128i __A
, __m128i __B
)
618 return (__m128i
) __builtin_ia32_vpcomneqw ((__v8hi
)__A
, (__v8hi
)__B
);
621 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
622 _mm_comfalse_epi16(__m128i __A
, __m128i __B
)
624 return (__m128i
) __builtin_ia32_vpcomfalsew ((__v8hi
)__A
, (__v8hi
)__B
);
627 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
628 _mm_comtrue_epi16(__m128i __A
, __m128i __B
)
630 return (__m128i
) __builtin_ia32_vpcomtruew ((__v8hi
)__A
, (__v8hi
)__B
);
633 /*pcom (integer, signed double words) */
635 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
636 _mm_comlt_epi32(__m128i __A
, __m128i __B
)
638 return (__m128i
) __builtin_ia32_vpcomltd ((__v4si
)__A
, (__v4si
)__B
);
641 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
642 _mm_comle_epi32(__m128i __A
, __m128i __B
)
644 return (__m128i
) __builtin_ia32_vpcomled ((__v4si
)__A
, (__v4si
)__B
);
647 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
648 _mm_comgt_epi32(__m128i __A
, __m128i __B
)
650 return (__m128i
) __builtin_ia32_vpcomgtd ((__v4si
)__A
, (__v4si
)__B
);
653 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
654 _mm_comge_epi32(__m128i __A
, __m128i __B
)
656 return (__m128i
) __builtin_ia32_vpcomged ((__v4si
)__A
, (__v4si
)__B
);
659 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
660 _mm_comeq_epi32(__m128i __A
, __m128i __B
)
662 return (__m128i
) __builtin_ia32_vpcomeqd ((__v4si
)__A
, (__v4si
)__B
);
665 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
666 _mm_comneq_epi32(__m128i __A
, __m128i __B
)
668 return (__m128i
) __builtin_ia32_vpcomneqd ((__v4si
)__A
, (__v4si
)__B
);
671 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
672 _mm_comfalse_epi32(__m128i __A
, __m128i __B
)
674 return (__m128i
) __builtin_ia32_vpcomfalsed ((__v4si
)__A
, (__v4si
)__B
);
677 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
678 _mm_comtrue_epi32(__m128i __A
, __m128i __B
)
680 return (__m128i
) __builtin_ia32_vpcomtrued ((__v4si
)__A
, (__v4si
)__B
);
683 /*pcom (integer, signed quad words) */
685 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
686 _mm_comlt_epi64(__m128i __A
, __m128i __B
)
688 return (__m128i
) __builtin_ia32_vpcomltq ((__v2di
)__A
, (__v2di
)__B
);
691 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
692 _mm_comle_epi64(__m128i __A
, __m128i __B
)
694 return (__m128i
) __builtin_ia32_vpcomleq ((__v2di
)__A
, (__v2di
)__B
);
697 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
698 _mm_comgt_epi64(__m128i __A
, __m128i __B
)
700 return (__m128i
) __builtin_ia32_vpcomgtq ((__v2di
)__A
, (__v2di
)__B
);
703 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
704 _mm_comge_epi64(__m128i __A
, __m128i __B
)
706 return (__m128i
) __builtin_ia32_vpcomgeq ((__v2di
)__A
, (__v2di
)__B
);
709 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
710 _mm_comeq_epi64(__m128i __A
, __m128i __B
)
712 return (__m128i
) __builtin_ia32_vpcomeqq ((__v2di
)__A
, (__v2di
)__B
);
715 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
716 _mm_comneq_epi64(__m128i __A
, __m128i __B
)
718 return (__m128i
) __builtin_ia32_vpcomneqq ((__v2di
)__A
, (__v2di
)__B
);
721 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
722 _mm_comfalse_epi64(__m128i __A
, __m128i __B
)
724 return (__m128i
) __builtin_ia32_vpcomfalseq ((__v2di
)__A
, (__v2di
)__B
);
727 extern __inline __m128i
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
728 _mm_comtrue_epi64(__m128i __A
, __m128i __B
)
730 return (__m128i
) __builtin_ia32_vpcomtrueq ((__v2di
)__A
, (__v2di
)__B
);
735 extern __inline __m128
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
736 _mm_frcz_ps (__m128 __A
)
738 return (__m128
) __builtin_ia32_vfrczps ((__v4sf
)__A
);
741 extern __inline __m128d
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
742 _mm_frcz_pd (__m128d __A
)
744 return (__m128d
) __builtin_ia32_vfrczpd ((__v2df
)__A
);
747 extern __inline __m128
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
748 _mm_frcz_ss (__m128 __A
, __m128 __B
)
750 return (__m128
) __builtin_ia32_movss ((__v4sf
)__A
,
752 __builtin_ia32_vfrczss ((__v4sf
)__B
));
755 extern __inline __m128d
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
756 _mm_frcz_sd (__m128d __A
, __m128d __B
)
758 return (__m128d
) __builtin_ia32_movsd ((__v2df
)__A
,
760 __builtin_ia32_vfrczsd ((__v2df
)__B
));
763 extern __inline __m256
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
764 _mm256_frcz_ps (__m256 __A
)
766 return (__m256
) __builtin_ia32_vfrczps256 ((__v8sf
)__A
);
769 extern __inline __m256d
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
770 _mm256_frcz_pd (__m256d __A
)
772 return (__m256d
) __builtin_ia32_vfrczpd256 ((__v4df
)__A
);
778 extern __inline __m128d
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
779 _mm_permute2_pd (__m128d __X
, __m128d __Y
, __m128i __C
, const int __I
)
781 return (__m128d
) __builtin_ia32_vpermil2pd ((__v2df
)__X
,
787 extern __inline __m256d
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
788 _mm256_permute2_pd (__m256d __X
, __m256d __Y
, __m256i __C
, const int __I
)
790 return (__m256d
) __builtin_ia32_vpermil2pd256 ((__v4df
)__X
,
796 extern __inline __m128
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
797 _mm_permute2_ps (__m128 __X
, __m128 __Y
, __m128i __C
, const int __I
)
799 return (__m128
) __builtin_ia32_vpermil2ps ((__v4sf
)__X
,
805 extern __inline __m256
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
806 _mm256_permute2_ps (__m256 __X
, __m256 __Y
, __m256i __C
, const int __I
)
808 return (__m256
) __builtin_ia32_vpermil2ps256 ((__v8sf
)__X
,
814 #define _mm_permute2_pd(X, Y, C, I) \
815 ((__m128d) __builtin_ia32_vpermil2pd ((__v2df)(__m128d)(X), \
816 (__v2df)(__m128d)(Y), \
817 (__v2di)(__m128d)(C), \
820 #define _mm256_permute2_pd(X, Y, C, I) \
821 ((__m256d) __builtin_ia32_vpermil2pd256 ((__v4df)(__m256d)(X), \
822 (__v4df)(__m256d)(Y), \
823 (__v4di)(__m256d)(C), \
826 #define _mm_permute2_ps(X, Y, C, I) \
827 ((__m128) __builtin_ia32_vpermil2ps ((__v4sf)(__m128)(X), \
828 (__v4sf)(__m128)(Y), \
829 (__v4si)(__m128)(C), \
832 #define _mm256_permute2_ps(X, Y, C, I) \
833 ((__m256) __builtin_ia32_vpermil2ps256 ((__v8sf)(__m256)(X), \
834 (__v8sf)(__m256)(Y), \
835 (__v8si)(__m256)(C), \
837 #endif /* __OPTIMIZE__ */
839 #ifdef __DISABLE_XOP__
840 #undef __DISABLE_XOP__
841 #pragma GCC pop_options
842 #endif /* __DISABLE_XOP__ */
844 #endif /* _XOPMMINTRIN_H_INCLUDED */