[docs] Fix build-docs.sh
[llvm-project.git] / clang / lib / Headers / xopintrin.h
blob976cdf4902a4052a7e02d210fc72a79ac16d23fc
1 /*===---- xopintrin.h - XOP intrinsics -------------------------------------===
3 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 * See https://llvm.org/LICENSE.txt for license information.
5 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 *===-----------------------------------------------------------------------===
8 */
10 #ifndef __X86INTRIN_H
11 #error "Never use <xopintrin.h> directly; include <x86intrin.h> instead."
12 #endif
14 #ifndef __XOPINTRIN_H
15 #define __XOPINTRIN_H
17 #include <fma4intrin.h>
19 /* Define the default attributes for the functions in this file. */
20 #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("xop"), __min_vector_width__(128)))
21 #define __DEFAULT_FN_ATTRS256 __attribute__((__always_inline__, __nodebug__, __target__("xop"), __min_vector_width__(256)))
23 static __inline__ __m128i __DEFAULT_FN_ATTRS
24 _mm_maccs_epi16(__m128i __A, __m128i __B, __m128i __C)
26 return (__m128i)__builtin_ia32_vpmacssww((__v8hi)__A, (__v8hi)__B, (__v8hi)__C);
29 static __inline__ __m128i __DEFAULT_FN_ATTRS
30 _mm_macc_epi16(__m128i __A, __m128i __B, __m128i __C)
32 return (__m128i)__builtin_ia32_vpmacsww((__v8hi)__A, (__v8hi)__B, (__v8hi)__C);
35 static __inline__ __m128i __DEFAULT_FN_ATTRS
36 _mm_maccsd_epi16(__m128i __A, __m128i __B, __m128i __C)
38 return (__m128i)__builtin_ia32_vpmacsswd((__v8hi)__A, (__v8hi)__B, (__v4si)__C);
41 static __inline__ __m128i __DEFAULT_FN_ATTRS
42 _mm_maccd_epi16(__m128i __A, __m128i __B, __m128i __C)
44 return (__m128i)__builtin_ia32_vpmacswd((__v8hi)__A, (__v8hi)__B, (__v4si)__C);
47 static __inline__ __m128i __DEFAULT_FN_ATTRS
48 _mm_maccs_epi32(__m128i __A, __m128i __B, __m128i __C)
50 return (__m128i)__builtin_ia32_vpmacssdd((__v4si)__A, (__v4si)__B, (__v4si)__C);
53 static __inline__ __m128i __DEFAULT_FN_ATTRS
54 _mm_macc_epi32(__m128i __A, __m128i __B, __m128i __C)
56 return (__m128i)__builtin_ia32_vpmacsdd((__v4si)__A, (__v4si)__B, (__v4si)__C);
59 static __inline__ __m128i __DEFAULT_FN_ATTRS
60 _mm_maccslo_epi32(__m128i __A, __m128i __B, __m128i __C)
62 return (__m128i)__builtin_ia32_vpmacssdql((__v4si)__A, (__v4si)__B, (__v2di)__C);
65 static __inline__ __m128i __DEFAULT_FN_ATTRS
66 _mm_macclo_epi32(__m128i __A, __m128i __B, __m128i __C)
68 return (__m128i)__builtin_ia32_vpmacsdql((__v4si)__A, (__v4si)__B, (__v2di)__C);
71 static __inline__ __m128i __DEFAULT_FN_ATTRS
72 _mm_maccshi_epi32(__m128i __A, __m128i __B, __m128i __C)
74 return (__m128i)__builtin_ia32_vpmacssdqh((__v4si)__A, (__v4si)__B, (__v2di)__C);
77 static __inline__ __m128i __DEFAULT_FN_ATTRS
78 _mm_macchi_epi32(__m128i __A, __m128i __B, __m128i __C)
80 return (__m128i)__builtin_ia32_vpmacsdqh((__v4si)__A, (__v4si)__B, (__v2di)__C);
83 static __inline__ __m128i __DEFAULT_FN_ATTRS
84 _mm_maddsd_epi16(__m128i __A, __m128i __B, __m128i __C)
86 return (__m128i)__builtin_ia32_vpmadcsswd((__v8hi)__A, (__v8hi)__B, (__v4si)__C);
89 static __inline__ __m128i __DEFAULT_FN_ATTRS
90 _mm_maddd_epi16(__m128i __A, __m128i __B, __m128i __C)
92 return (__m128i)__builtin_ia32_vpmadcswd((__v8hi)__A, (__v8hi)__B, (__v4si)__C);
95 static __inline__ __m128i __DEFAULT_FN_ATTRS
96 _mm_haddw_epi8(__m128i __A)
98 return (__m128i)__builtin_ia32_vphaddbw((__v16qi)__A);
101 static __inline__ __m128i __DEFAULT_FN_ATTRS
102 _mm_haddd_epi8(__m128i __A)
104 return (__m128i)__builtin_ia32_vphaddbd((__v16qi)__A);
107 static __inline__ __m128i __DEFAULT_FN_ATTRS
108 _mm_haddq_epi8(__m128i __A)
110 return (__m128i)__builtin_ia32_vphaddbq((__v16qi)__A);
113 static __inline__ __m128i __DEFAULT_FN_ATTRS
114 _mm_haddd_epi16(__m128i __A)
116 return (__m128i)__builtin_ia32_vphaddwd((__v8hi)__A);
119 static __inline__ __m128i __DEFAULT_FN_ATTRS
120 _mm_haddq_epi16(__m128i __A)
122 return (__m128i)__builtin_ia32_vphaddwq((__v8hi)__A);
125 static __inline__ __m128i __DEFAULT_FN_ATTRS
126 _mm_haddq_epi32(__m128i __A)
128 return (__m128i)__builtin_ia32_vphadddq((__v4si)__A);
131 static __inline__ __m128i __DEFAULT_FN_ATTRS
132 _mm_haddw_epu8(__m128i __A)
134 return (__m128i)__builtin_ia32_vphaddubw((__v16qi)__A);
137 static __inline__ __m128i __DEFAULT_FN_ATTRS
138 _mm_haddd_epu8(__m128i __A)
140 return (__m128i)__builtin_ia32_vphaddubd((__v16qi)__A);
143 static __inline__ __m128i __DEFAULT_FN_ATTRS
144 _mm_haddq_epu8(__m128i __A)
146 return (__m128i)__builtin_ia32_vphaddubq((__v16qi)__A);
149 static __inline__ __m128i __DEFAULT_FN_ATTRS
150 _mm_haddd_epu16(__m128i __A)
152 return (__m128i)__builtin_ia32_vphadduwd((__v8hi)__A);
155 static __inline__ __m128i __DEFAULT_FN_ATTRS
156 _mm_haddq_epu16(__m128i __A)
158 return (__m128i)__builtin_ia32_vphadduwq((__v8hi)__A);
161 static __inline__ __m128i __DEFAULT_FN_ATTRS
162 _mm_haddq_epu32(__m128i __A)
164 return (__m128i)__builtin_ia32_vphaddudq((__v4si)__A);
167 static __inline__ __m128i __DEFAULT_FN_ATTRS
168 _mm_hsubw_epi8(__m128i __A)
170 return (__m128i)__builtin_ia32_vphsubbw((__v16qi)__A);
173 static __inline__ __m128i __DEFAULT_FN_ATTRS
174 _mm_hsubd_epi16(__m128i __A)
176 return (__m128i)__builtin_ia32_vphsubwd((__v8hi)__A);
179 static __inline__ __m128i __DEFAULT_FN_ATTRS
180 _mm_hsubq_epi32(__m128i __A)
182 return (__m128i)__builtin_ia32_vphsubdq((__v4si)__A);
185 static __inline__ __m128i __DEFAULT_FN_ATTRS
186 _mm_cmov_si128(__m128i __A, __m128i __B, __m128i __C)
188 return (__m128i)(((__v2du)__A & (__v2du)__C) | ((__v2du)__B & ~(__v2du)__C));
191 static __inline__ __m256i __DEFAULT_FN_ATTRS256
192 _mm256_cmov_si256(__m256i __A, __m256i __B, __m256i __C)
194 return (__m256i)(((__v4du)__A & (__v4du)__C) | ((__v4du)__B & ~(__v4du)__C));
197 static __inline__ __m128i __DEFAULT_FN_ATTRS
198 _mm_perm_epi8(__m128i __A, __m128i __B, __m128i __C)
200 return (__m128i)__builtin_ia32_vpperm((__v16qi)__A, (__v16qi)__B, (__v16qi)__C);
203 static __inline__ __m128i __DEFAULT_FN_ATTRS
204 _mm_rot_epi8(__m128i __A, __m128i __B)
206 return (__m128i)__builtin_ia32_vprotb((__v16qi)__A, (__v16qi)__B);
209 static __inline__ __m128i __DEFAULT_FN_ATTRS
210 _mm_rot_epi16(__m128i __A, __m128i __B)
212 return (__m128i)__builtin_ia32_vprotw((__v8hi)__A, (__v8hi)__B);
215 static __inline__ __m128i __DEFAULT_FN_ATTRS
216 _mm_rot_epi32(__m128i __A, __m128i __B)
218 return (__m128i)__builtin_ia32_vprotd((__v4si)__A, (__v4si)__B);
221 static __inline__ __m128i __DEFAULT_FN_ATTRS
222 _mm_rot_epi64(__m128i __A, __m128i __B)
224 return (__m128i)__builtin_ia32_vprotq((__v2di)__A, (__v2di)__B);
227 #define _mm_roti_epi8(A, N) \
228 ((__m128i)__builtin_ia32_vprotbi((__v16qi)(__m128i)(A), (N)))
230 #define _mm_roti_epi16(A, N) \
231 ((__m128i)__builtin_ia32_vprotwi((__v8hi)(__m128i)(A), (N)))
233 #define _mm_roti_epi32(A, N) \
234 ((__m128i)__builtin_ia32_vprotdi((__v4si)(__m128i)(A), (N)))
236 #define _mm_roti_epi64(A, N) \
237 ((__m128i)__builtin_ia32_vprotqi((__v2di)(__m128i)(A), (N)))
239 static __inline__ __m128i __DEFAULT_FN_ATTRS
240 _mm_shl_epi8(__m128i __A, __m128i __B)
242 return (__m128i)__builtin_ia32_vpshlb((__v16qi)__A, (__v16qi)__B);
245 static __inline__ __m128i __DEFAULT_FN_ATTRS
246 _mm_shl_epi16(__m128i __A, __m128i __B)
248 return (__m128i)__builtin_ia32_vpshlw((__v8hi)__A, (__v8hi)__B);
251 static __inline__ __m128i __DEFAULT_FN_ATTRS
252 _mm_shl_epi32(__m128i __A, __m128i __B)
254 return (__m128i)__builtin_ia32_vpshld((__v4si)__A, (__v4si)__B);
257 static __inline__ __m128i __DEFAULT_FN_ATTRS
258 _mm_shl_epi64(__m128i __A, __m128i __B)
260 return (__m128i)__builtin_ia32_vpshlq((__v2di)__A, (__v2di)__B);
263 static __inline__ __m128i __DEFAULT_FN_ATTRS
264 _mm_sha_epi8(__m128i __A, __m128i __B)
266 return (__m128i)__builtin_ia32_vpshab((__v16qi)__A, (__v16qi)__B);
269 static __inline__ __m128i __DEFAULT_FN_ATTRS
270 _mm_sha_epi16(__m128i __A, __m128i __B)
272 return (__m128i)__builtin_ia32_vpshaw((__v8hi)__A, (__v8hi)__B);
275 static __inline__ __m128i __DEFAULT_FN_ATTRS
276 _mm_sha_epi32(__m128i __A, __m128i __B)
278 return (__m128i)__builtin_ia32_vpshad((__v4si)__A, (__v4si)__B);
281 static __inline__ __m128i __DEFAULT_FN_ATTRS
282 _mm_sha_epi64(__m128i __A, __m128i __B)
284 return (__m128i)__builtin_ia32_vpshaq((__v2di)__A, (__v2di)__B);
287 #define _mm_com_epu8(A, B, N) \
288 ((__m128i)__builtin_ia32_vpcomub((__v16qi)(__m128i)(A), \
289 (__v16qi)(__m128i)(B), (N)))
291 #define _mm_com_epu16(A, B, N) \
292 ((__m128i)__builtin_ia32_vpcomuw((__v8hi)(__m128i)(A), \
293 (__v8hi)(__m128i)(B), (N)))
295 #define _mm_com_epu32(A, B, N) \
296 ((__m128i)__builtin_ia32_vpcomud((__v4si)(__m128i)(A), \
297 (__v4si)(__m128i)(B), (N)))
299 #define _mm_com_epu64(A, B, N) \
300 ((__m128i)__builtin_ia32_vpcomuq((__v2di)(__m128i)(A), \
301 (__v2di)(__m128i)(B), (N)))
303 #define _mm_com_epi8(A, B, N) \
304 ((__m128i)__builtin_ia32_vpcomb((__v16qi)(__m128i)(A), \
305 (__v16qi)(__m128i)(B), (N)))
307 #define _mm_com_epi16(A, B, N) \
308 ((__m128i)__builtin_ia32_vpcomw((__v8hi)(__m128i)(A), \
309 (__v8hi)(__m128i)(B), (N)))
311 #define _mm_com_epi32(A, B, N) \
312 ((__m128i)__builtin_ia32_vpcomd((__v4si)(__m128i)(A), \
313 (__v4si)(__m128i)(B), (N)))
315 #define _mm_com_epi64(A, B, N) \
316 ((__m128i)__builtin_ia32_vpcomq((__v2di)(__m128i)(A), \
317 (__v2di)(__m128i)(B), (N)))
319 #define _MM_PCOMCTRL_LT 0
320 #define _MM_PCOMCTRL_LE 1
321 #define _MM_PCOMCTRL_GT 2
322 #define _MM_PCOMCTRL_GE 3
323 #define _MM_PCOMCTRL_EQ 4
324 #define _MM_PCOMCTRL_NEQ 5
325 #define _MM_PCOMCTRL_FALSE 6
326 #define _MM_PCOMCTRL_TRUE 7
328 static __inline__ __m128i __DEFAULT_FN_ATTRS
329 _mm_comlt_epu8(__m128i __A, __m128i __B)
331 return _mm_com_epu8(__A, __B, _MM_PCOMCTRL_LT);
334 static __inline__ __m128i __DEFAULT_FN_ATTRS
335 _mm_comle_epu8(__m128i __A, __m128i __B)
337 return _mm_com_epu8(__A, __B, _MM_PCOMCTRL_LE);
340 static __inline__ __m128i __DEFAULT_FN_ATTRS
341 _mm_comgt_epu8(__m128i __A, __m128i __B)
343 return _mm_com_epu8(__A, __B, _MM_PCOMCTRL_GT);
346 static __inline__ __m128i __DEFAULT_FN_ATTRS
347 _mm_comge_epu8(__m128i __A, __m128i __B)
349 return _mm_com_epu8(__A, __B, _MM_PCOMCTRL_GE);
352 static __inline__ __m128i __DEFAULT_FN_ATTRS
353 _mm_comeq_epu8(__m128i __A, __m128i __B)
355 return _mm_com_epu8(__A, __B, _MM_PCOMCTRL_EQ);
358 static __inline__ __m128i __DEFAULT_FN_ATTRS
359 _mm_comneq_epu8(__m128i __A, __m128i __B)
361 return _mm_com_epu8(__A, __B, _MM_PCOMCTRL_NEQ);
364 static __inline__ __m128i __DEFAULT_FN_ATTRS
365 _mm_comfalse_epu8(__m128i __A, __m128i __B)
367 return _mm_com_epu8(__A, __B, _MM_PCOMCTRL_FALSE);
370 static __inline__ __m128i __DEFAULT_FN_ATTRS
371 _mm_comtrue_epu8(__m128i __A, __m128i __B)
373 return _mm_com_epu8(__A, __B, _MM_PCOMCTRL_TRUE);
376 static __inline__ __m128i __DEFAULT_FN_ATTRS
377 _mm_comlt_epu16(__m128i __A, __m128i __B)
379 return _mm_com_epu16(__A, __B, _MM_PCOMCTRL_LT);
382 static __inline__ __m128i __DEFAULT_FN_ATTRS
383 _mm_comle_epu16(__m128i __A, __m128i __B)
385 return _mm_com_epu16(__A, __B, _MM_PCOMCTRL_LE);
388 static __inline__ __m128i __DEFAULT_FN_ATTRS
389 _mm_comgt_epu16(__m128i __A, __m128i __B)
391 return _mm_com_epu16(__A, __B, _MM_PCOMCTRL_GT);
394 static __inline__ __m128i __DEFAULT_FN_ATTRS
395 _mm_comge_epu16(__m128i __A, __m128i __B)
397 return _mm_com_epu16(__A, __B, _MM_PCOMCTRL_GE);
400 static __inline__ __m128i __DEFAULT_FN_ATTRS
401 _mm_comeq_epu16(__m128i __A, __m128i __B)
403 return _mm_com_epu16(__A, __B, _MM_PCOMCTRL_EQ);
406 static __inline__ __m128i __DEFAULT_FN_ATTRS
407 _mm_comneq_epu16(__m128i __A, __m128i __B)
409 return _mm_com_epu16(__A, __B, _MM_PCOMCTRL_NEQ);
412 static __inline__ __m128i __DEFAULT_FN_ATTRS
413 _mm_comfalse_epu16(__m128i __A, __m128i __B)
415 return _mm_com_epu16(__A, __B, _MM_PCOMCTRL_FALSE);
418 static __inline__ __m128i __DEFAULT_FN_ATTRS
419 _mm_comtrue_epu16(__m128i __A, __m128i __B)
421 return _mm_com_epu16(__A, __B, _MM_PCOMCTRL_TRUE);
424 static __inline__ __m128i __DEFAULT_FN_ATTRS
425 _mm_comlt_epu32(__m128i __A, __m128i __B)
427 return _mm_com_epu32(__A, __B, _MM_PCOMCTRL_LT);
430 static __inline__ __m128i __DEFAULT_FN_ATTRS
431 _mm_comle_epu32(__m128i __A, __m128i __B)
433 return _mm_com_epu32(__A, __B, _MM_PCOMCTRL_LE);
436 static __inline__ __m128i __DEFAULT_FN_ATTRS
437 _mm_comgt_epu32(__m128i __A, __m128i __B)
439 return _mm_com_epu32(__A, __B, _MM_PCOMCTRL_GT);
442 static __inline__ __m128i __DEFAULT_FN_ATTRS
443 _mm_comge_epu32(__m128i __A, __m128i __B)
445 return _mm_com_epu32(__A, __B, _MM_PCOMCTRL_GE);
448 static __inline__ __m128i __DEFAULT_FN_ATTRS
449 _mm_comeq_epu32(__m128i __A, __m128i __B)
451 return _mm_com_epu32(__A, __B, _MM_PCOMCTRL_EQ);
454 static __inline__ __m128i __DEFAULT_FN_ATTRS
455 _mm_comneq_epu32(__m128i __A, __m128i __B)
457 return _mm_com_epu32(__A, __B, _MM_PCOMCTRL_NEQ);
460 static __inline__ __m128i __DEFAULT_FN_ATTRS
461 _mm_comfalse_epu32(__m128i __A, __m128i __B)
463 return _mm_com_epu32(__A, __B, _MM_PCOMCTRL_FALSE);
466 static __inline__ __m128i __DEFAULT_FN_ATTRS
467 _mm_comtrue_epu32(__m128i __A, __m128i __B)
469 return _mm_com_epu32(__A, __B, _MM_PCOMCTRL_TRUE);
472 static __inline__ __m128i __DEFAULT_FN_ATTRS
473 _mm_comlt_epu64(__m128i __A, __m128i __B)
475 return _mm_com_epu64(__A, __B, _MM_PCOMCTRL_LT);
478 static __inline__ __m128i __DEFAULT_FN_ATTRS
479 _mm_comle_epu64(__m128i __A, __m128i __B)
481 return _mm_com_epu64(__A, __B, _MM_PCOMCTRL_LE);
484 static __inline__ __m128i __DEFAULT_FN_ATTRS
485 _mm_comgt_epu64(__m128i __A, __m128i __B)
487 return _mm_com_epu64(__A, __B, _MM_PCOMCTRL_GT);
490 static __inline__ __m128i __DEFAULT_FN_ATTRS
491 _mm_comge_epu64(__m128i __A, __m128i __B)
493 return _mm_com_epu64(__A, __B, _MM_PCOMCTRL_GE);
496 static __inline__ __m128i __DEFAULT_FN_ATTRS
497 _mm_comeq_epu64(__m128i __A, __m128i __B)
499 return _mm_com_epu64(__A, __B, _MM_PCOMCTRL_EQ);
502 static __inline__ __m128i __DEFAULT_FN_ATTRS
503 _mm_comneq_epu64(__m128i __A, __m128i __B)
505 return _mm_com_epu64(__A, __B, _MM_PCOMCTRL_NEQ);
508 static __inline__ __m128i __DEFAULT_FN_ATTRS
509 _mm_comfalse_epu64(__m128i __A, __m128i __B)
511 return _mm_com_epu64(__A, __B, _MM_PCOMCTRL_FALSE);
514 static __inline__ __m128i __DEFAULT_FN_ATTRS
515 _mm_comtrue_epu64(__m128i __A, __m128i __B)
517 return _mm_com_epu64(__A, __B, _MM_PCOMCTRL_TRUE);
520 static __inline__ __m128i __DEFAULT_FN_ATTRS
521 _mm_comlt_epi8(__m128i __A, __m128i __B)
523 return _mm_com_epi8(__A, __B, _MM_PCOMCTRL_LT);
526 static __inline__ __m128i __DEFAULT_FN_ATTRS
527 _mm_comle_epi8(__m128i __A, __m128i __B)
529 return _mm_com_epi8(__A, __B, _MM_PCOMCTRL_LE);
532 static __inline__ __m128i __DEFAULT_FN_ATTRS
533 _mm_comgt_epi8(__m128i __A, __m128i __B)
535 return _mm_com_epi8(__A, __B, _MM_PCOMCTRL_GT);
538 static __inline__ __m128i __DEFAULT_FN_ATTRS
539 _mm_comge_epi8(__m128i __A, __m128i __B)
541 return _mm_com_epi8(__A, __B, _MM_PCOMCTRL_GE);
544 static __inline__ __m128i __DEFAULT_FN_ATTRS
545 _mm_comeq_epi8(__m128i __A, __m128i __B)
547 return _mm_com_epi8(__A, __B, _MM_PCOMCTRL_EQ);
550 static __inline__ __m128i __DEFAULT_FN_ATTRS
551 _mm_comneq_epi8(__m128i __A, __m128i __B)
553 return _mm_com_epi8(__A, __B, _MM_PCOMCTRL_NEQ);
556 static __inline__ __m128i __DEFAULT_FN_ATTRS
557 _mm_comfalse_epi8(__m128i __A, __m128i __B)
559 return _mm_com_epi8(__A, __B, _MM_PCOMCTRL_FALSE);
562 static __inline__ __m128i __DEFAULT_FN_ATTRS
563 _mm_comtrue_epi8(__m128i __A, __m128i __B)
565 return _mm_com_epi8(__A, __B, _MM_PCOMCTRL_TRUE);
568 static __inline__ __m128i __DEFAULT_FN_ATTRS
569 _mm_comlt_epi16(__m128i __A, __m128i __B)
571 return _mm_com_epi16(__A, __B, _MM_PCOMCTRL_LT);
574 static __inline__ __m128i __DEFAULT_FN_ATTRS
575 _mm_comle_epi16(__m128i __A, __m128i __B)
577 return _mm_com_epi16(__A, __B, _MM_PCOMCTRL_LE);
580 static __inline__ __m128i __DEFAULT_FN_ATTRS
581 _mm_comgt_epi16(__m128i __A, __m128i __B)
583 return _mm_com_epi16(__A, __B, _MM_PCOMCTRL_GT);
586 static __inline__ __m128i __DEFAULT_FN_ATTRS
587 _mm_comge_epi16(__m128i __A, __m128i __B)
589 return _mm_com_epi16(__A, __B, _MM_PCOMCTRL_GE);
592 static __inline__ __m128i __DEFAULT_FN_ATTRS
593 _mm_comeq_epi16(__m128i __A, __m128i __B)
595 return _mm_com_epi16(__A, __B, _MM_PCOMCTRL_EQ);
598 static __inline__ __m128i __DEFAULT_FN_ATTRS
599 _mm_comneq_epi16(__m128i __A, __m128i __B)
601 return _mm_com_epi16(__A, __B, _MM_PCOMCTRL_NEQ);
604 static __inline__ __m128i __DEFAULT_FN_ATTRS
605 _mm_comfalse_epi16(__m128i __A, __m128i __B)
607 return _mm_com_epi16(__A, __B, _MM_PCOMCTRL_FALSE);
610 static __inline__ __m128i __DEFAULT_FN_ATTRS
611 _mm_comtrue_epi16(__m128i __A, __m128i __B)
613 return _mm_com_epi16(__A, __B, _MM_PCOMCTRL_TRUE);
616 static __inline__ __m128i __DEFAULT_FN_ATTRS
617 _mm_comlt_epi32(__m128i __A, __m128i __B)
619 return _mm_com_epi32(__A, __B, _MM_PCOMCTRL_LT);
622 static __inline__ __m128i __DEFAULT_FN_ATTRS
623 _mm_comle_epi32(__m128i __A, __m128i __B)
625 return _mm_com_epi32(__A, __B, _MM_PCOMCTRL_LE);
628 static __inline__ __m128i __DEFAULT_FN_ATTRS
629 _mm_comgt_epi32(__m128i __A, __m128i __B)
631 return _mm_com_epi32(__A, __B, _MM_PCOMCTRL_GT);
634 static __inline__ __m128i __DEFAULT_FN_ATTRS
635 _mm_comge_epi32(__m128i __A, __m128i __B)
637 return _mm_com_epi32(__A, __B, _MM_PCOMCTRL_GE);
640 static __inline__ __m128i __DEFAULT_FN_ATTRS
641 _mm_comeq_epi32(__m128i __A, __m128i __B)
643 return _mm_com_epi32(__A, __B, _MM_PCOMCTRL_EQ);
646 static __inline__ __m128i __DEFAULT_FN_ATTRS
647 _mm_comneq_epi32(__m128i __A, __m128i __B)
649 return _mm_com_epi32(__A, __B, _MM_PCOMCTRL_NEQ);
652 static __inline__ __m128i __DEFAULT_FN_ATTRS
653 _mm_comfalse_epi32(__m128i __A, __m128i __B)
655 return _mm_com_epi32(__A, __B, _MM_PCOMCTRL_FALSE);
658 static __inline__ __m128i __DEFAULT_FN_ATTRS
659 _mm_comtrue_epi32(__m128i __A, __m128i __B)
661 return _mm_com_epi32(__A, __B, _MM_PCOMCTRL_TRUE);
664 static __inline__ __m128i __DEFAULT_FN_ATTRS
665 _mm_comlt_epi64(__m128i __A, __m128i __B)
667 return _mm_com_epi64(__A, __B, _MM_PCOMCTRL_LT);
670 static __inline__ __m128i __DEFAULT_FN_ATTRS
671 _mm_comle_epi64(__m128i __A, __m128i __B)
673 return _mm_com_epi64(__A, __B, _MM_PCOMCTRL_LE);
676 static __inline__ __m128i __DEFAULT_FN_ATTRS
677 _mm_comgt_epi64(__m128i __A, __m128i __B)
679 return _mm_com_epi64(__A, __B, _MM_PCOMCTRL_GT);
682 static __inline__ __m128i __DEFAULT_FN_ATTRS
683 _mm_comge_epi64(__m128i __A, __m128i __B)
685 return _mm_com_epi64(__A, __B, _MM_PCOMCTRL_GE);
688 static __inline__ __m128i __DEFAULT_FN_ATTRS
689 _mm_comeq_epi64(__m128i __A, __m128i __B)
691 return _mm_com_epi64(__A, __B, _MM_PCOMCTRL_EQ);
694 static __inline__ __m128i __DEFAULT_FN_ATTRS
695 _mm_comneq_epi64(__m128i __A, __m128i __B)
697 return _mm_com_epi64(__A, __B, _MM_PCOMCTRL_NEQ);
700 static __inline__ __m128i __DEFAULT_FN_ATTRS
701 _mm_comfalse_epi64(__m128i __A, __m128i __B)
703 return _mm_com_epi64(__A, __B, _MM_PCOMCTRL_FALSE);
706 static __inline__ __m128i __DEFAULT_FN_ATTRS
707 _mm_comtrue_epi64(__m128i __A, __m128i __B)
709 return _mm_com_epi64(__A, __B, _MM_PCOMCTRL_TRUE);
712 #define _mm_permute2_pd(X, Y, C, I) \
713 ((__m128d)__builtin_ia32_vpermil2pd((__v2df)(__m128d)(X), \
714 (__v2df)(__m128d)(Y), \
715 (__v2di)(__m128i)(C), (I)))
717 #define _mm256_permute2_pd(X, Y, C, I) \
718 ((__m256d)__builtin_ia32_vpermil2pd256((__v4df)(__m256d)(X), \
719 (__v4df)(__m256d)(Y), \
720 (__v4di)(__m256i)(C), (I)))
722 #define _mm_permute2_ps(X, Y, C, I) \
723 ((__m128)__builtin_ia32_vpermil2ps((__v4sf)(__m128)(X), (__v4sf)(__m128)(Y), \
724 (__v4si)(__m128i)(C), (I)))
726 #define _mm256_permute2_ps(X, Y, C, I) \
727 ((__m256)__builtin_ia32_vpermil2ps256((__v8sf)(__m256)(X), \
728 (__v8sf)(__m256)(Y), \
729 (__v8si)(__m256i)(C), (I)))
731 static __inline__ __m128 __DEFAULT_FN_ATTRS
732 _mm_frcz_ss(__m128 __A)
734 return (__m128)__builtin_ia32_vfrczss((__v4sf)__A);
737 static __inline__ __m128d __DEFAULT_FN_ATTRS
738 _mm_frcz_sd(__m128d __A)
740 return (__m128d)__builtin_ia32_vfrczsd((__v2df)__A);
743 static __inline__ __m128 __DEFAULT_FN_ATTRS
744 _mm_frcz_ps(__m128 __A)
746 return (__m128)__builtin_ia32_vfrczps((__v4sf)__A);
749 static __inline__ __m128d __DEFAULT_FN_ATTRS
750 _mm_frcz_pd(__m128d __A)
752 return (__m128d)__builtin_ia32_vfrczpd((__v2df)__A);
755 static __inline__ __m256 __DEFAULT_FN_ATTRS256
756 _mm256_frcz_ps(__m256 __A)
758 return (__m256)__builtin_ia32_vfrczps256((__v8sf)__A);
761 static __inline__ __m256d __DEFAULT_FN_ATTRS256
762 _mm256_frcz_pd(__m256d __A)
764 return (__m256d)__builtin_ia32_vfrczpd256((__v4df)__A);
767 #undef __DEFAULT_FN_ATTRS
768 #undef __DEFAULT_FN_ATTRS256
770 #endif /* __XOPINTRIN_H */