1 /*===---- emmintrin.h - SSE2 intrinsics ------------------------------------===
3 * Permission is hereby granted, free of charge, to any person obtaining a copy
4 * of this software and associated documentation files (the "Software"), to deal
5 * in the Software without restriction, including without limitation the rights
6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 * copies of the Software, and to permit persons to whom the Software is
8 * furnished to do so, subject to the following conditions:
10 * The above copyright notice and this permission notice shall be included in
11 * all copies or substantial portions of the Software.
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 *===-----------------------------------------------------------------------===
27 #include <xmmintrin.h>
29 typedef double __m128d __attribute__((__vector_size__(16)));
30 typedef long long __m128i __attribute__((__vector_size__(16)));
33 typedef double __v2df __attribute__ ((__vector_size__ (16)));
34 typedef long long __v2di __attribute__ ((__vector_size__ (16)));
35 typedef short __v8hi __attribute__((__vector_size__(16)));
36 typedef char __v16qi __attribute__((__vector_size__(16)));
39 typedef unsigned long long __v2du __attribute__ ((__vector_size__ (16)));
40 typedef unsigned short __v8hu __attribute__((__vector_size__(16)));
41 typedef unsigned char __v16qu __attribute__((__vector_size__(16)));
43 /* We need an explicitly signed variant for char. Note that this shouldn't
44 * appear in the interface though. */
45 typedef signed char __v16qs __attribute__((__vector_size__(16)));
47 /* Define the default attributes for the functions in this file. */
48 #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("sse2"), __min_vector_width__(128)))
49 #define __DEFAULT_FN_ATTRS_MMX __attribute__((__always_inline__, __nodebug__, __target__("mmx,sse2"), __min_vector_width__(64)))
51 /// Adds lower double-precision values in both operands and returns the
52 /// sum in the lower 64 bits of the result. The upper 64 bits of the result
53 /// are copied from the upper double-precision value of the first operand.
55 /// \headerfile <x86intrin.h>
57 /// This intrinsic corresponds to the <c> VADDSD / ADDSD </c> instruction.
60 /// A 128-bit vector of [2 x double] containing one of the source operands.
62 /// A 128-bit vector of [2 x double] containing one of the source operands.
63 /// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the
64 /// sum of the lower 64 bits of both operands. The upper 64 bits are copied
65 /// from the upper 64 bits of the first source operand.
66 static __inline__ __m128d __DEFAULT_FN_ATTRS
67 _mm_add_sd(__m128d __a, __m128d __b)
73 /// Adds two 128-bit vectors of [2 x double].
75 /// \headerfile <x86intrin.h>
77 /// This intrinsic corresponds to the <c> VADDPD / ADDPD </c> instruction.
80 /// A 128-bit vector of [2 x double] containing one of the source operands.
82 /// A 128-bit vector of [2 x double] containing one of the source operands.
83 /// \returns A 128-bit vector of [2 x double] containing the sums of both
85 static __inline__ __m128d __DEFAULT_FN_ATTRS
86 _mm_add_pd(__m128d __a, __m128d __b)
88 return (__m128d)((__v2df)__a + (__v2df)__b);
91 /// Subtracts the lower double-precision value of the second operand
92 /// from the lower double-precision value of the first operand and returns
93 /// the difference in the lower 64 bits of the result. The upper 64 bits of
94 /// the result are copied from the upper double-precision value of the first
97 /// \headerfile <x86intrin.h>
99 /// This intrinsic corresponds to the <c> VSUBSD / SUBSD </c> instruction.
102 /// A 128-bit vector of [2 x double] containing the minuend.
104 /// A 128-bit vector of [2 x double] containing the subtrahend.
105 /// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the
106 /// difference of the lower 64 bits of both operands. The upper 64 bits are
107 /// copied from the upper 64 bits of the first source operand.
108 static __inline__ __m128d __DEFAULT_FN_ATTRS
109 _mm_sub_sd(__m128d __a, __m128d __b)
115 /// Subtracts two 128-bit vectors of [2 x double].
117 /// \headerfile <x86intrin.h>
119 /// This intrinsic corresponds to the <c> VSUBPD / SUBPD </c> instruction.
122 /// A 128-bit vector of [2 x double] containing the minuend.
124 /// A 128-bit vector of [2 x double] containing the subtrahend.
125 /// \returns A 128-bit vector of [2 x double] containing the differences between
127 static __inline__ __m128d __DEFAULT_FN_ATTRS
128 _mm_sub_pd(__m128d __a, __m128d __b)
130 return (__m128d)((__v2df)__a - (__v2df)__b);
133 /// Multiplies lower double-precision values in both operands and returns
134 /// the product in the lower 64 bits of the result. The upper 64 bits of the
135 /// result are copied from the upper double-precision value of the first
138 /// \headerfile <x86intrin.h>
140 /// This intrinsic corresponds to the <c> VMULSD / MULSD </c> instruction.
143 /// A 128-bit vector of [2 x double] containing one of the source operands.
145 /// A 128-bit vector of [2 x double] containing one of the source operands.
146 /// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the
147 /// product of the lower 64 bits of both operands. The upper 64 bits are
148 /// copied from the upper 64 bits of the first source operand.
149 static __inline__ __m128d __DEFAULT_FN_ATTRS
150 _mm_mul_sd(__m128d __a, __m128d __b)
156 /// Multiplies two 128-bit vectors of [2 x double].
158 /// \headerfile <x86intrin.h>
160 /// This intrinsic corresponds to the <c> VMULPD / MULPD </c> instruction.
163 /// A 128-bit vector of [2 x double] containing one of the operands.
165 /// A 128-bit vector of [2 x double] containing one of the operands.
166 /// \returns A 128-bit vector of [2 x double] containing the products of both
168 static __inline__ __m128d __DEFAULT_FN_ATTRS
169 _mm_mul_pd(__m128d __a, __m128d __b)
171 return (__m128d)((__v2df)__a * (__v2df)__b);
174 /// Divides the lower double-precision value of the first operand by the
175 /// lower double-precision value of the second operand and returns the
176 /// quotient in the lower 64 bits of the result. The upper 64 bits of the
177 /// result are copied from the upper double-precision value of the first
180 /// \headerfile <x86intrin.h>
182 /// This intrinsic corresponds to the <c> VDIVSD / DIVSD </c> instruction.
185 /// A 128-bit vector of [2 x double] containing the dividend.
187 /// A 128-bit vector of [2 x double] containing divisor.
188 /// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the
189 /// quotient of the lower 64 bits of both operands. The upper 64 bits are
190 /// copied from the upper 64 bits of the first source operand.
191 static __inline__ __m128d __DEFAULT_FN_ATTRS
192 _mm_div_sd(__m128d __a, __m128d __b)
198 /// Performs an element-by-element division of two 128-bit vectors of
201 /// \headerfile <x86intrin.h>
203 /// This intrinsic corresponds to the <c> VDIVPD / DIVPD </c> instruction.
206 /// A 128-bit vector of [2 x double] containing the dividend.
208 /// A 128-bit vector of [2 x double] containing the divisor.
209 /// \returns A 128-bit vector of [2 x double] containing the quotients of both
211 static __inline__ __m128d __DEFAULT_FN_ATTRS
212 _mm_div_pd(__m128d __a, __m128d __b)
214 return (__m128d)((__v2df)__a / (__v2df)__b);
217 /// Calculates the square root of the lower double-precision value of
218 /// the second operand and returns it in the lower 64 bits of the result.
219 /// The upper 64 bits of the result are copied from the upper
220 /// double-precision value of the first operand.
222 /// \headerfile <x86intrin.h>
224 /// This intrinsic corresponds to the <c> VSQRTSD / SQRTSD </c> instruction.
227 /// A 128-bit vector of [2 x double] containing one of the operands. The
228 /// upper 64 bits of this operand are copied to the upper 64 bits of the
231 /// A 128-bit vector of [2 x double] containing one of the operands. The
232 /// square root is calculated using the lower 64 bits of this operand.
233 /// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the
234 /// square root of the lower 64 bits of operand \a __b, and whose upper 64
235 /// bits are copied from the upper 64 bits of operand \a __a.
236 static __inline__ __m128d __DEFAULT_FN_ATTRS
237 _mm_sqrt_sd(__m128d __a, __m128d __b)
239 __m128d __c = __builtin_ia32_sqrtsd((__v2df)__b);
240 return __extension__ (__m128d) { __c[0], __a[1] };
243 /// Calculates the square root of the each of two values stored in a
244 /// 128-bit vector of [2 x double].
246 /// \headerfile <x86intrin.h>
248 /// This intrinsic corresponds to the <c> VSQRTPD / SQRTPD </c> instruction.
251 /// A 128-bit vector of [2 x double].
252 /// \returns A 128-bit vector of [2 x double] containing the square roots of the
253 /// values in the operand.
254 static __inline__ __m128d __DEFAULT_FN_ATTRS
255 _mm_sqrt_pd(__m128d __a)
257 return __builtin_ia32_sqrtpd((__v2df)__a);
260 /// Compares lower 64-bit double-precision values of both operands, and
261 /// returns the lesser of the pair of values in the lower 64-bits of the
262 /// result. The upper 64 bits of the result are copied from the upper
263 /// double-precision value of the first operand.
265 /// \headerfile <x86intrin.h>
267 /// This intrinsic corresponds to the <c> VMINSD / MINSD </c> instruction.
270 /// A 128-bit vector of [2 x double] containing one of the operands. The
271 /// lower 64 bits of this operand are used in the comparison.
273 /// A 128-bit vector of [2 x double] containing one of the operands. The
274 /// lower 64 bits of this operand are used in the comparison.
275 /// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the
276 /// minimum value between both operands. The upper 64 bits are copied from
277 /// the upper 64 bits of the first source operand.
278 static __inline__ __m128d __DEFAULT_FN_ATTRS
279 _mm_min_sd(__m128d __a, __m128d __b)
281 return __builtin_ia32_minsd((__v2df)__a, (__v2df)__b);
284 /// Performs element-by-element comparison of the two 128-bit vectors of
285 /// [2 x double] and returns the vector containing the lesser of each pair of
288 /// \headerfile <x86intrin.h>
290 /// This intrinsic corresponds to the <c> VMINPD / MINPD </c> instruction.
293 /// A 128-bit vector of [2 x double] containing one of the operands.
295 /// A 128-bit vector of [2 x double] containing one of the operands.
296 /// \returns A 128-bit vector of [2 x double] containing the minimum values
297 /// between both operands.
298 static __inline__ __m128d __DEFAULT_FN_ATTRS
299 _mm_min_pd(__m128d __a, __m128d __b)
301 return __builtin_ia32_minpd((__v2df)__a, (__v2df)__b);
304 /// Compares lower 64-bit double-precision values of both operands, and
305 /// returns the greater of the pair of values in the lower 64-bits of the
306 /// result. The upper 64 bits of the result are copied from the upper
307 /// double-precision value of the first operand.
309 /// \headerfile <x86intrin.h>
311 /// This intrinsic corresponds to the <c> VMAXSD / MAXSD </c> instruction.
314 /// A 128-bit vector of [2 x double] containing one of the operands. The
315 /// lower 64 bits of this operand are used in the comparison.
317 /// A 128-bit vector of [2 x double] containing one of the operands. The
318 /// lower 64 bits of this operand are used in the comparison.
319 /// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the
320 /// maximum value between both operands. The upper 64 bits are copied from
321 /// the upper 64 bits of the first source operand.
322 static __inline__ __m128d __DEFAULT_FN_ATTRS
323 _mm_max_sd(__m128d __a, __m128d __b)
325 return __builtin_ia32_maxsd((__v2df)__a, (__v2df)__b);
328 /// Performs element-by-element comparison of the two 128-bit vectors of
329 /// [2 x double] and returns the vector containing the greater of each pair
332 /// \headerfile <x86intrin.h>
334 /// This intrinsic corresponds to the <c> VMAXPD / MAXPD </c> instruction.
337 /// A 128-bit vector of [2 x double] containing one of the operands.
339 /// A 128-bit vector of [2 x double] containing one of the operands.
340 /// \returns A 128-bit vector of [2 x double] containing the maximum values
341 /// between both operands.
342 static __inline__ __m128d __DEFAULT_FN_ATTRS
343 _mm_max_pd(__m128d __a, __m128d __b)
345 return __builtin_ia32_maxpd((__v2df)__a, (__v2df)__b);
348 /// Performs a bitwise AND of two 128-bit vectors of [2 x double].
350 /// \headerfile <x86intrin.h>
352 /// This intrinsic corresponds to the <c> VPAND / PAND </c> instruction.
355 /// A 128-bit vector of [2 x double] containing one of the source operands.
357 /// A 128-bit vector of [2 x double] containing one of the source operands.
358 /// \returns A 128-bit vector of [2 x double] containing the bitwise AND of the
359 /// values between both operands.
360 static __inline__ __m128d __DEFAULT_FN_ATTRS
361 _mm_and_pd(__m128d __a, __m128d __b)
363 return (__m128d)((__v2du)__a & (__v2du)__b);
366 /// Performs a bitwise AND of two 128-bit vectors of [2 x double], using
367 /// the one's complement of the values contained in the first source operand.
369 /// \headerfile <x86intrin.h>
371 /// This intrinsic corresponds to the <c> VPANDN / PANDN </c> instruction.
374 /// A 128-bit vector of [2 x double] containing the left source operand. The
375 /// one's complement of this value is used in the bitwise AND.
377 /// A 128-bit vector of [2 x double] containing the right source operand.
378 /// \returns A 128-bit vector of [2 x double] containing the bitwise AND of the
379 /// values in the second operand and the one's complement of the first
381 static __inline__ __m128d __DEFAULT_FN_ATTRS
382 _mm_andnot_pd(__m128d __a, __m128d __b)
384 return (__m128d)(~(__v2du)__a & (__v2du)__b);
387 /// Performs a bitwise OR of two 128-bit vectors of [2 x double].
389 /// \headerfile <x86intrin.h>
391 /// This intrinsic corresponds to the <c> VPOR / POR </c> instruction.
394 /// A 128-bit vector of [2 x double] containing one of the source operands.
396 /// A 128-bit vector of [2 x double] containing one of the source operands.
397 /// \returns A 128-bit vector of [2 x double] containing the bitwise OR of the
398 /// values between both operands.
399 static __inline__ __m128d __DEFAULT_FN_ATTRS
400 _mm_or_pd(__m128d __a, __m128d __b)
402 return (__m128d)((__v2du)__a | (__v2du)__b);
405 /// Performs a bitwise XOR of two 128-bit vectors of [2 x double].
407 /// \headerfile <x86intrin.h>
409 /// This intrinsic corresponds to the <c> VPXOR / PXOR </c> instruction.
412 /// A 128-bit vector of [2 x double] containing one of the source operands.
414 /// A 128-bit vector of [2 x double] containing one of the source operands.
415 /// \returns A 128-bit vector of [2 x double] containing the bitwise XOR of the
416 /// values between both operands.
417 static __inline__ __m128d __DEFAULT_FN_ATTRS
418 _mm_xor_pd(__m128d __a, __m128d __b)
420 return (__m128d)((__v2du)__a ^ (__v2du)__b);
423 /// Compares each of the corresponding double-precision values of the
424 /// 128-bit vectors of [2 x double] for equality. Each comparison yields 0x0
425 /// for false, 0xFFFFFFFFFFFFFFFF for true.
427 /// \headerfile <x86intrin.h>
429 /// This intrinsic corresponds to the <c> VCMPEQPD / CMPEQPD </c> instruction.
432 /// A 128-bit vector of [2 x double].
434 /// A 128-bit vector of [2 x double].
435 /// \returns A 128-bit vector containing the comparison results.
436 static __inline__ __m128d __DEFAULT_FN_ATTRS
437 _mm_cmpeq_pd(__m128d __a, __m128d __b)
439 return (__m128d)__builtin_ia32_cmpeqpd((__v2df)__a, (__v2df)__b);
442 /// Compares each of the corresponding double-precision values of the
443 /// 128-bit vectors of [2 x double] to determine if the values in the first
444 /// operand are less than those in the second operand. Each comparison
445 /// yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
447 /// \headerfile <x86intrin.h>
449 /// This intrinsic corresponds to the <c> VCMPLTPD / CMPLTPD </c> instruction.
452 /// A 128-bit vector of [2 x double].
454 /// A 128-bit vector of [2 x double].
455 /// \returns A 128-bit vector containing the comparison results.
456 static __inline__ __m128d __DEFAULT_FN_ATTRS
457 _mm_cmplt_pd(__m128d __a, __m128d __b)
459 return (__m128d)__builtin_ia32_cmpltpd((__v2df)__a, (__v2df)__b);
462 /// Compares each of the corresponding double-precision values of the
463 /// 128-bit vectors of [2 x double] to determine if the values in the first
464 /// operand are less than or equal to those in the second operand.
466 /// Each comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
468 /// \headerfile <x86intrin.h>
470 /// This intrinsic corresponds to the <c> VCMPLEPD / CMPLEPD </c> instruction.
473 /// A 128-bit vector of [2 x double].
475 /// A 128-bit vector of [2 x double].
476 /// \returns A 128-bit vector containing the comparison results.
477 static __inline__ __m128d __DEFAULT_FN_ATTRS
478 _mm_cmple_pd(__m128d __a, __m128d __b)
480 return (__m128d)__builtin_ia32_cmplepd((__v2df)__a, (__v2df)__b);
483 /// Compares each of the corresponding double-precision values of the
484 /// 128-bit vectors of [2 x double] to determine if the values in the first
485 /// operand are greater than those in the second operand.
487 /// Each comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
489 /// \headerfile <x86intrin.h>
491 /// This intrinsic corresponds to the <c> VCMPLTPD / CMPLTPD </c> instruction.
494 /// A 128-bit vector of [2 x double].
496 /// A 128-bit vector of [2 x double].
497 /// \returns A 128-bit vector containing the comparison results.
498 static __inline__ __m128d __DEFAULT_FN_ATTRS
499 _mm_cmpgt_pd(__m128d __a, __m128d __b)
501 return (__m128d)__builtin_ia32_cmpltpd((__v2df)__b, (__v2df)__a);
504 /// Compares each of the corresponding double-precision values of the
505 /// 128-bit vectors of [2 x double] to determine if the values in the first
506 /// operand are greater than or equal to those in the second operand.
508 /// Each comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
510 /// \headerfile <x86intrin.h>
512 /// This intrinsic corresponds to the <c> VCMPLEPD / CMPLEPD </c> instruction.
515 /// A 128-bit vector of [2 x double].
517 /// A 128-bit vector of [2 x double].
518 /// \returns A 128-bit vector containing the comparison results.
519 static __inline__ __m128d __DEFAULT_FN_ATTRS
520 _mm_cmpge_pd(__m128d __a, __m128d __b)
522 return (__m128d)__builtin_ia32_cmplepd((__v2df)__b, (__v2df)__a);
525 /// Compares each of the corresponding double-precision values of the
526 /// 128-bit vectors of [2 x double] to determine if the values in the first
527 /// operand are ordered with respect to those in the second operand.
529 /// A pair of double-precision values are "ordered" with respect to each
530 /// other if neither value is a NaN. Each comparison yields 0x0 for false,
531 /// 0xFFFFFFFFFFFFFFFF for true.
533 /// \headerfile <x86intrin.h>
535 /// This intrinsic corresponds to the <c> VCMPORDPD / CMPORDPD </c> instruction.
538 /// A 128-bit vector of [2 x double].
540 /// A 128-bit vector of [2 x double].
541 /// \returns A 128-bit vector containing the comparison results.
542 static __inline__ __m128d __DEFAULT_FN_ATTRS
543 _mm_cmpord_pd(__m128d __a, __m128d __b)
545 return (__m128d)__builtin_ia32_cmpordpd((__v2df)__a, (__v2df)__b);
548 /// Compares each of the corresponding double-precision values of the
549 /// 128-bit vectors of [2 x double] to determine if the values in the first
550 /// operand are unordered with respect to those in the second operand.
552 /// A pair of double-precision values are "unordered" with respect to each
553 /// other if one or both values are NaN. Each comparison yields 0x0 for
554 /// false, 0xFFFFFFFFFFFFFFFF for true.
556 /// \headerfile <x86intrin.h>
558 /// This intrinsic corresponds to the <c> VCMPUNORDPD / CMPUNORDPD </c>
562 /// A 128-bit vector of [2 x double].
564 /// A 128-bit vector of [2 x double].
565 /// \returns A 128-bit vector containing the comparison results.
566 static __inline__ __m128d __DEFAULT_FN_ATTRS
567 _mm_cmpunord_pd(__m128d __a, __m128d __b)
569 return (__m128d)__builtin_ia32_cmpunordpd((__v2df)__a, (__v2df)__b);
572 /// Compares each of the corresponding double-precision values of the
573 /// 128-bit vectors of [2 x double] to determine if the values in the first
574 /// operand are unequal to those in the second operand.
576 /// Each comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
578 /// \headerfile <x86intrin.h>
580 /// This intrinsic corresponds to the <c> VCMPNEQPD / CMPNEQPD </c> instruction.
583 /// A 128-bit vector of [2 x double].
585 /// A 128-bit vector of [2 x double].
586 /// \returns A 128-bit vector containing the comparison results.
587 static __inline__ __m128d __DEFAULT_FN_ATTRS
588 _mm_cmpneq_pd(__m128d __a, __m128d __b)
590 return (__m128d)__builtin_ia32_cmpneqpd((__v2df)__a, (__v2df)__b);
593 /// Compares each of the corresponding double-precision values of the
594 /// 128-bit vectors of [2 x double] to determine if the values in the first
595 /// operand are not less than those in the second operand.
597 /// Each comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
599 /// \headerfile <x86intrin.h>
601 /// This intrinsic corresponds to the <c> VCMPNLTPD / CMPNLTPD </c> instruction.
604 /// A 128-bit vector of [2 x double].
606 /// A 128-bit vector of [2 x double].
607 /// \returns A 128-bit vector containing the comparison results.
608 static __inline__ __m128d __DEFAULT_FN_ATTRS
609 _mm_cmpnlt_pd(__m128d __a, __m128d __b)
611 return (__m128d)__builtin_ia32_cmpnltpd((__v2df)__a, (__v2df)__b);
614 /// Compares each of the corresponding double-precision values of the
615 /// 128-bit vectors of [2 x double] to determine if the values in the first
616 /// operand are not less than or equal to those in the second operand.
618 /// Each comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
620 /// \headerfile <x86intrin.h>
622 /// This intrinsic corresponds to the <c> VCMPNLEPD / CMPNLEPD </c> instruction.
625 /// A 128-bit vector of [2 x double].
627 /// A 128-bit vector of [2 x double].
628 /// \returns A 128-bit vector containing the comparison results.
629 static __inline__ __m128d __DEFAULT_FN_ATTRS
630 _mm_cmpnle_pd(__m128d __a, __m128d __b)
632 return (__m128d)__builtin_ia32_cmpnlepd((__v2df)__a, (__v2df)__b);
635 /// Compares each of the corresponding double-precision values of the
636 /// 128-bit vectors of [2 x double] to determine if the values in the first
637 /// operand are not greater than those in the second operand.
639 /// Each comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
641 /// \headerfile <x86intrin.h>
643 /// This intrinsic corresponds to the <c> VCMPNLTPD / CMPNLTPD </c> instruction.
646 /// A 128-bit vector of [2 x double].
648 /// A 128-bit vector of [2 x double].
649 /// \returns A 128-bit vector containing the comparison results.
650 static __inline__ __m128d __DEFAULT_FN_ATTRS
651 _mm_cmpngt_pd(__m128d __a, __m128d __b)
653 return (__m128d)__builtin_ia32_cmpnltpd((__v2df)__b, (__v2df)__a);
656 /// Compares each of the corresponding double-precision values of the
657 /// 128-bit vectors of [2 x double] to determine if the values in the first
658 /// operand are not greater than or equal to those in the second operand.
660 /// Each comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
662 /// \headerfile <x86intrin.h>
664 /// This intrinsic corresponds to the <c> VCMPNLEPD / CMPNLEPD </c> instruction.
667 /// A 128-bit vector of [2 x double].
669 /// A 128-bit vector of [2 x double].
670 /// \returns A 128-bit vector containing the comparison results.
671 static __inline__ __m128d __DEFAULT_FN_ATTRS
672 _mm_cmpnge_pd(__m128d __a, __m128d __b)
674 return (__m128d)__builtin_ia32_cmpnlepd((__v2df)__b, (__v2df)__a);
677 /// Compares the lower double-precision floating-point values in each of
678 /// the two 128-bit floating-point vectors of [2 x double] for equality.
680 /// The comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
682 /// \headerfile <x86intrin.h>
684 /// This intrinsic corresponds to the <c> VCMPEQSD / CMPEQSD </c> instruction.
687 /// A 128-bit vector of [2 x double]. The lower double-precision value is
688 /// compared to the lower double-precision value of \a __b.
690 /// A 128-bit vector of [2 x double]. The lower double-precision value is
691 /// compared to the lower double-precision value of \a __a.
692 /// \returns A 128-bit vector. The lower 64 bits contains the comparison
693 /// results. The upper 64 bits are copied from the upper 64 bits of \a __a.
694 static __inline__ __m128d __DEFAULT_FN_ATTRS
695 _mm_cmpeq_sd(__m128d __a, __m128d __b)
697 return (__m128d)__builtin_ia32_cmpeqsd((__v2df)__a, (__v2df)__b);
700 /// Compares the lower double-precision floating-point values in each of
701 /// the two 128-bit floating-point vectors of [2 x double] to determine if
702 /// the value in the first parameter is less than the corresponding value in
703 /// the second parameter.
705 /// The comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
707 /// \headerfile <x86intrin.h>
709 /// This intrinsic corresponds to the <c> VCMPLTSD / CMPLTSD </c> instruction.
712 /// A 128-bit vector of [2 x double]. The lower double-precision value is
713 /// compared to the lower double-precision value of \a __b.
715 /// A 128-bit vector of [2 x double]. The lower double-precision value is
716 /// compared to the lower double-precision value of \a __a.
717 /// \returns A 128-bit vector. The lower 64 bits contains the comparison
718 /// results. The upper 64 bits are copied from the upper 64 bits of \a __a.
719 static __inline__ __m128d __DEFAULT_FN_ATTRS
720 _mm_cmplt_sd(__m128d __a, __m128d __b)
722 return (__m128d)__builtin_ia32_cmpltsd((__v2df)__a, (__v2df)__b);
725 /// Compares the lower double-precision floating-point values in each of
726 /// the two 128-bit floating-point vectors of [2 x double] to determine if
727 /// the value in the first parameter is less than or equal to the
728 /// corresponding value in the second parameter.
730 /// The comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
732 /// \headerfile <x86intrin.h>
734 /// This intrinsic corresponds to the <c> VCMPLESD / CMPLESD </c> instruction.
737 /// A 128-bit vector of [2 x double]. The lower double-precision value is
738 /// compared to the lower double-precision value of \a __b.
740 /// A 128-bit vector of [2 x double]. The lower double-precision value is
741 /// compared to the lower double-precision value of \a __a.
742 /// \returns A 128-bit vector. The lower 64 bits contains the comparison
743 /// results. The upper 64 bits are copied from the upper 64 bits of \a __a.
744 static __inline__ __m128d __DEFAULT_FN_ATTRS
745 _mm_cmple_sd(__m128d __a, __m128d __b)
747 return (__m128d)__builtin_ia32_cmplesd((__v2df)__a, (__v2df)__b);
750 /// Compares the lower double-precision floating-point values in each of
751 /// the two 128-bit floating-point vectors of [2 x double] to determine if
752 /// the value in the first parameter is greater than the corresponding value
753 /// in the second parameter.
755 /// The comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
757 /// \headerfile <x86intrin.h>
759 /// This intrinsic corresponds to the <c> VCMPLTSD / CMPLTSD </c> instruction.
762 /// A 128-bit vector of [2 x double]. The lower double-precision value is
763 /// compared to the lower double-precision value of \a __b.
765 /// A 128-bit vector of [2 x double]. The lower double-precision value is
766 /// compared to the lower double-precision value of \a __a.
767 /// \returns A 128-bit vector. The lower 64 bits contains the comparison
768 /// results. The upper 64 bits are copied from the upper 64 bits of \a __a.
769 static __inline__ __m128d __DEFAULT_FN_ATTRS
770 _mm_cmpgt_sd(__m128d __a, __m128d __b)
772 __m128d __c = __builtin_ia32_cmpltsd((__v2df)__b, (__v2df)__a);
773 return __extension__ (__m128d) { __c[0], __a[1] };
776 /// Compares the lower double-precision floating-point values in each of
777 /// the two 128-bit floating-point vectors of [2 x double] to determine if
778 /// the value in the first parameter is greater than or equal to the
779 /// corresponding value in the second parameter.
781 /// The comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
783 /// \headerfile <x86intrin.h>
785 /// This intrinsic corresponds to the <c> VCMPLESD / CMPLESD </c> instruction.
788 /// A 128-bit vector of [2 x double]. The lower double-precision value is
789 /// compared to the lower double-precision value of \a __b.
791 /// A 128-bit vector of [2 x double]. The lower double-precision value is
792 /// compared to the lower double-precision value of \a __a.
793 /// \returns A 128-bit vector. The lower 64 bits contains the comparison
794 /// results. The upper 64 bits are copied from the upper 64 bits of \a __a.
795 static __inline__ __m128d __DEFAULT_FN_ATTRS
796 _mm_cmpge_sd(__m128d __a, __m128d __b)
798 __m128d __c = __builtin_ia32_cmplesd((__v2df)__b, (__v2df)__a);
799 return __extension__ (__m128d) { __c[0], __a[1] };
802 /// Compares the lower double-precision floating-point values in each of
803 /// the two 128-bit floating-point vectors of [2 x double] to determine if
804 /// the value in the first parameter is "ordered" with respect to the
805 /// corresponding value in the second parameter.
807 /// The comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true. A pair
808 /// of double-precision values are "ordered" with respect to each other if
809 /// neither value is a NaN.
811 /// \headerfile <x86intrin.h>
813 /// This intrinsic corresponds to the <c> VCMPORDSD / CMPORDSD </c> instruction.
816 /// A 128-bit vector of [2 x double]. The lower double-precision value is
817 /// compared to the lower double-precision value of \a __b.
819 /// A 128-bit vector of [2 x double]. The lower double-precision value is
820 /// compared to the lower double-precision value of \a __a.
821 /// \returns A 128-bit vector. The lower 64 bits contains the comparison
822 /// results. The upper 64 bits are copied from the upper 64 bits of \a __a.
823 static __inline__ __m128d __DEFAULT_FN_ATTRS
824 _mm_cmpord_sd(__m128d __a, __m128d __b)
826 return (__m128d)__builtin_ia32_cmpordsd((__v2df)__a, (__v2df)__b);
829 /// Compares the lower double-precision floating-point values in each of
830 /// the two 128-bit floating-point vectors of [2 x double] to determine if
831 /// the value in the first parameter is "unordered" with respect to the
832 /// corresponding value in the second parameter.
834 /// The comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true. A pair
835 /// of double-precision values are "unordered" with respect to each other if
836 /// one or both values are NaN.
838 /// \headerfile <x86intrin.h>
840 /// This intrinsic corresponds to the <c> VCMPUNORDSD / CMPUNORDSD </c>
844 /// A 128-bit vector of [2 x double]. The lower double-precision value is
845 /// compared to the lower double-precision value of \a __b.
847 /// A 128-bit vector of [2 x double]. The lower double-precision value is
848 /// compared to the lower double-precision value of \a __a.
849 /// \returns A 128-bit vector. The lower 64 bits contains the comparison
850 /// results. The upper 64 bits are copied from the upper 64 bits of \a __a.
851 static __inline__ __m128d __DEFAULT_FN_ATTRS
852 _mm_cmpunord_sd(__m128d __a, __m128d __b)
854 return (__m128d)__builtin_ia32_cmpunordsd((__v2df)__a, (__v2df)__b);
857 /// Compares the lower double-precision floating-point values in each of
858 /// the two 128-bit floating-point vectors of [2 x double] to determine if
859 /// the value in the first parameter is unequal to the corresponding value in
860 /// the second parameter.
862 /// The comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
864 /// \headerfile <x86intrin.h>
866 /// This intrinsic corresponds to the <c> VCMPNEQSD / CMPNEQSD </c> instruction.
869 /// A 128-bit vector of [2 x double]. The lower double-precision value is
870 /// compared to the lower double-precision value of \a __b.
872 /// A 128-bit vector of [2 x double]. The lower double-precision value is
873 /// compared to the lower double-precision value of \a __a.
874 /// \returns A 128-bit vector. The lower 64 bits contains the comparison
875 /// results. The upper 64 bits are copied from the upper 64 bits of \a __a.
876 static __inline__ __m128d __DEFAULT_FN_ATTRS
877 _mm_cmpneq_sd(__m128d __a, __m128d __b)
879 return (__m128d)__builtin_ia32_cmpneqsd((__v2df)__a, (__v2df)__b);
882 /// Compares the lower double-precision floating-point values in each of
883 /// the two 128-bit floating-point vectors of [2 x double] to determine if
884 /// the value in the first parameter is not less than the corresponding
885 /// value in the second parameter.
887 /// The comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
889 /// \headerfile <x86intrin.h>
891 /// This intrinsic corresponds to the <c> VCMPNLTSD / CMPNLTSD </c> instruction.
894 /// A 128-bit vector of [2 x double]. The lower double-precision value is
895 /// compared to the lower double-precision value of \a __b.
897 /// A 128-bit vector of [2 x double]. The lower double-precision value is
898 /// compared to the lower double-precision value of \a __a.
899 /// \returns A 128-bit vector. The lower 64 bits contains the comparison
900 /// results. The upper 64 bits are copied from the upper 64 bits of \a __a.
901 static __inline__ __m128d __DEFAULT_FN_ATTRS
902 _mm_cmpnlt_sd(__m128d __a, __m128d __b)
904 return (__m128d)__builtin_ia32_cmpnltsd((__v2df)__a, (__v2df)__b);
907 /// Compares the lower double-precision floating-point values in each of
908 /// the two 128-bit floating-point vectors of [2 x double] to determine if
909 /// the value in the first parameter is not less than or equal to the
910 /// corresponding value in the second parameter.
912 /// The comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
914 /// \headerfile <x86intrin.h>
916 /// This intrinsic corresponds to the <c> VCMPNLESD / CMPNLESD </c> instruction.
919 /// A 128-bit vector of [2 x double]. The lower double-precision value is
920 /// compared to the lower double-precision value of \a __b.
922 /// A 128-bit vector of [2 x double]. The lower double-precision value is
923 /// compared to the lower double-precision value of \a __a.
924 /// \returns A 128-bit vector. The lower 64 bits contains the comparison
925 /// results. The upper 64 bits are copied from the upper 64 bits of \a __a.
926 static __inline__ __m128d __DEFAULT_FN_ATTRS
927 _mm_cmpnle_sd(__m128d __a, __m128d __b)
929 return (__m128d)__builtin_ia32_cmpnlesd((__v2df)__a, (__v2df)__b);
932 /// Compares the lower double-precision floating-point values in each of
933 /// the two 128-bit floating-point vectors of [2 x double] to determine if
934 /// the value in the first parameter is not greater than the corresponding
935 /// value in the second parameter.
937 /// The comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
939 /// \headerfile <x86intrin.h>
941 /// This intrinsic corresponds to the <c> VCMPNLTSD / CMPNLTSD </c> instruction.
944 /// A 128-bit vector of [2 x double]. The lower double-precision value is
945 /// compared to the lower double-precision value of \a __b.
947 /// A 128-bit vector of [2 x double]. The lower double-precision value is
948 /// compared to the lower double-precision value of \a __a.
949 /// \returns A 128-bit vector. The lower 64 bits contains the comparison
950 /// results. The upper 64 bits are copied from the upper 64 bits of \a __a.
951 static __inline__ __m128d __DEFAULT_FN_ATTRS
952 _mm_cmpngt_sd(__m128d __a, __m128d __b)
954 __m128d __c = __builtin_ia32_cmpnltsd((__v2df)__b, (__v2df)__a);
955 return __extension__ (__m128d) { __c[0], __a[1] };
958 /// Compares the lower double-precision floating-point values in each of
959 /// the two 128-bit floating-point vectors of [2 x double] to determine if
960 /// the value in the first parameter is not greater than or equal to the
961 /// corresponding value in the second parameter.
963 /// The comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
965 /// \headerfile <x86intrin.h>
967 /// This intrinsic corresponds to the <c> VCMPNLESD / CMPNLESD </c> instruction.
970 /// A 128-bit vector of [2 x double]. The lower double-precision value is
971 /// compared to the lower double-precision value of \a __b.
973 /// A 128-bit vector of [2 x double]. The lower double-precision value is
974 /// compared to the lower double-precision value of \a __a.
975 /// \returns A 128-bit vector. The lower 64 bits contains the comparison
976 /// results. The upper 64 bits are copied from the upper 64 bits of \a __a.
977 static __inline__ __m128d __DEFAULT_FN_ATTRS
978 _mm_cmpnge_sd(__m128d __a, __m128d __b)
980 __m128d __c = __builtin_ia32_cmpnlesd((__v2df)__b, (__v2df)__a);
981 return __extension__ (__m128d) { __c[0], __a[1] };
984 /// Compares the lower double-precision floating-point values in each of
985 /// the two 128-bit floating-point vectors of [2 x double] for equality.
987 /// The comparison yields 0 for false, 1 for true. If either of the two
988 /// lower double-precision values is NaN, 0 is returned.
990 /// \headerfile <x86intrin.h>
992 /// This intrinsic corresponds to the <c> VCOMISD / COMISD </c> instruction.
995 /// A 128-bit vector of [2 x double]. The lower double-precision value is
996 /// compared to the lower double-precision value of \a __b.
998 /// A 128-bit vector of [2 x double]. The lower double-precision value is
999 /// compared to the lower double-precision value of \a __a.
1000 /// \returns An integer containing the comparison results. If either of the two
1001 /// lower double-precision values is NaN, 0 is returned.
1002 static __inline__ int __DEFAULT_FN_ATTRS
1003 _mm_comieq_sd(__m128d __a, __m128d __b)
1005 return __builtin_ia32_comisdeq((__v2df)__a, (__v2df)__b);
1008 /// Compares the lower double-precision floating-point values in each of
1009 /// the two 128-bit floating-point vectors of [2 x double] to determine if
1010 /// the value in the first parameter is less than the corresponding value in
1011 /// the second parameter.
1013 /// The comparison yields 0 for false, 1 for true. If either of the two
1014 /// lower double-precision values is NaN, 0 is returned.
1016 /// \headerfile <x86intrin.h>
1018 /// This intrinsic corresponds to the <c> VCOMISD / COMISD </c> instruction.
1021 /// A 128-bit vector of [2 x double]. The lower double-precision value is
1022 /// compared to the lower double-precision value of \a __b.
1024 /// A 128-bit vector of [2 x double]. The lower double-precision value is
1025 /// compared to the lower double-precision value of \a __a.
1026 /// \returns An integer containing the comparison results. If either of the two
1027 /// lower double-precision values is NaN, 0 is returned.
1028 static __inline__ int __DEFAULT_FN_ATTRS
1029 _mm_comilt_sd(__m128d __a, __m128d __b)
1031 return __builtin_ia32_comisdlt((__v2df)__a, (__v2df)__b);
1034 /// Compares the lower double-precision floating-point values in each of
1035 /// the two 128-bit floating-point vectors of [2 x double] to determine if
1036 /// the value in the first parameter is less than or equal to the
1037 /// corresponding value in the second parameter.
1039 /// The comparison yields 0 for false, 1 for true. If either of the two
1040 /// lower double-precision values is NaN, 0 is returned.
1042 /// \headerfile <x86intrin.h>
1044 /// This intrinsic corresponds to the <c> VCOMISD / COMISD </c> instruction.
1047 /// A 128-bit vector of [2 x double]. The lower double-precision value is
1048 /// compared to the lower double-precision value of \a __b.
1050 /// A 128-bit vector of [2 x double]. The lower double-precision value is
1051 /// compared to the lower double-precision value of \a __a.
1052 /// \returns An integer containing the comparison results. If either of the two
1053 /// lower double-precision values is NaN, 0 is returned.
1054 static __inline__ int __DEFAULT_FN_ATTRS
1055 _mm_comile_sd(__m128d __a, __m128d __b)
1057 return __builtin_ia32_comisdle((__v2df)__a, (__v2df)__b);
1060 /// Compares the lower double-precision floating-point values in each of
1061 /// the two 128-bit floating-point vectors of [2 x double] to determine if
1062 /// the value in the first parameter is greater than the corresponding value
1063 /// in the second parameter.
1065 /// The comparison yields 0 for false, 1 for true. If either of the two
1066 /// lower double-precision values is NaN, 0 is returned.
1068 /// \headerfile <x86intrin.h>
1070 /// This intrinsic corresponds to the <c> VCOMISD / COMISD </c> instruction.
1073 /// A 128-bit vector of [2 x double]. The lower double-precision value is
1074 /// compared to the lower double-precision value of \a __b.
1076 /// A 128-bit vector of [2 x double]. The lower double-precision value is
1077 /// compared to the lower double-precision value of \a __a.
1078 /// \returns An integer containing the comparison results. If either of the two
1079 /// lower double-precision values is NaN, 0 is returned.
1080 static __inline__ int __DEFAULT_FN_ATTRS
1081 _mm_comigt_sd(__m128d __a, __m128d __b)
1083 return __builtin_ia32_comisdgt((__v2df)__a, (__v2df)__b);
1086 /// Compares the lower double-precision floating-point values in each of
1087 /// the two 128-bit floating-point vectors of [2 x double] to determine if
1088 /// the value in the first parameter is greater than or equal to the
1089 /// corresponding value in the second parameter.
1091 /// The comparison yields 0 for false, 1 for true. If either of the two
1092 /// lower double-precision values is NaN, 0 is returned.
1094 /// \headerfile <x86intrin.h>
1096 /// This intrinsic corresponds to the <c> VCOMISD / COMISD </c> instruction.
1099 /// A 128-bit vector of [2 x double]. The lower double-precision value is
1100 /// compared to the lower double-precision value of \a __b.
1102 /// A 128-bit vector of [2 x double]. The lower double-precision value is
1103 /// compared to the lower double-precision value of \a __a.
1104 /// \returns An integer containing the comparison results. If either of the two
1105 /// lower double-precision values is NaN, 0 is returned.
1106 static __inline__ int __DEFAULT_FN_ATTRS
1107 _mm_comige_sd(__m128d __a, __m128d __b)
1109 return __builtin_ia32_comisdge((__v2df)__a, (__v2df)__b);
1112 /// Compares the lower double-precision floating-point values in each of
1113 /// the two 128-bit floating-point vectors of [2 x double] to determine if
1114 /// the value in the first parameter is unequal to the corresponding value in
1115 /// the second parameter.
1117 /// The comparison yields 0 for false, 1 for true. If either of the two
1118 /// lower double-precision values is NaN, 1 is returned.
1120 /// \headerfile <x86intrin.h>
1122 /// This intrinsic corresponds to the <c> VCOMISD / COMISD </c> instruction.
1125 /// A 128-bit vector of [2 x double]. The lower double-precision value is
1126 /// compared to the lower double-precision value of \a __b.
1128 /// A 128-bit vector of [2 x double]. The lower double-precision value is
1129 /// compared to the lower double-precision value of \a __a.
1130 /// \returns An integer containing the comparison results. If either of the two
1131 /// lower double-precision values is NaN, 1 is returned.
1132 static __inline__ int __DEFAULT_FN_ATTRS
1133 _mm_comineq_sd(__m128d __a, __m128d __b)
1135 return __builtin_ia32_comisdneq((__v2df)__a, (__v2df)__b);
1138 /// Compares the lower double-precision floating-point values in each of
1139 /// the two 128-bit floating-point vectors of [2 x double] for equality. The
1140 /// comparison yields 0 for false, 1 for true.
1142 /// If either of the two lower double-precision values is NaN, 0 is returned.
1144 /// \headerfile <x86intrin.h>
1146 /// This intrinsic corresponds to the <c> VUCOMISD / UCOMISD </c> instruction.
1149 /// A 128-bit vector of [2 x double]. The lower double-precision value is
1150 /// compared to the lower double-precision value of \a __b.
1152 /// A 128-bit vector of [2 x double]. The lower double-precision value is
1153 /// compared to the lower double-precision value of \a __a.
1154 /// \returns An integer containing the comparison results. If either of the two
1155 /// lower double-precision values is NaN, 0 is returned.
1156 static __inline__ int __DEFAULT_FN_ATTRS
1157 _mm_ucomieq_sd(__m128d __a, __m128d __b)
1159 return __builtin_ia32_ucomisdeq((__v2df)__a, (__v2df)__b);
1162 /// Compares the lower double-precision floating-point values in each of
1163 /// the two 128-bit floating-point vectors of [2 x double] to determine if
1164 /// the value in the first parameter is less than the corresponding value in
1165 /// the second parameter.
1167 /// The comparison yields 0 for false, 1 for true. If either of the two lower
1168 /// double-precision values is NaN, 0 is returned.
1170 /// \headerfile <x86intrin.h>
1172 /// This intrinsic corresponds to the <c> VUCOMISD / UCOMISD </c> instruction.
1175 /// A 128-bit vector of [2 x double]. The lower double-precision value is
1176 /// compared to the lower double-precision value of \a __b.
1178 /// A 128-bit vector of [2 x double]. The lower double-precision value is
1179 /// compared to the lower double-precision value of \a __a.
1180 /// \returns An integer containing the comparison results. If either of the two
1181 /// lower double-precision values is NaN, 0 is returned.
1182 static __inline__ int __DEFAULT_FN_ATTRS
1183 _mm_ucomilt_sd(__m128d __a, __m128d __b)
1185 return __builtin_ia32_ucomisdlt((__v2df)__a, (__v2df)__b);
1188 /// Compares the lower double-precision floating-point values in each of
1189 /// the two 128-bit floating-point vectors of [2 x double] to determine if
1190 /// the value in the first parameter is less than or equal to the
1191 /// corresponding value in the second parameter.
1193 /// The comparison yields 0 for false, 1 for true. If either of the two lower
1194 /// double-precision values is NaN, 0 is returned.
1196 /// \headerfile <x86intrin.h>
1198 /// This intrinsic corresponds to the <c> VUCOMISD / UCOMISD </c> instruction.
1201 /// A 128-bit vector of [2 x double]. The lower double-precision value is
1202 /// compared to the lower double-precision value of \a __b.
1204 /// A 128-bit vector of [2 x double]. The lower double-precision value is
1205 /// compared to the lower double-precision value of \a __a.
1206 /// \returns An integer containing the comparison results. If either of the two
1207 /// lower double-precision values is NaN, 0 is returned.
1208 static __inline__ int __DEFAULT_FN_ATTRS
1209 _mm_ucomile_sd(__m128d __a, __m128d __b)
1211 return __builtin_ia32_ucomisdle((__v2df)__a, (__v2df)__b);
1214 /// Compares the lower double-precision floating-point values in each of
1215 /// the two 128-bit floating-point vectors of [2 x double] to determine if
1216 /// the value in the first parameter is greater than the corresponding value
1217 /// in the second parameter.
1219 /// The comparison yields 0 for false, 1 for true. If either of the two lower
1220 /// double-precision values is NaN, 0 is returned.
1222 /// \headerfile <x86intrin.h>
1224 /// This intrinsic corresponds to the <c> VUCOMISD / UCOMISD </c> instruction.
1227 /// A 128-bit vector of [2 x double]. The lower double-precision value is
1228 /// compared to the lower double-precision value of \a __b.
1230 /// A 128-bit vector of [2 x double]. The lower double-precision value is
1231 /// compared to the lower double-precision value of \a __a.
1232 /// \returns An integer containing the comparison results. If either of the two
1233 /// lower double-precision values is NaN, 0 is returned.
1234 static __inline__ int __DEFAULT_FN_ATTRS
1235 _mm_ucomigt_sd(__m128d __a, __m128d __b)
1237 return __builtin_ia32_ucomisdgt((__v2df)__a, (__v2df)__b);
1240 /// Compares the lower double-precision floating-point values in each of
1241 /// the two 128-bit floating-point vectors of [2 x double] to determine if
1242 /// the value in the first parameter is greater than or equal to the
1243 /// corresponding value in the second parameter.
1245 /// The comparison yields 0 for false, 1 for true. If either of the two
1246 /// lower double-precision values is NaN, 0 is returned.
1248 /// \headerfile <x86intrin.h>
1250 /// This intrinsic corresponds to the <c> VUCOMISD / UCOMISD </c> instruction.
1253 /// A 128-bit vector of [2 x double]. The lower double-precision value is
1254 /// compared to the lower double-precision value of \a __b.
1256 /// A 128-bit vector of [2 x double]. The lower double-precision value is
1257 /// compared to the lower double-precision value of \a __a.
1258 /// \returns An integer containing the comparison results. If either of the two
1259 /// lower double-precision values is NaN, 0 is returned.
1260 static __inline__ int __DEFAULT_FN_ATTRS
1261 _mm_ucomige_sd(__m128d __a, __m128d __b)
1263 return __builtin_ia32_ucomisdge((__v2df)__a, (__v2df)__b);
1266 /// Compares the lower double-precision floating-point values in each of
1267 /// the two 128-bit floating-point vectors of [2 x double] to determine if
1268 /// the value in the first parameter is unequal to the corresponding value in
1269 /// the second parameter.
1271 /// The comparison yields 0 for false, 1 for true. If either of the two lower
1272 /// double-precision values is NaN, 1 is returned.
1274 /// \headerfile <x86intrin.h>
1276 /// This intrinsic corresponds to the <c> VUCOMISD / UCOMISD </c> instruction.
1279 /// A 128-bit vector of [2 x double]. The lower double-precision value is
1280 /// compared to the lower double-precision value of \a __b.
1282 /// A 128-bit vector of [2 x double]. The lower double-precision value is
1283 /// compared to the lower double-precision value of \a __a.
1284 /// \returns An integer containing the comparison result. If either of the two
1285 /// lower double-precision values is NaN, 1 is returned.
1286 static __inline__ int __DEFAULT_FN_ATTRS
1287 _mm_ucomineq_sd(__m128d __a, __m128d __b)
1289 return __builtin_ia32_ucomisdneq((__v2df)__a, (__v2df)__b);
1292 /// Converts the two double-precision floating-point elements of a
1293 /// 128-bit vector of [2 x double] into two single-precision floating-point
1294 /// values, returned in the lower 64 bits of a 128-bit vector of [4 x float].
1295 /// The upper 64 bits of the result vector are set to zero.
1297 /// \headerfile <x86intrin.h>
1299 /// This intrinsic corresponds to the <c> VCVTPD2PS / CVTPD2PS </c> instruction.
1302 /// A 128-bit vector of [2 x double].
1303 /// \returns A 128-bit vector of [4 x float] whose lower 64 bits contain the
1304 /// converted values. The upper 64 bits are set to zero.
1305 static __inline__ __m128 __DEFAULT_FN_ATTRS
1306 _mm_cvtpd_ps(__m128d __a)
1308 return __builtin_ia32_cvtpd2ps((__v2df)__a);
1311 /// Converts the lower two single-precision floating-point elements of a
1312 /// 128-bit vector of [4 x float] into two double-precision floating-point
1313 /// values, returned in a 128-bit vector of [2 x double]. The upper two
1314 /// elements of the input vector are unused.
1316 /// \headerfile <x86intrin.h>
1318 /// This intrinsic corresponds to the <c> VCVTPS2PD / CVTPS2PD </c> instruction.
1321 /// A 128-bit vector of [4 x float]. The lower two single-precision
1322 /// floating-point elements are converted to double-precision values. The
1323 /// upper two elements are unused.
1324 /// \returns A 128-bit vector of [2 x double] containing the converted values.
1325 static __inline__ __m128d __DEFAULT_FN_ATTRS
1326 _mm_cvtps_pd(__m128 __a)
1328 return (__m128d) __builtin_convertvector(
1329 __builtin_shufflevector((__v4sf)__a, (__v4sf)__a, 0, 1), __v2df);
1332 /// Converts the lower two integer elements of a 128-bit vector of
1333 /// [4 x i32] into two double-precision floating-point values, returned in a
1334 /// 128-bit vector of [2 x double].
1336 /// The upper two elements of the input vector are unused.
1338 /// \headerfile <x86intrin.h>
1340 /// This intrinsic corresponds to the <c> VCVTDQ2PD / CVTDQ2PD </c> instruction.
1343 /// A 128-bit integer vector of [4 x i32]. The lower two integer elements are
1344 /// converted to double-precision values.
1346 /// The upper two elements are unused.
1347 /// \returns A 128-bit vector of [2 x double] containing the converted values.
1348 static __inline__ __m128d __DEFAULT_FN_ATTRS
1349 _mm_cvtepi32_pd(__m128i __a)
1351 return (__m128d) __builtin_convertvector(
1352 __builtin_shufflevector((__v4si)__a, (__v4si)__a, 0, 1), __v2df);
1355 /// Converts the two double-precision floating-point elements of a
1356 /// 128-bit vector of [2 x double] into two signed 32-bit integer values,
1357 /// returned in the lower 64 bits of a 128-bit vector of [4 x i32]. The upper
1358 /// 64 bits of the result vector are set to zero.
1360 /// \headerfile <x86intrin.h>
1362 /// This intrinsic corresponds to the <c> VCVTPD2DQ / CVTPD2DQ </c> instruction.
1365 /// A 128-bit vector of [2 x double].
1366 /// \returns A 128-bit vector of [4 x i32] whose lower 64 bits contain the
1367 /// converted values. The upper 64 bits are set to zero.
1368 static __inline__ __m128i __DEFAULT_FN_ATTRS
1369 _mm_cvtpd_epi32(__m128d __a)
1371 return __builtin_ia32_cvtpd2dq((__v2df)__a);
1374 /// Converts the low-order element of a 128-bit vector of [2 x double]
1375 /// into a 32-bit signed integer value.
1377 /// \headerfile <x86intrin.h>
1379 /// This intrinsic corresponds to the <c> VCVTSD2SI / CVTSD2SI </c> instruction.
1382 /// A 128-bit vector of [2 x double]. The lower 64 bits are used in the
1384 /// \returns A 32-bit signed integer containing the converted value.
1385 static __inline__ int __DEFAULT_FN_ATTRS
1386 _mm_cvtsd_si32(__m128d __a)
1388 return __builtin_ia32_cvtsd2si((__v2df)__a);
1391 /// Converts the lower double-precision floating-point element of a
1392 /// 128-bit vector of [2 x double], in the second parameter, into a
1393 /// single-precision floating-point value, returned in the lower 32 bits of a
1394 /// 128-bit vector of [4 x float]. The upper 96 bits of the result vector are
1395 /// copied from the upper 96 bits of the first parameter.
1397 /// \headerfile <x86intrin.h>
1399 /// This intrinsic corresponds to the <c> VCVTSD2SS / CVTSD2SS </c> instruction.
1402 /// A 128-bit vector of [4 x float]. The upper 96 bits of this parameter are
1403 /// copied to the upper 96 bits of the result.
1405 /// A 128-bit vector of [2 x double]. The lower double-precision
1406 /// floating-point element is used in the conversion.
1407 /// \returns A 128-bit vector of [4 x float]. The lower 32 bits contain the
1408 /// converted value from the second parameter. The upper 96 bits are copied
1409 /// from the upper 96 bits of the first parameter.
1410 static __inline__ __m128 __DEFAULT_FN_ATTRS
1411 _mm_cvtsd_ss(__m128 __a, __m128d __b)
1413 return (__m128)__builtin_ia32_cvtsd2ss((__v4sf)__a, (__v2df)__b);
1416 /// Converts a 32-bit signed integer value, in the second parameter, into
1417 /// a double-precision floating-point value, returned in the lower 64 bits of
1418 /// a 128-bit vector of [2 x double]. The upper 64 bits of the result vector
1419 /// are copied from the upper 64 bits of the first parameter.
1421 /// \headerfile <x86intrin.h>
1423 /// This intrinsic corresponds to the <c> VCVTSI2SD / CVTSI2SD </c> instruction.
1426 /// A 128-bit vector of [2 x double]. The upper 64 bits of this parameter are
1427 /// copied to the upper 64 bits of the result.
1429 /// A 32-bit signed integer containing the value to be converted.
1430 /// \returns A 128-bit vector of [2 x double]. The lower 64 bits contain the
1431 /// converted value from the second parameter. The upper 64 bits are copied
1432 /// from the upper 64 bits of the first parameter.
1433 static __inline__ __m128d __DEFAULT_FN_ATTRS
1434 _mm_cvtsi32_sd(__m128d __a, int __b)
1440 /// Converts the lower single-precision floating-point element of a
1441 /// 128-bit vector of [4 x float], in the second parameter, into a
1442 /// double-precision floating-point value, returned in the lower 64 bits of
1443 /// a 128-bit vector of [2 x double]. The upper 64 bits of the result vector
1444 /// are copied from the upper 64 bits of the first parameter.
1446 /// \headerfile <x86intrin.h>
1448 /// This intrinsic corresponds to the <c> VCVTSS2SD / CVTSS2SD </c> instruction.
1451 /// A 128-bit vector of [2 x double]. The upper 64 bits of this parameter are
1452 /// copied to the upper 64 bits of the result.
1454 /// A 128-bit vector of [4 x float]. The lower single-precision
1455 /// floating-point element is used in the conversion.
1456 /// \returns A 128-bit vector of [2 x double]. The lower 64 bits contain the
1457 /// converted value from the second parameter. The upper 64 bits are copied
1458 /// from the upper 64 bits of the first parameter.
1459 static __inline__ __m128d __DEFAULT_FN_ATTRS
1460 _mm_cvtss_sd(__m128d __a, __m128 __b)
1466 /// Converts the two double-precision floating-point elements of a
1467 /// 128-bit vector of [2 x double] into two signed 32-bit integer values,
1468 /// returned in the lower 64 bits of a 128-bit vector of [4 x i32].
1470 /// If the result of either conversion is inexact, the result is truncated
1471 /// (rounded towards zero) regardless of the current MXCSR setting. The upper
1472 /// 64 bits of the result vector are set to zero.
1474 /// \headerfile <x86intrin.h>
1476 /// This intrinsic corresponds to the <c> VCVTTPD2DQ / CVTTPD2DQ </c>
1480 /// A 128-bit vector of [2 x double].
1481 /// \returns A 128-bit vector of [4 x i32] whose lower 64 bits contain the
1482 /// converted values. The upper 64 bits are set to zero.
1483 static __inline__ __m128i __DEFAULT_FN_ATTRS
1484 _mm_cvttpd_epi32(__m128d __a)
1486 return (__m128i)__builtin_ia32_cvttpd2dq((__v2df)__a);
1489 /// Converts the low-order element of a [2 x double] vector into a 32-bit
1490 /// signed integer value, truncating the result when it is inexact.
1492 /// \headerfile <x86intrin.h>
1494 /// This intrinsic corresponds to the <c> VCVTTSD2SI / CVTTSD2SI </c>
1498 /// A 128-bit vector of [2 x double]. The lower 64 bits are used in the
1500 /// \returns A 32-bit signed integer containing the converted value.
1501 static __inline__ int __DEFAULT_FN_ATTRS
1502 _mm_cvttsd_si32(__m128d __a)
1504 return __builtin_ia32_cvttsd2si((__v2df)__a);
1507 /// Converts the two double-precision floating-point elements of a
1508 /// 128-bit vector of [2 x double] into two signed 32-bit integer values,
1509 /// returned in a 64-bit vector of [2 x i32].
1511 /// \headerfile <x86intrin.h>
1513 /// This intrinsic corresponds to the <c> CVTPD2PI </c> instruction.
1516 /// A 128-bit vector of [2 x double].
1517 /// \returns A 64-bit vector of [2 x i32] containing the converted values.
1518 static __inline__ __m64 __DEFAULT_FN_ATTRS_MMX
1519 _mm_cvtpd_pi32(__m128d __a)
1521 return (__m64)__builtin_ia32_cvtpd2pi((__v2df)__a);
1524 /// Converts the two double-precision floating-point elements of a
1525 /// 128-bit vector of [2 x double] into two signed 32-bit integer values,
1526 /// returned in a 64-bit vector of [2 x i32].
1528 /// If the result of either conversion is inexact, the result is truncated
1529 /// (rounded towards zero) regardless of the current MXCSR setting.
1531 /// \headerfile <x86intrin.h>
1533 /// This intrinsic corresponds to the <c> CVTTPD2PI </c> instruction.
1536 /// A 128-bit vector of [2 x double].
1537 /// \returns A 64-bit vector of [2 x i32] containing the converted values.
1538 static __inline__ __m64 __DEFAULT_FN_ATTRS_MMX
1539 _mm_cvttpd_pi32(__m128d __a)
1541 return (__m64)__builtin_ia32_cvttpd2pi((__v2df)__a);
1544 /// Converts the two signed 32-bit integer elements of a 64-bit vector of
1545 /// [2 x i32] into two double-precision floating-point values, returned in a
1546 /// 128-bit vector of [2 x double].
1548 /// \headerfile <x86intrin.h>
1550 /// This intrinsic corresponds to the <c> CVTPI2PD </c> instruction.
1553 /// A 64-bit vector of [2 x i32].
1554 /// \returns A 128-bit vector of [2 x double] containing the converted values.
1555 static __inline__ __m128d __DEFAULT_FN_ATTRS_MMX
1556 _mm_cvtpi32_pd(__m64 __a)
1558 return __builtin_ia32_cvtpi2pd((__v2si)__a);
1561 /// Returns the low-order element of a 128-bit vector of [2 x double] as
1562 /// a double-precision floating-point value.
1564 /// \headerfile <x86intrin.h>
1566 /// This intrinsic has no corresponding instruction.
1569 /// A 128-bit vector of [2 x double]. The lower 64 bits are returned.
1570 /// \returns A double-precision floating-point value copied from the lower 64
1572 static __inline__ double __DEFAULT_FN_ATTRS
1573 _mm_cvtsd_f64(__m128d __a)
1578 /// Loads a 128-bit floating-point vector of [2 x double] from an aligned
1579 /// memory location.
1581 /// \headerfile <x86intrin.h>
1583 /// This intrinsic corresponds to the <c> VMOVAPD / MOVAPD </c> instruction.
1586 /// A pointer to a 128-bit memory location. The address of the memory
1587 /// location has to be 16-byte aligned.
1588 /// \returns A 128-bit vector of [2 x double] containing the loaded values.
1589 static __inline__ __m128d __DEFAULT_FN_ATTRS
1590 _mm_load_pd(double const *__dp)
1592 return *(__m128d*)__dp;
1595 /// Loads a double-precision floating-point value from a specified memory
1596 /// location and duplicates it to both vector elements of a 128-bit vector of
1599 /// \headerfile <x86intrin.h>
1601 /// This intrinsic corresponds to the <c> VMOVDDUP / MOVDDUP </c> instruction.
1604 /// A pointer to a memory location containing a double-precision value.
1605 /// \returns A 128-bit vector of [2 x double] containing the loaded and
1606 /// duplicated values.
1607 static __inline__ __m128d __DEFAULT_FN_ATTRS
1608 _mm_load1_pd(double const *__dp)
1610 struct __mm_load1_pd_struct {
1612 } __attribute__((__packed__, __may_alias__));
1613 double __u = ((struct __mm_load1_pd_struct*)__dp)->__u;
1614 return __extension__ (__m128d){ __u, __u };
1617 #define _mm_load_pd1(dp) _mm_load1_pd(dp)
1619 /// Loads two double-precision values, in reverse order, from an aligned
1620 /// memory location into a 128-bit vector of [2 x double].
1622 /// \headerfile <x86intrin.h>
1624 /// This intrinsic corresponds to the <c> VMOVAPD / MOVAPD </c> instruction +
1625 /// needed shuffling instructions. In AVX mode, the shuffling may be combined
1626 /// with the \c VMOVAPD, resulting in only a \c VPERMILPD instruction.
1629 /// A 16-byte aligned pointer to an array of double-precision values to be
1630 /// loaded in reverse order.
1631 /// \returns A 128-bit vector of [2 x double] containing the reversed loaded
1633 static __inline__ __m128d __DEFAULT_FN_ATTRS
1634 _mm_loadr_pd(double const *__dp)
1636 __m128d __u = *(__m128d*)__dp;
1637 return __builtin_shufflevector((__v2df)__u, (__v2df)__u, 1, 0);
1640 /// Loads a 128-bit floating-point vector of [2 x double] from an
1641 /// unaligned memory location.
1643 /// \headerfile <x86intrin.h>
1645 /// This intrinsic corresponds to the <c> VMOVUPD / MOVUPD </c> instruction.
1648 /// A pointer to a 128-bit memory location. The address of the memory
1649 /// location does not have to be aligned.
1650 /// \returns A 128-bit vector of [2 x double] containing the loaded values.
1651 static __inline__ __m128d __DEFAULT_FN_ATTRS
1652 _mm_loadu_pd(double const *__dp)
1656 } __attribute__((__packed__, __may_alias__));
1657 return ((struct __loadu_pd*)__dp)->__v;
1660 /// Loads a 64-bit integer value to the low element of a 128-bit integer
1661 /// vector and clears the upper element.
1663 /// \headerfile <x86intrin.h>
1665 /// This intrinsic corresponds to the <c> VMOVQ / MOVQ </c> instruction.
1668 /// A pointer to a 64-bit memory location. The address of the memory
1669 /// location does not have to be aligned.
1670 /// \returns A 128-bit vector of [2 x i64] containing the loaded value.
1671 static __inline__ __m128i __DEFAULT_FN_ATTRS
1672 _mm_loadu_si64(void const *__a)
1674 struct __loadu_si64 {
1676 } __attribute__((__packed__, __may_alias__));
1677 long long __u = ((struct __loadu_si64*)__a)->__v;
1678 return __extension__ (__m128i)(__v2di){__u, 0LL};
1681 /// Loads a 32-bit integer value to the low element of a 128-bit integer
1682 /// vector and clears the upper element.
1684 /// \headerfile <x86intrin.h>
1686 /// This intrinsic corresponds to the <c> VMOVD / MOVD </c> instruction.
1689 /// A pointer to a 32-bit memory location. The address of the memory
1690 /// location does not have to be aligned.
1691 /// \returns A 128-bit vector of [4 x i32] containing the loaded value.
1692 static __inline__ __m128i __DEFAULT_FN_ATTRS
1693 _mm_loadu_si32(void const *__a)
1695 struct __loadu_si32 {
1697 } __attribute__((__packed__, __may_alias__));
1698 int __u = ((struct __loadu_si32*)__a)->__v;
1699 return __extension__ (__m128i)(__v4si){__u, 0, 0, 0};
1702 /// Loads a 16-bit integer value to the low element of a 128-bit integer
1703 /// vector and clears the upper element.
1705 /// \headerfile <x86intrin.h>
1707 /// This intrinsic does not correspond to a specific instruction.
1710 /// A pointer to a 16-bit memory location. The address of the memory
1711 /// location does not have to be aligned.
1712 /// \returns A 128-bit vector of [8 x i16] containing the loaded value.
1713 static __inline__ __m128i __DEFAULT_FN_ATTRS
1714 _mm_loadu_si16(void const *__a)
1716 struct __loadu_si16 {
1718 } __attribute__((__packed__, __may_alias__));
1719 short __u = ((struct __loadu_si16*)__a)->__v;
1720 return __extension__ (__m128i)(__v8hi){__u, 0, 0, 0, 0, 0, 0, 0};
1723 /// Loads a 64-bit double-precision value to the low element of a
1724 /// 128-bit integer vector and clears the upper element.
1726 /// \headerfile <x86intrin.h>
1728 /// This intrinsic corresponds to the <c> VMOVSD / MOVSD </c> instruction.
1731 /// A pointer to a memory location containing a double-precision value.
1732 /// The address of the memory location does not have to be aligned.
1733 /// \returns A 128-bit vector of [2 x double] containing the loaded value.
1734 static __inline__ __m128d __DEFAULT_FN_ATTRS
1735 _mm_load_sd(double const *__dp)
1737 struct __mm_load_sd_struct {
1739 } __attribute__((__packed__, __may_alias__));
1740 double __u = ((struct __mm_load_sd_struct*)__dp)->__u;
1741 return __extension__ (__m128d){ __u, 0 };
1744 /// Loads a double-precision value into the high-order bits of a 128-bit
1745 /// vector of [2 x double]. The low-order bits are copied from the low-order
1746 /// bits of the first operand.
1748 /// \headerfile <x86intrin.h>
1750 /// This intrinsic corresponds to the <c> VMOVHPD / MOVHPD </c> instruction.
1753 /// A 128-bit vector of [2 x double]. \n
1754 /// Bits [63:0] are written to bits [63:0] of the result.
1756 /// A pointer to a 64-bit memory location containing a double-precision
1757 /// floating-point value that is loaded. The loaded value is written to bits
1758 /// [127:64] of the result. The address of the memory location does not have
1760 /// \returns A 128-bit vector of [2 x double] containing the moved values.
1761 static __inline__ __m128d __DEFAULT_FN_ATTRS
1762 _mm_loadh_pd(__m128d __a, double const *__dp)
1764 struct __mm_loadh_pd_struct {
1766 } __attribute__((__packed__, __may_alias__));
1767 double __u = ((struct __mm_loadh_pd_struct*)__dp)->__u;
1768 return __extension__ (__m128d){ __a[0], __u };
1771 /// Loads a double-precision value into the low-order bits of a 128-bit
1772 /// vector of [2 x double]. The high-order bits are copied from the
1773 /// high-order bits of the first operand.
1775 /// \headerfile <x86intrin.h>
1777 /// This intrinsic corresponds to the <c> VMOVLPD / MOVLPD </c> instruction.
1780 /// A 128-bit vector of [2 x double]. \n
1781 /// Bits [127:64] are written to bits [127:64] of the result.
1783 /// A pointer to a 64-bit memory location containing a double-precision
1784 /// floating-point value that is loaded. The loaded value is written to bits
1785 /// [63:0] of the result. The address of the memory location does not have to
1787 /// \returns A 128-bit vector of [2 x double] containing the moved values.
1788 static __inline__ __m128d __DEFAULT_FN_ATTRS
1789 _mm_loadl_pd(__m128d __a, double const *__dp)
1791 struct __mm_loadl_pd_struct {
1793 } __attribute__((__packed__, __may_alias__));
1794 double __u = ((struct __mm_loadl_pd_struct*)__dp)->__u;
1795 return __extension__ (__m128d){ __u, __a[1] };
1798 /// Constructs a 128-bit floating-point vector of [2 x double] with
1799 /// unspecified content. This could be used as an argument to another
1800 /// intrinsic function where the argument is required but the value is not
1803 /// \headerfile <x86intrin.h>
1805 /// This intrinsic has no corresponding instruction.
1807 /// \returns A 128-bit floating-point vector of [2 x double] with unspecified
1809 static __inline__ __m128d __DEFAULT_FN_ATTRS
1810 _mm_undefined_pd(void)
1812 return (__m128d)__builtin_ia32_undef128();
1815 /// Constructs a 128-bit floating-point vector of [2 x double]. The lower
1816 /// 64 bits of the vector are initialized with the specified double-precision
1817 /// floating-point value. The upper 64 bits are set to zero.
1819 /// \headerfile <x86intrin.h>
1821 /// This intrinsic corresponds to the <c> VMOVQ / MOVQ </c> instruction.
1824 /// A double-precision floating-point value used to initialize the lower 64
1825 /// bits of the result.
1826 /// \returns An initialized 128-bit floating-point vector of [2 x double]. The
1827 /// lower 64 bits contain the value of the parameter. The upper 64 bits are
1829 static __inline__ __m128d __DEFAULT_FN_ATTRS
1830 _mm_set_sd(double __w)
1832 return __extension__ (__m128d){ __w, 0 };
1835 /// Constructs a 128-bit floating-point vector of [2 x double], with each
1836 /// of the two double-precision floating-point vector elements set to the
1837 /// specified double-precision floating-point value.
1839 /// \headerfile <x86intrin.h>
1841 /// This intrinsic corresponds to the <c> VMOVDDUP / MOVLHPS </c> instruction.
1844 /// A double-precision floating-point value used to initialize each vector
1845 /// element of the result.
1846 /// \returns An initialized 128-bit floating-point vector of [2 x double].
1847 static __inline__ __m128d __DEFAULT_FN_ATTRS
1848 _mm_set1_pd(double __w)
1850 return __extension__ (__m128d){ __w, __w };
1853 /// Constructs a 128-bit floating-point vector of [2 x double], with each
1854 /// of the two double-precision floating-point vector elements set to the
1855 /// specified double-precision floating-point value.
1857 /// \headerfile <x86intrin.h>
1859 /// This intrinsic corresponds to the <c> VMOVDDUP / MOVLHPS </c> instruction.
1862 /// A double-precision floating-point value used to initialize each vector
1863 /// element of the result.
1864 /// \returns An initialized 128-bit floating-point vector of [2 x double].
1865 static __inline__ __m128d __DEFAULT_FN_ATTRS
1866 _mm_set_pd1(double __w)
1868 return _mm_set1_pd(__w);
1871 /// Constructs a 128-bit floating-point vector of [2 x double]
1872 /// initialized with the specified double-precision floating-point values.
1874 /// \headerfile <x86intrin.h>
1876 /// This intrinsic corresponds to the <c> VUNPCKLPD / UNPCKLPD </c> instruction.
1879 /// A double-precision floating-point value used to initialize the upper 64
1880 /// bits of the result.
1882 /// A double-precision floating-point value used to initialize the lower 64
1883 /// bits of the result.
1884 /// \returns An initialized 128-bit floating-point vector of [2 x double].
1885 static __inline__ __m128d __DEFAULT_FN_ATTRS
1886 _mm_set_pd(double __w, double __x)
1888 return __extension__ (__m128d){ __x, __w };
1891 /// Constructs a 128-bit floating-point vector of [2 x double],
1892 /// initialized in reverse order with the specified double-precision
1893 /// floating-point values.
1895 /// \headerfile <x86intrin.h>
1897 /// This intrinsic corresponds to the <c> VUNPCKLPD / UNPCKLPD </c> instruction.
1900 /// A double-precision floating-point value used to initialize the lower 64
1901 /// bits of the result.
1903 /// A double-precision floating-point value used to initialize the upper 64
1904 /// bits of the result.
1905 /// \returns An initialized 128-bit floating-point vector of [2 x double].
1906 static __inline__ __m128d __DEFAULT_FN_ATTRS
1907 _mm_setr_pd(double __w, double __x)
1909 return __extension__ (__m128d){ __w, __x };
1912 /// Constructs a 128-bit floating-point vector of [2 x double]
1913 /// initialized to zero.
1915 /// \headerfile <x86intrin.h>
1917 /// This intrinsic corresponds to the <c> VXORPS / XORPS </c> instruction.
1919 /// \returns An initialized 128-bit floating-point vector of [2 x double] with
1920 /// all elements set to zero.
1921 static __inline__ __m128d __DEFAULT_FN_ATTRS
1922 _mm_setzero_pd(void)
1924 return __extension__ (__m128d){ 0, 0 };
1927 /// Constructs a 128-bit floating-point vector of [2 x double]. The lower
1928 /// 64 bits are set to the lower 64 bits of the second parameter. The upper
1929 /// 64 bits are set to the upper 64 bits of the first parameter.
1931 /// \headerfile <x86intrin.h>
1933 /// This intrinsic corresponds to the <c> VBLENDPD / BLENDPD </c> instruction.
1936 /// A 128-bit vector of [2 x double]. The upper 64 bits are written to the
1937 /// upper 64 bits of the result.
1939 /// A 128-bit vector of [2 x double]. The lower 64 bits are written to the
1940 /// lower 64 bits of the result.
1941 /// \returns A 128-bit vector of [2 x double] containing the moved values.
1942 static __inline__ __m128d __DEFAULT_FN_ATTRS
1943 _mm_move_sd(__m128d __a, __m128d __b)
1949 /// Stores the lower 64 bits of a 128-bit vector of [2 x double] to a
1950 /// memory location.
1952 /// \headerfile <x86intrin.h>
1954 /// This intrinsic corresponds to the <c> VMOVSD / MOVSD </c> instruction.
1957 /// A pointer to a 64-bit memory location.
1959 /// A 128-bit vector of [2 x double] containing the value to be stored.
1960 static __inline__ void __DEFAULT_FN_ATTRS
1961 _mm_store_sd(double *__dp, __m128d __a)
1963 struct __mm_store_sd_struct {
1965 } __attribute__((__packed__, __may_alias__));
1966 ((struct __mm_store_sd_struct*)__dp)->__u = __a[0];
1969 /// Moves packed double-precision values from a 128-bit vector of
1970 /// [2 x double] to a memory location.
1972 /// \headerfile <x86intrin.h>
1974 /// This intrinsic corresponds to the <c>VMOVAPD / MOVAPS</c> instruction.
1977 /// A pointer to an aligned memory location that can store two
1978 /// double-precision values.
1980 /// A packed 128-bit vector of [2 x double] containing the values to be
1982 static __inline__ void __DEFAULT_FN_ATTRS
1983 _mm_store_pd(double *__dp, __m128d __a)
1985 *(__m128d*)__dp = __a;
1988 /// Moves the lower 64 bits of a 128-bit vector of [2 x double] twice to
1989 /// the upper and lower 64 bits of a memory location.
1991 /// \headerfile <x86intrin.h>
1993 /// This intrinsic corresponds to the
1994 /// <c> VMOVDDUP + VMOVAPD / MOVLHPS + MOVAPS </c> instruction.
1997 /// A pointer to a memory location that can store two double-precision
2000 /// A 128-bit vector of [2 x double] whose lower 64 bits are copied to each
2001 /// of the values in \a __dp.
2002 static __inline__ void __DEFAULT_FN_ATTRS
2003 _mm_store1_pd(double *__dp, __m128d __a)
2005 __a = __builtin_shufflevector((__v2df)__a, (__v2df)__a, 0, 0);
2006 _mm_store_pd(__dp, __a);
2009 /// Moves the lower 64 bits of a 128-bit vector of [2 x double] twice to
2010 /// the upper and lower 64 bits of a memory location.
2012 /// \headerfile <x86intrin.h>
2014 /// This intrinsic corresponds to the
2015 /// <c> VMOVDDUP + VMOVAPD / MOVLHPS + MOVAPS </c> instruction.
2018 /// A pointer to a memory location that can store two double-precision
2021 /// A 128-bit vector of [2 x double] whose lower 64 bits are copied to each
2022 /// of the values in \a __dp.
2023 static __inline__ void __DEFAULT_FN_ATTRS
2024 _mm_store_pd1(double *__dp, __m128d __a)
2026 _mm_store1_pd(__dp, __a);
2029 /// Stores a 128-bit vector of [2 x double] into an unaligned memory
2032 /// \headerfile <x86intrin.h>
2034 /// This intrinsic corresponds to the <c> VMOVUPD / MOVUPD </c> instruction.
2037 /// A pointer to a 128-bit memory location. The address of the memory
2038 /// location does not have to be aligned.
2040 /// A 128-bit vector of [2 x double] containing the values to be stored.
2041 static __inline__ void __DEFAULT_FN_ATTRS
2042 _mm_storeu_pd(double *__dp, __m128d __a)
2044 struct __storeu_pd {
2046 } __attribute__((__packed__, __may_alias__));
2047 ((struct __storeu_pd*)__dp)->__v = __a;
2050 /// Stores two double-precision values, in reverse order, from a 128-bit
2051 /// vector of [2 x double] to a 16-byte aligned memory location.
2053 /// \headerfile <x86intrin.h>
2055 /// This intrinsic corresponds to a shuffling instruction followed by a
2056 /// <c> VMOVAPD / MOVAPD </c> instruction.
2059 /// A pointer to a 16-byte aligned memory location that can store two
2060 /// double-precision values.
2062 /// A 128-bit vector of [2 x double] containing the values to be reversed and
2064 static __inline__ void __DEFAULT_FN_ATTRS
2065 _mm_storer_pd(double *__dp, __m128d __a)
2067 __a = __builtin_shufflevector((__v2df)__a, (__v2df)__a, 1, 0);
2068 *(__m128d *)__dp = __a;
2071 /// Stores the upper 64 bits of a 128-bit vector of [2 x double] to a
2072 /// memory location.
2074 /// \headerfile <x86intrin.h>
2076 /// This intrinsic corresponds to the <c> VMOVHPD / MOVHPD </c> instruction.
2079 /// A pointer to a 64-bit memory location.
2081 /// A 128-bit vector of [2 x double] containing the value to be stored.
2082 static __inline__ void __DEFAULT_FN_ATTRS
2083 _mm_storeh_pd(double *__dp, __m128d __a)
2085 struct __mm_storeh_pd_struct {
2087 } __attribute__((__packed__, __may_alias__));
2088 ((struct __mm_storeh_pd_struct*)__dp)->__u = __a[1];
2091 /// Stores the lower 64 bits of a 128-bit vector of [2 x double] to a
2092 /// memory location.
2094 /// \headerfile <x86intrin.h>
2096 /// This intrinsic corresponds to the <c> VMOVLPD / MOVLPD </c> instruction.
2099 /// A pointer to a 64-bit memory location.
2101 /// A 128-bit vector of [2 x double] containing the value to be stored.
2102 static __inline__ void __DEFAULT_FN_ATTRS
2103 _mm_storel_pd(double *__dp, __m128d __a)
2105 struct __mm_storeh_pd_struct {
2107 } __attribute__((__packed__, __may_alias__));
2108 ((struct __mm_storeh_pd_struct*)__dp)->__u = __a[0];
2111 /// Adds the corresponding elements of two 128-bit vectors of [16 x i8],
2112 /// saving the lower 8 bits of each sum in the corresponding element of a
2113 /// 128-bit result vector of [16 x i8].
2115 /// The integer elements of both parameters can be either signed or unsigned.
2117 /// \headerfile <x86intrin.h>
2119 /// This intrinsic corresponds to the <c> VPADDB / PADDB </c> instruction.
2122 /// A 128-bit vector of [16 x i8].
2124 /// A 128-bit vector of [16 x i8].
2125 /// \returns A 128-bit vector of [16 x i8] containing the sums of both
2127 static __inline__ __m128i __DEFAULT_FN_ATTRS
2128 _mm_add_epi8(__m128i __a, __m128i __b)
2130 return (__m128i)((__v16qu)__a + (__v16qu)__b);
2133 /// Adds the corresponding elements of two 128-bit vectors of [8 x i16],
2134 /// saving the lower 16 bits of each sum in the corresponding element of a
2135 /// 128-bit result vector of [8 x i16].
2137 /// The integer elements of both parameters can be either signed or unsigned.
2139 /// \headerfile <x86intrin.h>
2141 /// This intrinsic corresponds to the <c> VPADDW / PADDW </c> instruction.
2144 /// A 128-bit vector of [8 x i16].
2146 /// A 128-bit vector of [8 x i16].
2147 /// \returns A 128-bit vector of [8 x i16] containing the sums of both
2149 static __inline__ __m128i __DEFAULT_FN_ATTRS
2150 _mm_add_epi16(__m128i __a, __m128i __b)
2152 return (__m128i)((__v8hu)__a + (__v8hu)__b);
2155 /// Adds the corresponding elements of two 128-bit vectors of [4 x i32],
2156 /// saving the lower 32 bits of each sum in the corresponding element of a
2157 /// 128-bit result vector of [4 x i32].
2159 /// The integer elements of both parameters can be either signed or unsigned.
2161 /// \headerfile <x86intrin.h>
2163 /// This intrinsic corresponds to the <c> VPADDD / PADDD </c> instruction.
2166 /// A 128-bit vector of [4 x i32].
2168 /// A 128-bit vector of [4 x i32].
2169 /// \returns A 128-bit vector of [4 x i32] containing the sums of both
2171 static __inline__ __m128i __DEFAULT_FN_ATTRS
2172 _mm_add_epi32(__m128i __a, __m128i __b)
2174 return (__m128i)((__v4su)__a + (__v4su)__b);
2177 /// Adds two signed or unsigned 64-bit integer values, returning the
2178 /// lower 64 bits of the sum.
2180 /// \headerfile <x86intrin.h>
2182 /// This intrinsic corresponds to the <c> PADDQ </c> instruction.
2185 /// A 64-bit integer.
2187 /// A 64-bit integer.
2188 /// \returns A 64-bit integer containing the sum of both parameters.
2189 static __inline__ __m64 __DEFAULT_FN_ATTRS_MMX
2190 _mm_add_si64(__m64 __a, __m64 __b)
2192 return (__m64)__builtin_ia32_paddq((__v1di)__a, (__v1di)__b);
2195 /// Adds the corresponding elements of two 128-bit vectors of [2 x i64],
2196 /// saving the lower 64 bits of each sum in the corresponding element of a
2197 /// 128-bit result vector of [2 x i64].
2199 /// The integer elements of both parameters can be either signed or unsigned.
2201 /// \headerfile <x86intrin.h>
2203 /// This intrinsic corresponds to the <c> VPADDQ / PADDQ </c> instruction.
2206 /// A 128-bit vector of [2 x i64].
2208 /// A 128-bit vector of [2 x i64].
2209 /// \returns A 128-bit vector of [2 x i64] containing the sums of both
2211 static __inline__ __m128i __DEFAULT_FN_ATTRS
2212 _mm_add_epi64(__m128i __a, __m128i __b)
2214 return (__m128i)((__v2du)__a + (__v2du)__b);
2217 /// Adds, with saturation, the corresponding elements of two 128-bit
2218 /// signed [16 x i8] vectors, saving each sum in the corresponding element of
2219 /// a 128-bit result vector of [16 x i8]. Positive sums greater than 0x7F are
2220 /// saturated to 0x7F. Negative sums less than 0x80 are saturated to 0x80.
2222 /// \headerfile <x86intrin.h>
2224 /// This intrinsic corresponds to the <c> VPADDSB / PADDSB </c> instruction.
2227 /// A 128-bit signed [16 x i8] vector.
2229 /// A 128-bit signed [16 x i8] vector.
2230 /// \returns A 128-bit signed [16 x i8] vector containing the saturated sums of
2231 /// both parameters.
2232 static __inline__ __m128i __DEFAULT_FN_ATTRS
2233 _mm_adds_epi8(__m128i __a, __m128i __b)
2235 return (__m128i)__builtin_ia32_paddsb128((__v16qi)__a, (__v16qi)__b);
2238 /// Adds, with saturation, the corresponding elements of two 128-bit
2239 /// signed [8 x i16] vectors, saving each sum in the corresponding element of
2240 /// a 128-bit result vector of [8 x i16]. Positive sums greater than 0x7FFF
2241 /// are saturated to 0x7FFF. Negative sums less than 0x8000 are saturated to
2244 /// \headerfile <x86intrin.h>
2246 /// This intrinsic corresponds to the <c> VPADDSW / PADDSW </c> instruction.
2249 /// A 128-bit signed [8 x i16] vector.
2251 /// A 128-bit signed [8 x i16] vector.
2252 /// \returns A 128-bit signed [8 x i16] vector containing the saturated sums of
2253 /// both parameters.
2254 static __inline__ __m128i __DEFAULT_FN_ATTRS
2255 _mm_adds_epi16(__m128i __a, __m128i __b)
2257 return (__m128i)__builtin_ia32_paddsw128((__v8hi)__a, (__v8hi)__b);
2260 /// Adds, with saturation, the corresponding elements of two 128-bit
2261 /// unsigned [16 x i8] vectors, saving each sum in the corresponding element
2262 /// of a 128-bit result vector of [16 x i8]. Positive sums greater than 0xFF
2263 /// are saturated to 0xFF. Negative sums are saturated to 0x00.
2265 /// \headerfile <x86intrin.h>
2267 /// This intrinsic corresponds to the <c> VPADDUSB / PADDUSB </c> instruction.
2270 /// A 128-bit unsigned [16 x i8] vector.
2272 /// A 128-bit unsigned [16 x i8] vector.
2273 /// \returns A 128-bit unsigned [16 x i8] vector containing the saturated sums
2274 /// of both parameters.
2275 static __inline__ __m128i __DEFAULT_FN_ATTRS
2276 _mm_adds_epu8(__m128i __a, __m128i __b)
2278 return (__m128i)__builtin_ia32_paddusb128((__v16qi)__a, (__v16qi)__b);
2281 /// Adds, with saturation, the corresponding elements of two 128-bit
2282 /// unsigned [8 x i16] vectors, saving each sum in the corresponding element
2283 /// of a 128-bit result vector of [8 x i16]. Positive sums greater than
2284 /// 0xFFFF are saturated to 0xFFFF. Negative sums are saturated to 0x0000.
2286 /// \headerfile <x86intrin.h>
2288 /// This intrinsic corresponds to the <c> VPADDUSB / PADDUSB </c> instruction.
2291 /// A 128-bit unsigned [8 x i16] vector.
2293 /// A 128-bit unsigned [8 x i16] vector.
2294 /// \returns A 128-bit unsigned [8 x i16] vector containing the saturated sums
2295 /// of both parameters.
2296 static __inline__ __m128i __DEFAULT_FN_ATTRS
2297 _mm_adds_epu16(__m128i __a, __m128i __b)
2299 return (__m128i)__builtin_ia32_paddusw128((__v8hi)__a, (__v8hi)__b);
2302 /// Computes the rounded avarages of corresponding elements of two
2303 /// 128-bit unsigned [16 x i8] vectors, saving each result in the
2304 /// corresponding element of a 128-bit result vector of [16 x i8].
2306 /// \headerfile <x86intrin.h>
2308 /// This intrinsic corresponds to the <c> VPAVGB / PAVGB </c> instruction.
2311 /// A 128-bit unsigned [16 x i8] vector.
2313 /// A 128-bit unsigned [16 x i8] vector.
2314 /// \returns A 128-bit unsigned [16 x i8] vector containing the rounded
2315 /// averages of both parameters.
2316 static __inline__ __m128i __DEFAULT_FN_ATTRS
2317 _mm_avg_epu8(__m128i __a, __m128i __b)
2319 typedef unsigned short __v16hu __attribute__ ((__vector_size__ (32)));
2320 return (__m128i)__builtin_convertvector(
2321 ((__builtin_convertvector((__v16qu)__a, __v16hu) +
2322 __builtin_convertvector((__v16qu)__b, __v16hu)) + 1)
2326 /// Computes the rounded avarages of corresponding elements of two
2327 /// 128-bit unsigned [8 x i16] vectors, saving each result in the
2328 /// corresponding element of a 128-bit result vector of [8 x i16].
2330 /// \headerfile <x86intrin.h>
2332 /// This intrinsic corresponds to the <c> VPAVGW / PAVGW </c> instruction.
2335 /// A 128-bit unsigned [8 x i16] vector.
2337 /// A 128-bit unsigned [8 x i16] vector.
2338 /// \returns A 128-bit unsigned [8 x i16] vector containing the rounded
2339 /// averages of both parameters.
2340 static __inline__ __m128i __DEFAULT_FN_ATTRS
2341 _mm_avg_epu16(__m128i __a, __m128i __b)
2343 typedef unsigned int __v8su __attribute__ ((__vector_size__ (32)));
2344 return (__m128i)__builtin_convertvector(
2345 ((__builtin_convertvector((__v8hu)__a, __v8su) +
2346 __builtin_convertvector((__v8hu)__b, __v8su)) + 1)
2350 /// Multiplies the corresponding elements of two 128-bit signed [8 x i16]
2351 /// vectors, producing eight intermediate 32-bit signed integer products, and
2352 /// adds the consecutive pairs of 32-bit products to form a 128-bit signed
2353 /// [4 x i32] vector.
2355 /// For example, bits [15:0] of both parameters are multiplied producing a
2356 /// 32-bit product, bits [31:16] of both parameters are multiplied producing
2357 /// a 32-bit product, and the sum of those two products becomes bits [31:0]
2360 /// \headerfile <x86intrin.h>
2362 /// This intrinsic corresponds to the <c> VPMADDWD / PMADDWD </c> instruction.
2365 /// A 128-bit signed [8 x i16] vector.
2367 /// A 128-bit signed [8 x i16] vector.
2368 /// \returns A 128-bit signed [4 x i32] vector containing the sums of products
2369 /// of both parameters.
2370 static __inline__ __m128i __DEFAULT_FN_ATTRS
2371 _mm_madd_epi16(__m128i __a, __m128i __b)
2373 return (__m128i)__builtin_ia32_pmaddwd128((__v8hi)__a, (__v8hi)__b);
2376 /// Compares corresponding elements of two 128-bit signed [8 x i16]
2377 /// vectors, saving the greater value from each comparison in the
2378 /// corresponding element of a 128-bit result vector of [8 x i16].
2380 /// \headerfile <x86intrin.h>
2382 /// This intrinsic corresponds to the <c> VPMAXSW / PMAXSW </c> instruction.
2385 /// A 128-bit signed [8 x i16] vector.
2387 /// A 128-bit signed [8 x i16] vector.
2388 /// \returns A 128-bit signed [8 x i16] vector containing the greater value of
2389 /// each comparison.
2390 static __inline__ __m128i __DEFAULT_FN_ATTRS
2391 _mm_max_epi16(__m128i __a, __m128i __b)
2393 return (__m128i)__builtin_ia32_pmaxsw128((__v8hi)__a, (__v8hi)__b);
2396 /// Compares corresponding elements of two 128-bit unsigned [16 x i8]
2397 /// vectors, saving the greater value from each comparison in the
2398 /// corresponding element of a 128-bit result vector of [16 x i8].
2400 /// \headerfile <x86intrin.h>
2402 /// This intrinsic corresponds to the <c> VPMAXUB / PMAXUB </c> instruction.
2405 /// A 128-bit unsigned [16 x i8] vector.
2407 /// A 128-bit unsigned [16 x i8] vector.
2408 /// \returns A 128-bit unsigned [16 x i8] vector containing the greater value of
2409 /// each comparison.
2410 static __inline__ __m128i __DEFAULT_FN_ATTRS
2411 _mm_max_epu8(__m128i __a, __m128i __b)
2413 return (__m128i)__builtin_ia32_pmaxub128((__v16qi)__a, (__v16qi)__b);
2416 /// Compares corresponding elements of two 128-bit signed [8 x i16]
2417 /// vectors, saving the smaller value from each comparison in the
2418 /// corresponding element of a 128-bit result vector of [8 x i16].
2420 /// \headerfile <x86intrin.h>
2422 /// This intrinsic corresponds to the <c> VPMINSW / PMINSW </c> instruction.
2425 /// A 128-bit signed [8 x i16] vector.
2427 /// A 128-bit signed [8 x i16] vector.
2428 /// \returns A 128-bit signed [8 x i16] vector containing the smaller value of
2429 /// each comparison.
2430 static __inline__ __m128i __DEFAULT_FN_ATTRS
2431 _mm_min_epi16(__m128i __a, __m128i __b)
2433 return (__m128i)__builtin_ia32_pminsw128((__v8hi)__a, (__v8hi)__b);
2436 /// Compares corresponding elements of two 128-bit unsigned [16 x i8]
2437 /// vectors, saving the smaller value from each comparison in the
2438 /// corresponding element of a 128-bit result vector of [16 x i8].
2440 /// \headerfile <x86intrin.h>
2442 /// This intrinsic corresponds to the <c> VPMINUB / PMINUB </c> instruction.
2445 /// A 128-bit unsigned [16 x i8] vector.
2447 /// A 128-bit unsigned [16 x i8] vector.
2448 /// \returns A 128-bit unsigned [16 x i8] vector containing the smaller value of
2449 /// each comparison.
2450 static __inline__ __m128i __DEFAULT_FN_ATTRS
2451 _mm_min_epu8(__m128i __a, __m128i __b)
2453 return (__m128i)__builtin_ia32_pminub128((__v16qi)__a, (__v16qi)__b);
2456 /// Multiplies the corresponding elements of two signed [8 x i16]
2457 /// vectors, saving the upper 16 bits of each 32-bit product in the
2458 /// corresponding element of a 128-bit signed [8 x i16] result vector.
2460 /// \headerfile <x86intrin.h>
2462 /// This intrinsic corresponds to the <c> VPMULHW / PMULHW </c> instruction.
2465 /// A 128-bit signed [8 x i16] vector.
2467 /// A 128-bit signed [8 x i16] vector.
2468 /// \returns A 128-bit signed [8 x i16] vector containing the upper 16 bits of
2469 /// each of the eight 32-bit products.
2470 static __inline__ __m128i __DEFAULT_FN_ATTRS
2471 _mm_mulhi_epi16(__m128i __a, __m128i __b)
2473 return (__m128i)__builtin_ia32_pmulhw128((__v8hi)__a, (__v8hi)__b);
2476 /// Multiplies the corresponding elements of two unsigned [8 x i16]
2477 /// vectors, saving the upper 16 bits of each 32-bit product in the
2478 /// corresponding element of a 128-bit unsigned [8 x i16] result vector.
2480 /// \headerfile <x86intrin.h>
2482 /// This intrinsic corresponds to the <c> VPMULHUW / PMULHUW </c> instruction.
2485 /// A 128-bit unsigned [8 x i16] vector.
2487 /// A 128-bit unsigned [8 x i16] vector.
2488 /// \returns A 128-bit unsigned [8 x i16] vector containing the upper 16 bits
2489 /// of each of the eight 32-bit products.
2490 static __inline__ __m128i __DEFAULT_FN_ATTRS
2491 _mm_mulhi_epu16(__m128i __a, __m128i __b)
2493 return (__m128i)__builtin_ia32_pmulhuw128((__v8hi)__a, (__v8hi)__b);
2496 /// Multiplies the corresponding elements of two signed [8 x i16]
2497 /// vectors, saving the lower 16 bits of each 32-bit product in the
2498 /// corresponding element of a 128-bit signed [8 x i16] result vector.
2500 /// \headerfile <x86intrin.h>
2502 /// This intrinsic corresponds to the <c> VPMULLW / PMULLW </c> instruction.
2505 /// A 128-bit signed [8 x i16] vector.
2507 /// A 128-bit signed [8 x i16] vector.
2508 /// \returns A 128-bit signed [8 x i16] vector containing the lower 16 bits of
2509 /// each of the eight 32-bit products.
2510 static __inline__ __m128i __DEFAULT_FN_ATTRS
2511 _mm_mullo_epi16(__m128i __a, __m128i __b)
2513 return (__m128i)((__v8hu)__a * (__v8hu)__b);
2516 /// Multiplies 32-bit unsigned integer values contained in the lower bits
2517 /// of the two 64-bit integer vectors and returns the 64-bit unsigned
2520 /// \headerfile <x86intrin.h>
2522 /// This intrinsic corresponds to the <c> PMULUDQ </c> instruction.
2525 /// A 64-bit integer containing one of the source operands.
2527 /// A 64-bit integer containing one of the source operands.
2528 /// \returns A 64-bit integer vector containing the product of both operands.
2529 static __inline__ __m64 __DEFAULT_FN_ATTRS_MMX
2530 _mm_mul_su32(__m64 __a, __m64 __b)
2532 return __builtin_ia32_pmuludq((__v2si)__a, (__v2si)__b);
2535 /// Multiplies 32-bit unsigned integer values contained in the lower
2536 /// bits of the corresponding elements of two [2 x i64] vectors, and returns
2537 /// the 64-bit products in the corresponding elements of a [2 x i64] vector.
2539 /// \headerfile <x86intrin.h>
2541 /// This intrinsic corresponds to the <c> VPMULUDQ / PMULUDQ </c> instruction.
2544 /// A [2 x i64] vector containing one of the source operands.
2546 /// A [2 x i64] vector containing one of the source operands.
2547 /// \returns A [2 x i64] vector containing the product of both operands.
2548 static __inline__ __m128i __DEFAULT_FN_ATTRS
2549 _mm_mul_epu32(__m128i __a, __m128i __b)
2551 return __builtin_ia32_pmuludq128((__v4si)__a, (__v4si)__b);
2554 /// Computes the absolute differences of corresponding 8-bit integer
2555 /// values in two 128-bit vectors. Sums the first 8 absolute differences, and
2556 /// separately sums the second 8 absolute differences. Packs these two
2557 /// unsigned 16-bit integer sums into the upper and lower elements of a
2558 /// [2 x i64] vector.
2560 /// \headerfile <x86intrin.h>
2562 /// This intrinsic corresponds to the <c> VPSADBW / PSADBW </c> instruction.
2565 /// A 128-bit integer vector containing one of the source operands.
2567 /// A 128-bit integer vector containing one of the source operands.
2568 /// \returns A [2 x i64] vector containing the sums of the sets of absolute
2569 /// differences between both operands.
2570 static __inline__ __m128i __DEFAULT_FN_ATTRS
2571 _mm_sad_epu8(__m128i __a, __m128i __b)
2573 return __builtin_ia32_psadbw128((__v16qi)__a, (__v16qi)__b);
2576 /// Subtracts the corresponding 8-bit integer values in the operands.
2578 /// \headerfile <x86intrin.h>
2580 /// This intrinsic corresponds to the <c> VPSUBB / PSUBB </c> instruction.
2583 /// A 128-bit integer vector containing the minuends.
2585 /// A 128-bit integer vector containing the subtrahends.
2586 /// \returns A 128-bit integer vector containing the differences of the values
2587 /// in the operands.
2588 static __inline__ __m128i __DEFAULT_FN_ATTRS
2589 _mm_sub_epi8(__m128i __a, __m128i __b)
2591 return (__m128i)((__v16qu)__a - (__v16qu)__b);
2594 /// Subtracts the corresponding 16-bit integer values in the operands.
2596 /// \headerfile <x86intrin.h>
2598 /// This intrinsic corresponds to the <c> VPSUBW / PSUBW </c> instruction.
2601 /// A 128-bit integer vector containing the minuends.
2603 /// A 128-bit integer vector containing the subtrahends.
2604 /// \returns A 128-bit integer vector containing the differences of the values
2605 /// in the operands.
2606 static __inline__ __m128i __DEFAULT_FN_ATTRS
2607 _mm_sub_epi16(__m128i __a, __m128i __b)
2609 return (__m128i)((__v8hu)__a - (__v8hu)__b);
2612 /// Subtracts the corresponding 32-bit integer values in the operands.
2614 /// \headerfile <x86intrin.h>
2616 /// This intrinsic corresponds to the <c> VPSUBD / PSUBD </c> instruction.
2619 /// A 128-bit integer vector containing the minuends.
2621 /// A 128-bit integer vector containing the subtrahends.
2622 /// \returns A 128-bit integer vector containing the differences of the values
2623 /// in the operands.
2624 static __inline__ __m128i __DEFAULT_FN_ATTRS
2625 _mm_sub_epi32(__m128i __a, __m128i __b)
2627 return (__m128i)((__v4su)__a - (__v4su)__b);
2630 /// Subtracts signed or unsigned 64-bit integer values and writes the
2631 /// difference to the corresponding bits in the destination.
2633 /// \headerfile <x86intrin.h>
2635 /// This intrinsic corresponds to the <c> PSUBQ </c> instruction.
2638 /// A 64-bit integer vector containing the minuend.
2640 /// A 64-bit integer vector containing the subtrahend.
2641 /// \returns A 64-bit integer vector containing the difference of the values in
2643 static __inline__ __m64 __DEFAULT_FN_ATTRS_MMX
2644 _mm_sub_si64(__m64 __a, __m64 __b)
2646 return (__m64)__builtin_ia32_psubq((__v1di)__a, (__v1di)__b);
2649 /// Subtracts the corresponding elements of two [2 x i64] vectors.
2651 /// \headerfile <x86intrin.h>
2653 /// This intrinsic corresponds to the <c> VPSUBQ / PSUBQ </c> instruction.
2656 /// A 128-bit integer vector containing the minuends.
2658 /// A 128-bit integer vector containing the subtrahends.
2659 /// \returns A 128-bit integer vector containing the differences of the values
2660 /// in the operands.
2661 static __inline__ __m128i __DEFAULT_FN_ATTRS
2662 _mm_sub_epi64(__m128i __a, __m128i __b)
2664 return (__m128i)((__v2du)__a - (__v2du)__b);
2667 /// Subtracts corresponding 8-bit signed integer values in the input and
2668 /// returns the differences in the corresponding bytes in the destination.
2669 /// Differences greater than 0x7F are saturated to 0x7F, and differences less
2670 /// than 0x80 are saturated to 0x80.
2672 /// \headerfile <x86intrin.h>
2674 /// This intrinsic corresponds to the <c> VPSUBSB / PSUBSB </c> instruction.
2677 /// A 128-bit integer vector containing the minuends.
2679 /// A 128-bit integer vector containing the subtrahends.
2680 /// \returns A 128-bit integer vector containing the differences of the values
2681 /// in the operands.
2682 static __inline__ __m128i __DEFAULT_FN_ATTRS
2683 _mm_subs_epi8(__m128i __a, __m128i __b)
2685 return (__m128i)__builtin_ia32_psubsb128((__v16qi)__a, (__v16qi)__b);
2688 /// Subtracts corresponding 16-bit signed integer values in the input and
2689 /// returns the differences in the corresponding bytes in the destination.
2690 /// Differences greater than 0x7FFF are saturated to 0x7FFF, and values less
2691 /// than 0x8000 are saturated to 0x8000.
2693 /// \headerfile <x86intrin.h>
2695 /// This intrinsic corresponds to the <c> VPSUBSW / PSUBSW </c> instruction.
2698 /// A 128-bit integer vector containing the minuends.
2700 /// A 128-bit integer vector containing the subtrahends.
2701 /// \returns A 128-bit integer vector containing the differences of the values
2702 /// in the operands.
2703 static __inline__ __m128i __DEFAULT_FN_ATTRS
2704 _mm_subs_epi16(__m128i __a, __m128i __b)
2706 return (__m128i)__builtin_ia32_psubsw128((__v8hi)__a, (__v8hi)__b);
2709 /// Subtracts corresponding 8-bit unsigned integer values in the input
2710 /// and returns the differences in the corresponding bytes in the
2711 /// destination. Differences less than 0x00 are saturated to 0x00.
2713 /// \headerfile <x86intrin.h>
2715 /// This intrinsic corresponds to the <c> VPSUBUSB / PSUBUSB </c> instruction.
2718 /// A 128-bit integer vector containing the minuends.
2720 /// A 128-bit integer vector containing the subtrahends.
2721 /// \returns A 128-bit integer vector containing the unsigned integer
2722 /// differences of the values in the operands.
2723 static __inline__ __m128i __DEFAULT_FN_ATTRS
2724 _mm_subs_epu8(__m128i __a, __m128i __b)
2726 return (__m128i)__builtin_ia32_psubusb128((__v16qi)__a, (__v16qi)__b);
2729 /// Subtracts corresponding 16-bit unsigned integer values in the input
2730 /// and returns the differences in the corresponding bytes in the
2731 /// destination. Differences less than 0x0000 are saturated to 0x0000.
2733 /// \headerfile <x86intrin.h>
2735 /// This intrinsic corresponds to the <c> VPSUBUSW / PSUBUSW </c> instruction.
2738 /// A 128-bit integer vector containing the minuends.
2740 /// A 128-bit integer vector containing the subtrahends.
2741 /// \returns A 128-bit integer vector containing the unsigned integer
2742 /// differences of the values in the operands.
2743 static __inline__ __m128i __DEFAULT_FN_ATTRS
2744 _mm_subs_epu16(__m128i __a, __m128i __b)
2746 return (__m128i)__builtin_ia32_psubusw128((__v8hi)__a, (__v8hi)__b);
2749 /// Performs a bitwise AND of two 128-bit integer vectors.
2751 /// \headerfile <x86intrin.h>
2753 /// This intrinsic corresponds to the <c> VPAND / PAND </c> instruction.
2756 /// A 128-bit integer vector containing one of the source operands.
2758 /// A 128-bit integer vector containing one of the source operands.
2759 /// \returns A 128-bit integer vector containing the bitwise AND of the values
2760 /// in both operands.
2761 static __inline__ __m128i __DEFAULT_FN_ATTRS
2762 _mm_and_si128(__m128i __a, __m128i __b)
2764 return (__m128i)((__v2du)__a & (__v2du)__b);
2767 /// Performs a bitwise AND of two 128-bit integer vectors, using the
2768 /// one's complement of the values contained in the first source operand.
2770 /// \headerfile <x86intrin.h>
2772 /// This intrinsic corresponds to the <c> VPANDN / PANDN </c> instruction.
2775 /// A 128-bit vector containing the left source operand. The one's complement
2776 /// of this value is used in the bitwise AND.
2778 /// A 128-bit vector containing the right source operand.
2779 /// \returns A 128-bit integer vector containing the bitwise AND of the one's
2780 /// complement of the first operand and the values in the second operand.
2781 static __inline__ __m128i __DEFAULT_FN_ATTRS
2782 _mm_andnot_si128(__m128i __a, __m128i __b)
2784 return (__m128i)(~(__v2du)__a & (__v2du)__b);
2786 /// Performs a bitwise OR of two 128-bit integer vectors.
2788 /// \headerfile <x86intrin.h>
2790 /// This intrinsic corresponds to the <c> VPOR / POR </c> instruction.
2793 /// A 128-bit integer vector containing one of the source operands.
2795 /// A 128-bit integer vector containing one of the source operands.
2796 /// \returns A 128-bit integer vector containing the bitwise OR of the values
2797 /// in both operands.
2798 static __inline__ __m128i __DEFAULT_FN_ATTRS
2799 _mm_or_si128(__m128i __a, __m128i __b)
2801 return (__m128i)((__v2du)__a | (__v2du)__b);
2804 /// Performs a bitwise exclusive OR of two 128-bit integer vectors.
2806 /// \headerfile <x86intrin.h>
2808 /// This intrinsic corresponds to the <c> VPXOR / PXOR </c> instruction.
2811 /// A 128-bit integer vector containing one of the source operands.
2813 /// A 128-bit integer vector containing one of the source operands.
2814 /// \returns A 128-bit integer vector containing the bitwise exclusive OR of the
2815 /// values in both operands.
2816 static __inline__ __m128i __DEFAULT_FN_ATTRS
2817 _mm_xor_si128(__m128i __a, __m128i __b)
2819 return (__m128i)((__v2du)__a ^ (__v2du)__b);
2822 /// Left-shifts the 128-bit integer vector operand by the specified
2823 /// number of bytes. Low-order bits are cleared.
2825 /// \headerfile <x86intrin.h>
2828 /// __m128i _mm_slli_si128(__m128i a, const int imm);
2831 /// This intrinsic corresponds to the <c> VPSLLDQ / PSLLDQ </c> instruction.
2834 /// A 128-bit integer vector containing the source operand.
2836 /// An immediate value specifying the number of bytes to left-shift operand
2838 /// \returns A 128-bit integer vector containing the left-shifted value.
2839 #define _mm_slli_si128(a, imm) \
2840 (__m128i)__builtin_ia32_pslldqi128_byteshift((__v2di)(__m128i)(a), (int)(imm))
2842 #define _mm_bslli_si128(a, imm) \
2843 (__m128i)__builtin_ia32_pslldqi128_byteshift((__v2di)(__m128i)(a), (int)(imm))
2845 /// Left-shifts each 16-bit value in the 128-bit integer vector operand
2846 /// by the specified number of bits. Low-order bits are cleared.
2848 /// \headerfile <x86intrin.h>
2850 /// This intrinsic corresponds to the <c> VPSLLW / PSLLW </c> instruction.
2853 /// A 128-bit integer vector containing the source operand.
2855 /// An integer value specifying the number of bits to left-shift each value
2856 /// in operand \a __a.
2857 /// \returns A 128-bit integer vector containing the left-shifted values.
2858 static __inline__ __m128i __DEFAULT_FN_ATTRS
2859 _mm_slli_epi16(__m128i __a, int __count)
2861 return (__m128i)__builtin_ia32_psllwi128((__v8hi)__a, __count);
2864 /// Left-shifts each 16-bit value in the 128-bit integer vector operand
2865 /// by the specified number of bits. Low-order bits are cleared.
2867 /// \headerfile <x86intrin.h>
2869 /// This intrinsic corresponds to the <c> VPSLLW / PSLLW </c> instruction.
2872 /// A 128-bit integer vector containing the source operand.
2874 /// A 128-bit integer vector in which bits [63:0] specify the number of bits
2875 /// to left-shift each value in operand \a __a.
2876 /// \returns A 128-bit integer vector containing the left-shifted values.
2877 static __inline__ __m128i __DEFAULT_FN_ATTRS
2878 _mm_sll_epi16(__m128i __a, __m128i __count)
2880 return (__m128i)__builtin_ia32_psllw128((__v8hi)__a, (__v8hi)__count);
2883 /// Left-shifts each 32-bit value in the 128-bit integer vector operand
2884 /// by the specified number of bits. Low-order bits are cleared.
2886 /// \headerfile <x86intrin.h>
2888 /// This intrinsic corresponds to the <c> VPSLLD / PSLLD </c> instruction.
2891 /// A 128-bit integer vector containing the source operand.
2893 /// An integer value specifying the number of bits to left-shift each value
2894 /// in operand \a __a.
2895 /// \returns A 128-bit integer vector containing the left-shifted values.
2896 static __inline__ __m128i __DEFAULT_FN_ATTRS
2897 _mm_slli_epi32(__m128i __a, int __count)
2899 return (__m128i)__builtin_ia32_pslldi128((__v4si)__a, __count);
2902 /// Left-shifts each 32-bit value in the 128-bit integer vector operand
2903 /// by the specified number of bits. Low-order bits are cleared.
2905 /// \headerfile <x86intrin.h>
2907 /// This intrinsic corresponds to the <c> VPSLLD / PSLLD </c> instruction.
2910 /// A 128-bit integer vector containing the source operand.
2912 /// A 128-bit integer vector in which bits [63:0] specify the number of bits
2913 /// to left-shift each value in operand \a __a.
2914 /// \returns A 128-bit integer vector containing the left-shifted values.
2915 static __inline__ __m128i __DEFAULT_FN_ATTRS
2916 _mm_sll_epi32(__m128i __a, __m128i __count)
2918 return (__m128i)__builtin_ia32_pslld128((__v4si)__a, (__v4si)__count);
2921 /// Left-shifts each 64-bit value in the 128-bit integer vector operand
2922 /// by the specified number of bits. Low-order bits are cleared.
2924 /// \headerfile <x86intrin.h>
2926 /// This intrinsic corresponds to the <c> VPSLLQ / PSLLQ </c> instruction.
2929 /// A 128-bit integer vector containing the source operand.
2931 /// An integer value specifying the number of bits to left-shift each value
2932 /// in operand \a __a.
2933 /// \returns A 128-bit integer vector containing the left-shifted values.
2934 static __inline__ __m128i __DEFAULT_FN_ATTRS
2935 _mm_slli_epi64(__m128i __a, int __count)
2937 return __builtin_ia32_psllqi128((__v2di)__a, __count);
2940 /// Left-shifts each 64-bit value in the 128-bit integer vector operand
2941 /// by the specified number of bits. Low-order bits are cleared.
2943 /// \headerfile <x86intrin.h>
2945 /// This intrinsic corresponds to the <c> VPSLLQ / PSLLQ </c> instruction.
2948 /// A 128-bit integer vector containing the source operand.
2950 /// A 128-bit integer vector in which bits [63:0] specify the number of bits
2951 /// to left-shift each value in operand \a __a.
2952 /// \returns A 128-bit integer vector containing the left-shifted values.
2953 static __inline__ __m128i __DEFAULT_FN_ATTRS
2954 _mm_sll_epi64(__m128i __a, __m128i __count)
2956 return __builtin_ia32_psllq128((__v2di)__a, (__v2di)__count);
2959 /// Right-shifts each 16-bit value in the 128-bit integer vector operand
2960 /// by the specified number of bits. High-order bits are filled with the sign
2961 /// bit of the initial value.
2963 /// \headerfile <x86intrin.h>
2965 /// This intrinsic corresponds to the <c> VPSRAW / PSRAW </c> instruction.
2968 /// A 128-bit integer vector containing the source operand.
2970 /// An integer value specifying the number of bits to right-shift each value
2971 /// in operand \a __a.
2972 /// \returns A 128-bit integer vector containing the right-shifted values.
2973 static __inline__ __m128i __DEFAULT_FN_ATTRS
2974 _mm_srai_epi16(__m128i __a, int __count)
2976 return (__m128i)__builtin_ia32_psrawi128((__v8hi)__a, __count);
2979 /// Right-shifts each 16-bit value in the 128-bit integer vector operand
2980 /// by the specified number of bits. High-order bits are filled with the sign
2981 /// bit of the initial value.
2983 /// \headerfile <x86intrin.h>
2985 /// This intrinsic corresponds to the <c> VPSRAW / PSRAW </c> instruction.
2988 /// A 128-bit integer vector containing the source operand.
2990 /// A 128-bit integer vector in which bits [63:0] specify the number of bits
2991 /// to right-shift each value in operand \a __a.
2992 /// \returns A 128-bit integer vector containing the right-shifted values.
2993 static __inline__ __m128i __DEFAULT_FN_ATTRS
2994 _mm_sra_epi16(__m128i __a, __m128i __count)
2996 return (__m128i)__builtin_ia32_psraw128((__v8hi)__a, (__v8hi)__count);
2999 /// Right-shifts each 32-bit value in the 128-bit integer vector operand
3000 /// by the specified number of bits. High-order bits are filled with the sign
3001 /// bit of the initial value.
3003 /// \headerfile <x86intrin.h>
3005 /// This intrinsic corresponds to the <c> VPSRAD / PSRAD </c> instruction.
3008 /// A 128-bit integer vector containing the source operand.
3010 /// An integer value specifying the number of bits to right-shift each value
3011 /// in operand \a __a.
3012 /// \returns A 128-bit integer vector containing the right-shifted values.
3013 static __inline__ __m128i __DEFAULT_FN_ATTRS
3014 _mm_srai_epi32(__m128i __a, int __count)
3016 return (__m128i)__builtin_ia32_psradi128((__v4si)__a, __count);
3019 /// Right-shifts each 32-bit value in the 128-bit integer vector operand
3020 /// by the specified number of bits. High-order bits are filled with the sign
3021 /// bit of the initial value.
3023 /// \headerfile <x86intrin.h>
3025 /// This intrinsic corresponds to the <c> VPSRAD / PSRAD </c> instruction.
3028 /// A 128-bit integer vector containing the source operand.
3030 /// A 128-bit integer vector in which bits [63:0] specify the number of bits
3031 /// to right-shift each value in operand \a __a.
3032 /// \returns A 128-bit integer vector containing the right-shifted values.
3033 static __inline__ __m128i __DEFAULT_FN_ATTRS
3034 _mm_sra_epi32(__m128i __a, __m128i __count)
3036 return (__m128i)__builtin_ia32_psrad128((__v4si)__a, (__v4si)__count);
3039 /// Right-shifts the 128-bit integer vector operand by the specified
3040 /// number of bytes. High-order bits are cleared.
3042 /// \headerfile <x86intrin.h>
3045 /// __m128i _mm_srli_si128(__m128i a, const int imm);
3048 /// This intrinsic corresponds to the <c> VPSRLDQ / PSRLDQ </c> instruction.
3051 /// A 128-bit integer vector containing the source operand.
3053 /// An immediate value specifying the number of bytes to right-shift operand
3055 /// \returns A 128-bit integer vector containing the right-shifted value.
3056 #define _mm_srli_si128(a, imm) \
3057 (__m128i)__builtin_ia32_psrldqi128_byteshift((__v2di)(__m128i)(a), (int)(imm))
3059 #define _mm_bsrli_si128(a, imm) \
3060 (__m128i)__builtin_ia32_psrldqi128_byteshift((__v2di)(__m128i)(a), (int)(imm))
3062 /// Right-shifts each of 16-bit values in the 128-bit integer vector
3063 /// operand by the specified number of bits. High-order bits are cleared.
3065 /// \headerfile <x86intrin.h>
3067 /// This intrinsic corresponds to the <c> VPSRLW / PSRLW </c> instruction.
3070 /// A 128-bit integer vector containing the source operand.
3072 /// An integer value specifying the number of bits to right-shift each value
3073 /// in operand \a __a.
3074 /// \returns A 128-bit integer vector containing the right-shifted values.
3075 static __inline__ __m128i __DEFAULT_FN_ATTRS
3076 _mm_srli_epi16(__m128i __a, int __count)
3078 return (__m128i)__builtin_ia32_psrlwi128((__v8hi)__a, __count);
3081 /// Right-shifts each of 16-bit values in the 128-bit integer vector
3082 /// operand by the specified number of bits. High-order bits are cleared.
3084 /// \headerfile <x86intrin.h>
3086 /// This intrinsic corresponds to the <c> VPSRLW / PSRLW </c> instruction.
3089 /// A 128-bit integer vector containing the source operand.
3091 /// A 128-bit integer vector in which bits [63:0] specify the number of bits
3092 /// to right-shift each value in operand \a __a.
3093 /// \returns A 128-bit integer vector containing the right-shifted values.
3094 static __inline__ __m128i __DEFAULT_FN_ATTRS
3095 _mm_srl_epi16(__m128i __a, __m128i __count)
3097 return (__m128i)__builtin_ia32_psrlw128((__v8hi)__a, (__v8hi)__count);
3100 /// Right-shifts each of 32-bit values in the 128-bit integer vector
3101 /// operand by the specified number of bits. High-order bits are cleared.
3103 /// \headerfile <x86intrin.h>
3105 /// This intrinsic corresponds to the <c> VPSRLD / PSRLD </c> instruction.
3108 /// A 128-bit integer vector containing the source operand.
3110 /// An integer value specifying the number of bits to right-shift each value
3111 /// in operand \a __a.
3112 /// \returns A 128-bit integer vector containing the right-shifted values.
3113 static __inline__ __m128i __DEFAULT_FN_ATTRS
3114 _mm_srli_epi32(__m128i __a, int __count)
3116 return (__m128i)__builtin_ia32_psrldi128((__v4si)__a, __count);
3119 /// Right-shifts each of 32-bit values in the 128-bit integer vector
3120 /// operand by the specified number of bits. High-order bits are cleared.
3122 /// \headerfile <x86intrin.h>
3124 /// This intrinsic corresponds to the <c> VPSRLD / PSRLD </c> instruction.
3127 /// A 128-bit integer vector containing the source operand.
3129 /// A 128-bit integer vector in which bits [63:0] specify the number of bits
3130 /// to right-shift each value in operand \a __a.
3131 /// \returns A 128-bit integer vector containing the right-shifted values.
3132 static __inline__ __m128i __DEFAULT_FN_ATTRS
3133 _mm_srl_epi32(__m128i __a, __m128i __count)
3135 return (__m128i)__builtin_ia32_psrld128((__v4si)__a, (__v4si)__count);
3138 /// Right-shifts each of 64-bit values in the 128-bit integer vector
3139 /// operand by the specified number of bits. High-order bits are cleared.
3141 /// \headerfile <x86intrin.h>
3143 /// This intrinsic corresponds to the <c> VPSRLQ / PSRLQ </c> instruction.
3146 /// A 128-bit integer vector containing the source operand.
3148 /// An integer value specifying the number of bits to right-shift each value
3149 /// in operand \a __a.
3150 /// \returns A 128-bit integer vector containing the right-shifted values.
3151 static __inline__ __m128i __DEFAULT_FN_ATTRS
3152 _mm_srli_epi64(__m128i __a, int __count)
3154 return __builtin_ia32_psrlqi128((__v2di)__a, __count);
3157 /// Right-shifts each of 64-bit values in the 128-bit integer vector
3158 /// operand by the specified number of bits. High-order bits are cleared.
3160 /// \headerfile <x86intrin.h>
3162 /// This intrinsic corresponds to the <c> VPSRLQ / PSRLQ </c> instruction.
3165 /// A 128-bit integer vector containing the source operand.
3167 /// A 128-bit integer vector in which bits [63:0] specify the number of bits
3168 /// to right-shift each value in operand \a __a.
3169 /// \returns A 128-bit integer vector containing the right-shifted values.
3170 static __inline__ __m128i __DEFAULT_FN_ATTRS
3171 _mm_srl_epi64(__m128i __a, __m128i __count)
3173 return __builtin_ia32_psrlq128((__v2di)__a, (__v2di)__count);
3176 /// Compares each of the corresponding 8-bit values of the 128-bit
3177 /// integer vectors for equality. Each comparison yields 0x0 for false, 0xFF
3180 /// \headerfile <x86intrin.h>
3182 /// This intrinsic corresponds to the <c> VPCMPEQB / PCMPEQB </c> instruction.
3185 /// A 128-bit integer vector.
3187 /// A 128-bit integer vector.
3188 /// \returns A 128-bit integer vector containing the comparison results.
3189 static __inline__ __m128i __DEFAULT_FN_ATTRS
3190 _mm_cmpeq_epi8(__m128i __a, __m128i __b)
3192 return (__m128i)((__v16qi)__a == (__v16qi)__b);
3195 /// Compares each of the corresponding 16-bit values of the 128-bit
3196 /// integer vectors for equality. Each comparison yields 0x0 for false,
3197 /// 0xFFFF for true.
3199 /// \headerfile <x86intrin.h>
3201 /// This intrinsic corresponds to the <c> VPCMPEQW / PCMPEQW </c> instruction.
3204 /// A 128-bit integer vector.
3206 /// A 128-bit integer vector.
3207 /// \returns A 128-bit integer vector containing the comparison results.
3208 static __inline__ __m128i __DEFAULT_FN_ATTRS
3209 _mm_cmpeq_epi16(__m128i __a, __m128i __b)
3211 return (__m128i)((__v8hi)__a == (__v8hi)__b);
3214 /// Compares each of the corresponding 32-bit values of the 128-bit
3215 /// integer vectors for equality. Each comparison yields 0x0 for false,
3216 /// 0xFFFFFFFF for true.
3218 /// \headerfile <x86intrin.h>
3220 /// This intrinsic corresponds to the <c> VPCMPEQD / PCMPEQD </c> instruction.
3223 /// A 128-bit integer vector.
3225 /// A 128-bit integer vector.
3226 /// \returns A 128-bit integer vector containing the comparison results.
3227 static __inline__ __m128i __DEFAULT_FN_ATTRS
3228 _mm_cmpeq_epi32(__m128i __a, __m128i __b)
3230 return (__m128i)((__v4si)__a == (__v4si)__b);
3233 /// Compares each of the corresponding signed 8-bit values of the 128-bit
3234 /// integer vectors to determine if the values in the first operand are
3235 /// greater than those in the second operand. Each comparison yields 0x0 for
3236 /// false, 0xFF for true.
3238 /// \headerfile <x86intrin.h>
3240 /// This intrinsic corresponds to the <c> VPCMPGTB / PCMPGTB </c> instruction.
3243 /// A 128-bit integer vector.
3245 /// A 128-bit integer vector.
3246 /// \returns A 128-bit integer vector containing the comparison results.
3247 static __inline__ __m128i __DEFAULT_FN_ATTRS
3248 _mm_cmpgt_epi8(__m128i __a, __m128i __b)
3250 /* This function always performs a signed comparison, but __v16qi is a char
3251 which may be signed or unsigned, so use __v16qs. */
3252 return (__m128i)((__v16qs)__a > (__v16qs)__b);
3255 /// Compares each of the corresponding signed 16-bit values of the
3256 /// 128-bit integer vectors to determine if the values in the first operand
3257 /// are greater than those in the second operand.
3259 /// Each comparison yields 0x0 for false, 0xFFFF for true.
3261 /// \headerfile <x86intrin.h>
3263 /// This intrinsic corresponds to the <c> VPCMPGTW / PCMPGTW </c> instruction.
3266 /// A 128-bit integer vector.
3268 /// A 128-bit integer vector.
3269 /// \returns A 128-bit integer vector containing the comparison results.
3270 static __inline__ __m128i __DEFAULT_FN_ATTRS
3271 _mm_cmpgt_epi16(__m128i __a, __m128i __b)
3273 return (__m128i)((__v8hi)__a > (__v8hi)__b);
3276 /// Compares each of the corresponding signed 32-bit values of the
3277 /// 128-bit integer vectors to determine if the values in the first operand
3278 /// are greater than those in the second operand.
3280 /// Each comparison yields 0x0 for false, 0xFFFFFFFF for true.
3282 /// \headerfile <x86intrin.h>
3284 /// This intrinsic corresponds to the <c> VPCMPGTD / PCMPGTD </c> instruction.
3287 /// A 128-bit integer vector.
3289 /// A 128-bit integer vector.
3290 /// \returns A 128-bit integer vector containing the comparison results.
3291 static __inline__ __m128i __DEFAULT_FN_ATTRS
3292 _mm_cmpgt_epi32(__m128i __a, __m128i __b)
3294 return (__m128i)((__v4si)__a > (__v4si)__b);
3297 /// Compares each of the corresponding signed 8-bit values of the 128-bit
3298 /// integer vectors to determine if the values in the first operand are less
3299 /// than those in the second operand.
3301 /// Each comparison yields 0x0 for false, 0xFF for true.
3303 /// \headerfile <x86intrin.h>
3305 /// This intrinsic corresponds to the <c> VPCMPGTB / PCMPGTB </c> instruction.
3308 /// A 128-bit integer vector.
3310 /// A 128-bit integer vector.
3311 /// \returns A 128-bit integer vector containing the comparison results.
3312 static __inline__ __m128i __DEFAULT_FN_ATTRS
3313 _mm_cmplt_epi8(__m128i __a, __m128i __b)
3315 return _mm_cmpgt_epi8(__b, __a);
3318 /// Compares each of the corresponding signed 16-bit values of the
3319 /// 128-bit integer vectors to determine if the values in the first operand
3320 /// are less than those in the second operand.
3322 /// Each comparison yields 0x0 for false, 0xFFFF for true.
3324 /// \headerfile <x86intrin.h>
3326 /// This intrinsic corresponds to the <c> VPCMPGTW / PCMPGTW </c> instruction.
3329 /// A 128-bit integer vector.
3331 /// A 128-bit integer vector.
3332 /// \returns A 128-bit integer vector containing the comparison results.
3333 static __inline__ __m128i __DEFAULT_FN_ATTRS
3334 _mm_cmplt_epi16(__m128i __a, __m128i __b)
3336 return _mm_cmpgt_epi16(__b, __a);
3339 /// Compares each of the corresponding signed 32-bit values of the
3340 /// 128-bit integer vectors to determine if the values in the first operand
3341 /// are less than those in the second operand.
3343 /// Each comparison yields 0x0 for false, 0xFFFFFFFF for true.
3345 /// \headerfile <x86intrin.h>
3347 /// This intrinsic corresponds to the <c> VPCMPGTD / PCMPGTD </c> instruction.
3350 /// A 128-bit integer vector.
3352 /// A 128-bit integer vector.
3353 /// \returns A 128-bit integer vector containing the comparison results.
3354 static __inline__ __m128i __DEFAULT_FN_ATTRS
3355 _mm_cmplt_epi32(__m128i __a, __m128i __b)
3357 return _mm_cmpgt_epi32(__b, __a);
3361 /// Converts a 64-bit signed integer value from the second operand into a
3362 /// double-precision value and returns it in the lower element of a [2 x
3363 /// double] vector; the upper element of the returned vector is copied from
3364 /// the upper element of the first operand.
3366 /// \headerfile <x86intrin.h>
3368 /// This intrinsic corresponds to the <c> VCVTSI2SD / CVTSI2SD </c> instruction.
3371 /// A 128-bit vector of [2 x double]. The upper 64 bits of this operand are
3372 /// copied to the upper 64 bits of the destination.
3374 /// A 64-bit signed integer operand containing the value to be converted.
3375 /// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the
3376 /// converted value of the second operand. The upper 64 bits are copied from
3377 /// the upper 64 bits of the first operand.
3378 static __inline__ __m128d __DEFAULT_FN_ATTRS
3379 _mm_cvtsi64_sd(__m128d __a, long long __b)
3385 /// Converts the first (lower) element of a vector of [2 x double] into a
3386 /// 64-bit signed integer value, according to the current rounding mode.
3388 /// \headerfile <x86intrin.h>
3390 /// This intrinsic corresponds to the <c> VCVTSD2SI / CVTSD2SI </c> instruction.
3393 /// A 128-bit vector of [2 x double]. The lower 64 bits are used in the
3395 /// \returns A 64-bit signed integer containing the converted value.
3396 static __inline__ long long __DEFAULT_FN_ATTRS
3397 _mm_cvtsd_si64(__m128d __a)
3399 return __builtin_ia32_cvtsd2si64((__v2df)__a);
3402 /// Converts the first (lower) element of a vector of [2 x double] into a
3403 /// 64-bit signed integer value, truncating the result when it is inexact.
3405 /// \headerfile <x86intrin.h>
3407 /// This intrinsic corresponds to the <c> VCVTTSD2SI / CVTTSD2SI </c>
3411 /// A 128-bit vector of [2 x double]. The lower 64 bits are used in the
3413 /// \returns A 64-bit signed integer containing the converted value.
3414 static __inline__ long long __DEFAULT_FN_ATTRS
3415 _mm_cvttsd_si64(__m128d __a)
3417 return __builtin_ia32_cvttsd2si64((__v2df)__a);
3421 /// Converts a vector of [4 x i32] into a vector of [4 x float].
3423 /// \headerfile <x86intrin.h>
3425 /// This intrinsic corresponds to the <c> VCVTDQ2PS / CVTDQ2PS </c> instruction.
3428 /// A 128-bit integer vector.
3429 /// \returns A 128-bit vector of [4 x float] containing the converted values.
3430 static __inline__ __m128 __DEFAULT_FN_ATTRS
3431 _mm_cvtepi32_ps(__m128i __a)
3433 return (__m128)__builtin_convertvector((__v4si)__a, __v4sf);
3436 /// Converts a vector of [4 x float] into a vector of [4 x i32].
3438 /// \headerfile <x86intrin.h>
3440 /// This intrinsic corresponds to the <c> VCVTPS2DQ / CVTPS2DQ </c> instruction.
3443 /// A 128-bit vector of [4 x float].
3444 /// \returns A 128-bit integer vector of [4 x i32] containing the converted
3446 static __inline__ __m128i __DEFAULT_FN_ATTRS
3447 _mm_cvtps_epi32(__m128 __a)
3449 return (__m128i)__builtin_ia32_cvtps2dq((__v4sf)__a);
3452 /// Converts a vector of [4 x float] into a vector of [4 x i32],
3453 /// truncating the result when it is inexact.
3455 /// \headerfile <x86intrin.h>
3457 /// This intrinsic corresponds to the <c> VCVTTPS2DQ / CVTTPS2DQ </c>
3461 /// A 128-bit vector of [4 x float].
3462 /// \returns A 128-bit vector of [4 x i32] containing the converted values.
3463 static __inline__ __m128i __DEFAULT_FN_ATTRS
3464 _mm_cvttps_epi32(__m128 __a)
3466 return (__m128i)__builtin_ia32_cvttps2dq((__v4sf)__a);
3469 /// Returns a vector of [4 x i32] where the lowest element is the input
3470 /// operand and the remaining elements are zero.
3472 /// \headerfile <x86intrin.h>
3474 /// This intrinsic corresponds to the <c> VMOVD / MOVD </c> instruction.
3477 /// A 32-bit signed integer operand.
3478 /// \returns A 128-bit vector of [4 x i32].
3479 static __inline__ __m128i __DEFAULT_FN_ATTRS
3480 _mm_cvtsi32_si128(int __a)
3482 return __extension__ (__m128i)(__v4si){ __a, 0, 0, 0 };
3486 /// Returns a vector of [2 x i64] where the lower element is the input
3487 /// operand and the upper element is zero.
3489 /// \headerfile <x86intrin.h>
3491 /// This intrinsic corresponds to the <c> VMOVQ / MOVQ </c> instruction.
3494 /// A 64-bit signed integer operand containing the value to be converted.
3495 /// \returns A 128-bit vector of [2 x i64] containing the converted value.
3496 static __inline__ __m128i __DEFAULT_FN_ATTRS
3497 _mm_cvtsi64_si128(long long __a)
3499 return __extension__ (__m128i)(__v2di){ __a, 0 };
3503 /// Moves the least significant 32 bits of a vector of [4 x i32] to a
3504 /// 32-bit signed integer value.
3506 /// \headerfile <x86intrin.h>
3508 /// This intrinsic corresponds to the <c> VMOVD / MOVD </c> instruction.
3511 /// A vector of [4 x i32]. The least significant 32 bits are moved to the
3513 /// \returns A 32-bit signed integer containing the moved value.
3514 static __inline__ int __DEFAULT_FN_ATTRS
3515 _mm_cvtsi128_si32(__m128i __a)
3517 __v4si __b = (__v4si)__a;
3522 /// Moves the least significant 64 bits of a vector of [2 x i64] to a
3523 /// 64-bit signed integer value.
3525 /// \headerfile <x86intrin.h>
3527 /// This intrinsic corresponds to the <c> VMOVQ / MOVQ </c> instruction.
3530 /// A vector of [2 x i64]. The least significant 64 bits are moved to the
3532 /// \returns A 64-bit signed integer containing the moved value.
3533 static __inline__ long long __DEFAULT_FN_ATTRS
3534 _mm_cvtsi128_si64(__m128i __a)
3540 /// Moves packed integer values from an aligned 128-bit memory location
3541 /// to elements in a 128-bit integer vector.
3543 /// \headerfile <x86intrin.h>
3545 /// This intrinsic corresponds to the <c> VMOVDQA / MOVDQA </c> instruction.
3548 /// An aligned pointer to a memory location containing integer values.
3549 /// \returns A 128-bit integer vector containing the moved values.
3550 static __inline__ __m128i __DEFAULT_FN_ATTRS
3551 _mm_load_si128(__m128i const *__p)
3556 /// Moves packed integer values from an unaligned 128-bit memory location
3557 /// to elements in a 128-bit integer vector.
3559 /// \headerfile <x86intrin.h>
3561 /// This intrinsic corresponds to the <c> VMOVDQU / MOVDQU </c> instruction.
3564 /// A pointer to a memory location containing integer values.
3565 /// \returns A 128-bit integer vector containing the moved values.
3566 static __inline__ __m128i __DEFAULT_FN_ATTRS
3567 _mm_loadu_si128(__m128i const *__p)
3569 struct __loadu_si128 {
3571 } __attribute__((__packed__, __may_alias__));
3572 return ((struct __loadu_si128*)__p)->__v;
3575 /// Returns a vector of [2 x i64] where the lower element is taken from
3576 /// the lower element of the operand, and the upper element is zero.
3578 /// \headerfile <x86intrin.h>
3580 /// This intrinsic corresponds to the <c> VMOVQ / MOVQ </c> instruction.
3583 /// A 128-bit vector of [2 x i64]. Bits [63:0] are written to bits [63:0] of
3584 /// the destination.
3585 /// \returns A 128-bit vector of [2 x i64]. The lower order bits contain the
3586 /// moved value. The higher order bits are cleared.
3587 static __inline__ __m128i __DEFAULT_FN_ATTRS
3588 _mm_loadl_epi64(__m128i const *__p)
3590 struct __mm_loadl_epi64_struct {
3592 } __attribute__((__packed__, __may_alias__));
3593 return __extension__ (__m128i) { ((struct __mm_loadl_epi64_struct*)__p)->__u, 0};
3596 /// Generates a 128-bit vector of [4 x i32] with unspecified content.
3597 /// This could be used as an argument to another intrinsic function where the
3598 /// argument is required but the value is not actually used.
3600 /// \headerfile <x86intrin.h>
3602 /// This intrinsic has no corresponding instruction.
3604 /// \returns A 128-bit vector of [4 x i32] with unspecified content.
3605 static __inline__ __m128i __DEFAULT_FN_ATTRS
3606 _mm_undefined_si128(void)
3608 return (__m128i)__builtin_ia32_undef128();
3611 /// Initializes both 64-bit values in a 128-bit vector of [2 x i64] with
3612 /// the specified 64-bit integer values.
3614 /// \headerfile <x86intrin.h>
3616 /// This intrinsic is a utility function and does not correspond to a specific
3620 /// A 64-bit integer value used to initialize the upper 64 bits of the
3621 /// destination vector of [2 x i64].
3623 /// A 64-bit integer value used to initialize the lower 64 bits of the
3624 /// destination vector of [2 x i64].
3625 /// \returns An initialized 128-bit vector of [2 x i64] containing the values
3626 /// provided in the operands.
3627 static __inline__ __m128i __DEFAULT_FN_ATTRS
3628 _mm_set_epi64x(long long __q1, long long __q0)
3630 return __extension__ (__m128i)(__v2di){ __q0, __q1 };
3633 /// Initializes both 64-bit values in a 128-bit vector of [2 x i64] with
3634 /// the specified 64-bit integer values.
3636 /// \headerfile <x86intrin.h>
3638 /// This intrinsic is a utility function and does not correspond to a specific
3642 /// A 64-bit integer value used to initialize the upper 64 bits of the
3643 /// destination vector of [2 x i64].
3645 /// A 64-bit integer value used to initialize the lower 64 bits of the
3646 /// destination vector of [2 x i64].
3647 /// \returns An initialized 128-bit vector of [2 x i64] containing the values
3648 /// provided in the operands.
3649 static __inline__ __m128i __DEFAULT_FN_ATTRS
3650 _mm_set_epi64(__m64 __q1, __m64 __q0)
3652 return _mm_set_epi64x((long long)__q1, (long long)__q0);
3655 /// Initializes the 32-bit values in a 128-bit vector of [4 x i32] with
3656 /// the specified 32-bit integer values.
3658 /// \headerfile <x86intrin.h>
3660 /// This intrinsic is a utility function and does not correspond to a specific
3664 /// A 32-bit integer value used to initialize bits [127:96] of the
3665 /// destination vector.
3667 /// A 32-bit integer value used to initialize bits [95:64] of the destination
3670 /// A 32-bit integer value used to initialize bits [63:32] of the destination
3673 /// A 32-bit integer value used to initialize bits [31:0] of the destination
3675 /// \returns An initialized 128-bit vector of [4 x i32] containing the values
3676 /// provided in the operands.
3677 static __inline__ __m128i __DEFAULT_FN_ATTRS
3678 _mm_set_epi32(int __i3, int __i2, int __i1, int __i0)
3680 return __extension__ (__m128i)(__v4si){ __i0, __i1, __i2, __i3};
3683 /// Initializes the 16-bit values in a 128-bit vector of [8 x i16] with
3684 /// the specified 16-bit integer values.
3686 /// \headerfile <x86intrin.h>
3688 /// This intrinsic is a utility function and does not correspond to a specific
3692 /// A 16-bit integer value used to initialize bits [127:112] of the
3693 /// destination vector.
3695 /// A 16-bit integer value used to initialize bits [111:96] of the
3696 /// destination vector.
3698 /// A 16-bit integer value used to initialize bits [95:80] of the destination
3701 /// A 16-bit integer value used to initialize bits [79:64] of the destination
3704 /// A 16-bit integer value used to initialize bits [63:48] of the destination
3707 /// A 16-bit integer value used to initialize bits [47:32] of the destination
3710 /// A 16-bit integer value used to initialize bits [31:16] of the destination
3713 /// A 16-bit integer value used to initialize bits [15:0] of the destination
3715 /// \returns An initialized 128-bit vector of [8 x i16] containing the values
3716 /// provided in the operands.
3717 static __inline__ __m128i __DEFAULT_FN_ATTRS
3718 _mm_set_epi16(short __w7, short __w6, short __w5, short __w4, short __w3, short __w2, short __w1, short __w0)
3720 return __extension__ (__m128i)(__v8hi){ __w0, __w1, __w2, __w3, __w4, __w5, __w6, __w7 };
3723 /// Initializes the 8-bit values in a 128-bit vector of [16 x i8] with
3724 /// the specified 8-bit integer values.
3726 /// \headerfile <x86intrin.h>
3728 /// This intrinsic is a utility function and does not correspond to a specific
3732 /// Initializes bits [127:120] of the destination vector.
3734 /// Initializes bits [119:112] of the destination vector.
3736 /// Initializes bits [111:104] of the destination vector.
3738 /// Initializes bits [103:96] of the destination vector.
3740 /// Initializes bits [95:88] of the destination vector.
3742 /// Initializes bits [87:80] of the destination vector.
3744 /// Initializes bits [79:72] of the destination vector.
3746 /// Initializes bits [71:64] of the destination vector.
3748 /// Initializes bits [63:56] of the destination vector.
3750 /// Initializes bits [55:48] of the destination vector.
3752 /// Initializes bits [47:40] of the destination vector.
3754 /// Initializes bits [39:32] of the destination vector.
3756 /// Initializes bits [31:24] of the destination vector.
3758 /// Initializes bits [23:16] of the destination vector.
3760 /// Initializes bits [15:8] of the destination vector.
3762 /// Initializes bits [7:0] of the destination vector.
3763 /// \returns An initialized 128-bit vector of [16 x i8] containing the values
3764 /// provided in the operands.
3765 static __inline__ __m128i __DEFAULT_FN_ATTRS
3766 _mm_set_epi8(char __b15, char __b14, char __b13, char __b12, char __b11, char __b10, char __b9, char __b8, char __b7, char __b6, char __b5, char __b4, char __b3, char __b2, char __b1, char __b0)
3768 return __extension__ (__m128i)(__v16qi){ __b0, __b1, __b2, __b3, __b4, __b5, __b6, __b7, __b8, __b9, __b10, __b11, __b12, __b13, __b14, __b15 };
3771 /// Initializes both values in a 128-bit integer vector with the
3772 /// specified 64-bit integer value.
3774 /// \headerfile <x86intrin.h>
3776 /// This intrinsic is a utility function and does not correspond to a specific
3780 /// Integer value used to initialize the elements of the destination integer
3782 /// \returns An initialized 128-bit integer vector of [2 x i64] with both
3783 /// elements containing the value provided in the operand.
3784 static __inline__ __m128i __DEFAULT_FN_ATTRS
3785 _mm_set1_epi64x(long long __q)
3787 return _mm_set_epi64x(__q, __q);
3790 /// Initializes both values in a 128-bit vector of [2 x i64] with the
3791 /// specified 64-bit value.
3793 /// \headerfile <x86intrin.h>
3795 /// This intrinsic is a utility function and does not correspond to a specific
3799 /// A 64-bit value used to initialize the elements of the destination integer
3801 /// \returns An initialized 128-bit vector of [2 x i64] with all elements
3802 /// containing the value provided in the operand.
3803 static __inline__ __m128i __DEFAULT_FN_ATTRS
3804 _mm_set1_epi64(__m64 __q)
3806 return _mm_set_epi64(__q, __q);
3809 /// Initializes all values in a 128-bit vector of [4 x i32] with the
3810 /// specified 32-bit value.
3812 /// \headerfile <x86intrin.h>
3814 /// This intrinsic is a utility function and does not correspond to a specific
3818 /// A 32-bit value used to initialize the elements of the destination integer
3820 /// \returns An initialized 128-bit vector of [4 x i32] with all elements
3821 /// containing the value provided in the operand.
3822 static __inline__ __m128i __DEFAULT_FN_ATTRS
3823 _mm_set1_epi32(int __i)
3825 return _mm_set_epi32(__i, __i, __i, __i);
3828 /// Initializes all values in a 128-bit vector of [8 x i16] with the
3829 /// specified 16-bit value.
3831 /// \headerfile <x86intrin.h>
3833 /// This intrinsic is a utility function and does not correspond to a specific
3837 /// A 16-bit value used to initialize the elements of the destination integer
3839 /// \returns An initialized 128-bit vector of [8 x i16] with all elements
3840 /// containing the value provided in the operand.
3841 static __inline__ __m128i __DEFAULT_FN_ATTRS
3842 _mm_set1_epi16(short __w)
3844 return _mm_set_epi16(__w, __w, __w, __w, __w, __w, __w, __w);
3847 /// Initializes all values in a 128-bit vector of [16 x i8] with the
3848 /// specified 8-bit value.
3850 /// \headerfile <x86intrin.h>
3852 /// This intrinsic is a utility function and does not correspond to a specific
3856 /// An 8-bit value used to initialize the elements of the destination integer
3858 /// \returns An initialized 128-bit vector of [16 x i8] with all elements
3859 /// containing the value provided in the operand.
3860 static __inline__ __m128i __DEFAULT_FN_ATTRS
3861 _mm_set1_epi8(char __b)
3863 return _mm_set_epi8(__b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b);
3866 /// Constructs a 128-bit integer vector, initialized in reverse order
3867 /// with the specified 64-bit integral values.
3869 /// \headerfile <x86intrin.h>
3871 /// This intrinsic does not correspond to a specific instruction.
3874 /// A 64-bit integral value used to initialize the lower 64 bits of the
3877 /// A 64-bit integral value used to initialize the upper 64 bits of the
3879 /// \returns An initialized 128-bit integer vector.
3880 static __inline__ __m128i __DEFAULT_FN_ATTRS
3881 _mm_setr_epi64(__m64 __q0, __m64 __q1)
3883 return _mm_set_epi64(__q1, __q0);
3886 /// Constructs a 128-bit integer vector, initialized in reverse order
3887 /// with the specified 32-bit integral values.
3889 /// \headerfile <x86intrin.h>
3891 /// This intrinsic is a utility function and does not correspond to a specific
3895 /// A 32-bit integral value used to initialize bits [31:0] of the result.
3897 /// A 32-bit integral value used to initialize bits [63:32] of the result.
3899 /// A 32-bit integral value used to initialize bits [95:64] of the result.
3901 /// A 32-bit integral value used to initialize bits [127:96] of the result.
3902 /// \returns An initialized 128-bit integer vector.
3903 static __inline__ __m128i __DEFAULT_FN_ATTRS
3904 _mm_setr_epi32(int __i0, int __i1, int __i2, int __i3)
3906 return _mm_set_epi32(__i3, __i2, __i1, __i0);
3909 /// Constructs a 128-bit integer vector, initialized in reverse order
3910 /// with the specified 16-bit integral values.
3912 /// \headerfile <x86intrin.h>
3914 /// This intrinsic is a utility function and does not correspond to a specific
3918 /// A 16-bit integral value used to initialize bits [15:0] of the result.
3920 /// A 16-bit integral value used to initialize bits [31:16] of the result.
3922 /// A 16-bit integral value used to initialize bits [47:32] of the result.
3924 /// A 16-bit integral value used to initialize bits [63:48] of the result.
3926 /// A 16-bit integral value used to initialize bits [79:64] of the result.
3928 /// A 16-bit integral value used to initialize bits [95:80] of the result.
3930 /// A 16-bit integral value used to initialize bits [111:96] of the result.
3932 /// A 16-bit integral value used to initialize bits [127:112] of the result.
3933 /// \returns An initialized 128-bit integer vector.
3934 static __inline__ __m128i __DEFAULT_FN_ATTRS
3935 _mm_setr_epi16(short __w0, short __w1, short __w2, short __w3, short __w4, short __w5, short __w6, short __w7)
3937 return _mm_set_epi16(__w7, __w6, __w5, __w4, __w3, __w2, __w1, __w0);
3940 /// Constructs a 128-bit integer vector, initialized in reverse order
3941 /// with the specified 8-bit integral values.
3943 /// \headerfile <x86intrin.h>
3945 /// This intrinsic is a utility function and does not correspond to a specific
3949 /// An 8-bit integral value used to initialize bits [7:0] of the result.
3951 /// An 8-bit integral value used to initialize bits [15:8] of the result.
3953 /// An 8-bit integral value used to initialize bits [23:16] of the result.
3955 /// An 8-bit integral value used to initialize bits [31:24] of the result.
3957 /// An 8-bit integral value used to initialize bits [39:32] of the result.
3959 /// An 8-bit integral value used to initialize bits [47:40] of the result.
3961 /// An 8-bit integral value used to initialize bits [55:48] of the result.
3963 /// An 8-bit integral value used to initialize bits [63:56] of the result.
3965 /// An 8-bit integral value used to initialize bits [71:64] of the result.
3967 /// An 8-bit integral value used to initialize bits [79:72] of the result.
3969 /// An 8-bit integral value used to initialize bits [87:80] of the result.
3971 /// An 8-bit integral value used to initialize bits [95:88] of the result.
3973 /// An 8-bit integral value used to initialize bits [103:96] of the result.
3975 /// An 8-bit integral value used to initialize bits [111:104] of the result.
3977 /// An 8-bit integral value used to initialize bits [119:112] of the result.
3979 /// An 8-bit integral value used to initialize bits [127:120] of the result.
3980 /// \returns An initialized 128-bit integer vector.
3981 static __inline__ __m128i __DEFAULT_FN_ATTRS
3982 _mm_setr_epi8(char __b0, char __b1, char __b2, char __b3, char __b4, char __b5, char __b6, char __b7, char __b8, char __b9, char __b10, char __b11, char __b12, char __b13, char __b14, char __b15)
3984 return _mm_set_epi8(__b15, __b14, __b13, __b12, __b11, __b10, __b9, __b8, __b7, __b6, __b5, __b4, __b3, __b2, __b1, __b0);
3987 /// Creates a 128-bit integer vector initialized to zero.
3989 /// \headerfile <x86intrin.h>
3991 /// This intrinsic corresponds to the <c> VXORPS / XORPS </c> instruction.
3993 /// \returns An initialized 128-bit integer vector with all elements set to
3995 static __inline__ __m128i __DEFAULT_FN_ATTRS
3996 _mm_setzero_si128(void)
3998 return __extension__ (__m128i)(__v2di){ 0LL, 0LL };
4001 /// Stores a 128-bit integer vector to a memory location aligned on a
4002 /// 128-bit boundary.
4004 /// \headerfile <x86intrin.h>
4006 /// This intrinsic corresponds to the <c> VMOVAPS / MOVAPS </c> instruction.
4009 /// A pointer to an aligned memory location that will receive the integer
4012 /// A 128-bit integer vector containing the values to be moved.
4013 static __inline__ void __DEFAULT_FN_ATTRS
4014 _mm_store_si128(__m128i *__p, __m128i __b)
4019 /// Stores a 128-bit integer vector to an unaligned memory location.
4021 /// \headerfile <x86intrin.h>
4023 /// This intrinsic corresponds to the <c> VMOVUPS / MOVUPS </c> instruction.
4026 /// A pointer to a memory location that will receive the integer values.
4028 /// A 128-bit integer vector containing the values to be moved.
4029 static __inline__ void __DEFAULT_FN_ATTRS
4030 _mm_storeu_si128(__m128i *__p, __m128i __b)
4032 struct __storeu_si128 {
4034 } __attribute__((__packed__, __may_alias__));
4035 ((struct __storeu_si128*)__p)->__v = __b;
4038 /// Stores a 64-bit integer value from the low element of a 128-bit integer
4041 /// \headerfile <x86intrin.h>
4043 /// This intrinsic corresponds to the <c> VMOVQ / MOVQ </c> instruction.
4046 /// A pointer to a 64-bit memory location. The address of the memory
4047 /// location does not have to be algned.
4049 /// A 128-bit integer vector containing the value to be stored.
4050 static __inline__ void __DEFAULT_FN_ATTRS
4051 _mm_storeu_si64(void const *__p, __m128i __b)
4053 struct __storeu_si64 {
4055 } __attribute__((__packed__, __may_alias__));
4056 ((struct __storeu_si64*)__p)->__v = ((__v2di)__b)[0];
4059 /// Stores a 32-bit integer value from the low element of a 128-bit integer
4062 /// \headerfile <x86intrin.h>
4064 /// This intrinsic corresponds to the <c> VMOVD / MOVD </c> instruction.
4067 /// A pointer to a 32-bit memory location. The address of the memory
4068 /// location does not have to be aligned.
4070 /// A 128-bit integer vector containing the value to be stored.
4071 static __inline__ void __DEFAULT_FN_ATTRS
4072 _mm_storeu_si32(void const *__p, __m128i __b)
4074 struct __storeu_si32 {
4076 } __attribute__((__packed__, __may_alias__));
4077 ((struct __storeu_si32*)__p)->__v = ((__v4si)__b)[0];
4080 /// Stores a 16-bit integer value from the low element of a 128-bit integer
4083 /// \headerfile <x86intrin.h>
4085 /// This intrinsic does not correspond to a specific instruction.
4088 /// A pointer to a 16-bit memory location. The address of the memory
4089 /// location does not have to be aligned.
4091 /// A 128-bit integer vector containing the value to be stored.
4092 static __inline__ void __DEFAULT_FN_ATTRS
4093 _mm_storeu_si16(void const *__p, __m128i __b)
4095 struct __storeu_si16 {
4097 } __attribute__((__packed__, __may_alias__));
4098 ((struct __storeu_si16*)__p)->__v = ((__v8hi)__b)[0];
4101 /// Moves bytes selected by the mask from the first operand to the
4102 /// specified unaligned memory location. When a mask bit is 1, the
4103 /// corresponding byte is written, otherwise it is not written.
4105 /// To minimize caching, the data is flagged as non-temporal (unlikely to be
4106 /// used again soon). Exception and trap behavior for elements not selected
4107 /// for storage to memory are implementation dependent.
4109 /// \headerfile <x86intrin.h>
4111 /// This intrinsic corresponds to the <c> VMASKMOVDQU / MASKMOVDQU </c>
4115 /// A 128-bit integer vector containing the values to be moved.
4117 /// A 128-bit integer vector containing the mask. The most significant bit of
4118 /// each byte represents the mask bits.
4120 /// A pointer to an unaligned 128-bit memory location where the specified
4121 /// values are moved.
4122 static __inline__ void __DEFAULT_FN_ATTRS
4123 _mm_maskmoveu_si128(__m128i __d, __m128i __n, char *__p)
4125 __builtin_ia32_maskmovdqu((__v16qi)__d, (__v16qi)__n, __p);
4128 /// Stores the lower 64 bits of a 128-bit integer vector of [2 x i64] to
4129 /// a memory location.
4131 /// \headerfile <x86intrin.h>
4133 /// This intrinsic corresponds to the <c> VMOVLPS / MOVLPS </c> instruction.
4136 /// A pointer to a 64-bit memory location that will receive the lower 64 bits
4137 /// of the integer vector parameter.
4139 /// A 128-bit integer vector of [2 x i64]. The lower 64 bits contain the
4140 /// value to be stored.
4141 static __inline__ void __DEFAULT_FN_ATTRS
4142 _mm_storel_epi64(__m128i *__p, __m128i __a)
4144 struct __mm_storel_epi64_struct {
4146 } __attribute__((__packed__, __may_alias__));
4147 ((struct __mm_storel_epi64_struct*)__p)->__u = __a[0];
4150 /// Stores a 128-bit floating point vector of [2 x double] to a 128-bit
4151 /// aligned memory location.
4153 /// To minimize caching, the data is flagged as non-temporal (unlikely to be
4154 /// used again soon).
4156 /// \headerfile <x86intrin.h>
4158 /// This intrinsic corresponds to the <c> VMOVNTPS / MOVNTPS </c> instruction.
4161 /// A pointer to the 128-bit aligned memory location used to store the value.
4163 /// A vector of [2 x double] containing the 64-bit values to be stored.
4164 static __inline__ void __DEFAULT_FN_ATTRS
4165 _mm_stream_pd(double *__p, __m128d __a)
4167 __builtin_nontemporal_store((__v2df)__a, (__v2df*)__p);
4170 /// Stores a 128-bit integer vector to a 128-bit aligned memory location.
4172 /// To minimize caching, the data is flagged as non-temporal (unlikely to be
4173 /// used again soon).
4175 /// \headerfile <x86intrin.h>
4177 /// This intrinsic corresponds to the <c> VMOVNTPS / MOVNTPS </c> instruction.
4180 /// A pointer to the 128-bit aligned memory location used to store the value.
4182 /// A 128-bit integer vector containing the values to be stored.
4183 static __inline__ void __DEFAULT_FN_ATTRS
4184 _mm_stream_si128(__m128i *__p, __m128i __a)
4186 __builtin_nontemporal_store((__v2di)__a, (__v2di*)__p);
4189 /// Stores a 32-bit integer value in the specified memory location.
4191 /// To minimize caching, the data is flagged as non-temporal (unlikely to be
4192 /// used again soon).
4194 /// \headerfile <x86intrin.h>
4196 /// This intrinsic corresponds to the <c> MOVNTI </c> instruction.
4199 /// A pointer to the 32-bit memory location used to store the value.
4201 /// A 32-bit integer containing the value to be stored.
4202 static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse2")))
4203 _mm_stream_si32(int *__p, int __a)
4205 __builtin_ia32_movnti(__p, __a);
4209 /// Stores a 64-bit integer value in the specified memory location.
4211 /// To minimize caching, the data is flagged as non-temporal (unlikely to be
4212 /// used again soon).
4214 /// \headerfile <x86intrin.h>
4216 /// This intrinsic corresponds to the <c> MOVNTIQ </c> instruction.
4219 /// A pointer to the 64-bit memory location used to store the value.
4221 /// A 64-bit integer containing the value to be stored.
4222 static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse2")))
4223 _mm_stream_si64(long long *__p, long long __a)
4225 __builtin_ia32_movnti64(__p, __a);
4229 #if defined(__cplusplus)
4233 /// The cache line containing \a __p is flushed and invalidated from all
4234 /// caches in the coherency domain.
4236 /// \headerfile <x86intrin.h>
4238 /// This intrinsic corresponds to the <c> CLFLUSH </c> instruction.
4241 /// A pointer to the memory location used to identify the cache line to be
4243 void _mm_clflush(void const * __p);
4245 /// Forces strong memory ordering (serialization) between load
4246 /// instructions preceding this instruction and load instructions following
4247 /// this instruction, ensuring the system completes all previous loads before
4248 /// executing subsequent loads.
4250 /// \headerfile <x86intrin.h>
4252 /// This intrinsic corresponds to the <c> LFENCE </c> instruction.
4254 void _mm_lfence(void);
4256 /// Forces strong memory ordering (serialization) between load and store
4257 /// instructions preceding this instruction and load and store instructions
4258 /// following this instruction, ensuring that the system completes all
4259 /// previous memory accesses before executing subsequent memory accesses.
4261 /// \headerfile <x86intrin.h>
4263 /// This intrinsic corresponds to the <c> MFENCE </c> instruction.
4265 void _mm_mfence(void);
4267 #if defined(__cplusplus)
4271 /// Converts 16-bit signed integers from both 128-bit integer vector
4272 /// operands into 8-bit signed integers, and packs the results into the
4273 /// destination. Positive values greater than 0x7F are saturated to 0x7F.
4274 /// Negative values less than 0x80 are saturated to 0x80.
4276 /// \headerfile <x86intrin.h>
4278 /// This intrinsic corresponds to the <c> VPACKSSWB / PACKSSWB </c> instruction.
4281 /// A 128-bit integer vector of [8 x i16]. Each 16-bit element is treated as
4282 /// a signed integer and is converted to a 8-bit signed integer with
4283 /// saturation. Values greater than 0x7F are saturated to 0x7F. Values less
4284 /// than 0x80 are saturated to 0x80. The converted [8 x i8] values are
4285 /// written to the lower 64 bits of the result.
4287 /// A 128-bit integer vector of [8 x i16]. Each 16-bit element is treated as
4288 /// a signed integer and is converted to a 8-bit signed integer with
4289 /// saturation. Values greater than 0x7F are saturated to 0x7F. Values less
4290 /// than 0x80 are saturated to 0x80. The converted [8 x i8] values are
4291 /// written to the higher 64 bits of the result.
4292 /// \returns A 128-bit vector of [16 x i8] containing the converted values.
4293 static __inline__ __m128i __DEFAULT_FN_ATTRS
4294 _mm_packs_epi16(__m128i __a, __m128i __b)
4296 return (__m128i)__builtin_ia32_packsswb128((__v8hi)__a, (__v8hi)__b);
4299 /// Converts 32-bit signed integers from both 128-bit integer vector
4300 /// operands into 16-bit signed integers, and packs the results into the
4301 /// destination. Positive values greater than 0x7FFF are saturated to 0x7FFF.
4302 /// Negative values less than 0x8000 are saturated to 0x8000.
4304 /// \headerfile <x86intrin.h>
4306 /// This intrinsic corresponds to the <c> VPACKSSDW / PACKSSDW </c> instruction.
4309 /// A 128-bit integer vector of [4 x i32]. Each 32-bit element is treated as
4310 /// a signed integer and is converted to a 16-bit signed integer with
4311 /// saturation. Values greater than 0x7FFF are saturated to 0x7FFF. Values
4312 /// less than 0x8000 are saturated to 0x8000. The converted [4 x i16] values
4313 /// are written to the lower 64 bits of the result.
4315 /// A 128-bit integer vector of [4 x i32]. Each 32-bit element is treated as
4316 /// a signed integer and is converted to a 16-bit signed integer with
4317 /// saturation. Values greater than 0x7FFF are saturated to 0x7FFF. Values
4318 /// less than 0x8000 are saturated to 0x8000. The converted [4 x i16] values
4319 /// are written to the higher 64 bits of the result.
4320 /// \returns A 128-bit vector of [8 x i16] containing the converted values.
4321 static __inline__ __m128i __DEFAULT_FN_ATTRS
4322 _mm_packs_epi32(__m128i __a, __m128i __b)
4324 return (__m128i)__builtin_ia32_packssdw128((__v4si)__a, (__v4si)__b);
4327 /// Converts 16-bit signed integers from both 128-bit integer vector
4328 /// operands into 8-bit unsigned integers, and packs the results into the
4329 /// destination. Values greater than 0xFF are saturated to 0xFF. Values less
4330 /// than 0x00 are saturated to 0x00.
4332 /// \headerfile <x86intrin.h>
4334 /// This intrinsic corresponds to the <c> VPACKUSWB / PACKUSWB </c> instruction.
4337 /// A 128-bit integer vector of [8 x i16]. Each 16-bit element is treated as
4338 /// a signed integer and is converted to an 8-bit unsigned integer with
4339 /// saturation. Values greater than 0xFF are saturated to 0xFF. Values less
4340 /// than 0x00 are saturated to 0x00. The converted [8 x i8] values are
4341 /// written to the lower 64 bits of the result.
4343 /// A 128-bit integer vector of [8 x i16]. Each 16-bit element is treated as
4344 /// a signed integer and is converted to an 8-bit unsigned integer with
4345 /// saturation. Values greater than 0xFF are saturated to 0xFF. Values less
4346 /// than 0x00 are saturated to 0x00. The converted [8 x i8] values are
4347 /// written to the higher 64 bits of the result.
4348 /// \returns A 128-bit vector of [16 x i8] containing the converted values.
4349 static __inline__ __m128i __DEFAULT_FN_ATTRS
4350 _mm_packus_epi16(__m128i __a, __m128i __b)
4352 return (__m128i)__builtin_ia32_packuswb128((__v8hi)__a, (__v8hi)__b);
4355 /// Extracts 16 bits from a 128-bit integer vector of [8 x i16], using
4356 /// the immediate-value parameter as a selector.
4358 /// \headerfile <x86intrin.h>
4360 /// This intrinsic corresponds to the <c> VPEXTRW / PEXTRW </c> instruction.
4363 /// A 128-bit integer vector.
4365 /// An immediate value. Bits [2:0] selects values from \a __a to be assigned
4366 /// to bits[15:0] of the result. \n
4367 /// 000: assign values from bits [15:0] of \a __a. \n
4368 /// 001: assign values from bits [31:16] of \a __a. \n
4369 /// 010: assign values from bits [47:32] of \a __a. \n
4370 /// 011: assign values from bits [63:48] of \a __a. \n
4371 /// 100: assign values from bits [79:64] of \a __a. \n
4372 /// 101: assign values from bits [95:80] of \a __a. \n
4373 /// 110: assign values from bits [111:96] of \a __a. \n
4374 /// 111: assign values from bits [127:112] of \a __a.
4375 /// \returns An integer, whose lower 16 bits are selected from the 128-bit
4376 /// integer vector parameter and the remaining bits are assigned zeros.
4377 #define _mm_extract_epi16(a, imm) \
4378 (int)(unsigned short)__builtin_ia32_vec_ext_v8hi((__v8hi)(__m128i)(a), \
4381 /// Constructs a 128-bit integer vector by first making a copy of the
4382 /// 128-bit integer vector parameter, and then inserting the lower 16 bits
4383 /// of an integer parameter into an offset specified by the immediate-value
4386 /// \headerfile <x86intrin.h>
4388 /// This intrinsic corresponds to the <c> VPINSRW / PINSRW </c> instruction.
4391 /// A 128-bit integer vector of [8 x i16]. This vector is copied to the
4392 /// result and then one of the eight elements in the result is replaced by
4393 /// the lower 16 bits of \a __b.
4395 /// An integer. The lower 16 bits of this parameter are written to the
4396 /// result beginning at an offset specified by \a __imm.
4398 /// An immediate value specifying the bit offset in the result at which the
4399 /// lower 16 bits of \a __b are written.
4400 /// \returns A 128-bit integer vector containing the constructed values.
4401 #define _mm_insert_epi16(a, b, imm) \
4402 (__m128i)__builtin_ia32_vec_set_v8hi((__v8hi)(__m128i)(a), (int)(b), \
4405 /// Copies the values of the most significant bits from each 8-bit
4406 /// element in a 128-bit integer vector of [16 x i8] to create a 16-bit mask
4407 /// value, zero-extends the value, and writes it to the destination.
4409 /// \headerfile <x86intrin.h>
4411 /// This intrinsic corresponds to the <c> VPMOVMSKB / PMOVMSKB </c> instruction.
4414 /// A 128-bit integer vector containing the values with bits to be extracted.
4415 /// \returns The most significant bits from each 8-bit element in \a __a,
4416 /// written to bits [15:0]. The other bits are assigned zeros.
4417 static __inline__ int __DEFAULT_FN_ATTRS
4418 _mm_movemask_epi8(__m128i __a)
4420 return __builtin_ia32_pmovmskb128((__v16qi)__a);
4423 /// Constructs a 128-bit integer vector by shuffling four 32-bit
4424 /// elements of a 128-bit integer vector parameter, using the immediate-value
4425 /// parameter as a specifier.
4427 /// \headerfile <x86intrin.h>
4430 /// __m128i _mm_shuffle_epi32(__m128i a, const int imm);
4433 /// This intrinsic corresponds to the <c> VPSHUFD / PSHUFD </c> instruction.
4436 /// A 128-bit integer vector containing the values to be copied.
4438 /// An immediate value containing an 8-bit value specifying which elements to
4439 /// copy from a. The destinations within the 128-bit destination are assigned
4440 /// values as follows: \n
4441 /// Bits [1:0] are used to assign values to bits [31:0] of the result. \n
4442 /// Bits [3:2] are used to assign values to bits [63:32] of the result. \n
4443 /// Bits [5:4] are used to assign values to bits [95:64] of the result. \n
4444 /// Bits [7:6] are used to assign values to bits [127:96] of the result. \n
4445 /// Bit value assignments: \n
4446 /// 00: assign values from bits [31:0] of \a a. \n
4447 /// 01: assign values from bits [63:32] of \a a. \n
4448 /// 10: assign values from bits [95:64] of \a a. \n
4449 /// 11: assign values from bits [127:96] of \a a.
4450 /// \returns A 128-bit integer vector containing the shuffled values.
4451 #define _mm_shuffle_epi32(a, imm) \
4452 (__m128i)__builtin_ia32_pshufd((__v4si)(__m128i)(a), (int)(imm))
4454 /// Constructs a 128-bit integer vector by shuffling four lower 16-bit
4455 /// elements of a 128-bit integer vector of [8 x i16], using the immediate
4456 /// value parameter as a specifier.
4458 /// \headerfile <x86intrin.h>
4461 /// __m128i _mm_shufflelo_epi16(__m128i a, const int imm);
4464 /// This intrinsic corresponds to the <c> VPSHUFLW / PSHUFLW </c> instruction.
4467 /// A 128-bit integer vector of [8 x i16]. Bits [127:64] are copied to bits
4468 /// [127:64] of the result.
4470 /// An 8-bit immediate value specifying which elements to copy from \a a. \n
4471 /// Bits[1:0] are used to assign values to bits [15:0] of the result. \n
4472 /// Bits[3:2] are used to assign values to bits [31:16] of the result. \n
4473 /// Bits[5:4] are used to assign values to bits [47:32] of the result. \n
4474 /// Bits[7:6] are used to assign values to bits [63:48] of the result. \n
4475 /// Bit value assignments: \n
4476 /// 00: assign values from bits [15:0] of \a a. \n
4477 /// 01: assign values from bits [31:16] of \a a. \n
4478 /// 10: assign values from bits [47:32] of \a a. \n
4479 /// 11: assign values from bits [63:48] of \a a. \n
4480 /// \returns A 128-bit integer vector containing the shuffled values.
4481 #define _mm_shufflelo_epi16(a, imm) \
4482 (__m128i)__builtin_ia32_pshuflw((__v8hi)(__m128i)(a), (int)(imm))
4484 /// Constructs a 128-bit integer vector by shuffling four upper 16-bit
4485 /// elements of a 128-bit integer vector of [8 x i16], using the immediate
4486 /// value parameter as a specifier.
4488 /// \headerfile <x86intrin.h>
4491 /// __m128i _mm_shufflehi_epi16(__m128i a, const int imm);
4494 /// This intrinsic corresponds to the <c> VPSHUFHW / PSHUFHW </c> instruction.
4497 /// A 128-bit integer vector of [8 x i16]. Bits [63:0] are copied to bits
4498 /// [63:0] of the result.
4500 /// An 8-bit immediate value specifying which elements to copy from \a a. \n
4501 /// Bits[1:0] are used to assign values to bits [79:64] of the result. \n
4502 /// Bits[3:2] are used to assign values to bits [95:80] of the result. \n
4503 /// Bits[5:4] are used to assign values to bits [111:96] of the result. \n
4504 /// Bits[7:6] are used to assign values to bits [127:112] of the result. \n
4505 /// Bit value assignments: \n
4506 /// 00: assign values from bits [79:64] of \a a. \n
4507 /// 01: assign values from bits [95:80] of \a a. \n
4508 /// 10: assign values from bits [111:96] of \a a. \n
4509 /// 11: assign values from bits [127:112] of \a a. \n
4510 /// \returns A 128-bit integer vector containing the shuffled values.
4511 #define _mm_shufflehi_epi16(a, imm) \
4512 (__m128i)__builtin_ia32_pshufhw((__v8hi)(__m128i)(a), (int)(imm))
4514 /// Unpacks the high-order (index 8-15) values from two 128-bit vectors
4515 /// of [16 x i8] and interleaves them into a 128-bit vector of [16 x i8].
4517 /// \headerfile <x86intrin.h>
4519 /// This intrinsic corresponds to the <c> VPUNPCKHBW / PUNPCKHBW </c>
4523 /// A 128-bit vector of [16 x i8].
4524 /// Bits [71:64] are written to bits [7:0] of the result. \n
4525 /// Bits [79:72] are written to bits [23:16] of the result. \n
4526 /// Bits [87:80] are written to bits [39:32] of the result. \n
4527 /// Bits [95:88] are written to bits [55:48] of the result. \n
4528 /// Bits [103:96] are written to bits [71:64] of the result. \n
4529 /// Bits [111:104] are written to bits [87:80] of the result. \n
4530 /// Bits [119:112] are written to bits [103:96] of the result. \n
4531 /// Bits [127:120] are written to bits [119:112] of the result.
4533 /// A 128-bit vector of [16 x i8]. \n
4534 /// Bits [71:64] are written to bits [15:8] of the result. \n
4535 /// Bits [79:72] are written to bits [31:24] of the result. \n
4536 /// Bits [87:80] are written to bits [47:40] of the result. \n
4537 /// Bits [95:88] are written to bits [63:56] of the result. \n
4538 /// Bits [103:96] are written to bits [79:72] of the result. \n
4539 /// Bits [111:104] are written to bits [95:88] of the result. \n
4540 /// Bits [119:112] are written to bits [111:104] of the result. \n
4541 /// Bits [127:120] are written to bits [127:120] of the result.
4542 /// \returns A 128-bit vector of [16 x i8] containing the interleaved values.
4543 static __inline__ __m128i __DEFAULT_FN_ATTRS
4544 _mm_unpackhi_epi8(__m128i __a, __m128i __b)
4546 return (__m128i)__builtin_shufflevector((__v16qi)__a, (__v16qi)__b, 8, 16+8, 9, 16+9, 10, 16+10, 11, 16+11, 12, 16+12, 13, 16+13, 14, 16+14, 15, 16+15);
4549 /// Unpacks the high-order (index 4-7) values from two 128-bit vectors of
4550 /// [8 x i16] and interleaves them into a 128-bit vector of [8 x i16].
4552 /// \headerfile <x86intrin.h>
4554 /// This intrinsic corresponds to the <c> VPUNPCKHWD / PUNPCKHWD </c>
4558 /// A 128-bit vector of [8 x i16].
4559 /// Bits [79:64] are written to bits [15:0] of the result. \n
4560 /// Bits [95:80] are written to bits [47:32] of the result. \n
4561 /// Bits [111:96] are written to bits [79:64] of the result. \n
4562 /// Bits [127:112] are written to bits [111:96] of the result.
4564 /// A 128-bit vector of [8 x i16].
4565 /// Bits [79:64] are written to bits [31:16] of the result. \n
4566 /// Bits [95:80] are written to bits [63:48] of the result. \n
4567 /// Bits [111:96] are written to bits [95:80] of the result. \n
4568 /// Bits [127:112] are written to bits [127:112] of the result.
4569 /// \returns A 128-bit vector of [8 x i16] containing the interleaved values.
4570 static __inline__ __m128i __DEFAULT_FN_ATTRS
4571 _mm_unpackhi_epi16(__m128i __a, __m128i __b)
4573 return (__m128i)__builtin_shufflevector((__v8hi)__a, (__v8hi)__b, 4, 8+4, 5, 8+5, 6, 8+6, 7, 8+7);
4576 /// Unpacks the high-order (index 2,3) values from two 128-bit vectors of
4577 /// [4 x i32] and interleaves them into a 128-bit vector of [4 x i32].
4579 /// \headerfile <x86intrin.h>
4581 /// This intrinsic corresponds to the <c> VPUNPCKHDQ / PUNPCKHDQ </c>
4585 /// A 128-bit vector of [4 x i32]. \n
4586 /// Bits [95:64] are written to bits [31:0] of the destination. \n
4587 /// Bits [127:96] are written to bits [95:64] of the destination.
4589 /// A 128-bit vector of [4 x i32]. \n
4590 /// Bits [95:64] are written to bits [64:32] of the destination. \n
4591 /// Bits [127:96] are written to bits [127:96] of the destination.
4592 /// \returns A 128-bit vector of [4 x i32] containing the interleaved values.
4593 static __inline__ __m128i __DEFAULT_FN_ATTRS
4594 _mm_unpackhi_epi32(__m128i __a, __m128i __b)
4596 return (__m128i)__builtin_shufflevector((__v4si)__a, (__v4si)__b, 2, 4+2, 3, 4+3);
4599 /// Unpacks the high-order 64-bit elements from two 128-bit vectors of
4600 /// [2 x i64] and interleaves them into a 128-bit vector of [2 x i64].
4602 /// \headerfile <x86intrin.h>
4604 /// This intrinsic corresponds to the <c> VPUNPCKHQDQ / PUNPCKHQDQ </c>
4608 /// A 128-bit vector of [2 x i64]. \n
4609 /// Bits [127:64] are written to bits [63:0] of the destination.
4611 /// A 128-bit vector of [2 x i64]. \n
4612 /// Bits [127:64] are written to bits [127:64] of the destination.
4613 /// \returns A 128-bit vector of [2 x i64] containing the interleaved values.
4614 static __inline__ __m128i __DEFAULT_FN_ATTRS
4615 _mm_unpackhi_epi64(__m128i __a, __m128i __b)
4617 return (__m128i)__builtin_shufflevector((__v2di)__a, (__v2di)__b, 1, 2+1);
4620 /// Unpacks the low-order (index 0-7) values from two 128-bit vectors of
4621 /// [16 x i8] and interleaves them into a 128-bit vector of [16 x i8].
4623 /// \headerfile <x86intrin.h>
4625 /// This intrinsic corresponds to the <c> VPUNPCKLBW / PUNPCKLBW </c>
4629 /// A 128-bit vector of [16 x i8]. \n
4630 /// Bits [7:0] are written to bits [7:0] of the result. \n
4631 /// Bits [15:8] are written to bits [23:16] of the result. \n
4632 /// Bits [23:16] are written to bits [39:32] of the result. \n
4633 /// Bits [31:24] are written to bits [55:48] of the result. \n
4634 /// Bits [39:32] are written to bits [71:64] of the result. \n
4635 /// Bits [47:40] are written to bits [87:80] of the result. \n
4636 /// Bits [55:48] are written to bits [103:96] of the result. \n
4637 /// Bits [63:56] are written to bits [119:112] of the result.
4639 /// A 128-bit vector of [16 x i8].
4640 /// Bits [7:0] are written to bits [15:8] of the result. \n
4641 /// Bits [15:8] are written to bits [31:24] of the result. \n
4642 /// Bits [23:16] are written to bits [47:40] of the result. \n
4643 /// Bits [31:24] are written to bits [63:56] of the result. \n
4644 /// Bits [39:32] are written to bits [79:72] of the result. \n
4645 /// Bits [47:40] are written to bits [95:88] of the result. \n
4646 /// Bits [55:48] are written to bits [111:104] of the result. \n
4647 /// Bits [63:56] are written to bits [127:120] of the result.
4648 /// \returns A 128-bit vector of [16 x i8] containing the interleaved values.
4649 static __inline__ __m128i __DEFAULT_FN_ATTRS
4650 _mm_unpacklo_epi8(__m128i __a, __m128i __b)
4652 return (__m128i)__builtin_shufflevector((__v16qi)__a, (__v16qi)__b, 0, 16+0, 1, 16+1, 2, 16+2, 3, 16+3, 4, 16+4, 5, 16+5, 6, 16+6, 7, 16+7);
4655 /// Unpacks the low-order (index 0-3) values from each of the two 128-bit
4656 /// vectors of [8 x i16] and interleaves them into a 128-bit vector of
4659 /// \headerfile <x86intrin.h>
4661 /// This intrinsic corresponds to the <c> VPUNPCKLWD / PUNPCKLWD </c>
4665 /// A 128-bit vector of [8 x i16].
4666 /// Bits [15:0] are written to bits [15:0] of the result. \n
4667 /// Bits [31:16] are written to bits [47:32] of the result. \n
4668 /// Bits [47:32] are written to bits [79:64] of the result. \n
4669 /// Bits [63:48] are written to bits [111:96] of the result.
4671 /// A 128-bit vector of [8 x i16].
4672 /// Bits [15:0] are written to bits [31:16] of the result. \n
4673 /// Bits [31:16] are written to bits [63:48] of the result. \n
4674 /// Bits [47:32] are written to bits [95:80] of the result. \n
4675 /// Bits [63:48] are written to bits [127:112] of the result.
4676 /// \returns A 128-bit vector of [8 x i16] containing the interleaved values.
4677 static __inline__ __m128i __DEFAULT_FN_ATTRS
4678 _mm_unpacklo_epi16(__m128i __a, __m128i __b)
4680 return (__m128i)__builtin_shufflevector((__v8hi)__a, (__v8hi)__b, 0, 8+0, 1, 8+1, 2, 8+2, 3, 8+3);
4683 /// Unpacks the low-order (index 0,1) values from two 128-bit vectors of
4684 /// [4 x i32] and interleaves them into a 128-bit vector of [4 x i32].
4686 /// \headerfile <x86intrin.h>
4688 /// This intrinsic corresponds to the <c> VPUNPCKLDQ / PUNPCKLDQ </c>
4692 /// A 128-bit vector of [4 x i32]. \n
4693 /// Bits [31:0] are written to bits [31:0] of the destination. \n
4694 /// Bits [63:32] are written to bits [95:64] of the destination.
4696 /// A 128-bit vector of [4 x i32]. \n
4697 /// Bits [31:0] are written to bits [64:32] of the destination. \n
4698 /// Bits [63:32] are written to bits [127:96] of the destination.
4699 /// \returns A 128-bit vector of [4 x i32] containing the interleaved values.
4700 static __inline__ __m128i __DEFAULT_FN_ATTRS
4701 _mm_unpacklo_epi32(__m128i __a, __m128i __b)
4703 return (__m128i)__builtin_shufflevector((__v4si)__a, (__v4si)__b, 0, 4+0, 1, 4+1);
4706 /// Unpacks the low-order 64-bit elements from two 128-bit vectors of
4707 /// [2 x i64] and interleaves them into a 128-bit vector of [2 x i64].
4709 /// \headerfile <x86intrin.h>
4711 /// This intrinsic corresponds to the <c> VPUNPCKLQDQ / PUNPCKLQDQ </c>
4715 /// A 128-bit vector of [2 x i64]. \n
4716 /// Bits [63:0] are written to bits [63:0] of the destination. \n
4718 /// A 128-bit vector of [2 x i64]. \n
4719 /// Bits [63:0] are written to bits [127:64] of the destination. \n
4720 /// \returns A 128-bit vector of [2 x i64] containing the interleaved values.
4721 static __inline__ __m128i __DEFAULT_FN_ATTRS
4722 _mm_unpacklo_epi64(__m128i __a, __m128i __b)
4724 return (__m128i)__builtin_shufflevector((__v2di)__a, (__v2di)__b, 0, 2+0);
4727 /// Returns the lower 64 bits of a 128-bit integer vector as a 64-bit
4730 /// \headerfile <x86intrin.h>
4732 /// This intrinsic corresponds to the <c> MOVDQ2Q </c> instruction.
4735 /// A 128-bit integer vector operand. The lower 64 bits are moved to the
4737 /// \returns A 64-bit integer containing the lower 64 bits of the parameter.
4738 static __inline__ __m64 __DEFAULT_FN_ATTRS
4739 _mm_movepi64_pi64(__m128i __a)
4741 return (__m64)__a[0];
4744 /// Moves the 64-bit operand to a 128-bit integer vector, zeroing the
4747 /// \headerfile <x86intrin.h>
4749 /// This intrinsic corresponds to the <c> MOVD+VMOVQ </c> instruction.
4753 /// \returns A 128-bit integer vector. The lower 64 bits contain the value from
4754 /// the operand. The upper 64 bits are assigned zeros.
4755 static __inline__ __m128i __DEFAULT_FN_ATTRS
4756 _mm_movpi64_epi64(__m64 __a)
4758 return __extension__ (__m128i)(__v2di){ (long long)__a, 0 };
4761 /// Moves the lower 64 bits of a 128-bit integer vector to a 128-bit
4762 /// integer vector, zeroing the upper bits.
4764 /// \headerfile <x86intrin.h>
4766 /// This intrinsic corresponds to the <c> VMOVQ / MOVQ </c> instruction.
4769 /// A 128-bit integer vector operand. The lower 64 bits are moved to the
4771 /// \returns A 128-bit integer vector. The lower 64 bits contain the value from
4772 /// the operand. The upper 64 bits are assigned zeros.
4773 static __inline__ __m128i __DEFAULT_FN_ATTRS
4774 _mm_move_epi64(__m128i __a)
4776 return __builtin_shufflevector((__v2di)__a, _mm_setzero_si128(), 0, 2);
4779 /// Unpacks the high-order 64-bit elements from two 128-bit vectors of
4780 /// [2 x double] and interleaves them into a 128-bit vector of [2 x
4783 /// \headerfile <x86intrin.h>
4785 /// This intrinsic corresponds to the <c> VUNPCKHPD / UNPCKHPD </c> instruction.
4788 /// A 128-bit vector of [2 x double]. \n
4789 /// Bits [127:64] are written to bits [63:0] of the destination.
4791 /// A 128-bit vector of [2 x double]. \n
4792 /// Bits [127:64] are written to bits [127:64] of the destination.
4793 /// \returns A 128-bit vector of [2 x double] containing the interleaved values.
4794 static __inline__ __m128d __DEFAULT_FN_ATTRS
4795 _mm_unpackhi_pd(__m128d __a, __m128d __b)
4797 return __builtin_shufflevector((__v2df)__a, (__v2df)__b, 1, 2+1);
4800 /// Unpacks the low-order 64-bit elements from two 128-bit vectors
4801 /// of [2 x double] and interleaves them into a 128-bit vector of [2 x
4804 /// \headerfile <x86intrin.h>
4806 /// This intrinsic corresponds to the <c> VUNPCKLPD / UNPCKLPD </c> instruction.
4809 /// A 128-bit vector of [2 x double]. \n
4810 /// Bits [63:0] are written to bits [63:0] of the destination.
4812 /// A 128-bit vector of [2 x double]. \n
4813 /// Bits [63:0] are written to bits [127:64] of the destination.
4814 /// \returns A 128-bit vector of [2 x double] containing the interleaved values.
4815 static __inline__ __m128d __DEFAULT_FN_ATTRS
4816 _mm_unpacklo_pd(__m128d __a, __m128d __b)
4818 return __builtin_shufflevector((__v2df)__a, (__v2df)__b, 0, 2+0);
4821 /// Extracts the sign bits of the double-precision values in the 128-bit
4822 /// vector of [2 x double], zero-extends the value, and writes it to the
4823 /// low-order bits of the destination.
4825 /// \headerfile <x86intrin.h>
4827 /// This intrinsic corresponds to the <c> VMOVMSKPD / MOVMSKPD </c> instruction.
4830 /// A 128-bit vector of [2 x double] containing the values with sign bits to
4832 /// \returns The sign bits from each of the double-precision elements in \a __a,
4833 /// written to bits [1:0]. The remaining bits are assigned values of zero.
4834 static __inline__ int __DEFAULT_FN_ATTRS
4835 _mm_movemask_pd(__m128d __a)
4837 return __builtin_ia32_movmskpd((__v2df)__a);
4841 /// Constructs a 128-bit floating-point vector of [2 x double] from two
4842 /// 128-bit vector parameters of [2 x double], using the immediate-value
4843 /// parameter as a specifier.
4845 /// \headerfile <x86intrin.h>
4848 /// __m128d _mm_shuffle_pd(__m128d a, __m128d b, const int i);
4851 /// This intrinsic corresponds to the <c> VSHUFPD / SHUFPD </c> instruction.
4854 /// A 128-bit vector of [2 x double].
4856 /// A 128-bit vector of [2 x double].
4858 /// An 8-bit immediate value. The least significant two bits specify which
4859 /// elements to copy from \a a and \a b: \n
4860 /// Bit[0] = 0: lower element of \a a copied to lower element of result. \n
4861 /// Bit[0] = 1: upper element of \a a copied to lower element of result. \n
4862 /// Bit[1] = 0: lower element of \a b copied to upper element of result. \n
4863 /// Bit[1] = 1: upper element of \a b copied to upper element of result. \n
4864 /// \returns A 128-bit vector of [2 x double] containing the shuffled values.
4865 #define _mm_shuffle_pd(a, b, i) \
4866 (__m128d)__builtin_ia32_shufpd((__v2df)(__m128d)(a), (__v2df)(__m128d)(b), \
4869 /// Casts a 128-bit floating-point vector of [2 x double] into a 128-bit
4870 /// floating-point vector of [4 x float].
4872 /// \headerfile <x86intrin.h>
4874 /// This intrinsic has no corresponding instruction.
4877 /// A 128-bit floating-point vector of [2 x double].
4878 /// \returns A 128-bit floating-point vector of [4 x float] containing the same
4879 /// bitwise pattern as the parameter.
4880 static __inline__ __m128 __DEFAULT_FN_ATTRS
4881 _mm_castpd_ps(__m128d __a)
4886 /// Casts a 128-bit floating-point vector of [2 x double] into a 128-bit
4889 /// \headerfile <x86intrin.h>
4891 /// This intrinsic has no corresponding instruction.
4894 /// A 128-bit floating-point vector of [2 x double].
4895 /// \returns A 128-bit integer vector containing the same bitwise pattern as the
4897 static __inline__ __m128i __DEFAULT_FN_ATTRS
4898 _mm_castpd_si128(__m128d __a)
4900 return (__m128i)__a;
4903 /// Casts a 128-bit floating-point vector of [4 x float] into a 128-bit
4904 /// floating-point vector of [2 x double].
4906 /// \headerfile <x86intrin.h>
4908 /// This intrinsic has no corresponding instruction.
4911 /// A 128-bit floating-point vector of [4 x float].
4912 /// \returns A 128-bit floating-point vector of [2 x double] containing the same
4913 /// bitwise pattern as the parameter.
4914 static __inline__ __m128d __DEFAULT_FN_ATTRS
4915 _mm_castps_pd(__m128 __a)
4917 return (__m128d)__a;
4920 /// Casts a 128-bit floating-point vector of [4 x float] into a 128-bit
4923 /// \headerfile <x86intrin.h>
4925 /// This intrinsic has no corresponding instruction.
4928 /// A 128-bit floating-point vector of [4 x float].
4929 /// \returns A 128-bit integer vector containing the same bitwise pattern as the
4931 static __inline__ __m128i __DEFAULT_FN_ATTRS
4932 _mm_castps_si128(__m128 __a)
4934 return (__m128i)__a;
4937 /// Casts a 128-bit integer vector into a 128-bit floating-point vector
4940 /// \headerfile <x86intrin.h>
4942 /// This intrinsic has no corresponding instruction.
4945 /// A 128-bit integer vector.
4946 /// \returns A 128-bit floating-point vector of [4 x float] containing the same
4947 /// bitwise pattern as the parameter.
4948 static __inline__ __m128 __DEFAULT_FN_ATTRS
4949 _mm_castsi128_ps(__m128i __a)
4954 /// Casts a 128-bit integer vector into a 128-bit floating-point vector
4955 /// of [2 x double].
4957 /// \headerfile <x86intrin.h>
4959 /// This intrinsic has no corresponding instruction.
4962 /// A 128-bit integer vector.
4963 /// \returns A 128-bit floating-point vector of [2 x double] containing the same
4964 /// bitwise pattern as the parameter.
4965 static __inline__ __m128d __DEFAULT_FN_ATTRS
4966 _mm_castsi128_pd(__m128i __a)
4968 return (__m128d)__a;
4971 #if defined(__cplusplus)
4975 /// Indicates that a spin loop is being executed for the purposes of
4976 /// optimizing power consumption during the loop.
4978 /// \headerfile <x86intrin.h>
4980 /// This intrinsic corresponds to the <c> PAUSE </c> instruction.
4982 void _mm_pause(void);
4984 #if defined(__cplusplus)
4987 #undef __DEFAULT_FN_ATTRS
4988 #undef __DEFAULT_FN_ATTRS_MMX
4990 #define _MM_SHUFFLE2(x, y) (((x) << 1) | (y))
4992 #define _MM_DENORMALS_ZERO_ON (0x0040)
4993 #define _MM_DENORMALS_ZERO_OFF (0x0000)
4995 #define _MM_DENORMALS_ZERO_MASK (0x0040)
4997 #define _MM_GET_DENORMALS_ZERO_MODE() (_mm_getcsr() & _MM_DENORMALS_ZERO_MASK)
4998 #define _MM_SET_DENORMALS_ZERO_MODE(x) (_mm_setcsr((_mm_getcsr() & ~_MM_DENORMALS_ZERO_MASK) | (x)))
5000 #endif /* __EMMINTRIN_H */