clang 22.0.0git
emmintrin.h
Go to the documentation of this file.
1/*===---- emmintrin.h - SSE2 intrinsics ------------------------------------===
2 *
3 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 * See https://llvm.org/LICENSE.txt for license information.
5 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 *
7 *===-----------------------------------------------------------------------===
8 */
9
10#ifndef __EMMINTRIN_H
11#define __EMMINTRIN_H
12
13#if !defined(__i386__) && !defined(__x86_64__)
14#error "This header is only meant to be used on x86 and x64 architecture"
15#endif
16
17#include <xmmintrin.h>
18
19typedef double __m128d __attribute__((__vector_size__(16), __aligned__(16)));
20
21typedef double __m128d_u __attribute__((__vector_size__(16), __aligned__(1)));
22typedef long long __m128i_u
23 __attribute__((__vector_size__(16), __aligned__(1)));
24
25/* Type defines. */
26typedef double __v2df __attribute__((__vector_size__(16)));
27
28/* Unsigned types */
29typedef unsigned long long __v2du __attribute__((__vector_size__(16)));
30typedef unsigned char __v16qu __attribute__((__vector_size__(16)));
31
32/* We need an explicitly signed variant for char. Note that this shouldn't
33 * appear in the interface though. */
34typedef signed char __v16qs __attribute__((__vector_size__(16)));
35
36#ifdef __SSE2__
37/* Both _Float16 and __bf16 require SSE2 being enabled. */
38typedef _Float16 __v8hf __attribute__((__vector_size__(16), __aligned__(16)));
39typedef _Float16 __m128h __attribute__((__vector_size__(16), __aligned__(16)));
40typedef _Float16 __m128h_u __attribute__((__vector_size__(16), __aligned__(1)));
41
42typedef __bf16 __v8bf __attribute__((__vector_size__(16), __aligned__(16)));
43typedef __bf16 __m128bh __attribute__((__vector_size__(16), __aligned__(16)));
44#endif
45
46/* Define the default attributes for the functions in this file. */
47#if defined(__EVEX512__) && !defined(__AVX10_1_512__)
48#define __DEFAULT_FN_ATTRS \
49 __attribute__((__always_inline__, __nodebug__, \
50 __target__("sse2,no-evex512"), __min_vector_width__(128)))
51#else
52#define __DEFAULT_FN_ATTRS \
53 __attribute__((__always_inline__, __nodebug__, __target__("sse2"), \
54 __min_vector_width__(128)))
55#endif
56
57#if defined(__cplusplus) && (__cplusplus >= 201103L)
58#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr
59#else
60#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS
61#endif
62
63#define __trunc64(x) \
64 (__m64) __builtin_shufflevector((__v2di)(x), __extension__(__v2di){}, 0)
65#define __zext128(x) \
66 (__m128i) __builtin_shufflevector((__v2si)(x), __extension__(__v2si){}, 0, \
67 1, 2, 3)
68#define __anyext128(x) \
69 (__m128i) __builtin_shufflevector((__v2si)(x), __extension__(__v2si){}, 0, \
70 1, -1, -1)
71
72/// Adds lower double-precision values in both operands and returns the
73/// sum in the lower 64 bits of the result. The upper 64 bits of the result
74/// are copied from the upper double-precision value of the first operand.
75///
76/// \headerfile <x86intrin.h>
77///
78/// This intrinsic corresponds to the <c> VADDSD / ADDSD </c> instruction.
79///
80/// \param __a
81/// A 128-bit vector of [2 x double] containing one of the source operands.
82/// \param __b
83/// A 128-bit vector of [2 x double] containing one of the source operands.
84/// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the
85/// sum of the lower 64 bits of both operands. The upper 64 bits are copied
86/// from the upper 64 bits of the first source operand.
87static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_add_sd(__m128d __a,
88 __m128d __b) {
89 __a[0] += __b[0];
90 return __a;
91}
92
93/// Adds two 128-bit vectors of [2 x double].
94///
95/// \headerfile <x86intrin.h>
96///
97/// This intrinsic corresponds to the <c> VADDPD / ADDPD </c> instruction.
98///
99/// \param __a
100/// A 128-bit vector of [2 x double] containing one of the source operands.
101/// \param __b
102/// A 128-bit vector of [2 x double] containing one of the source operands.
103/// \returns A 128-bit vector of [2 x double] containing the sums of both
104/// operands.
105static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_add_pd(__m128d __a,
106 __m128d __b) {
107 return (__m128d)((__v2df)__a + (__v2df)__b);
108}
109
110/// Subtracts the lower double-precision value of the second operand
111/// from the lower double-precision value of the first operand and returns
112/// the difference in the lower 64 bits of the result. The upper 64 bits of
113/// the result are copied from the upper double-precision value of the first
114/// operand.
115///
116/// \headerfile <x86intrin.h>
117///
118/// This intrinsic corresponds to the <c> VSUBSD / SUBSD </c> instruction.
119///
120/// \param __a
121/// A 128-bit vector of [2 x double] containing the minuend.
122/// \param __b
123/// A 128-bit vector of [2 x double] containing the subtrahend.
124/// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the
125/// difference of the lower 64 bits of both operands. The upper 64 bits are
126/// copied from the upper 64 bits of the first source operand.
127static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_sub_sd(__m128d __a,
128 __m128d __b) {
129 __a[0] -= __b[0];
130 return __a;
131}
132
133/// Subtracts two 128-bit vectors of [2 x double].
134///
135/// \headerfile <x86intrin.h>
136///
137/// This intrinsic corresponds to the <c> VSUBPD / SUBPD </c> instruction.
138///
139/// \param __a
140/// A 128-bit vector of [2 x double] containing the minuend.
141/// \param __b
142/// A 128-bit vector of [2 x double] containing the subtrahend.
143/// \returns A 128-bit vector of [2 x double] containing the differences between
144/// both operands.
145static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_sub_pd(__m128d __a,
146 __m128d __b) {
147 return (__m128d)((__v2df)__a - (__v2df)__b);
148}
149
150/// Multiplies lower double-precision values in both operands and returns
151/// the product in the lower 64 bits of the result. The upper 64 bits of the
152/// result are copied from the upper double-precision value of the first
153/// operand.
154///
155/// \headerfile <x86intrin.h>
156///
157/// This intrinsic corresponds to the <c> VMULSD / MULSD </c> instruction.
158///
159/// \param __a
160/// A 128-bit vector of [2 x double] containing one of the source operands.
161/// \param __b
162/// A 128-bit vector of [2 x double] containing one of the source operands.
163/// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the
164/// product of the lower 64 bits of both operands. The upper 64 bits are
165/// copied from the upper 64 bits of the first source operand.
166static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_mul_sd(__m128d __a,
167 __m128d __b) {
168 __a[0] *= __b[0];
169 return __a;
170}
171
172/// Multiplies two 128-bit vectors of [2 x double].
173///
174/// \headerfile <x86intrin.h>
175///
176/// This intrinsic corresponds to the <c> VMULPD / MULPD </c> instruction.
177///
178/// \param __a
179/// A 128-bit vector of [2 x double] containing one of the operands.
180/// \param __b
181/// A 128-bit vector of [2 x double] containing one of the operands.
182/// \returns A 128-bit vector of [2 x double] containing the products of both
183/// operands.
184static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_mul_pd(__m128d __a,
185 __m128d __b) {
186 return (__m128d)((__v2df)__a * (__v2df)__b);
187}
188
189/// Divides the lower double-precision value of the first operand by the
190/// lower double-precision value of the second operand and returns the
191/// quotient in the lower 64 bits of the result. The upper 64 bits of the
192/// result are copied from the upper double-precision value of the first
193/// operand.
194///
195/// \headerfile <x86intrin.h>
196///
197/// This intrinsic corresponds to the <c> VDIVSD / DIVSD </c> instruction.
198///
199/// \param __a
200/// A 128-bit vector of [2 x double] containing the dividend.
201/// \param __b
202/// A 128-bit vector of [2 x double] containing divisor.
203/// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the
204/// quotient of the lower 64 bits of both operands. The upper 64 bits are
205/// copied from the upper 64 bits of the first source operand.
206static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_div_sd(__m128d __a,
207 __m128d __b) {
208 __a[0] /= __b[0];
209 return __a;
210}
211
212/// Performs an element-by-element division of two 128-bit vectors of
213/// [2 x double].
214///
215/// \headerfile <x86intrin.h>
216///
217/// This intrinsic corresponds to the <c> VDIVPD / DIVPD </c> instruction.
218///
219/// \param __a
220/// A 128-bit vector of [2 x double] containing the dividend.
221/// \param __b
222/// A 128-bit vector of [2 x double] containing the divisor.
223/// \returns A 128-bit vector of [2 x double] containing the quotients of both
224/// operands.
225static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_div_pd(__m128d __a,
226 __m128d __b) {
227 return (__m128d)((__v2df)__a / (__v2df)__b);
228}
229
230/// Calculates the square root of the lower double-precision value of
231/// the second operand and returns it in the lower 64 bits of the result.
232/// The upper 64 bits of the result are copied from the upper
233/// double-precision value of the first operand.
234///
235/// \headerfile <x86intrin.h>
236///
237/// This intrinsic corresponds to the <c> VSQRTSD / SQRTSD </c> instruction.
238///
239/// \param __a
240/// A 128-bit vector of [2 x double] containing one of the operands. The
241/// upper 64 bits of this operand are copied to the upper 64 bits of the
242/// result.
243/// \param __b
244/// A 128-bit vector of [2 x double] containing one of the operands. The
245/// square root is calculated using the lower 64 bits of this operand.
246/// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the
247/// square root of the lower 64 bits of operand \a __b, and whose upper 64
248/// bits are copied from the upper 64 bits of operand \a __a.
249static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_sqrt_sd(__m128d __a,
250 __m128d __b) {
251 __m128d __c = __builtin_ia32_sqrtsd((__v2df)__b);
252 return __extension__(__m128d){__c[0], __a[1]};
253}
254
255/// Calculates the square root of the each of two values stored in a
256/// 128-bit vector of [2 x double].
257///
258/// \headerfile <x86intrin.h>
259///
260/// This intrinsic corresponds to the <c> VSQRTPD / SQRTPD </c> instruction.
261///
262/// \param __a
263/// A 128-bit vector of [2 x double].
264/// \returns A 128-bit vector of [2 x double] containing the square roots of the
265/// values in the operand.
266static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_sqrt_pd(__m128d __a) {
267 return __builtin_ia32_sqrtpd((__v2df)__a);
268}
269
270/// Compares lower 64-bit double-precision values of both operands, and
271/// returns the lesser of the pair of values in the lower 64-bits of the
272/// result. The upper 64 bits of the result are copied from the upper
273/// double-precision value of the first operand.
274///
275/// If either value in a comparison is NaN, returns the value from \a __b.
276///
277/// \headerfile <x86intrin.h>
278///
279/// This intrinsic corresponds to the <c> VMINSD / MINSD </c> instruction.
280///
281/// \param __a
282/// A 128-bit vector of [2 x double] containing one of the operands. The
283/// lower 64 bits of this operand are used in the comparison.
284/// \param __b
285/// A 128-bit vector of [2 x double] containing one of the operands. The
286/// lower 64 bits of this operand are used in the comparison.
287/// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the
288/// minimum value between both operands. The upper 64 bits are copied from
289/// the upper 64 bits of the first source operand.
290static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_min_sd(__m128d __a,
291 __m128d __b) {
292 return __builtin_ia32_minsd((__v2df)__a, (__v2df)__b);
293}
294
295/// Performs element-by-element comparison of the two 128-bit vectors of
296/// [2 x double] and returns a vector containing the lesser of each pair of
297/// values.
298///
299/// If either value in a comparison is NaN, returns the value from \a __b.
300///
301/// \headerfile <x86intrin.h>
302///
303/// This intrinsic corresponds to the <c> VMINPD / MINPD </c> instruction.
304///
305/// \param __a
306/// A 128-bit vector of [2 x double] containing one of the operands.
307/// \param __b
308/// A 128-bit vector of [2 x double] containing one of the operands.
309/// \returns A 128-bit vector of [2 x double] containing the minimum values
310/// between both operands.
311static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_min_pd(__m128d __a,
312 __m128d __b) {
313 return __builtin_ia32_minpd((__v2df)__a, (__v2df)__b);
314}
315
316/// Compares lower 64-bit double-precision values of both operands, and
317/// returns the greater of the pair of values in the lower 64-bits of the
318/// result. The upper 64 bits of the result are copied from the upper
319/// double-precision value of the first operand.
320///
321/// If either value in a comparison is NaN, returns the value from \a __b.
322///
323/// \headerfile <x86intrin.h>
324///
325/// This intrinsic corresponds to the <c> VMAXSD / MAXSD </c> instruction.
326///
327/// \param __a
328/// A 128-bit vector of [2 x double] containing one of the operands. The
329/// lower 64 bits of this operand are used in the comparison.
330/// \param __b
331/// A 128-bit vector of [2 x double] containing one of the operands. The
332/// lower 64 bits of this operand are used in the comparison.
333/// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the
334/// maximum value between both operands. The upper 64 bits are copied from
335/// the upper 64 bits of the first source operand.
336static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_max_sd(__m128d __a,
337 __m128d __b) {
338 return __builtin_ia32_maxsd((__v2df)__a, (__v2df)__b);
339}
340
341/// Performs element-by-element comparison of the two 128-bit vectors of
342/// [2 x double] and returns a vector containing the greater of each pair
343/// of values.
344///
345/// If either value in a comparison is NaN, returns the value from \a __b.
346///
347/// \headerfile <x86intrin.h>
348///
349/// This intrinsic corresponds to the <c> VMAXPD / MAXPD </c> instruction.
350///
351/// \param __a
352/// A 128-bit vector of [2 x double] containing one of the operands.
353/// \param __b
354/// A 128-bit vector of [2 x double] containing one of the operands.
355/// \returns A 128-bit vector of [2 x double] containing the maximum values
356/// between both operands.
357static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_max_pd(__m128d __a,
358 __m128d __b) {
359 return __builtin_ia32_maxpd((__v2df)__a, (__v2df)__b);
360}
361
362/// Performs a bitwise AND of two 128-bit vectors of [2 x double].
363///
364/// \headerfile <x86intrin.h>
365///
366/// This intrinsic corresponds to the <c> VPAND / PAND </c> instruction.
367///
368/// \param __a
369/// A 128-bit vector of [2 x double] containing one of the source operands.
370/// \param __b
371/// A 128-bit vector of [2 x double] containing one of the source operands.
372/// \returns A 128-bit vector of [2 x double] containing the bitwise AND of the
373/// values between both operands.
374static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_and_pd(__m128d __a,
375 __m128d __b) {
376 return (__m128d)((__v2du)__a & (__v2du)__b);
377}
378
379/// Performs a bitwise AND of two 128-bit vectors of [2 x double], using
380/// the one's complement of the values contained in the first source operand.
381///
382/// \headerfile <x86intrin.h>
383///
384/// This intrinsic corresponds to the <c> VPANDN / PANDN </c> instruction.
385///
386/// \param __a
387/// A 128-bit vector of [2 x double] containing the left source operand. The
388/// one's complement of this value is used in the bitwise AND.
389/// \param __b
390/// A 128-bit vector of [2 x double] containing the right source operand.
391/// \returns A 128-bit vector of [2 x double] containing the bitwise AND of the
392/// values in the second operand and the one's complement of the first
393/// operand.
394static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR
395_mm_andnot_pd(__m128d __a, __m128d __b) {
396 return (__m128d)(~(__v2du)__a & (__v2du)__b);
397}
398
399/// Performs a bitwise OR of two 128-bit vectors of [2 x double].
400///
401/// \headerfile <x86intrin.h>
402///
403/// This intrinsic corresponds to the <c> VPOR / POR </c> instruction.
404///
405/// \param __a
406/// A 128-bit vector of [2 x double] containing one of the source operands.
407/// \param __b
408/// A 128-bit vector of [2 x double] containing one of the source operands.
409/// \returns A 128-bit vector of [2 x double] containing the bitwise OR of the
410/// values between both operands.
411static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_or_pd(__m128d __a,
412 __m128d __b) {
413 return (__m128d)((__v2du)__a | (__v2du)__b);
414}
415
416/// Performs a bitwise XOR of two 128-bit vectors of [2 x double].
417///
418/// \headerfile <x86intrin.h>
419///
420/// This intrinsic corresponds to the <c> VPXOR / PXOR </c> instruction.
421///
422/// \param __a
423/// A 128-bit vector of [2 x double] containing one of the source operands.
424/// \param __b
425/// A 128-bit vector of [2 x double] containing one of the source operands.
426/// \returns A 128-bit vector of [2 x double] containing the bitwise XOR of the
427/// values between both operands.
428static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_xor_pd(__m128d __a,
429 __m128d __b) {
430 return (__m128d)((__v2du)__a ^ (__v2du)__b);
431}
432
433/// Compares each of the corresponding double-precision values of the
434/// 128-bit vectors of [2 x double] for equality.
435///
436/// Each comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
437/// If either value in a comparison is NaN, returns false.
438///
439/// \headerfile <x86intrin.h>
440///
441/// This intrinsic corresponds to the <c> VCMPEQPD / CMPEQPD </c> instruction.
442///
443/// \param __a
444/// A 128-bit vector of [2 x double].
445/// \param __b
446/// A 128-bit vector of [2 x double].
447/// \returns A 128-bit vector containing the comparison results.
448static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpeq_pd(__m128d __a,
449 __m128d __b) {
450 return (__m128d)__builtin_ia32_cmpeqpd((__v2df)__a, (__v2df)__b);
451}
452
453/// Compares each of the corresponding double-precision values of the
454/// 128-bit vectors of [2 x double] to determine if the values in the first
455/// operand are less than those in the second operand.
456///
457/// Each comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
458/// If either value in a comparison is NaN, returns false.
459///
460/// \headerfile <x86intrin.h>
461///
462/// This intrinsic corresponds to the <c> VCMPLTPD / CMPLTPD </c> instruction.
463///
464/// \param __a
465/// A 128-bit vector of [2 x double].
466/// \param __b
467/// A 128-bit vector of [2 x double].
468/// \returns A 128-bit vector containing the comparison results.
469static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmplt_pd(__m128d __a,
470 __m128d __b) {
471 return (__m128d)__builtin_ia32_cmpltpd((__v2df)__a, (__v2df)__b);
472}
473
474/// Compares each of the corresponding double-precision values of the
475/// 128-bit vectors of [2 x double] to determine if the values in the first
476/// operand are less than or equal to those in the second operand.
477///
478/// Each comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
479/// If either value in a comparison is NaN, returns false.
480///
481/// \headerfile <x86intrin.h>
482///
483/// This intrinsic corresponds to the <c> VCMPLEPD / CMPLEPD </c> instruction.
484///
485/// \param __a
486/// A 128-bit vector of [2 x double].
487/// \param __b
488/// A 128-bit vector of [2 x double].
489/// \returns A 128-bit vector containing the comparison results.
490static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmple_pd(__m128d __a,
491 __m128d __b) {
492 return (__m128d)__builtin_ia32_cmplepd((__v2df)__a, (__v2df)__b);
493}
494
495/// Compares each of the corresponding double-precision values of the
496/// 128-bit vectors of [2 x double] to determine if the values in the first
497/// operand are greater than those in the second operand.
498///
499/// Each comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
500/// If either value in a comparison is NaN, returns false.
501///
502/// \headerfile <x86intrin.h>
503///
504/// This intrinsic corresponds to the <c> VCMPLTPD / CMPLTPD </c> instruction.
505///
506/// \param __a
507/// A 128-bit vector of [2 x double].
508/// \param __b
509/// A 128-bit vector of [2 x double].
510/// \returns A 128-bit vector containing the comparison results.
511static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpgt_pd(__m128d __a,
512 __m128d __b) {
513 return (__m128d)__builtin_ia32_cmpltpd((__v2df)__b, (__v2df)__a);
514}
515
516/// Compares each of the corresponding double-precision values of the
517/// 128-bit vectors of [2 x double] to determine if the values in the first
518/// operand are greater than or equal to those in the second operand.
519///
520/// Each comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
521/// If either value in a comparison is NaN, returns false.
522///
523/// \headerfile <x86intrin.h>
524///
525/// This intrinsic corresponds to the <c> VCMPLEPD / CMPLEPD </c> instruction.
526///
527/// \param __a
528/// A 128-bit vector of [2 x double].
529/// \param __b
530/// A 128-bit vector of [2 x double].
531/// \returns A 128-bit vector containing the comparison results.
532static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpge_pd(__m128d __a,
533 __m128d __b) {
534 return (__m128d)__builtin_ia32_cmplepd((__v2df)__b, (__v2df)__a);
535}
536
537/// Compares each of the corresponding double-precision values of the
538/// 128-bit vectors of [2 x double] to determine if the values in the first
539/// operand are ordered with respect to those in the second operand.
540///
541/// A pair of double-precision values are ordered with respect to each
542/// other if neither value is a NaN. Each comparison returns 0x0 for false,
543/// 0xFFFFFFFFFFFFFFFF for true.
544///
545/// \headerfile <x86intrin.h>
546///
547/// This intrinsic corresponds to the <c> VCMPORDPD / CMPORDPD </c> instruction.
548///
549/// \param __a
550/// A 128-bit vector of [2 x double].
551/// \param __b
552/// A 128-bit vector of [2 x double].
553/// \returns A 128-bit vector containing the comparison results.
554static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpord_pd(__m128d __a,
555 __m128d __b) {
556 return (__m128d)__builtin_ia32_cmpordpd((__v2df)__a, (__v2df)__b);
557}
558
559/// Compares each of the corresponding double-precision values of the
560/// 128-bit vectors of [2 x double] to determine if the values in the first
561/// operand are unordered with respect to those in the second operand.
562///
563/// A pair of double-precision values are unordered with respect to each
564/// other if one or both values are NaN. Each comparison returns 0x0 for
565/// false, 0xFFFFFFFFFFFFFFFF for true.
566///
567/// \headerfile <x86intrin.h>
568///
569/// This intrinsic corresponds to the <c> VCMPUNORDPD / CMPUNORDPD </c>
570/// instruction.
571///
572/// \param __a
573/// A 128-bit vector of [2 x double].
574/// \param __b
575/// A 128-bit vector of [2 x double].
576/// \returns A 128-bit vector containing the comparison results.
577static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpunord_pd(__m128d __a,
578 __m128d __b) {
579 return (__m128d)__builtin_ia32_cmpunordpd((__v2df)__a, (__v2df)__b);
580}
581
582/// Compares each of the corresponding double-precision values of the
583/// 128-bit vectors of [2 x double] to determine if the values in the first
584/// operand are unequal to those in the second operand.
585///
586/// Each comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
587/// If either value in a comparison is NaN, returns true.
588///
589/// \headerfile <x86intrin.h>
590///
591/// This intrinsic corresponds to the <c> VCMPNEQPD / CMPNEQPD </c> instruction.
592///
593/// \param __a
594/// A 128-bit vector of [2 x double].
595/// \param __b
596/// A 128-bit vector of [2 x double].
597/// \returns A 128-bit vector containing the comparison results.
598static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpneq_pd(__m128d __a,
599 __m128d __b) {
600 return (__m128d)__builtin_ia32_cmpneqpd((__v2df)__a, (__v2df)__b);
601}
602
603/// Compares each of the corresponding double-precision values of the
604/// 128-bit vectors of [2 x double] to determine if the values in the first
605/// operand are not less than those in the second operand.
606///
607/// Each comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
608/// If either value in a comparison is NaN, returns true.
609///
610/// \headerfile <x86intrin.h>
611///
612/// This intrinsic corresponds to the <c> VCMPNLTPD / CMPNLTPD </c> instruction.
613///
614/// \param __a
615/// A 128-bit vector of [2 x double].
616/// \param __b
617/// A 128-bit vector of [2 x double].
618/// \returns A 128-bit vector containing the comparison results.
619static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpnlt_pd(__m128d __a,
620 __m128d __b) {
621 return (__m128d)__builtin_ia32_cmpnltpd((__v2df)__a, (__v2df)__b);
622}
623
624/// Compares each of the corresponding double-precision values of the
625/// 128-bit vectors of [2 x double] to determine if the values in the first
626/// operand are not less than or equal to those in the second operand.
627///
628/// Each comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
629/// If either value in a comparison is NaN, returns true.
630///
631/// \headerfile <x86intrin.h>
632///
633/// This intrinsic corresponds to the <c> VCMPNLEPD / CMPNLEPD </c> instruction.
634///
635/// \param __a
636/// A 128-bit vector of [2 x double].
637/// \param __b
638/// A 128-bit vector of [2 x double].
639/// \returns A 128-bit vector containing the comparison results.
640static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpnle_pd(__m128d __a,
641 __m128d __b) {
642 return (__m128d)__builtin_ia32_cmpnlepd((__v2df)__a, (__v2df)__b);
643}
644
645/// Compares each of the corresponding double-precision values of the
646/// 128-bit vectors of [2 x double] to determine if the values in the first
647/// operand are not greater than those in the second operand.
648///
649/// Each comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
650/// If either value in a comparison is NaN, returns true.
651///
652/// \headerfile <x86intrin.h>
653///
654/// This intrinsic corresponds to the <c> VCMPNLTPD / CMPNLTPD </c> instruction.
655///
656/// \param __a
657/// A 128-bit vector of [2 x double].
658/// \param __b
659/// A 128-bit vector of [2 x double].
660/// \returns A 128-bit vector containing the comparison results.
661static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpngt_pd(__m128d __a,
662 __m128d __b) {
663 return (__m128d)__builtin_ia32_cmpnltpd((__v2df)__b, (__v2df)__a);
664}
665
666/// Compares each of the corresponding double-precision values of the
667/// 128-bit vectors of [2 x double] to determine if the values in the first
668/// operand are not greater than or equal to those in the second operand.
669///
670/// Each comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
671/// If either value in a comparison is NaN, returns true.
672///
673/// \headerfile <x86intrin.h>
674///
675/// This intrinsic corresponds to the <c> VCMPNLEPD / CMPNLEPD </c> instruction.
676///
677/// \param __a
678/// A 128-bit vector of [2 x double].
679/// \param __b
680/// A 128-bit vector of [2 x double].
681/// \returns A 128-bit vector containing the comparison results.
682static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpnge_pd(__m128d __a,
683 __m128d __b) {
684 return (__m128d)__builtin_ia32_cmpnlepd((__v2df)__b, (__v2df)__a);
685}
686
687/// Compares the lower double-precision floating-point values in each of
688/// the two 128-bit floating-point vectors of [2 x double] for equality.
689///
690/// The comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
691/// If either value in a comparison is NaN, returns false.
692///
693/// \headerfile <x86intrin.h>
694///
695/// This intrinsic corresponds to the <c> VCMPEQSD / CMPEQSD </c> instruction.
696///
697/// \param __a
698/// A 128-bit vector of [2 x double]. The lower double-precision value is
699/// compared to the lower double-precision value of \a __b.
700/// \param __b
701/// A 128-bit vector of [2 x double]. The lower double-precision value is
702/// compared to the lower double-precision value of \a __a.
703/// \returns A 128-bit vector. The lower 64 bits contains the comparison
704/// results. The upper 64 bits are copied from the upper 64 bits of \a __a.
705static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpeq_sd(__m128d __a,
706 __m128d __b) {
707 return (__m128d)__builtin_ia32_cmpeqsd((__v2df)__a, (__v2df)__b);
708}
709
710/// Compares the lower double-precision floating-point values in each of
711/// the two 128-bit floating-point vectors of [2 x double] to determine if
712/// the value in the first parameter is less than the corresponding value in
713/// the second parameter.
714///
715/// The comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
716/// If either value in a comparison is NaN, returns false.
717///
718/// \headerfile <x86intrin.h>
719///
720/// This intrinsic corresponds to the <c> VCMPLTSD / CMPLTSD </c> instruction.
721///
722/// \param __a
723/// A 128-bit vector of [2 x double]. The lower double-precision value is
724/// compared to the lower double-precision value of \a __b.
725/// \param __b
726/// A 128-bit vector of [2 x double]. The lower double-precision value is
727/// compared to the lower double-precision value of \a __a.
728/// \returns A 128-bit vector. The lower 64 bits contains the comparison
729/// results. The upper 64 bits are copied from the upper 64 bits of \a __a.
730static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmplt_sd(__m128d __a,
731 __m128d __b) {
732 return (__m128d)__builtin_ia32_cmpltsd((__v2df)__a, (__v2df)__b);
733}
734
735/// Compares the lower double-precision floating-point values in each of
736/// the two 128-bit floating-point vectors of [2 x double] to determine if
737/// the value in the first parameter is less than or equal to the
738/// corresponding value in the second parameter.
739///
740/// The comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
741/// If either value in a comparison is NaN, returns false.
742///
743/// \headerfile <x86intrin.h>
744///
745/// This intrinsic corresponds to the <c> VCMPLESD / CMPLESD </c> instruction.
746///
747/// \param __a
748/// A 128-bit vector of [2 x double]. The lower double-precision value is
749/// compared to the lower double-precision value of \a __b.
750/// \param __b
751/// A 128-bit vector of [2 x double]. The lower double-precision value is
752/// compared to the lower double-precision value of \a __a.
753/// \returns A 128-bit vector. The lower 64 bits contains the comparison
754/// results. The upper 64 bits are copied from the upper 64 bits of \a __a.
755static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmple_sd(__m128d __a,
756 __m128d __b) {
757 return (__m128d)__builtin_ia32_cmplesd((__v2df)__a, (__v2df)__b);
758}
759
760/// Compares the lower double-precision floating-point values in each of
761/// the two 128-bit floating-point vectors of [2 x double] to determine if
762/// the value in the first parameter is greater than the corresponding value
763/// in the second parameter.
764///
765/// The comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
766/// If either value in a comparison is NaN, returns false.
767///
768/// \headerfile <x86intrin.h>
769///
770/// This intrinsic corresponds to the <c> VCMPLTSD / CMPLTSD </c> instruction.
771///
772/// \param __a
773/// A 128-bit vector of [2 x double]. The lower double-precision value is
774/// compared to the lower double-precision value of \a __b.
775/// \param __b
776/// A 128-bit vector of [2 x double]. The lower double-precision value is
777/// compared to the lower double-precision value of \a __a.
778/// \returns A 128-bit vector. The lower 64 bits contains the comparison
779/// results. The upper 64 bits are copied from the upper 64 bits of \a __a.
780static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpgt_sd(__m128d __a,
781 __m128d __b) {
782 __m128d __c = __builtin_ia32_cmpltsd((__v2df)__b, (__v2df)__a);
783 return __extension__(__m128d){__c[0], __a[1]};
784}
785
786/// Compares the lower double-precision floating-point values in each of
787/// the two 128-bit floating-point vectors of [2 x double] to determine if
788/// the value in the first parameter is greater than or equal to the
789/// corresponding value in the second parameter.
790///
791/// The comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
792/// If either value in a comparison is NaN, returns false.
793///
794/// \headerfile <x86intrin.h>
795///
796/// This intrinsic corresponds to the <c> VCMPLESD / CMPLESD </c> instruction.
797///
798/// \param __a
799/// A 128-bit vector of [2 x double]. The lower double-precision value is
800/// compared to the lower double-precision value of \a __b.
801/// \param __b
802/// A 128-bit vector of [2 x double]. The lower double-precision value is
803/// compared to the lower double-precision value of \a __a.
804/// \returns A 128-bit vector. The lower 64 bits contains the comparison
805/// results. The upper 64 bits are copied from the upper 64 bits of \a __a.
806static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpge_sd(__m128d __a,
807 __m128d __b) {
808 __m128d __c = __builtin_ia32_cmplesd((__v2df)__b, (__v2df)__a);
809 return __extension__(__m128d){__c[0], __a[1]};
810}
811
812/// Compares the lower double-precision floating-point values in each of
813/// the two 128-bit floating-point vectors of [2 x double] to determine if
814/// the value in the first parameter is ordered with respect to the
815/// corresponding value in the second parameter.
816///
817/// The comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true. A pair
818/// of double-precision values are ordered with respect to each other if
819/// neither value is a NaN.
820///
821/// \headerfile <x86intrin.h>
822///
823/// This intrinsic corresponds to the <c> VCMPORDSD / CMPORDSD </c> instruction.
824///
825/// \param __a
826/// A 128-bit vector of [2 x double]. The lower double-precision value is
827/// compared to the lower double-precision value of \a __b.
828/// \param __b
829/// A 128-bit vector of [2 x double]. The lower double-precision value is
830/// compared to the lower double-precision value of \a __a.
831/// \returns A 128-bit vector. The lower 64 bits contains the comparison
832/// results. The upper 64 bits are copied from the upper 64 bits of \a __a.
833static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpord_sd(__m128d __a,
834 __m128d __b) {
835 return (__m128d)__builtin_ia32_cmpordsd((__v2df)__a, (__v2df)__b);
836}
837
838/// Compares the lower double-precision floating-point values in each of
839/// the two 128-bit floating-point vectors of [2 x double] to determine if
840/// the value in the first parameter is unordered with respect to the
841/// corresponding value in the second parameter.
842///
843/// The comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true. A pair
844/// of double-precision values are unordered with respect to each other if
845/// one or both values are NaN.
846///
847/// \headerfile <x86intrin.h>
848///
849/// This intrinsic corresponds to the <c> VCMPUNORDSD / CMPUNORDSD </c>
850/// instruction.
851///
852/// \param __a
853/// A 128-bit vector of [2 x double]. The lower double-precision value is
854/// compared to the lower double-precision value of \a __b.
855/// \param __b
856/// A 128-bit vector of [2 x double]. The lower double-precision value is
857/// compared to the lower double-precision value of \a __a.
858/// \returns A 128-bit vector. The lower 64 bits contains the comparison
859/// results. The upper 64 bits are copied from the upper 64 bits of \a __a.
860static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpunord_sd(__m128d __a,
861 __m128d __b) {
862 return (__m128d)__builtin_ia32_cmpunordsd((__v2df)__a, (__v2df)__b);
863}
864
865/// Compares the lower double-precision floating-point values in each of
866/// the two 128-bit floating-point vectors of [2 x double] to determine if
867/// the value in the first parameter is unequal to the corresponding value in
868/// the second parameter.
869///
870/// The comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
871/// If either value in a comparison is NaN, returns true.
872///
873/// \headerfile <x86intrin.h>
874///
875/// This intrinsic corresponds to the <c> VCMPNEQSD / CMPNEQSD </c> instruction.
876///
877/// \param __a
878/// A 128-bit vector of [2 x double]. The lower double-precision value is
879/// compared to the lower double-precision value of \a __b.
880/// \param __b
881/// A 128-bit vector of [2 x double]. The lower double-precision value is
882/// compared to the lower double-precision value of \a __a.
883/// \returns A 128-bit vector. The lower 64 bits contains the comparison
884/// results. The upper 64 bits are copied from the upper 64 bits of \a __a.
885static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpneq_sd(__m128d __a,
886 __m128d __b) {
887 return (__m128d)__builtin_ia32_cmpneqsd((__v2df)__a, (__v2df)__b);
888}
889
890/// Compares the lower double-precision floating-point values in each of
891/// the two 128-bit floating-point vectors of [2 x double] to determine if
892/// the value in the first parameter is not less than the corresponding
893/// value in the second parameter.
894///
895/// The comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
896/// If either value in a comparison is NaN, returns true.
897///
898/// \headerfile <x86intrin.h>
899///
900/// This intrinsic corresponds to the <c> VCMPNLTSD / CMPNLTSD </c> instruction.
901///
902/// \param __a
903/// A 128-bit vector of [2 x double]. The lower double-precision value is
904/// compared to the lower double-precision value of \a __b.
905/// \param __b
906/// A 128-bit vector of [2 x double]. The lower double-precision value is
907/// compared to the lower double-precision value of \a __a.
908/// \returns A 128-bit vector. The lower 64 bits contains the comparison
909/// results. The upper 64 bits are copied from the upper 64 bits of \a __a.
910static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpnlt_sd(__m128d __a,
911 __m128d __b) {
912 return (__m128d)__builtin_ia32_cmpnltsd((__v2df)__a, (__v2df)__b);
913}
914
915/// Compares the lower double-precision floating-point values in each of
916/// the two 128-bit floating-point vectors of [2 x double] to determine if
917/// the value in the first parameter is not less than or equal to the
918/// corresponding value in the second parameter.
919///
920/// The comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
921/// If either value in a comparison is NaN, returns true.
922///
923/// \headerfile <x86intrin.h>
924///
925/// This intrinsic corresponds to the <c> VCMPNLESD / CMPNLESD </c> instruction.
926///
927/// \param __a
928/// A 128-bit vector of [2 x double]. The lower double-precision value is
929/// compared to the lower double-precision value of \a __b.
930/// \param __b
931/// A 128-bit vector of [2 x double]. The lower double-precision value is
932/// compared to the lower double-precision value of \a __a.
933/// \returns A 128-bit vector. The lower 64 bits contains the comparison
934/// results. The upper 64 bits are copied from the upper 64 bits of \a __a.
935static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpnle_sd(__m128d __a,
936 __m128d __b) {
937 return (__m128d)__builtin_ia32_cmpnlesd((__v2df)__a, (__v2df)__b);
938}
939
940/// Compares the lower double-precision floating-point values in each of
941/// the two 128-bit floating-point vectors of [2 x double] to determine if
942/// the value in the first parameter is not greater than the corresponding
943/// value in the second parameter.
944///
945/// The comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
946/// If either value in a comparison is NaN, returns true.
947///
948/// \headerfile <x86intrin.h>
949///
950/// This intrinsic corresponds to the <c> VCMPNLTSD / CMPNLTSD </c> instruction.
951///
952/// \param __a
953/// A 128-bit vector of [2 x double]. The lower double-precision value is
954/// compared to the lower double-precision value of \a __b.
955/// \param __b
956/// A 128-bit vector of [2 x double]. The lower double-precision value is
957/// compared to the lower double-precision value of \a __a.
958/// \returns A 128-bit vector. The lower 64 bits contains the comparison
959/// results. The upper 64 bits are copied from the upper 64 bits of \a __a.
960static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpngt_sd(__m128d __a,
961 __m128d __b) {
962 __m128d __c = __builtin_ia32_cmpnltsd((__v2df)__b, (__v2df)__a);
963 return __extension__(__m128d){__c[0], __a[1]};
964}
965
966/// Compares the lower double-precision floating-point values in each of
967/// the two 128-bit floating-point vectors of [2 x double] to determine if
968/// the value in the first parameter is not greater than or equal to the
969/// corresponding value in the second parameter.
970///
971/// The comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
972/// If either value in a comparison is NaN, returns true.
973///
974/// \headerfile <x86intrin.h>
975///
976/// This intrinsic corresponds to the <c> VCMPNLESD / CMPNLESD </c> instruction.
977///
978/// \param __a
979/// A 128-bit vector of [2 x double]. The lower double-precision value is
980/// compared to the lower double-precision value of \a __b.
981/// \param __b
982/// A 128-bit vector of [2 x double]. The lower double-precision value is
983/// compared to the lower double-precision value of \a __a.
984/// \returns A 128-bit vector. The lower 64 bits contains the comparison
985/// results. The upper 64 bits are copied from the upper 64 bits of \a __a.
986static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpnge_sd(__m128d __a,
987 __m128d __b) {
988 __m128d __c = __builtin_ia32_cmpnlesd((__v2df)__b, (__v2df)__a);
989 return __extension__(__m128d){__c[0], __a[1]};
990}
991
992/// Compares the lower double-precision floating-point values in each of
993/// the two 128-bit floating-point vectors of [2 x double] for equality.
994///
995/// The comparison returns 0 for false, 1 for true. If either value in a
996/// comparison is NaN, returns 0.
997///
998/// \headerfile <x86intrin.h>
999///
1000/// This intrinsic corresponds to the <c> VCOMISD / COMISD </c> instruction.
1001///
1002/// \param __a
1003/// A 128-bit vector of [2 x double]. The lower double-precision value is
1004/// compared to the lower double-precision value of \a __b.
1005/// \param __b
1006/// A 128-bit vector of [2 x double]. The lower double-precision value is
1007/// compared to the lower double-precision value of \a __a.
1008/// \returns An integer containing the comparison results.
1009static __inline__ int __DEFAULT_FN_ATTRS _mm_comieq_sd(__m128d __a,
1010 __m128d __b) {
1011 return __builtin_ia32_comisdeq((__v2df)__a, (__v2df)__b);
1012}
1013
1014/// Compares the lower double-precision floating-point values in each of
1015/// the two 128-bit floating-point vectors of [2 x double] to determine if
1016/// the value in the first parameter is less than the corresponding value in
1017/// the second parameter.
1018///
1019/// The comparison returns 0 for false, 1 for true. If either value in a
1020/// comparison is NaN, returns 0.
1021///
1022/// \headerfile <x86intrin.h>
1023///
1024/// This intrinsic corresponds to the <c> VCOMISD / COMISD </c> instruction.
1025///
1026/// \param __a
1027/// A 128-bit vector of [2 x double]. The lower double-precision value is
1028/// compared to the lower double-precision value of \a __b.
1029/// \param __b
1030/// A 128-bit vector of [2 x double]. The lower double-precision value is
1031/// compared to the lower double-precision value of \a __a.
1032/// \returns An integer containing the comparison results.
1033static __inline__ int __DEFAULT_FN_ATTRS _mm_comilt_sd(__m128d __a,
1034 __m128d __b) {
1035 return __builtin_ia32_comisdlt((__v2df)__a, (__v2df)__b);
1036}
1037
1038/// Compares the lower double-precision floating-point values in each of
1039/// the two 128-bit floating-point vectors of [2 x double] to determine if
1040/// the value in the first parameter is less than or equal to the
1041/// corresponding value in the second parameter.
1042///
1043/// The comparison returns 0 for false, 1 for true. If either value in a
1044/// comparison is NaN, returns 0.
1045///
1046/// \headerfile <x86intrin.h>
1047///
1048/// This intrinsic corresponds to the <c> VCOMISD / COMISD </c> instruction.
1049///
1050/// \param __a
1051/// A 128-bit vector of [2 x double]. The lower double-precision value is
1052/// compared to the lower double-precision value of \a __b.
1053/// \param __b
1054/// A 128-bit vector of [2 x double]. The lower double-precision value is
1055/// compared to the lower double-precision value of \a __a.
1056/// \returns An integer containing the comparison results.
1057static __inline__ int __DEFAULT_FN_ATTRS _mm_comile_sd(__m128d __a,
1058 __m128d __b) {
1059 return __builtin_ia32_comisdle((__v2df)__a, (__v2df)__b);
1060}
1061
1062/// Compares the lower double-precision floating-point values in each of
1063/// the two 128-bit floating-point vectors of [2 x double] to determine if
1064/// the value in the first parameter is greater than the corresponding value
1065/// in the second parameter.
1066///
1067/// The comparison returns 0 for false, 1 for true. If either value in a
1068/// comparison is NaN, returns 0.
1069///
1070/// \headerfile <x86intrin.h>
1071///
1072/// This intrinsic corresponds to the <c> VCOMISD / COMISD </c> instruction.
1073///
1074/// \param __a
1075/// A 128-bit vector of [2 x double]. The lower double-precision value is
1076/// compared to the lower double-precision value of \a __b.
1077/// \param __b
1078/// A 128-bit vector of [2 x double]. The lower double-precision value is
1079/// compared to the lower double-precision value of \a __a.
1080/// \returns An integer containing the comparison results.
1081static __inline__ int __DEFAULT_FN_ATTRS _mm_comigt_sd(__m128d __a,
1082 __m128d __b) {
1083 return __builtin_ia32_comisdgt((__v2df)__a, (__v2df)__b);
1084}
1085
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.
1090///
1091/// The comparison returns 0 for false, 1 for true. If either value in a
1092/// comparison is NaN, returns 0.
1093///
1094/// \headerfile <x86intrin.h>
1095///
1096/// This intrinsic corresponds to the <c> VCOMISD / COMISD </c> instruction.
1097///
1098/// \param __a
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.
1101/// \param __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.
1105static __inline__ int __DEFAULT_FN_ATTRS _mm_comige_sd(__m128d __a,
1106 __m128d __b) {
1107 return __builtin_ia32_comisdge((__v2df)__a, (__v2df)__b);
1108}
1109
1110/// Compares the lower double-precision floating-point values in each of
1111/// the two 128-bit floating-point vectors of [2 x double] to determine if
1112/// the value in the first parameter is unequal to the corresponding value in
1113/// the second parameter.
1114///
1115/// The comparison returns 0 for false, 1 for true. If either value in a
1116/// comparison is NaN, returns 1.
1117///
1118/// \headerfile <x86intrin.h>
1119///
1120/// This intrinsic corresponds to the <c> VCOMISD / COMISD </c> instruction.
1121///
1122/// \param __a
1123/// A 128-bit vector of [2 x double]. The lower double-precision value is
1124/// compared to the lower double-precision value of \a __b.
1125/// \param __b
1126/// A 128-bit vector of [2 x double]. The lower double-precision value is
1127/// compared to the lower double-precision value of \a __a.
1128/// \returns An integer containing the comparison results.
1129static __inline__ int __DEFAULT_FN_ATTRS _mm_comineq_sd(__m128d __a,
1130 __m128d __b) {
1131 return __builtin_ia32_comisdneq((__v2df)__a, (__v2df)__b);
1132}
1133
1134/// Compares the lower double-precision floating-point values in each of
1135/// the two 128-bit floating-point vectors of [2 x double] for equality.
1136///
1137/// The comparison returns 0 for false, 1 for true. If either value in a
1138/// comparison is NaN, returns 0.
1139///
1140/// \headerfile <x86intrin.h>
1141///
1142/// This intrinsic corresponds to the <c> VUCOMISD / UCOMISD </c> instruction.
1143///
1144/// \param __a
1145/// A 128-bit vector of [2 x double]. The lower double-precision value is
1146/// compared to the lower double-precision value of \a __b.
1147/// \param __b
1148/// A 128-bit vector of [2 x double]. The lower double-precision value is
1149/// compared to the lower double-precision value of \a __a.
1150/// \returns An integer containing the comparison results.
1151static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomieq_sd(__m128d __a,
1152 __m128d __b) {
1153 return __builtin_ia32_ucomisdeq((__v2df)__a, (__v2df)__b);
1154}
1155
1156/// Compares the lower double-precision floating-point values in each of
1157/// the two 128-bit floating-point vectors of [2 x double] to determine if
1158/// the value in the first parameter is less than the corresponding value in
1159/// the second parameter.
1160///
1161/// The comparison returns 0 for false, 1 for true. If either value in a
1162/// comparison is NaN, returns 0.
1163///
1164/// \headerfile <x86intrin.h>
1165///
1166/// This intrinsic corresponds to the <c> VUCOMISD / UCOMISD </c> instruction.
1167///
1168/// \param __a
1169/// A 128-bit vector of [2 x double]. The lower double-precision value is
1170/// compared to the lower double-precision value of \a __b.
1171/// \param __b
1172/// A 128-bit vector of [2 x double]. The lower double-precision value is
1173/// compared to the lower double-precision value of \a __a.
1174/// \returns An integer containing the comparison results.
1175static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomilt_sd(__m128d __a,
1176 __m128d __b) {
1177 return __builtin_ia32_ucomisdlt((__v2df)__a, (__v2df)__b);
1178}
1179
1180/// Compares the lower double-precision floating-point values in each of
1181/// the two 128-bit floating-point vectors of [2 x double] to determine if
1182/// the value in the first parameter is less than or equal to the
1183/// corresponding value in the second parameter.
1184///
1185/// The comparison returns 0 for false, 1 for true. If either value in a
1186/// comparison is NaN, returns 0.
1187///
1188/// \headerfile <x86intrin.h>
1189///
1190/// This intrinsic corresponds to the <c> VUCOMISD / UCOMISD </c> instruction.
1191///
1192/// \param __a
1193/// A 128-bit vector of [2 x double]. The lower double-precision value is
1194/// compared to the lower double-precision value of \a __b.
1195/// \param __b
1196/// A 128-bit vector of [2 x double]. The lower double-precision value is
1197/// compared to the lower double-precision value of \a __a.
1198/// \returns An integer containing the comparison results.
1199static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomile_sd(__m128d __a,
1200 __m128d __b) {
1201 return __builtin_ia32_ucomisdle((__v2df)__a, (__v2df)__b);
1202}
1203
1204/// Compares the lower double-precision floating-point values in each of
1205/// the two 128-bit floating-point vectors of [2 x double] to determine if
1206/// the value in the first parameter is greater than the corresponding value
1207/// in the second parameter.
1208///
1209/// The comparison returns 0 for false, 1 for true. If either value in a
1210/// comparison is NaN, returns 0.
1211///
1212/// \headerfile <x86intrin.h>
1213///
1214/// This intrinsic corresponds to the <c> VUCOMISD / UCOMISD </c> instruction.
1215///
1216/// \param __a
1217/// A 128-bit vector of [2 x double]. The lower double-precision value is
1218/// compared to the lower double-precision value of \a __b.
1219/// \param __b
1220/// A 128-bit vector of [2 x double]. The lower double-precision value is
1221/// compared to the lower double-precision value of \a __a.
1222/// \returns An integer containing the comparison results.
1223static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomigt_sd(__m128d __a,
1224 __m128d __b) {
1225 return __builtin_ia32_ucomisdgt((__v2df)__a, (__v2df)__b);
1226}
1227
1228/// Compares the lower double-precision floating-point values in each of
1229/// the two 128-bit floating-point vectors of [2 x double] to determine if
1230/// the value in the first parameter is greater than or equal to the
1231/// corresponding value in the second parameter.
1232///
1233/// The comparison returns 0 for false, 1 for true. If either value in a
1234/// comparison is NaN, returns 0.
1235///
1236/// \headerfile <x86intrin.h>
1237///
1238/// This intrinsic corresponds to the <c> VUCOMISD / UCOMISD </c> instruction.
1239///
1240/// \param __a
1241/// A 128-bit vector of [2 x double]. The lower double-precision value is
1242/// compared to the lower double-precision value of \a __b.
1243/// \param __b
1244/// A 128-bit vector of [2 x double]. The lower double-precision value is
1245/// compared to the lower double-precision value of \a __a.
1246/// \returns An integer containing the comparison results.
1247static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomige_sd(__m128d __a,
1248 __m128d __b) {
1249 return __builtin_ia32_ucomisdge((__v2df)__a, (__v2df)__b);
1250}
1251
1252/// Compares the lower double-precision floating-point values in each of
1253/// the two 128-bit floating-point vectors of [2 x double] to determine if
1254/// the value in the first parameter is unequal to the corresponding value in
1255/// the second parameter.
1256///
1257/// The comparison returns 0 for false, 1 for true. If either value in a
1258/// comparison is NaN, returns 1.
1259///
1260/// \headerfile <x86intrin.h>
1261///
1262/// This intrinsic corresponds to the <c> VUCOMISD / UCOMISD </c> instruction.
1263///
1264/// \param __a
1265/// A 128-bit vector of [2 x double]. The lower double-precision value is
1266/// compared to the lower double-precision value of \a __b.
1267/// \param __b
1268/// A 128-bit vector of [2 x double]. The lower double-precision value is
1269/// compared to the lower double-precision value of \a __a.
1270/// \returns An integer containing the comparison result.
1271static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomineq_sd(__m128d __a,
1272 __m128d __b) {
1273 return __builtin_ia32_ucomisdneq((__v2df)__a, (__v2df)__b);
1274}
1275
1276/// Converts the two double-precision floating-point elements of a
1277/// 128-bit vector of [2 x double] into two single-precision floating-point
1278/// values, returned in the lower 64 bits of a 128-bit vector of [4 x float].
1279/// The upper 64 bits of the result vector are set to zero.
1280///
1281/// \headerfile <x86intrin.h>
1282///
1283/// This intrinsic corresponds to the <c> VCVTPD2PS / CVTPD2PS </c> instruction.
1284///
1285/// \param __a
1286/// A 128-bit vector of [2 x double].
1287/// \returns A 128-bit vector of [4 x float] whose lower 64 bits contain the
1288/// converted values. The upper 64 bits are set to zero.
1289static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtpd_ps(__m128d __a) {
1290 return __builtin_ia32_cvtpd2ps((__v2df)__a);
1291}
1292
1293/// Converts the lower two single-precision floating-point elements of a
1294/// 128-bit vector of [4 x float] into two double-precision floating-point
1295/// values, returned in a 128-bit vector of [2 x double]. The upper two
1296/// elements of the input vector are unused.
1297///
1298/// \headerfile <x86intrin.h>
1299///
1300/// This intrinsic corresponds to the <c> VCVTPS2PD / CVTPS2PD </c> instruction.
1301///
1302/// \param __a
1303/// A 128-bit vector of [4 x float]. The lower two single-precision
1304/// floating-point elements are converted to double-precision values. The
1305/// upper two elements are unused.
1306/// \returns A 128-bit vector of [2 x double] containing the converted values.
1307static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR
1309 return (__m128d) __builtin_convertvector(
1310 __builtin_shufflevector((__v4sf)__a, (__v4sf)__a, 0, 1), __v2df);
1311}
1312
1313/// Converts the lower two integer elements of a 128-bit vector of
1314/// [4 x i32] into two double-precision floating-point values, returned in a
1315/// 128-bit vector of [2 x double].
1316///
1317/// The upper two elements of the input vector are unused.
1318///
1319/// \headerfile <x86intrin.h>
1320///
1321/// This intrinsic corresponds to the <c> VCVTDQ2PD / CVTDQ2PD </c> instruction.
1322///
1323/// \param __a
1324/// A 128-bit integer vector of [4 x i32]. The lower two integer elements are
1325/// converted to double-precision values.
1326///
1327/// The upper two elements are unused.
1328/// \returns A 128-bit vector of [2 x double] containing the converted values.
1329static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR
1331 return (__m128d) __builtin_convertvector(
1332 __builtin_shufflevector((__v4si)__a, (__v4si)__a, 0, 1), __v2df);
1333}
1334
1335/// Converts the two double-precision floating-point elements of a
1336/// 128-bit vector of [2 x double] into two signed 32-bit integer values,
1337/// returned in the lower 64 bits of a 128-bit vector of [4 x i32]. The upper
1338/// 64 bits of the result vector are set to zero.
1339///
1340/// If a converted value does not fit in a 32-bit integer, raises a
1341/// floating-point invalid exception. If the exception is masked, returns
1342/// the most negative integer.
1343///
1344/// \headerfile <x86intrin.h>
1345///
1346/// This intrinsic corresponds to the <c> VCVTPD2DQ / CVTPD2DQ </c> instruction.
1347///
1348/// \param __a
1349/// A 128-bit vector of [2 x double].
1350/// \returns A 128-bit vector of [4 x i32] whose lower 64 bits contain the
1351/// converted values. The upper 64 bits are set to zero.
1352static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtpd_epi32(__m128d __a) {
1353 return __builtin_ia32_cvtpd2dq((__v2df)__a);
1354}
1355
1356/// Converts the low-order element of a 128-bit vector of [2 x double]
1357/// into a 32-bit signed integer value.
1358///
1359/// If the converted value does not fit in a 32-bit integer, raises a
1360/// floating-point invalid exception. If the exception is masked, returns
1361/// the most negative integer.
1362///
1363/// \headerfile <x86intrin.h>
1364///
1365/// This intrinsic corresponds to the <c> VCVTSD2SI / CVTSD2SI </c> instruction.
1366///
1367/// \param __a
1368/// A 128-bit vector of [2 x double]. The lower 64 bits are used in the
1369/// conversion.
1370/// \returns A 32-bit signed integer containing the converted value.
1371static __inline__ int __DEFAULT_FN_ATTRS _mm_cvtsd_si32(__m128d __a) {
1372 return __builtin_ia32_cvtsd2si((__v2df)__a);
1373}
1374
1375/// Converts the lower double-precision floating-point element of a
1376/// 128-bit vector of [2 x double], in the second parameter, into a
1377/// single-precision floating-point value, returned in the lower 32 bits of a
1378/// 128-bit vector of [4 x float]. The upper 96 bits of the result vector are
1379/// copied from the upper 96 bits of the first parameter.
1380///
1381/// \headerfile <x86intrin.h>
1382///
1383/// This intrinsic corresponds to the <c> VCVTSD2SS / CVTSD2SS </c> instruction.
1384///
1385/// \param __a
1386/// A 128-bit vector of [4 x float]. The upper 96 bits of this parameter are
1387/// copied to the upper 96 bits of the result.
1388/// \param __b
1389/// A 128-bit vector of [2 x double]. The lower double-precision
1390/// floating-point element is used in the conversion.
1391/// \returns A 128-bit vector of [4 x float]. The lower 32 bits contain the
1392/// converted value from the second parameter. The upper 96 bits are copied
1393/// from the upper 96 bits of the first parameter.
1394static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtsd_ss(__m128 __a,
1395 __m128d __b) {
1396 return (__m128)__builtin_ia32_cvtsd2ss((__v4sf)__a, (__v2df)__b);
1397}
1398
1399/// Converts a 32-bit signed integer value, in the second parameter, into
1400/// a double-precision floating-point value, returned in the lower 64 bits of
1401/// a 128-bit vector of [2 x double]. The upper 64 bits of the result vector
1402/// are copied from the upper 64 bits of the first parameter.
1403///
1404/// \headerfile <x86intrin.h>
1405///
1406/// This intrinsic corresponds to the <c> VCVTSI2SD / CVTSI2SD </c> instruction.
1407///
1408/// \param __a
1409/// A 128-bit vector of [2 x double]. The upper 64 bits of this parameter are
1410/// copied to the upper 64 bits of the result.
1411/// \param __b
1412/// A 32-bit signed integer containing the value to be converted.
1413/// \returns A 128-bit vector of [2 x double]. The lower 64 bits contain the
1414/// converted value from the second parameter. The upper 64 bits are copied
1415/// from the upper 64 bits of the first parameter.
1416static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR
1417_mm_cvtsi32_sd(__m128d __a, int __b) {
1418 __a[0] = __b;
1419 return __a;
1420}
1421
1422/// Converts the lower single-precision floating-point element of a
1423/// 128-bit vector of [4 x float], in the second parameter, into a
1424/// double-precision floating-point value, returned in the lower 64 bits of
1425/// a 128-bit vector of [2 x double]. The upper 64 bits of the result vector
1426/// are copied from the upper 64 bits of the first parameter.
1427///
1428/// \headerfile <x86intrin.h>
1429///
1430/// This intrinsic corresponds to the <c> VCVTSS2SD / CVTSS2SD </c> instruction.
1431///
1432/// \param __a
1433/// A 128-bit vector of [2 x double]. The upper 64 bits of this parameter are
1434/// copied to the upper 64 bits of the result.
1435/// \param __b
1436/// A 128-bit vector of [4 x float]. The lower single-precision
1437/// floating-point element is used in the conversion.
1438/// \returns A 128-bit vector of [2 x double]. The lower 64 bits contain the
1439/// converted value from the second parameter. The upper 64 bits are copied
1440/// from the upper 64 bits of the first parameter.
1441static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR
1442_mm_cvtss_sd(__m128d __a, __m128 __b) {
1443 __a[0] = __b[0];
1444 return __a;
1445}
1446
1447/// Converts the two double-precision floating-point elements of a
1448/// 128-bit vector of [2 x double] into two signed truncated (rounded
1449/// toward zero) 32-bit integer values, returned in the lower 64 bits
1450/// of a 128-bit vector of [4 x i32].
1451///
1452/// If a converted value does not fit in a 32-bit integer, raises a
1453/// floating-point invalid exception. If the exception is masked, returns
1454/// the most negative integer.
1455///
1456/// \headerfile <x86intrin.h>
1457///
1458/// This intrinsic corresponds to the <c> VCVTTPD2DQ / CVTTPD2DQ </c>
1459/// instruction.
1460///
1461/// \param __a
1462/// A 128-bit vector of [2 x double].
1463/// \returns A 128-bit vector of [4 x i32] whose lower 64 bits contain the
1464/// converted values. The upper 64 bits are set to zero.
1465static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvttpd_epi32(__m128d __a) {
1466 return (__m128i)__builtin_ia32_cvttpd2dq((__v2df)__a);
1467}
1468
1469/// Converts the low-order element of a [2 x double] vector into a 32-bit
1470/// signed truncated (rounded toward zero) integer value.
1471///
1472/// If the converted value does not fit in a 32-bit integer, raises a
1473/// floating-point invalid exception. If the exception is masked, returns
1474/// the most negative integer.
1475///
1476/// \headerfile <x86intrin.h>
1477///
1478/// This intrinsic corresponds to the <c> VCVTTSD2SI / CVTTSD2SI </c>
1479/// instruction.
1480///
1481/// \param __a
1482/// A 128-bit vector of [2 x double]. The lower 64 bits are used in the
1483/// conversion.
1484/// \returns A 32-bit signed integer containing the converted value.
1485static __inline__ int __DEFAULT_FN_ATTRS _mm_cvttsd_si32(__m128d __a) {
1486 return __builtin_ia32_cvttsd2si((__v2df)__a);
1487}
1488
1489/// Converts the two double-precision floating-point elements of a
1490/// 128-bit vector of [2 x double] into two signed 32-bit integer values,
1491/// returned in a 64-bit vector of [2 x i32].
1492///
1493/// If a converted value does not fit in a 32-bit integer, raises a
1494/// floating-point invalid exception. If the exception is masked, returns
1495/// the most negative integer.
1496///
1497/// \headerfile <x86intrin.h>
1498///
1499/// This intrinsic corresponds to the <c> CVTPD2PI </c> instruction.
1500///
1501/// \param __a
1502/// A 128-bit vector of [2 x double].
1503/// \returns A 64-bit vector of [2 x i32] containing the converted values.
1504static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_cvtpd_pi32(__m128d __a) {
1505 return __trunc64(__builtin_ia32_cvtpd2dq((__v2df)__a));
1506}
1507
1508/// Converts the two double-precision floating-point elements of a
1509/// 128-bit vector of [2 x double] into two signed truncated (rounded toward
1510/// zero) 32-bit integer values, returned in a 64-bit vector of [2 x i32].
1511///
1512/// If a converted value does not fit in a 32-bit integer, raises a
1513/// floating-point invalid exception. If the exception is masked, returns
1514/// the most negative integer.
1515///
1516/// \headerfile <x86intrin.h>
1517///
1518/// This intrinsic corresponds to the <c> CVTTPD2PI </c> instruction.
1519///
1520/// \param __a
1521/// A 128-bit vector of [2 x double].
1522/// \returns A 64-bit vector of [2 x i32] containing the converted values.
1523static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_cvttpd_pi32(__m128d __a) {
1524 return __trunc64(__builtin_ia32_cvttpd2dq((__v2df)__a));
1525}
1526
1527/// Converts the two signed 32-bit integer elements of a 64-bit vector of
1528/// [2 x i32] into two double-precision floating-point values, returned in a
1529/// 128-bit vector of [2 x double].
1530///
1531/// \headerfile <x86intrin.h>
1532///
1533/// This intrinsic corresponds to the <c> CVTPI2PD </c> instruction.
1534///
1535/// \param __a
1536/// A 64-bit vector of [2 x i32].
1537/// \returns A 128-bit vector of [2 x double] containing the converted values.
1538static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR
1540 return (__m128d) __builtin_convertvector((__v2si)__a, __v2df);
1541}
1542
1543/// Returns the low-order element of a 128-bit vector of [2 x double] as
1544/// a double-precision floating-point value.
1545///
1546/// \headerfile <x86intrin.h>
1547///
1548/// This intrinsic has no corresponding instruction.
1549///
1550/// \param __a
1551/// A 128-bit vector of [2 x double]. The lower 64 bits are returned.
1552/// \returns A double-precision floating-point value copied from the lower 64
1553/// bits of \a __a.
1554static __inline__ double __DEFAULT_FN_ATTRS_CONSTEXPR
1556 return __a[0];
1557}
1558
1559/// Loads a 128-bit floating-point vector of [2 x double] from an aligned
1560/// memory location.
1561///
1562/// \headerfile <x86intrin.h>
1563///
1564/// This intrinsic corresponds to the <c> VMOVAPD / MOVAPD </c> instruction.
1565///
1566/// \param __dp
1567/// A pointer to a 128-bit memory location. The address of the memory
1568/// location has to be 16-byte aligned.
1569/// \returns A 128-bit vector of [2 x double] containing the loaded values.
1570static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_load_pd(double const *__dp) {
1571 return *(const __m128d *)__dp;
1572}
1573
1574/// Loads a double-precision floating-point value from a specified memory
1575/// location and duplicates it to both vector elements of a 128-bit vector of
1576/// [2 x double].
1577///
1578/// \headerfile <x86intrin.h>
1579///
1580/// This intrinsic corresponds to the <c> VMOVDDUP / MOVDDUP </c> instruction.
1581///
1582/// \param __dp
1583/// A pointer to a memory location containing a double-precision value.
1584/// \returns A 128-bit vector of [2 x double] containing the loaded and
1585/// duplicated values.
1586static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_load1_pd(double const *__dp) {
1587 struct __mm_load1_pd_struct {
1588 double __u;
1589 } __attribute__((__packed__, __may_alias__));
1590 double __u = ((const struct __mm_load1_pd_struct *)__dp)->__u;
1591 return __extension__(__m128d){__u, __u};
1592}
1593
1594#define _mm_load_pd1(dp) _mm_load1_pd(dp)
1595
1596/// Loads two double-precision values, in reverse order, from an aligned
1597/// memory location into a 128-bit vector of [2 x double].
1598///
1599/// \headerfile <x86intrin.h>
1600///
1601/// This intrinsic corresponds to the <c> VMOVAPD / MOVAPD </c> instruction +
1602/// needed shuffling instructions. In AVX mode, the shuffling may be combined
1603/// with the \c VMOVAPD, resulting in only a \c VPERMILPD instruction.
1604///
1605/// \param __dp
1606/// A 16-byte aligned pointer to an array of double-precision values to be
1607/// loaded in reverse order.
1608/// \returns A 128-bit vector of [2 x double] containing the reversed loaded
1609/// values.
1610static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_loadr_pd(double const *__dp) {
1611 __m128d __u = *(const __m128d *)__dp;
1612 return __builtin_shufflevector((__v2df)__u, (__v2df)__u, 1, 0);
1613}
1614
1615/// Loads a 128-bit floating-point vector of [2 x double] from an
1616/// unaligned memory location.
1617///
1618/// \headerfile <x86intrin.h>
1619///
1620/// This intrinsic corresponds to the <c> VMOVUPD / MOVUPD </c> instruction.
1621///
1622/// \param __dp
1623/// A pointer to a 128-bit memory location. The address of the memory
1624/// location does not have to be aligned.
1625/// \returns A 128-bit vector of [2 x double] containing the loaded values.
1626static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_loadu_pd(double const *__dp) {
1627 struct __loadu_pd {
1628 __m128d_u __v;
1629 } __attribute__((__packed__, __may_alias__));
1630 return ((const struct __loadu_pd *)__dp)->__v;
1631}
1632
1633/// Loads a 64-bit integer value to the low element of a 128-bit integer
1634/// vector and clears the upper element.
1635///
1636/// \headerfile <x86intrin.h>
1637///
1638/// This intrinsic corresponds to the <c> VMOVQ / MOVQ </c> instruction.
1639///
1640/// \param __a
1641/// A pointer to a 64-bit memory location. The address of the memory
1642/// location does not have to be aligned.
1643/// \returns A 128-bit vector of [2 x i64] containing the loaded value.
1644static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_loadu_si64(void const *__a) {
1645 struct __loadu_si64 {
1646 long long __v;
1647 } __attribute__((__packed__, __may_alias__));
1648 long long __u = ((const struct __loadu_si64 *)__a)->__v;
1649 return __extension__(__m128i)(__v2di){__u, 0LL};
1650}
1651
1652/// Loads a 32-bit integer value to the low element of a 128-bit integer
1653/// vector and clears the upper element.
1654///
1655/// \headerfile <x86intrin.h>
1656///
1657/// This intrinsic corresponds to the <c> VMOVD / MOVD </c> instruction.
1658///
1659/// \param __a
1660/// A pointer to a 32-bit memory location. The address of the memory
1661/// location does not have to be aligned.
1662/// \returns A 128-bit vector of [4 x i32] containing the loaded value.
1663static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_loadu_si32(void const *__a) {
1664 struct __loadu_si32 {
1665 int __v;
1666 } __attribute__((__packed__, __may_alias__));
1667 int __u = ((const struct __loadu_si32 *)__a)->__v;
1668 return __extension__(__m128i)(__v4si){__u, 0, 0, 0};
1669}
1670
1671/// Loads a 16-bit integer value to the low element of a 128-bit integer
1672/// vector and clears the upper element.
1673///
1674/// \headerfile <x86intrin.h>
1675///
1676/// This intrinsic does not correspond to a specific instruction.
1677///
1678/// \param __a
1679/// A pointer to a 16-bit memory location. The address of the memory
1680/// location does not have to be aligned.
1681/// \returns A 128-bit vector of [8 x i16] containing the loaded value.
1682static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_loadu_si16(void const *__a) {
1683 struct __loadu_si16 {
1684 short __v;
1685 } __attribute__((__packed__, __may_alias__));
1686 short __u = ((const struct __loadu_si16 *)__a)->__v;
1687 return __extension__(__m128i)(__v8hi){__u, 0, 0, 0, 0, 0, 0, 0};
1688}
1689
1690/// Loads a 64-bit double-precision value to the low element of a
1691/// 128-bit integer vector and clears the upper element.
1692///
1693/// \headerfile <x86intrin.h>
1694///
1695/// This intrinsic corresponds to the <c> VMOVSD / MOVSD </c> instruction.
1696///
1697/// \param __dp
1698/// A pointer to a memory location containing a double-precision value.
1699/// The address of the memory location does not have to be aligned.
1700/// \returns A 128-bit vector of [2 x double] containing the loaded value.
1701static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_load_sd(double const *__dp) {
1702 struct __mm_load_sd_struct {
1703 double __u;
1704 } __attribute__((__packed__, __may_alias__));
1705 double __u = ((const struct __mm_load_sd_struct *)__dp)->__u;
1706 return __extension__(__m128d){__u, 0};
1707}
1708
1709/// Loads a double-precision value into the high-order bits of a 128-bit
1710/// vector of [2 x double]. The low-order bits are copied from the low-order
1711/// bits of the first operand.
1712///
1713/// \headerfile <x86intrin.h>
1714///
1715/// This intrinsic corresponds to the <c> VMOVHPD / MOVHPD </c> instruction.
1716///
1717/// \param __a
1718/// A 128-bit vector of [2 x double]. \n
1719/// Bits [63:0] are written to bits [63:0] of the result.
1720/// \param __dp
1721/// A pointer to a 64-bit memory location containing a double-precision
1722/// floating-point value that is loaded. The loaded value is written to bits
1723/// [127:64] of the result. The address of the memory location does not have
1724/// to be aligned.
1725/// \returns A 128-bit vector of [2 x double] containing the moved values.
1726static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_loadh_pd(__m128d __a,
1727 double const *__dp) {
1728 struct __mm_loadh_pd_struct {
1729 double __u;
1730 } __attribute__((__packed__, __may_alias__));
1731 double __u = ((const struct __mm_loadh_pd_struct *)__dp)->__u;
1732 return __extension__(__m128d){__a[0], __u};
1733}
1734
1735/// Loads a double-precision value into the low-order bits of a 128-bit
1736/// vector of [2 x double]. The high-order bits are copied from the
1737/// high-order bits of the first operand.
1738///
1739/// \headerfile <x86intrin.h>
1740///
1741/// This intrinsic corresponds to the <c> VMOVLPD / MOVLPD </c> instruction.
1742///
1743/// \param __a
1744/// A 128-bit vector of [2 x double]. \n
1745/// Bits [127:64] are written to bits [127:64] of the result.
1746/// \param __dp
1747/// A pointer to a 64-bit memory location containing a double-precision
1748/// floating-point value that is loaded. The loaded value is written to bits
1749/// [63:0] of the result. The address of the memory location does not have to
1750/// be aligned.
1751/// \returns A 128-bit vector of [2 x double] containing the moved values.
1752static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_loadl_pd(__m128d __a,
1753 double const *__dp) {
1754 struct __mm_loadl_pd_struct {
1755 double __u;
1756 } __attribute__((__packed__, __may_alias__));
1757 double __u = ((const struct __mm_loadl_pd_struct *)__dp)->__u;
1758 return __extension__(__m128d){__u, __a[1]};
1759}
1760
1761/// Constructs a 128-bit floating-point vector of [2 x double] with
1762/// unspecified content. This could be used as an argument to another
1763/// intrinsic function where the argument is required but the value is not
1764/// actually used.
1765///
1766/// \headerfile <x86intrin.h>
1767///
1768/// This intrinsic has no corresponding instruction.
1769///
1770/// \returns A 128-bit floating-point vector of [2 x double] with unspecified
1771/// content.
1772static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_undefined_pd(void) {
1773 return (__m128d)__builtin_ia32_undef128();
1774}
1775
1776/// Constructs a 128-bit floating-point vector of [2 x double]. The lower
1777/// 64 bits of the vector are initialized with the specified double-precision
1778/// floating-point value. The upper 64 bits are set to zero.
1779///
1780/// \headerfile <x86intrin.h>
1781///
1782/// This intrinsic corresponds to the <c> VMOVQ / MOVQ </c> instruction.
1783///
1784/// \param __w
1785/// A double-precision floating-point value used to initialize the lower 64
1786/// bits of the result.
1787/// \returns An initialized 128-bit floating-point vector of [2 x double]. The
1788/// lower 64 bits contain the value of the parameter. The upper 64 bits are
1789/// set to zero.
1790static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_set_sd(double __w) {
1791 return __extension__(__m128d){__w, 0.0};
1792}
1793
1794/// Constructs a 128-bit floating-point vector of [2 x double], with each
1795/// of the two double-precision floating-point vector elements set to the
1796/// specified double-precision floating-point value.
1797///
1798/// \headerfile <x86intrin.h>
1799///
1800/// This intrinsic corresponds to the <c> VMOVDDUP / MOVLHPS </c> instruction.
1801///
1802/// \param __w
1803/// A double-precision floating-point value used to initialize each vector
1804/// element of the result.
1805/// \returns An initialized 128-bit floating-point vector of [2 x double].
1806static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_set1_pd(double __w) {
1807 return __extension__(__m128d){__w, __w};
1808}
1809
1810/// Constructs a 128-bit floating-point vector of [2 x double], with each
1811/// of the two double-precision floating-point vector elements set to the
1812/// specified double-precision floating-point value.
1813///
1814/// \headerfile <x86intrin.h>
1815///
1816/// This intrinsic corresponds to the <c> VMOVDDUP / MOVLHPS </c> instruction.
1817///
1818/// \param __w
1819/// A double-precision floating-point value used to initialize each vector
1820/// element of the result.
1821/// \returns An initialized 128-bit floating-point vector of [2 x double].
1822static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_set_pd1(double __w) {
1823 return _mm_set1_pd(__w);
1824}
1825
1826/// Constructs a 128-bit floating-point vector of [2 x double]
1827/// initialized with the specified double-precision floating-point values.
1828///
1829/// \headerfile <x86intrin.h>
1830///
1831/// This intrinsic corresponds to the <c> VUNPCKLPD / UNPCKLPD </c> instruction.
1832///
1833/// \param __w
1834/// A double-precision floating-point value used to initialize the upper 64
1835/// bits of the result.
1836/// \param __x
1837/// A double-precision floating-point value used to initialize the lower 64
1838/// bits of the result.
1839/// \returns An initialized 128-bit floating-point vector of [2 x double].
1840static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_set_pd(double __w,
1841 double __x) {
1842 return __extension__(__m128d){__x, __w};
1843}
1844
1845/// Constructs a 128-bit floating-point vector of [2 x double],
1846/// initialized in reverse order with the specified double-precision
1847/// floating-point values.
1848///
1849/// \headerfile <x86intrin.h>
1850///
1851/// This intrinsic corresponds to the <c> VUNPCKLPD / UNPCKLPD </c> instruction.
1852///
1853/// \param __w
1854/// A double-precision floating-point value used to initialize the lower 64
1855/// bits of the result.
1856/// \param __x
1857/// A double-precision floating-point value used to initialize the upper 64
1858/// bits of the result.
1859/// \returns An initialized 128-bit floating-point vector of [2 x double].
1860static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_setr_pd(double __w,
1861 double __x) {
1862 return __extension__(__m128d){__w, __x};
1863}
1864
1865/// Constructs a 128-bit floating-point vector of [2 x double]
1866/// initialized to zero.
1867///
1868/// \headerfile <x86intrin.h>
1869///
1870/// This intrinsic corresponds to the <c> VXORPS / XORPS </c> instruction.
1871///
1872/// \returns An initialized 128-bit floating-point vector of [2 x double] with
1873/// all elements set to zero.
1874static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_setzero_pd(void) {
1875 return __extension__(__m128d){0.0, 0.0};
1876}
1877
1878/// Constructs a 128-bit floating-point vector of [2 x double]. The lower
1879/// 64 bits are set to the lower 64 bits of the second parameter. The upper
1880/// 64 bits are set to the upper 64 bits of the first parameter.
1881///
1882/// \headerfile <x86intrin.h>
1883///
1884/// This intrinsic corresponds to the <c> VBLENDPD / BLENDPD </c> instruction.
1885///
1886/// \param __a
1887/// A 128-bit vector of [2 x double]. The upper 64 bits are written to the
1888/// upper 64 bits of the result.
1889/// \param __b
1890/// A 128-bit vector of [2 x double]. The lower 64 bits are written to the
1891/// lower 64 bits of the result.
1892/// \returns A 128-bit vector of [2 x double] containing the moved values.
1893static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR
1894_mm_move_sd(__m128d __a, __m128d __b) {
1895 __a[0] = __b[0];
1896 return __a;
1897}
1898
1899/// Stores the lower 64 bits of a 128-bit vector of [2 x double] to a
1900/// memory location.
1901///
1902/// \headerfile <x86intrin.h>
1903///
1904/// This intrinsic corresponds to the <c> VMOVSD / MOVSD </c> instruction.
1905///
1906/// \param __dp
1907/// A pointer to a 64-bit memory location.
1908/// \param __a
1909/// A 128-bit vector of [2 x double] containing the value to be stored.
1910static __inline__ void __DEFAULT_FN_ATTRS _mm_store_sd(double *__dp,
1911 __m128d __a) {
1912 struct __mm_store_sd_struct {
1913 double __u;
1914 } __attribute__((__packed__, __may_alias__));
1915 ((struct __mm_store_sd_struct *)__dp)->__u = __a[0];
1916}
1917
1918/// Moves packed double-precision values from a 128-bit vector of
1919/// [2 x double] to a memory location.
1920///
1921/// \headerfile <x86intrin.h>
1922///
1923/// This intrinsic corresponds to the <c>VMOVAPD / MOVAPS</c> instruction.
1924///
1925/// \param __dp
1926/// A pointer to an aligned memory location that can store two
1927/// double-precision values.
1928/// \param __a
1929/// A packed 128-bit vector of [2 x double] containing the values to be
1930/// moved.
1931static __inline__ void __DEFAULT_FN_ATTRS _mm_store_pd(double *__dp,
1932 __m128d __a) {
1933 *(__m128d *)__dp = __a;
1934}
1935
1936/// Moves the lower 64 bits of a 128-bit vector of [2 x double] twice to
1937/// the upper and lower 64 bits of a memory location.
1938///
1939/// \headerfile <x86intrin.h>
1940///
1941/// This intrinsic corresponds to the
1942/// <c> VMOVDDUP + VMOVAPD / MOVLHPS + MOVAPS </c> instruction.
1943///
1944/// \param __dp
1945/// A pointer to a memory location that can store two double-precision
1946/// values.
1947/// \param __a
1948/// A 128-bit vector of [2 x double] whose lower 64 bits are copied to each
1949/// of the values in \a __dp.
1950static __inline__ void __DEFAULT_FN_ATTRS _mm_store1_pd(double *__dp,
1951 __m128d __a) {
1952 __a = __builtin_shufflevector((__v2df)__a, (__v2df)__a, 0, 0);
1953 _mm_store_pd(__dp, __a);
1954}
1955
1956/// Moves the lower 64 bits of a 128-bit vector of [2 x double] twice to
1957/// the upper and lower 64 bits of a memory location.
1958///
1959/// \headerfile <x86intrin.h>
1960///
1961/// This intrinsic corresponds to the
1962/// <c> VMOVDDUP + VMOVAPD / MOVLHPS + MOVAPS </c> instruction.
1963///
1964/// \param __dp
1965/// A pointer to a memory location that can store two double-precision
1966/// values.
1967/// \param __a
1968/// A 128-bit vector of [2 x double] whose lower 64 bits are copied to each
1969/// of the values in \a __dp.
1970static __inline__ void __DEFAULT_FN_ATTRS _mm_store_pd1(double *__dp,
1971 __m128d __a) {
1972 _mm_store1_pd(__dp, __a);
1973}
1974
1975/// Stores a 128-bit vector of [2 x double] into an unaligned memory
1976/// location.
1977///
1978/// \headerfile <x86intrin.h>
1979///
1980/// This intrinsic corresponds to the <c> VMOVUPD / MOVUPD </c> instruction.
1981///
1982/// \param __dp
1983/// A pointer to a 128-bit memory location. The address of the memory
1984/// location does not have to be aligned.
1985/// \param __a
1986/// A 128-bit vector of [2 x double] containing the values to be stored.
1987static __inline__ void __DEFAULT_FN_ATTRS _mm_storeu_pd(double *__dp,
1988 __m128d __a) {
1989 struct __storeu_pd {
1990 __m128d_u __v;
1991 } __attribute__((__packed__, __may_alias__));
1992 ((struct __storeu_pd *)__dp)->__v = __a;
1993}
1994
1995/// Stores two double-precision values, in reverse order, from a 128-bit
1996/// vector of [2 x double] to a 16-byte aligned memory location.
1997///
1998/// \headerfile <x86intrin.h>
1999///
2000/// This intrinsic corresponds to a shuffling instruction followed by a
2001/// <c> VMOVAPD / MOVAPD </c> instruction.
2002///
2003/// \param __dp
2004/// A pointer to a 16-byte aligned memory location that can store two
2005/// double-precision values.
2006/// \param __a
2007/// A 128-bit vector of [2 x double] containing the values to be reversed and
2008/// stored.
2009static __inline__ void __DEFAULT_FN_ATTRS _mm_storer_pd(double *__dp,
2010 __m128d __a) {
2011 __a = __builtin_shufflevector((__v2df)__a, (__v2df)__a, 1, 0);
2012 *(__m128d *)__dp = __a;
2013}
2014
2015/// Stores the upper 64 bits of a 128-bit vector of [2 x double] to a
2016/// memory location.
2017///
2018/// \headerfile <x86intrin.h>
2019///
2020/// This intrinsic corresponds to the <c> VMOVHPD / MOVHPD </c> instruction.
2021///
2022/// \param __dp
2023/// A pointer to a 64-bit memory location.
2024/// \param __a
2025/// A 128-bit vector of [2 x double] containing the value to be stored.
2026static __inline__ void __DEFAULT_FN_ATTRS _mm_storeh_pd(double *__dp,
2027 __m128d __a) {
2028 struct __mm_storeh_pd_struct {
2029 double __u;
2030 } __attribute__((__packed__, __may_alias__));
2031 ((struct __mm_storeh_pd_struct *)__dp)->__u = __a[1];
2032}
2033
2034/// Stores the lower 64 bits of a 128-bit vector of [2 x double] to a
2035/// memory location.
2036///
2037/// \headerfile <x86intrin.h>
2038///
2039/// This intrinsic corresponds to the <c> VMOVLPD / MOVLPD </c> instruction.
2040///
2041/// \param __dp
2042/// A pointer to a 64-bit memory location.
2043/// \param __a
2044/// A 128-bit vector of [2 x double] containing the value to be stored.
2045static __inline__ void __DEFAULT_FN_ATTRS _mm_storel_pd(double *__dp,
2046 __m128d __a) {
2047 struct __mm_storeh_pd_struct {
2048 double __u;
2049 } __attribute__((__packed__, __may_alias__));
2050 ((struct __mm_storeh_pd_struct *)__dp)->__u = __a[0];
2051}
2052
2053/// Adds the corresponding elements of two 128-bit vectors of [16 x i8],
2054/// saving the lower 8 bits of each sum in the corresponding element of a
2055/// 128-bit result vector of [16 x i8].
2056///
2057/// The integer elements of both parameters can be either signed or unsigned.
2058///
2059/// \headerfile <x86intrin.h>
2060///
2061/// This intrinsic corresponds to the <c> VPADDB / PADDB </c> instruction.
2062///
2063/// \param __a
2064/// A 128-bit vector of [16 x i8].
2065/// \param __b
2066/// A 128-bit vector of [16 x i8].
2067/// \returns A 128-bit vector of [16 x i8] containing the sums of both
2068/// parameters.
2069static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_add_epi8(__m128i __a,
2070 __m128i __b) {
2071 return (__m128i)((__v16qu)__a + (__v16qu)__b);
2072}
2073
2074/// Adds the corresponding elements of two 128-bit vectors of [8 x i16],
2075/// saving the lower 16 bits of each sum in the corresponding element of a
2076/// 128-bit result vector of [8 x i16].
2077///
2078/// The integer elements of both parameters can be either signed or unsigned.
2079///
2080/// \headerfile <x86intrin.h>
2081///
2082/// This intrinsic corresponds to the <c> VPADDW / PADDW </c> instruction.
2083///
2084/// \param __a
2085/// A 128-bit vector of [8 x i16].
2086/// \param __b
2087/// A 128-bit vector of [8 x i16].
2088/// \returns A 128-bit vector of [8 x i16] containing the sums of both
2089/// parameters.
2090static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_add_epi16(__m128i __a,
2091 __m128i __b) {
2092 return (__m128i)((__v8hu)__a + (__v8hu)__b);
2093}
2094
2095/// Adds the corresponding elements of two 128-bit vectors of [4 x i32],
2096/// saving the lower 32 bits of each sum in the corresponding element of a
2097/// 128-bit result vector of [4 x i32].
2098///
2099/// The integer elements of both parameters can be either signed or unsigned.
2100///
2101/// \headerfile <x86intrin.h>
2102///
2103/// This intrinsic corresponds to the <c> VPADDD / PADDD </c> instruction.
2104///
2105/// \param __a
2106/// A 128-bit vector of [4 x i32].
2107/// \param __b
2108/// A 128-bit vector of [4 x i32].
2109/// \returns A 128-bit vector of [4 x i32] containing the sums of both
2110/// parameters.
2111static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2112_mm_add_epi32(__m128i __a, __m128i __b) {
2113 return (__m128i)((__v4su)__a + (__v4su)__b);
2114}
2115
2116/// Adds two signed or unsigned 64-bit integer values, returning the
2117/// lower 64 bits of the sum.
2118///
2119/// \headerfile <x86intrin.h>
2120///
2121/// This intrinsic corresponds to the <c> PADDQ </c> instruction.
2122///
2123/// \param __a
2124/// A 64-bit integer.
2125/// \param __b
2126/// A 64-bit integer.
2127/// \returns A 64-bit integer containing the sum of both parameters.
2128static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_add_si64(__m64 __a,
2129 __m64 __b) {
2130 return (__m64)(((__v1du)__a)[0] + ((__v1du)__b)[0]);
2131}
2132
2133/// Adds the corresponding elements of two 128-bit vectors of [2 x i64],
2134/// saving the lower 64 bits of each sum in the corresponding element of a
2135/// 128-bit result vector of [2 x i64].
2136///
2137/// The integer elements of both parameters can be either signed or unsigned.
2138///
2139/// \headerfile <x86intrin.h>
2140///
2141/// This intrinsic corresponds to the <c> VPADDQ / PADDQ </c> instruction.
2142///
2143/// \param __a
2144/// A 128-bit vector of [2 x i64].
2145/// \param __b
2146/// A 128-bit vector of [2 x i64].
2147/// \returns A 128-bit vector of [2 x i64] containing the sums of both
2148/// parameters.
2149static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2150_mm_add_epi64(__m128i __a, __m128i __b) {
2151 return (__m128i)((__v2du)__a + (__v2du)__b);
2152}
2153
2154/// Adds, with saturation, the corresponding elements of two 128-bit
2155/// signed [16 x i8] vectors, saving each sum in the corresponding element
2156/// of a 128-bit result vector of [16 x i8].
2157///
2158/// Positive sums greater than 0x7F are saturated to 0x7F. Negative sums
2159/// less than 0x80 are saturated to 0x80.
2160///
2161/// \headerfile <x86intrin.h>
2162///
2163/// This intrinsic corresponds to the <c> VPADDSB / PADDSB </c> instruction.
2164///
2165/// \param __a
2166/// A 128-bit signed [16 x i8] vector.
2167/// \param __b
2168/// A 128-bit signed [16 x i8] vector.
2169/// \returns A 128-bit signed [16 x i8] vector containing the saturated sums of
2170/// both parameters.
2171static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2172_mm_adds_epi8(__m128i __a, __m128i __b) {
2173 return (__m128i)__builtin_elementwise_add_sat((__v16qs)__a, (__v16qs)__b);
2174}
2175
2176/// Adds, with saturation, the corresponding elements of two 128-bit
2177/// signed [8 x i16] vectors, saving each sum in the corresponding element
2178/// of a 128-bit result vector of [8 x i16].
2179///
2180/// Positive sums greater than 0x7FFF are saturated to 0x7FFF. Negative sums
2181/// less than 0x8000 are saturated to 0x8000.
2182///
2183/// \headerfile <x86intrin.h>
2184///
2185/// This intrinsic corresponds to the <c> VPADDSW / PADDSW </c> instruction.
2186///
2187/// \param __a
2188/// A 128-bit signed [8 x i16] vector.
2189/// \param __b
2190/// A 128-bit signed [8 x i16] vector.
2191/// \returns A 128-bit signed [8 x i16] vector containing the saturated sums of
2192/// both parameters.
2193static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2194_mm_adds_epi16(__m128i __a, __m128i __b) {
2195 return (__m128i)__builtin_elementwise_add_sat((__v8hi)__a, (__v8hi)__b);
2196}
2197
2198/// Adds, with saturation, the corresponding elements of two 128-bit
2199/// unsigned [16 x i8] vectors, saving each sum in the corresponding element
2200/// of a 128-bit result vector of [16 x i8].
2201///
2202/// Positive sums greater than 0xFF are saturated to 0xFF. Negative sums are
2203/// saturated to 0x00.
2204///
2205/// \headerfile <x86intrin.h>
2206///
2207/// This intrinsic corresponds to the <c> VPADDUSB / PADDUSB </c> instruction.
2208///
2209/// \param __a
2210/// A 128-bit unsigned [16 x i8] vector.
2211/// \param __b
2212/// A 128-bit unsigned [16 x i8] vector.
2213/// \returns A 128-bit unsigned [16 x i8] vector containing the saturated sums
2214/// of both parameters.
2215static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2216_mm_adds_epu8(__m128i __a, __m128i __b) {
2217 return (__m128i)__builtin_elementwise_add_sat((__v16qu)__a, (__v16qu)__b);
2218}
2219
2220/// Adds, with saturation, the corresponding elements of two 128-bit
2221/// unsigned [8 x i16] vectors, saving each sum in the corresponding element
2222/// of a 128-bit result vector of [8 x i16].
2223///
2224/// Positive sums greater than 0xFFFF are saturated to 0xFFFF. Negative sums
2225/// are saturated to 0x0000.
2226///
2227/// \headerfile <x86intrin.h>
2228///
2229/// This intrinsic corresponds to the <c> VPADDUSB / PADDUSB </c> instruction.
2230///
2231/// \param __a
2232/// A 128-bit unsigned [8 x i16] vector.
2233/// \param __b
2234/// A 128-bit unsigned [8 x i16] vector.
2235/// \returns A 128-bit unsigned [8 x i16] vector containing the saturated sums
2236/// of both parameters.
2237static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2238_mm_adds_epu16(__m128i __a, __m128i __b) {
2239 return (__m128i)__builtin_elementwise_add_sat((__v8hu)__a, (__v8hu)__b);
2240}
2241
2242/// Computes the rounded averages of corresponding elements of two
2243/// 128-bit unsigned [16 x i8] vectors, saving each result in the
2244/// corresponding element of a 128-bit result vector of [16 x i8].
2245///
2246/// \headerfile <x86intrin.h>
2247///
2248/// This intrinsic corresponds to the <c> VPAVGB / PAVGB </c> instruction.
2249///
2250/// \param __a
2251/// A 128-bit unsigned [16 x i8] vector.
2252/// \param __b
2253/// A 128-bit unsigned [16 x i8] vector.
2254/// \returns A 128-bit unsigned [16 x i8] vector containing the rounded
2255/// averages of both parameters.
2256static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_avg_epu8(__m128i __a,
2257 __m128i __b) {
2258 return (__m128i)__builtin_ia32_pavgb128((__v16qi)__a, (__v16qi)__b);
2259}
2260
2261/// Computes the rounded averages of corresponding elements of two
2262/// 128-bit unsigned [8 x i16] vectors, saving each result in the
2263/// corresponding element of a 128-bit result vector of [8 x i16].
2264///
2265/// \headerfile <x86intrin.h>
2266///
2267/// This intrinsic corresponds to the <c> VPAVGW / PAVGW </c> instruction.
2268///
2269/// \param __a
2270/// A 128-bit unsigned [8 x i16] vector.
2271/// \param __b
2272/// A 128-bit unsigned [8 x i16] vector.
2273/// \returns A 128-bit unsigned [8 x i16] vector containing the rounded
2274/// averages of both parameters.
2275static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_avg_epu16(__m128i __a,
2276 __m128i __b) {
2277 return (__m128i)__builtin_ia32_pavgw128((__v8hi)__a, (__v8hi)__b);
2278}
2279
2280/// Multiplies the corresponding elements of two 128-bit signed [8 x i16]
2281/// vectors, producing eight intermediate 32-bit signed integer products, and
2282/// adds the consecutive pairs of 32-bit products to form a 128-bit signed
2283/// [4 x i32] vector.
2284///
2285/// For example, bits [15:0] of both parameters are multiplied producing a
2286/// 32-bit product, bits [31:16] of both parameters are multiplied producing
2287/// a 32-bit product, and the sum of those two products becomes bits [31:0]
2288/// of the result.
2289///
2290/// \headerfile <x86intrin.h>
2291///
2292/// This intrinsic corresponds to the <c> VPMADDWD / PMADDWD </c> instruction.
2293///
2294/// \param __a
2295/// A 128-bit signed [8 x i16] vector.
2296/// \param __b
2297/// A 128-bit signed [8 x i16] vector.
2298/// \returns A 128-bit signed [4 x i32] vector containing the sums of products
2299/// of both parameters.
2300static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_madd_epi16(__m128i __a,
2301 __m128i __b) {
2302 return (__m128i)__builtin_ia32_pmaddwd128((__v8hi)__a, (__v8hi)__b);
2303}
2304
2305/// Compares corresponding elements of two 128-bit signed [8 x i16]
2306/// vectors, saving the greater value from each comparison in the
2307/// corresponding element of a 128-bit result vector of [8 x i16].
2308///
2309/// \headerfile <x86intrin.h>
2310///
2311/// This intrinsic corresponds to the <c> VPMAXSW / PMAXSW </c> instruction.
2312///
2313/// \param __a
2314/// A 128-bit signed [8 x i16] vector.
2315/// \param __b
2316/// A 128-bit signed [8 x i16] vector.
2317/// \returns A 128-bit signed [8 x i16] vector containing the greater value of
2318/// each comparison.
2319static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epi16(__m128i __a,
2320 __m128i __b) {
2321 return (__m128i)__builtin_elementwise_max((__v8hi)__a, (__v8hi)__b);
2322}
2323
2324/// Compares corresponding elements of two 128-bit unsigned [16 x i8]
2325/// vectors, saving the greater value from each comparison in the
2326/// corresponding element of a 128-bit result vector of [16 x i8].
2327///
2328/// \headerfile <x86intrin.h>
2329///
2330/// This intrinsic corresponds to the <c> VPMAXUB / PMAXUB </c> instruction.
2331///
2332/// \param __a
2333/// A 128-bit unsigned [16 x i8] vector.
2334/// \param __b
2335/// A 128-bit unsigned [16 x i8] vector.
2336/// \returns A 128-bit unsigned [16 x i8] vector containing the greater value of
2337/// each comparison.
2338static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epu8(__m128i __a,
2339 __m128i __b) {
2340 return (__m128i)__builtin_elementwise_max((__v16qu)__a, (__v16qu)__b);
2341}
2342
2343/// Compares corresponding elements of two 128-bit signed [8 x i16]
2344/// vectors, saving the smaller value from each comparison in the
2345/// corresponding element of a 128-bit result vector of [8 x i16].
2346///
2347/// \headerfile <x86intrin.h>
2348///
2349/// This intrinsic corresponds to the <c> VPMINSW / PMINSW </c> instruction.
2350///
2351/// \param __a
2352/// A 128-bit signed [8 x i16] vector.
2353/// \param __b
2354/// A 128-bit signed [8 x i16] vector.
2355/// \returns A 128-bit signed [8 x i16] vector containing the smaller value of
2356/// each comparison.
2357static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epi16(__m128i __a,
2358 __m128i __b) {
2359 return (__m128i)__builtin_elementwise_min((__v8hi)__a, (__v8hi)__b);
2360}
2361
2362/// Compares corresponding elements of two 128-bit unsigned [16 x i8]
2363/// vectors, saving the smaller value from each comparison in the
2364/// corresponding element of a 128-bit result vector of [16 x i8].
2365///
2366/// \headerfile <x86intrin.h>
2367///
2368/// This intrinsic corresponds to the <c> VPMINUB / PMINUB </c> instruction.
2369///
2370/// \param __a
2371/// A 128-bit unsigned [16 x i8] vector.
2372/// \param __b
2373/// A 128-bit unsigned [16 x i8] vector.
2374/// \returns A 128-bit unsigned [16 x i8] vector containing the smaller value of
2375/// each comparison.
2376static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epu8(__m128i __a,
2377 __m128i __b) {
2378 return (__m128i)__builtin_elementwise_min((__v16qu)__a, (__v16qu)__b);
2379}
2380
2381/// Multiplies the corresponding elements of two signed [8 x i16]
2382/// vectors, saving the upper 16 bits of each 32-bit product in the
2383/// corresponding element of a 128-bit signed [8 x i16] result vector.
2384///
2385/// \headerfile <x86intrin.h>
2386///
2387/// This intrinsic corresponds to the <c> VPMULHW / PMULHW </c> instruction.
2388///
2389/// \param __a
2390/// A 128-bit signed [8 x i16] vector.
2391/// \param __b
2392/// A 128-bit signed [8 x i16] vector.
2393/// \returns A 128-bit signed [8 x i16] vector containing the upper 16 bits of
2394/// each of the eight 32-bit products.
2395static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2396_mm_mulhi_epi16(__m128i __a, __m128i __b) {
2397 return (__m128i)__builtin_ia32_pmulhw128((__v8hi)__a, (__v8hi)__b);
2398}
2399
2400/// Multiplies the corresponding elements of two unsigned [8 x i16]
2401/// vectors, saving the upper 16 bits of each 32-bit product in the
2402/// corresponding element of a 128-bit unsigned [8 x i16] result vector.
2403///
2404/// \headerfile <x86intrin.h>
2405///
2406/// This intrinsic corresponds to the <c> VPMULHUW / PMULHUW </c> instruction.
2407///
2408/// \param __a
2409/// A 128-bit unsigned [8 x i16] vector.
2410/// \param __b
2411/// A 128-bit unsigned [8 x i16] vector.
2412/// \returns A 128-bit unsigned [8 x i16] vector containing the upper 16 bits
2413/// of each of the eight 32-bit products.
2414static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2415_mm_mulhi_epu16(__m128i __a, __m128i __b) {
2416 return (__m128i)__builtin_ia32_pmulhuw128((__v8hu)__a, (__v8hu)__b);
2417}
2418
2419/// Multiplies the corresponding elements of two signed [8 x i16]
2420/// vectors, saving the lower 16 bits of each 32-bit product in the
2421/// corresponding element of a 128-bit signed [8 x i16] result vector.
2422///
2423/// \headerfile <x86intrin.h>
2424///
2425/// This intrinsic corresponds to the <c> VPMULLW / PMULLW </c> instruction.
2426///
2427/// \param __a
2428/// A 128-bit signed [8 x i16] vector.
2429/// \param __b
2430/// A 128-bit signed [8 x i16] vector.
2431/// \returns A 128-bit signed [8 x i16] vector containing the lower 16 bits of
2432/// each of the eight 32-bit products.
2433static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2434_mm_mullo_epi16(__m128i __a, __m128i __b) {
2435 return (__m128i)((__v8hu)__a * (__v8hu)__b);
2436}
2437
2438/// Multiplies 32-bit unsigned integer values contained in the lower bits
2439/// of the two 64-bit integer vectors and returns the 64-bit unsigned
2440/// product.
2441///
2442/// \headerfile <x86intrin.h>
2443///
2444/// This intrinsic corresponds to the <c> PMULUDQ </c> instruction.
2445///
2446/// \param __a
2447/// A 64-bit integer containing one of the source operands.
2448/// \param __b
2449/// A 64-bit integer containing one of the source operands.
2450/// \returns A 64-bit integer vector containing the product of both operands.
2451static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_mul_su32(__m64 __a,
2452 __m64 __b) {
2453 return __trunc64(__builtin_ia32_pmuludq128((__v4si)__zext128(__a),
2454 (__v4si)__zext128(__b)));
2455}
2456
2457/// Multiplies 32-bit unsigned integer values contained in the lower
2458/// bits of the corresponding elements of two [2 x i64] vectors, and returns
2459/// the 64-bit products in the corresponding elements of a [2 x i64] vector.
2460///
2461/// \headerfile <x86intrin.h>
2462///
2463/// This intrinsic corresponds to the <c> VPMULUDQ / PMULUDQ </c> instruction.
2464///
2465/// \param __a
2466/// A [2 x i64] vector containing one of the source operands.
2467/// \param __b
2468/// A [2 x i64] vector containing one of the source operands.
2469/// \returns A [2 x i64] vector containing the product of both operands.
2470static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2471_mm_mul_epu32(__m128i __a, __m128i __b) {
2472 return __builtin_ia32_pmuludq128((__v4si)__a, (__v4si)__b);
2473}
2474
2475/// Computes the absolute differences of corresponding 8-bit integer
2476/// values in two 128-bit vectors. Sums the first 8 absolute differences, and
2477/// separately sums the second 8 absolute differences. Packs these two
2478/// unsigned 16-bit integer sums into the upper and lower elements of a
2479/// [2 x i64] vector.
2480///
2481/// \headerfile <x86intrin.h>
2482///
2483/// This intrinsic corresponds to the <c> VPSADBW / PSADBW </c> instruction.
2484///
2485/// \param __a
2486/// A 128-bit integer vector containing one of the source operands.
2487/// \param __b
2488/// A 128-bit integer vector containing one of the source operands.
2489/// \returns A [2 x i64] vector containing the sums of the sets of absolute
2490/// differences between both operands.
2491static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sad_epu8(__m128i __a,
2492 __m128i __b) {
2493 return __builtin_ia32_psadbw128((__v16qi)__a, (__v16qi)__b);
2494}
2495
2496/// Subtracts the corresponding 8-bit integer values in the operands.
2497///
2498/// \headerfile <x86intrin.h>
2499///
2500/// This intrinsic corresponds to the <c> VPSUBB / PSUBB </c> instruction.
2501///
2502/// \param __a
2503/// A 128-bit integer vector containing the minuends.
2504/// \param __b
2505/// A 128-bit integer vector containing the subtrahends.
2506/// \returns A 128-bit integer vector containing the differences of the values
2507/// in the operands.
2508static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sub_epi8(__m128i __a,
2509 __m128i __b) {
2510 return (__m128i)((__v16qu)__a - (__v16qu)__b);
2511}
2512
2513/// Subtracts the corresponding 16-bit integer values in the operands.
2514///
2515/// \headerfile <x86intrin.h>
2516///
2517/// This intrinsic corresponds to the <c> VPSUBW / PSUBW </c> instruction.
2518///
2519/// \param __a
2520/// A 128-bit integer vector containing the minuends.
2521/// \param __b
2522/// A 128-bit integer vector containing the subtrahends.
2523/// \returns A 128-bit integer vector containing the differences of the values
2524/// in the operands.
2525static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sub_epi16(__m128i __a,
2526 __m128i __b) {
2527 return (__m128i)((__v8hu)__a - (__v8hu)__b);
2528}
2529
2530/// Subtracts the corresponding 32-bit integer values in the operands.
2531///
2532/// \headerfile <x86intrin.h>
2533///
2534/// This intrinsic corresponds to the <c> VPSUBD / PSUBD </c> instruction.
2535///
2536/// \param __a
2537/// A 128-bit integer vector containing the minuends.
2538/// \param __b
2539/// A 128-bit integer vector containing the subtrahends.
2540/// \returns A 128-bit integer vector containing the differences of the values
2541/// in the operands.
2542static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2543_mm_sub_epi32(__m128i __a, __m128i __b) {
2544 return (__m128i)((__v4su)__a - (__v4su)__b);
2545}
2546
2547/// Subtracts signed or unsigned 64-bit integer values and writes the
2548/// difference to the corresponding bits in the destination.
2549///
2550/// \headerfile <x86intrin.h>
2551///
2552/// This intrinsic corresponds to the <c> PSUBQ </c> instruction.
2553///
2554/// \param __a
2555/// A 64-bit integer vector containing the minuend.
2556/// \param __b
2557/// A 64-bit integer vector containing the subtrahend.
2558/// \returns A 64-bit integer vector containing the difference of the values in
2559/// the operands.
2560static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_sub_si64(__m64 __a,
2561 __m64 __b) {
2562 return (__m64)(((__v1du)__a)[0] - ((__v1du)__b)[0]);
2563}
2564
2565/// Subtracts the corresponding elements of two [2 x i64] vectors.
2566///
2567/// \headerfile <x86intrin.h>
2568///
2569/// This intrinsic corresponds to the <c> VPSUBQ / PSUBQ </c> instruction.
2570///
2571/// \param __a
2572/// A 128-bit integer vector containing the minuends.
2573/// \param __b
2574/// A 128-bit integer vector containing the subtrahends.
2575/// \returns A 128-bit integer vector containing the differences of the values
2576/// in the operands.
2577static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2578_mm_sub_epi64(__m128i __a, __m128i __b) {
2579 return (__m128i)((__v2du)__a - (__v2du)__b);
2580}
2581
2582/// Subtracts, with saturation, corresponding 8-bit signed integer values in
2583/// the input and returns the differences in the corresponding bytes in the
2584/// destination.
2585///
2586/// Differences greater than 0x7F are saturated to 0x7F, and differences
2587/// less than 0x80 are saturated to 0x80.
2588///
2589/// \headerfile <x86intrin.h>
2590///
2591/// This intrinsic corresponds to the <c> VPSUBSB / PSUBSB </c> instruction.
2592///
2593/// \param __a
2594/// A 128-bit integer vector containing the minuends.
2595/// \param __b
2596/// A 128-bit integer vector containing the subtrahends.
2597/// \returns A 128-bit integer vector containing the differences of the values
2598/// in the operands.
2599static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2600_mm_subs_epi8(__m128i __a, __m128i __b) {
2601 return (__m128i)__builtin_elementwise_sub_sat((__v16qs)__a, (__v16qs)__b);
2602}
2603
2604/// Subtracts, with saturation, corresponding 16-bit signed integer values in
2605/// the input and returns the differences in the corresponding bytes in the
2606/// destination.
2607///
2608/// Differences greater than 0x7FFF are saturated to 0x7FFF, and values less
2609/// than 0x8000 are saturated to 0x8000.
2610///
2611/// \headerfile <x86intrin.h>
2612///
2613/// This intrinsic corresponds to the <c> VPSUBSW / PSUBSW </c> instruction.
2614///
2615/// \param __a
2616/// A 128-bit integer vector containing the minuends.
2617/// \param __b
2618/// A 128-bit integer vector containing the subtrahends.
2619/// \returns A 128-bit integer vector containing the differences of the values
2620/// in the operands.
2621static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2622_mm_subs_epi16(__m128i __a, __m128i __b) {
2623 return (__m128i)__builtin_elementwise_sub_sat((__v8hi)__a, (__v8hi)__b);
2624}
2625
2626/// Subtracts, with saturation, corresponding 8-bit unsigned integer values in
2627/// the input and returns the differences in the corresponding bytes in the
2628/// destination.
2629///
2630/// Differences less than 0x00 are saturated to 0x00.
2631///
2632/// \headerfile <x86intrin.h>
2633///
2634/// This intrinsic corresponds to the <c> VPSUBUSB / PSUBUSB </c> instruction.
2635///
2636/// \param __a
2637/// A 128-bit integer vector containing the minuends.
2638/// \param __b
2639/// A 128-bit integer vector containing the subtrahends.
2640/// \returns A 128-bit integer vector containing the unsigned integer
2641/// differences of the values in the operands.
2642static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2643_mm_subs_epu8(__m128i __a, __m128i __b) {
2644 return (__m128i)__builtin_elementwise_sub_sat((__v16qu)__a, (__v16qu)__b);
2645}
2646
2647/// Subtracts, with saturation, corresponding 16-bit unsigned integer values in
2648/// the input and returns the differences in the corresponding bytes in the
2649/// destination.
2650///
2651/// Differences less than 0x0000 are saturated to 0x0000.
2652///
2653/// \headerfile <x86intrin.h>
2654///
2655/// This intrinsic corresponds to the <c> VPSUBUSW / PSUBUSW </c> instruction.
2656///
2657/// \param __a
2658/// A 128-bit integer vector containing the minuends.
2659/// \param __b
2660/// A 128-bit integer vector containing the subtrahends.
2661/// \returns A 128-bit integer vector containing the unsigned integer
2662/// differences of the values in the operands.
2663static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2664_mm_subs_epu16(__m128i __a, __m128i __b) {
2665 return (__m128i)__builtin_elementwise_sub_sat((__v8hu)__a, (__v8hu)__b);
2666}
2667
2668/// Performs a bitwise AND of two 128-bit integer vectors.
2669///
2670/// \headerfile <x86intrin.h>
2671///
2672/// This intrinsic corresponds to the <c> VPAND / PAND </c> instruction.
2673///
2674/// \param __a
2675/// A 128-bit integer vector containing one of the source operands.
2676/// \param __b
2677/// A 128-bit integer vector containing one of the source operands.
2678/// \returns A 128-bit integer vector containing the bitwise AND of the values
2679/// in both operands.
2680static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2681_mm_and_si128(__m128i __a, __m128i __b) {
2682 return (__m128i)((__v2du)__a & (__v2du)__b);
2683}
2684
2685/// Performs a bitwise AND of two 128-bit integer vectors, using the
2686/// one's complement of the values contained in the first source operand.
2687///
2688/// \headerfile <x86intrin.h>
2689///
2690/// This intrinsic corresponds to the <c> VPANDN / PANDN </c> instruction.
2691///
2692/// \param __a
2693/// A 128-bit vector containing the left source operand. The one's complement
2694/// of this value is used in the bitwise AND.
2695/// \param __b
2696/// A 128-bit vector containing the right source operand.
2697/// \returns A 128-bit integer vector containing the bitwise AND of the one's
2698/// complement of the first operand and the values in the second operand.
2699static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2700_mm_andnot_si128(__m128i __a, __m128i __b) {
2701 return (__m128i)(~(__v2du)__a & (__v2du)__b);
2702}
2703/// Performs a bitwise OR of two 128-bit integer vectors.
2704///
2705/// \headerfile <x86intrin.h>
2706///
2707/// This intrinsic corresponds to the <c> VPOR / POR </c> instruction.
2708///
2709/// \param __a
2710/// A 128-bit integer vector containing one of the source operands.
2711/// \param __b
2712/// A 128-bit integer vector containing one of the source operands.
2713/// \returns A 128-bit integer vector containing the bitwise OR of the values
2714/// in both operands.
2715static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2716_mm_or_si128(__m128i __a, __m128i __b) {
2717 return (__m128i)((__v2du)__a | (__v2du)__b);
2718}
2719
2720/// Performs a bitwise exclusive OR of two 128-bit integer vectors.
2721///
2722/// \headerfile <x86intrin.h>
2723///
2724/// This intrinsic corresponds to the <c> VPXOR / PXOR </c> instruction.
2725///
2726/// \param __a
2727/// A 128-bit integer vector containing one of the source operands.
2728/// \param __b
2729/// A 128-bit integer vector containing one of the source operands.
2730/// \returns A 128-bit integer vector containing the bitwise exclusive OR of the
2731/// values in both operands.
2732static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2733_mm_xor_si128(__m128i __a, __m128i __b) {
2734 return (__m128i)((__v2du)__a ^ (__v2du)__b);
2735}
2736
2737/// Left-shifts the 128-bit integer vector operand by the specified
2738/// number of bytes. Low-order bits are cleared.
2739///
2740/// \headerfile <x86intrin.h>
2741///
2742/// \code
2743/// __m128i _mm_slli_si128(__m128i a, const int imm);
2744/// \endcode
2745///
2746/// This intrinsic corresponds to the <c> VPSLLDQ / PSLLDQ </c> instruction.
2747///
2748/// \param a
2749/// A 128-bit integer vector containing the source operand.
2750/// \param imm
2751/// An immediate value specifying the number of bytes to left-shift operand
2752/// \a a.
2753/// \returns A 128-bit integer vector containing the left-shifted value.
2754#define _mm_slli_si128(a, imm) \
2755 ((__m128i)__builtin_ia32_pslldqi128_byteshift((__v2di)(__m128i)(a), \
2756 (int)(imm)))
2757
2758#define _mm_bslli_si128(a, imm) \
2759 ((__m128i)__builtin_ia32_pslldqi128_byteshift((__v2di)(__m128i)(a), \
2760 (int)(imm)))
2761
2762/// Left-shifts each 16-bit value in the 128-bit integer vector operand
2763/// by the specified number of bits. Low-order bits are cleared.
2764///
2765/// \headerfile <x86intrin.h>
2766///
2767/// This intrinsic corresponds to the <c> VPSLLW / PSLLW </c> instruction.
2768///
2769/// \param __a
2770/// A 128-bit integer vector containing the source operand.
2771/// \param __count
2772/// An integer value specifying the number of bits to left-shift each value
2773/// in operand \a __a.
2774/// \returns A 128-bit integer vector containing the left-shifted values.
2775static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2776_mm_slli_epi16(__m128i __a, int __count) {
2777 return (__m128i)__builtin_ia32_psllwi128((__v8hi)__a, __count);
2778}
2779
2780/// Left-shifts each 16-bit value in the 128-bit integer vector operand
2781/// by the specified number of bits. Low-order bits are cleared.
2782///
2783/// \headerfile <x86intrin.h>
2784///
2785/// This intrinsic corresponds to the <c> VPSLLW / PSLLW </c> instruction.
2786///
2787/// \param __a
2788/// A 128-bit integer vector containing the source operand.
2789/// \param __count
2790/// A 128-bit integer vector in which bits [63:0] specify the number of bits
2791/// to left-shift each value in operand \a __a.
2792/// \returns A 128-bit integer vector containing the left-shifted values.
2793static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sll_epi16(__m128i __a,
2794 __m128i __count) {
2795 return (__m128i)__builtin_ia32_psllw128((__v8hi)__a, (__v8hi)__count);
2796}
2797
2798/// Left-shifts each 32-bit value in the 128-bit integer vector operand
2799/// by the specified number of bits. Low-order bits are cleared.
2800///
2801/// \headerfile <x86intrin.h>
2802///
2803/// This intrinsic corresponds to the <c> VPSLLD / PSLLD </c> instruction.
2804///
2805/// \param __a
2806/// A 128-bit integer vector containing the source operand.
2807/// \param __count
2808/// An integer value specifying the number of bits to left-shift each value
2809/// in operand \a __a.
2810/// \returns A 128-bit integer vector containing the left-shifted values.
2811static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2812_mm_slli_epi32(__m128i __a, int __count) {
2813 return (__m128i)__builtin_ia32_pslldi128((__v4si)__a, __count);
2814}
2815
2816/// Left-shifts each 32-bit value in the 128-bit integer vector operand
2817/// by the specified number of bits. Low-order bits are cleared.
2818///
2819/// \headerfile <x86intrin.h>
2820///
2821/// This intrinsic corresponds to the <c> VPSLLD / PSLLD </c> instruction.
2822///
2823/// \param __a
2824/// A 128-bit integer vector containing the source operand.
2825/// \param __count
2826/// A 128-bit integer vector in which bits [63:0] specify the number of bits
2827/// to left-shift each value in operand \a __a.
2828/// \returns A 128-bit integer vector containing the left-shifted values.
2829static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sll_epi32(__m128i __a,
2830 __m128i __count) {
2831 return (__m128i)__builtin_ia32_pslld128((__v4si)__a, (__v4si)__count);
2832}
2833
2834/// Left-shifts each 64-bit value in the 128-bit integer vector operand
2835/// by the specified number of bits. Low-order bits are cleared.
2836///
2837/// \headerfile <x86intrin.h>
2838///
2839/// This intrinsic corresponds to the <c> VPSLLQ / PSLLQ </c> instruction.
2840///
2841/// \param __a
2842/// A 128-bit integer vector containing the source operand.
2843/// \param __count
2844/// An integer value specifying the number of bits to left-shift each value
2845/// in operand \a __a.
2846/// \returns A 128-bit integer vector containing the left-shifted values.
2847static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2848_mm_slli_epi64(__m128i __a, int __count) {
2849 return __builtin_ia32_psllqi128((__v2di)__a, __count);
2850}
2851
2852/// Left-shifts each 64-bit value in the 128-bit integer vector operand
2853/// by the specified number of bits. Low-order bits are cleared.
2854///
2855/// \headerfile <x86intrin.h>
2856///
2857/// This intrinsic corresponds to the <c> VPSLLQ / PSLLQ </c> instruction.
2858///
2859/// \param __a
2860/// A 128-bit integer vector containing the source operand.
2861/// \param __count
2862/// A 128-bit integer vector in which bits [63:0] specify the number of bits
2863/// to left-shift each value in operand \a __a.
2864/// \returns A 128-bit integer vector containing the left-shifted values.
2865static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sll_epi64(__m128i __a,
2866 __m128i __count) {
2867 return __builtin_ia32_psllq128((__v2di)__a, (__v2di)__count);
2868}
2869
2870/// Right-shifts each 16-bit value in the 128-bit integer vector operand
2871/// by the specified number of bits. High-order bits are filled with the sign
2872/// bit of the initial value.
2873///
2874/// \headerfile <x86intrin.h>
2875///
2876/// This intrinsic corresponds to the <c> VPSRAW / PSRAW </c> instruction.
2877///
2878/// \param __a
2879/// A 128-bit integer vector containing the source operand.
2880/// \param __count
2881/// An integer value specifying the number of bits to right-shift each value
2882/// in operand \a __a.
2883/// \returns A 128-bit integer vector containing the right-shifted values.
2884static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2885_mm_srai_epi16(__m128i __a, int __count) {
2886 return (__m128i)__builtin_ia32_psrawi128((__v8hi)__a, __count);
2887}
2888
2889/// Right-shifts each 16-bit value in the 128-bit integer vector operand
2890/// by the specified number of bits. High-order bits are filled with the sign
2891/// bit of the initial value.
2892///
2893/// \headerfile <x86intrin.h>
2894///
2895/// This intrinsic corresponds to the <c> VPSRAW / PSRAW </c> instruction.
2896///
2897/// \param __a
2898/// A 128-bit integer vector containing the source operand.
2899/// \param __count
2900/// A 128-bit integer vector in which bits [63:0] specify the number of bits
2901/// to right-shift each value in operand \a __a.
2902/// \returns A 128-bit integer vector containing the right-shifted values.
2903static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sra_epi16(__m128i __a,
2904 __m128i __count) {
2905 return (__m128i)__builtin_ia32_psraw128((__v8hi)__a, (__v8hi)__count);
2906}
2907
2908/// Right-shifts each 32-bit value in the 128-bit integer vector operand
2909/// by the specified number of bits. High-order bits are filled with the sign
2910/// bit of the initial value.
2911///
2912/// \headerfile <x86intrin.h>
2913///
2914/// This intrinsic corresponds to the <c> VPSRAD / PSRAD </c> instruction.
2915///
2916/// \param __a
2917/// A 128-bit integer vector containing the source operand.
2918/// \param __count
2919/// An integer value specifying the number of bits to right-shift each value
2920/// in operand \a __a.
2921/// \returns A 128-bit integer vector containing the right-shifted values.
2922static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2923_mm_srai_epi32(__m128i __a, int __count) {
2924 return (__m128i)__builtin_ia32_psradi128((__v4si)__a, __count);
2925}
2926
2927/// Right-shifts each 32-bit value in the 128-bit integer vector operand
2928/// by the specified number of bits. High-order bits are filled with the sign
2929/// bit of the initial value.
2930///
2931/// \headerfile <x86intrin.h>
2932///
2933/// This intrinsic corresponds to the <c> VPSRAD / PSRAD </c> instruction.
2934///
2935/// \param __a
2936/// A 128-bit integer vector containing the source operand.
2937/// \param __count
2938/// A 128-bit integer vector in which bits [63:0] specify the number of bits
2939/// to right-shift each value in operand \a __a.
2940/// \returns A 128-bit integer vector containing the right-shifted values.
2941static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sra_epi32(__m128i __a,
2942 __m128i __count) {
2943 return (__m128i)__builtin_ia32_psrad128((__v4si)__a, (__v4si)__count);
2944}
2945
2946/// Right-shifts the 128-bit integer vector operand by the specified
2947/// number of bytes. High-order bits are cleared.
2948///
2949/// \headerfile <x86intrin.h>
2950///
2951/// \code
2952/// __m128i _mm_srli_si128(__m128i a, const int imm);
2953/// \endcode
2954///
2955/// This intrinsic corresponds to the <c> VPSRLDQ / PSRLDQ </c> instruction.
2956///
2957/// \param a
2958/// A 128-bit integer vector containing the source operand.
2959/// \param imm
2960/// An immediate value specifying the number of bytes to right-shift operand
2961/// \a a.
2962/// \returns A 128-bit integer vector containing the right-shifted value.
2963#define _mm_srli_si128(a, imm) \
2964 ((__m128i)__builtin_ia32_psrldqi128_byteshift((__v2di)(__m128i)(a), \
2965 (int)(imm)))
2966
2967#define _mm_bsrli_si128(a, imm) \
2968 ((__m128i)__builtin_ia32_psrldqi128_byteshift((__v2di)(__m128i)(a), \
2969 (int)(imm)))
2970
2971/// Right-shifts each of 16-bit values in the 128-bit integer vector
2972/// operand by the specified number of bits. High-order bits are cleared.
2973///
2974/// \headerfile <x86intrin.h>
2975///
2976/// This intrinsic corresponds to the <c> VPSRLW / PSRLW </c> instruction.
2977///
2978/// \param __a
2979/// A 128-bit integer vector containing the source operand.
2980/// \param __count
2981/// An integer value specifying the number of bits to right-shift each value
2982/// in operand \a __a.
2983/// \returns A 128-bit integer vector containing the right-shifted values.
2984static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2985_mm_srli_epi16(__m128i __a, int __count) {
2986 return (__m128i)__builtin_ia32_psrlwi128((__v8hi)__a, __count);
2987}
2988
2989/// Right-shifts each of 16-bit values in the 128-bit integer vector
2990/// operand by the specified number of bits. High-order bits are cleared.
2991///
2992/// \headerfile <x86intrin.h>
2993///
2994/// This intrinsic corresponds to the <c> VPSRLW / PSRLW </c> instruction.
2995///
2996/// \param __a
2997/// A 128-bit integer vector containing the source operand.
2998/// \param __count
2999/// A 128-bit integer vector in which bits [63:0] specify the number of bits
3000/// to right-shift each value in operand \a __a.
3001/// \returns A 128-bit integer vector containing the right-shifted values.
3002static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srl_epi16(__m128i __a,
3003 __m128i __count) {
3004 return (__m128i)__builtin_ia32_psrlw128((__v8hi)__a, (__v8hi)__count);
3005}
3006
3007/// Right-shifts each of 32-bit values in the 128-bit integer vector
3008/// operand by the specified number of bits. High-order bits are cleared.
3009///
3010/// \headerfile <x86intrin.h>
3011///
3012/// This intrinsic corresponds to the <c> VPSRLD / PSRLD </c> instruction.
3013///
3014/// \param __a
3015/// A 128-bit integer vector containing the source operand.
3016/// \param __count
3017/// An integer value specifying the number of bits to right-shift each value
3018/// in operand \a __a.
3019/// \returns A 128-bit integer vector containing the right-shifted values.
3020static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3021_mm_srli_epi32(__m128i __a, int __count) {
3022 return (__m128i)__builtin_ia32_psrldi128((__v4si)__a, __count);
3023}
3024
3025/// Right-shifts each of 32-bit values in the 128-bit integer vector
3026/// operand by the specified number of bits. High-order bits are cleared.
3027///
3028/// \headerfile <x86intrin.h>
3029///
3030/// This intrinsic corresponds to the <c> VPSRLD / PSRLD </c> instruction.
3031///
3032/// \param __a
3033/// A 128-bit integer vector containing the source operand.
3034/// \param __count
3035/// A 128-bit integer vector in which bits [63:0] specify the number of bits
3036/// to right-shift each value in operand \a __a.
3037/// \returns A 128-bit integer vector containing the right-shifted values.
3038static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srl_epi32(__m128i __a,
3039 __m128i __count) {
3040 return (__m128i)__builtin_ia32_psrld128((__v4si)__a, (__v4si)__count);
3041}
3042
3043/// Right-shifts each of 64-bit values in the 128-bit integer vector
3044/// operand by the specified number of bits. High-order bits are cleared.
3045///
3046/// \headerfile <x86intrin.h>
3047///
3048/// This intrinsic corresponds to the <c> VPSRLQ / PSRLQ </c> instruction.
3049///
3050/// \param __a
3051/// A 128-bit integer vector containing the source operand.
3052/// \param __count
3053/// An integer value specifying the number of bits to right-shift each value
3054/// in operand \a __a.
3055/// \returns A 128-bit integer vector containing the right-shifted values.
3056static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3057_mm_srli_epi64(__m128i __a, int __count) {
3058 return __builtin_ia32_psrlqi128((__v2di)__a, __count);
3059}
3060
3061/// Right-shifts each of 64-bit values in the 128-bit integer vector
3062/// operand by the specified number of bits. High-order bits are cleared.
3063///
3064/// \headerfile <x86intrin.h>
3065///
3066/// This intrinsic corresponds to the <c> VPSRLQ / PSRLQ </c> instruction.
3067///
3068/// \param __a
3069/// A 128-bit integer vector containing the source operand.
3070/// \param __count
3071/// A 128-bit integer vector in which bits [63:0] specify the number of bits
3072/// to right-shift each value in operand \a __a.
3073/// \returns A 128-bit integer vector containing the right-shifted values.
3074static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srl_epi64(__m128i __a,
3075 __m128i __count) {
3076 return __builtin_ia32_psrlq128((__v2di)__a, (__v2di)__count);
3077}
3078
3079/// Compares each of the corresponding 8-bit values of the 128-bit
3080/// integer vectors for equality.
3081///
3082/// Each comparison returns 0x0 for false, 0xFF for true.
3083///
3084/// \headerfile <x86intrin.h>
3085///
3086/// This intrinsic corresponds to the <c> VPCMPEQB / PCMPEQB </c> instruction.
3087///
3088/// \param __a
3089/// A 128-bit integer vector.
3090/// \param __b
3091/// A 128-bit integer vector.
3092/// \returns A 128-bit integer vector containing the comparison results.
3093static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3094_mm_cmpeq_epi8(__m128i __a, __m128i __b) {
3095 return (__m128i)((__v16qi)__a == (__v16qi)__b);
3096}
3097
3098/// Compares each of the corresponding 16-bit values of the 128-bit
3099/// integer vectors for equality.
3100///
3101/// Each comparison returns 0x0 for false, 0xFFFF for true.
3102///
3103/// \headerfile <x86intrin.h>
3104///
3105/// This intrinsic corresponds to the <c> VPCMPEQW / PCMPEQW </c> instruction.
3106///
3107/// \param __a
3108/// A 128-bit integer vector.
3109/// \param __b
3110/// A 128-bit integer vector.
3111/// \returns A 128-bit integer vector containing the comparison results.
3112static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3113_mm_cmpeq_epi16(__m128i __a, __m128i __b) {
3114 return (__m128i)((__v8hi)__a == (__v8hi)__b);
3115}
3116
3117/// Compares each of the corresponding 32-bit values of the 128-bit
3118/// integer vectors for equality.
3119///
3120/// Each comparison returns 0x0 for false, 0xFFFFFFFF for true.
3121///
3122/// \headerfile <x86intrin.h>
3123///
3124/// This intrinsic corresponds to the <c> VPCMPEQD / PCMPEQD </c> instruction.
3125///
3126/// \param __a
3127/// A 128-bit integer vector.
3128/// \param __b
3129/// A 128-bit integer vector.
3130/// \returns A 128-bit integer vector containing the comparison results.
3131static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3132_mm_cmpeq_epi32(__m128i __a, __m128i __b) {
3133 return (__m128i)((__v4si)__a == (__v4si)__b);
3134}
3135
3136/// Compares each of the corresponding signed 8-bit values of the 128-bit
3137/// integer vectors to determine if the values in the first operand are
3138/// greater than those in the second operand.
3139///
3140/// Each comparison returns 0x0 for false, 0xFF for true.
3141///
3142/// \headerfile <x86intrin.h>
3143///
3144/// This intrinsic corresponds to the <c> VPCMPGTB / PCMPGTB </c> instruction.
3145///
3146/// \param __a
3147/// A 128-bit integer vector.
3148/// \param __b
3149/// A 128-bit integer vector.
3150/// \returns A 128-bit integer vector containing the comparison results.
3151static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3152_mm_cmpgt_epi8(__m128i __a, __m128i __b) {
3153 /* This function always performs a signed comparison, but __v16qi is a char
3154 which may be signed or unsigned, so use __v16qs. */
3155 return (__m128i)((__v16qs)__a > (__v16qs)__b);
3156}
3157
3158/// Compares each of the corresponding signed 16-bit values of the
3159/// 128-bit integer vectors to determine if the values in the first operand
3160/// are greater than those in the second operand.
3161///
3162/// Each comparison returns 0x0 for false, 0xFFFF for true.
3163///
3164/// \headerfile <x86intrin.h>
3165///
3166/// This intrinsic corresponds to the <c> VPCMPGTW / PCMPGTW </c> instruction.
3167///
3168/// \param __a
3169/// A 128-bit integer vector.
3170/// \param __b
3171/// A 128-bit integer vector.
3172/// \returns A 128-bit integer vector containing the comparison results.
3173static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3174_mm_cmpgt_epi16(__m128i __a, __m128i __b) {
3175 return (__m128i)((__v8hi)__a > (__v8hi)__b);
3176}
3177
3178/// Compares each of the corresponding signed 32-bit values of the
3179/// 128-bit integer vectors to determine if the values in the first operand
3180/// are greater than those in the second operand.
3181///
3182/// Each comparison returns 0x0 for false, 0xFFFFFFFF for true.
3183///
3184/// \headerfile <x86intrin.h>
3185///
3186/// This intrinsic corresponds to the <c> VPCMPGTD / PCMPGTD </c> instruction.
3187///
3188/// \param __a
3189/// A 128-bit integer vector.
3190/// \param __b
3191/// A 128-bit integer vector.
3192/// \returns A 128-bit integer vector containing the comparison results.
3193static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3194_mm_cmpgt_epi32(__m128i __a, __m128i __b) {
3195 return (__m128i)((__v4si)__a > (__v4si)__b);
3196}
3197
3198/// Compares each of the corresponding signed 8-bit values of the 128-bit
3199/// integer vectors to determine if the values in the first operand are less
3200/// than those in the second operand.
3201///
3202/// Each comparison returns 0x0 for false, 0xFF for true.
3203///
3204/// \headerfile <x86intrin.h>
3205///
3206/// This intrinsic corresponds to the <c> VPCMPGTB / PCMPGTB </c> instruction.
3207///
3208/// \param __a
3209/// A 128-bit integer vector.
3210/// \param __b
3211/// A 128-bit integer vector.
3212/// \returns A 128-bit integer vector containing the comparison results.
3213static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3214_mm_cmplt_epi8(__m128i __a, __m128i __b) {
3215 return _mm_cmpgt_epi8(__b, __a);
3216}
3217
3218/// Compares each of the corresponding signed 16-bit values of the
3219/// 128-bit integer vectors to determine if the values in the first operand
3220/// are less than those in the second operand.
3221///
3222/// Each comparison returns 0x0 for false, 0xFFFF for true.
3223///
3224/// \headerfile <x86intrin.h>
3225///
3226/// This intrinsic corresponds to the <c> VPCMPGTW / PCMPGTW </c> instruction.
3227///
3228/// \param __a
3229/// A 128-bit integer vector.
3230/// \param __b
3231/// A 128-bit integer vector.
3232/// \returns A 128-bit integer vector containing the comparison results.
3233static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3234_mm_cmplt_epi16(__m128i __a, __m128i __b) {
3235 return _mm_cmpgt_epi16(__b, __a);
3236}
3237
3238/// Compares each of the corresponding signed 32-bit values of the
3239/// 128-bit integer vectors to determine if the values in the first operand
3240/// are less than those in the second operand.
3241///
3242/// Each comparison returns 0x0 for false, 0xFFFFFFFF for true.
3243///
3244/// \headerfile <x86intrin.h>
3245///
3246/// This intrinsic corresponds to the <c> VPCMPGTD / PCMPGTD </c> instruction.
3247///
3248/// \param __a
3249/// A 128-bit integer vector.
3250/// \param __b
3251/// A 128-bit integer vector.
3252/// \returns A 128-bit integer vector containing the comparison results.
3253static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3254_mm_cmplt_epi32(__m128i __a, __m128i __b) {
3255 return _mm_cmpgt_epi32(__b, __a);
3256}
3257
3258#ifdef __x86_64__
3259/// Converts a 64-bit signed integer value from the second operand into a
3260/// double-precision value and returns it in the lower element of a [2 x
3261/// double] vector; the upper element of the returned vector is copied from
3262/// the upper element of the first operand.
3263///
3264/// \headerfile <x86intrin.h>
3265///
3266/// This intrinsic corresponds to the <c> VCVTSI2SD / CVTSI2SD </c> instruction.
3267///
3268/// \param __a
3269/// A 128-bit vector of [2 x double]. The upper 64 bits of this operand are
3270/// copied to the upper 64 bits of the destination.
3271/// \param __b
3272/// A 64-bit signed integer operand containing the value to be converted.
3273/// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the
3274/// converted value of the second operand. The upper 64 bits are copied from
3275/// the upper 64 bits of the first operand.
3276static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR
3277_mm_cvtsi64_sd(__m128d __a, long long __b) {
3278 __a[0] = __b;
3279 return __a;
3280}
3281
3282/// Converts the first (lower) element of a vector of [2 x double] into a
3283/// 64-bit signed integer value.
3284///
3285/// If the converted value does not fit in a 64-bit integer, raises a
3286/// floating-point invalid exception. If the exception is masked, returns
3287/// the most negative integer.
3288///
3289/// \headerfile <x86intrin.h>
3290///
3291/// This intrinsic corresponds to the <c> VCVTSD2SI / CVTSD2SI </c> instruction.
3292///
3293/// \param __a
3294/// A 128-bit vector of [2 x double]. The lower 64 bits are used in the
3295/// conversion.
3296/// \returns A 64-bit signed integer containing the converted value.
3297static __inline__ long long __DEFAULT_FN_ATTRS _mm_cvtsd_si64(__m128d __a) {
3298 return __builtin_ia32_cvtsd2si64((__v2df)__a);
3299}
3300
3301/// Converts the first (lower) element of a vector of [2 x double] into a
3302/// 64-bit signed truncated (rounded toward zero) integer value.
3303///
3304/// If a converted value does not fit in a 64-bit integer, raises a
3305/// floating-point invalid exception. If the exception is masked, returns
3306/// the most negative integer.
3307///
3308/// \headerfile <x86intrin.h>
3309///
3310/// This intrinsic corresponds to the <c> VCVTTSD2SI / CVTTSD2SI </c>
3311/// instruction.
3312///
3313/// \param __a
3314/// A 128-bit vector of [2 x double]. The lower 64 bits are used in the
3315/// conversion.
3316/// \returns A 64-bit signed integer containing the converted value.
3317static __inline__ long long __DEFAULT_FN_ATTRS _mm_cvttsd_si64(__m128d __a) {
3318 return __builtin_ia32_cvttsd2si64((__v2df)__a);
3319}
3320#endif
3321
3322/// Converts a vector of [4 x i32] into a vector of [4 x float].
3323///
3324/// \headerfile <x86intrin.h>
3325///
3326/// This intrinsic corresponds to the <c> VCVTDQ2PS / CVTDQ2PS </c> instruction.
3327///
3328/// \param __a
3329/// A 128-bit integer vector.
3330/// \returns A 128-bit vector of [4 x float] containing the converted values.
3331static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
3333 return (__m128) __builtin_convertvector((__v4si)__a, __v4sf);
3334}
3335
3336/// Converts a vector of [4 x float] into a vector of [4 x i32].
3337///
3338/// If a converted value does not fit in a 32-bit integer, raises a
3339/// floating-point invalid exception. If the exception is masked, returns
3340/// the most negative integer.
3341///
3342/// \headerfile <x86intrin.h>
3343///
3344/// This intrinsic corresponds to the <c> VCVTPS2DQ / CVTPS2DQ </c> instruction.
3345///
3346/// \param __a
3347/// A 128-bit vector of [4 x float].
3348/// \returns A 128-bit integer vector of [4 x i32] containing the converted
3349/// values.
3350static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtps_epi32(__m128 __a) {
3351 return (__m128i)__builtin_ia32_cvtps2dq((__v4sf)__a);
3352}
3353
3354/// Converts a vector of [4 x float] into four signed truncated (rounded toward
3355/// zero) 32-bit integers, returned in a vector of [4 x i32].
3356///
3357/// If a converted value does not fit in a 32-bit integer, raises a
3358/// floating-point invalid exception. If the exception is masked, returns
3359/// the most negative integer.
3360///
3361/// \headerfile <x86intrin.h>
3362///
3363/// This intrinsic corresponds to the <c> VCVTTPS2DQ / CVTTPS2DQ </c>
3364/// instruction.
3365///
3366/// \param __a
3367/// A 128-bit vector of [4 x float].
3368/// \returns A 128-bit vector of [4 x i32] containing the converted values.
3369static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvttps_epi32(__m128 __a) {
3370 return (__m128i)__builtin_ia32_cvttps2dq((__v4sf)__a);
3371}
3372
3373/// Returns a vector of [4 x i32] where the lowest element is the input
3374/// operand and the remaining elements are zero.
3375///
3376/// \headerfile <x86intrin.h>
3377///
3378/// This intrinsic corresponds to the <c> VMOVD / MOVD </c> instruction.
3379///
3380/// \param __a
3381/// A 32-bit signed integer operand.
3382/// \returns A 128-bit vector of [4 x i32].
3383static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3385 return __extension__(__m128i)(__v4si){__a, 0, 0, 0};
3386}
3387
3388/// Returns a vector of [2 x i64] where the lower element is the input
3389/// operand and the upper element is zero.
3390///
3391/// \headerfile <x86intrin.h>
3392///
3393/// This intrinsic corresponds to the <c> VMOVQ / MOVQ </c> instruction
3394/// in 64-bit mode.
3395///
3396/// \param __a
3397/// A 64-bit signed integer operand containing the value to be converted.
3398/// \returns A 128-bit vector of [2 x i64] containing the converted value.
3399static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3401 return __extension__(__m128i)(__v2di){__a, 0};
3402}
3403
3404/// Moves the least significant 32 bits of a vector of [4 x i32] to a
3405/// 32-bit signed integer value.
3406///
3407/// \headerfile <x86intrin.h>
3408///
3409/// This intrinsic corresponds to the <c> VMOVD / MOVD </c> instruction.
3410///
3411/// \param __a
3412/// A vector of [4 x i32]. The least significant 32 bits are moved to the
3413/// destination.
3414/// \returns A 32-bit signed integer containing the moved value.
3415static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
3417 __v4si __b = (__v4si)__a;
3418 return __b[0];
3419}
3420
3421/// Moves the least significant 64 bits of a vector of [2 x i64] to a
3422/// 64-bit signed integer value.
3423///
3424/// \headerfile <x86intrin.h>
3425///
3426/// This intrinsic corresponds to the <c> VMOVQ / MOVQ </c> instruction.
3427///
3428/// \param __a
3429/// A vector of [2 x i64]. The least significant 64 bits are moved to the
3430/// destination.
3431/// \returns A 64-bit signed integer containing the moved value.
3432static __inline__ long long __DEFAULT_FN_ATTRS_CONSTEXPR
3434 return __a[0];
3435}
3436
3437/// Moves packed integer values from an aligned 128-bit memory location
3438/// to elements in a 128-bit integer vector.
3439///
3440/// \headerfile <x86intrin.h>
3441///
3442/// This intrinsic corresponds to the <c> VMOVDQA / MOVDQA </c> instruction.
3443///
3444/// \param __p
3445/// An aligned pointer to a memory location containing integer values.
3446/// \returns A 128-bit integer vector containing the moved values.
3447static __inline__ __m128i __DEFAULT_FN_ATTRS
3448_mm_load_si128(__m128i const *__p) {
3449 return *__p;
3450}
3451
3452/// Moves packed integer values from an unaligned 128-bit memory location
3453/// to elements in a 128-bit integer vector.
3454///
3455/// \headerfile <x86intrin.h>
3456///
3457/// This intrinsic corresponds to the <c> VMOVDQU / MOVDQU </c> instruction.
3458///
3459/// \param __p
3460/// A pointer to a memory location containing integer values.
3461/// \returns A 128-bit integer vector containing the moved values.
3462static __inline__ __m128i __DEFAULT_FN_ATTRS
3463_mm_loadu_si128(__m128i_u const *__p) {
3464 struct __loadu_si128 {
3465 __m128i_u __v;
3466 } __attribute__((__packed__, __may_alias__));
3467 return ((const struct __loadu_si128 *)__p)->__v;
3468}
3469
3470/// Returns a vector of [2 x i64] where the lower element is taken from
3471/// the lower element of the operand, and the upper element is zero.
3472///
3473/// \headerfile <x86intrin.h>
3474///
3475/// This intrinsic corresponds to the <c> VMOVQ / MOVQ </c> instruction.
3476///
3477/// \param __p
3478/// A 128-bit vector of [2 x i64]. Bits [63:0] are written to bits [63:0] of
3479/// the destination.
3480/// \returns A 128-bit vector of [2 x i64]. The lower order bits contain the
3481/// moved value. The higher order bits are cleared.
3482static __inline__ __m128i __DEFAULT_FN_ATTRS
3483_mm_loadl_epi64(__m128i_u const *__p) {
3484 struct __mm_loadl_epi64_struct {
3485 long long __u;
3486 } __attribute__((__packed__, __may_alias__));
3487 return __extension__(__m128i){
3488 ((const struct __mm_loadl_epi64_struct *)__p)->__u, 0};
3489}
3490
3491/// Generates a 128-bit vector of [4 x i32] with unspecified content.
3492/// This could be used as an argument to another intrinsic function where the
3493/// argument is required but the value is not actually used.
3494///
3495/// \headerfile <x86intrin.h>
3496///
3497/// This intrinsic has no corresponding instruction.
3498///
3499/// \returns A 128-bit vector of [4 x i32] with unspecified content.
3500static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_undefined_si128(void) {
3501 return (__m128i)__builtin_ia32_undef128();
3502}
3503
3504/// Initializes both 64-bit values in a 128-bit vector of [2 x i64] with
3505/// the specified 64-bit integer values.
3506///
3507/// \headerfile <x86intrin.h>
3508///
3509/// This intrinsic is a utility function and does not correspond to a specific
3510/// instruction.
3511///
3512/// \param __q1
3513/// A 64-bit integer value used to initialize the upper 64 bits of the
3514/// destination vector of [2 x i64].
3515/// \param __q0
3516/// A 64-bit integer value used to initialize the lower 64 bits of the
3517/// destination vector of [2 x i64].
3518/// \returns An initialized 128-bit vector of [2 x i64] containing the values
3519/// provided in the operands.
3520static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3521_mm_set_epi64x(long long __q1, long long __q0) {
3522 return __extension__(__m128i)(__v2di){__q0, __q1};
3523}
3524
3525/// Initializes both 64-bit values in a 128-bit vector of [2 x i64] with
3526/// the specified 64-bit integer values.
3527///
3528/// \headerfile <x86intrin.h>
3529///
3530/// This intrinsic is a utility function and does not correspond to a specific
3531/// instruction.
3532///
3533/// \param __q1
3534/// A 64-bit integer value used to initialize the upper 64 bits of the
3535/// destination vector of [2 x i64].
3536/// \param __q0
3537/// A 64-bit integer value used to initialize the lower 64 bits of the
3538/// destination vector of [2 x i64].
3539/// \returns An initialized 128-bit vector of [2 x i64] containing the values
3540/// provided in the operands.
3541static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3542_mm_set_epi64(__m64 __q1, __m64 __q0) {
3543 return _mm_set_epi64x((long long)__q1[0], (long long)__q0[0]);
3544}
3545
3546/// Initializes the 32-bit values in a 128-bit vector of [4 x i32] with
3547/// the specified 32-bit integer values.
3548///
3549/// \headerfile <x86intrin.h>
3550///
3551/// This intrinsic is a utility function and does not correspond to a specific
3552/// instruction.
3553///
3554/// \param __i3
3555/// A 32-bit integer value used to initialize bits [127:96] of the
3556/// destination vector.
3557/// \param __i2
3558/// A 32-bit integer value used to initialize bits [95:64] of the destination
3559/// vector.
3560/// \param __i1
3561/// A 32-bit integer value used to initialize bits [63:32] of the destination
3562/// vector.
3563/// \param __i0
3564/// A 32-bit integer value used to initialize bits [31:0] of the destination
3565/// vector.
3566/// \returns An initialized 128-bit vector of [4 x i32] containing the values
3567/// provided in the operands.
3568static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_set_epi32(int __i3,
3569 int __i2,
3570 int __i1,
3571 int __i0) {
3572 return __extension__(__m128i)(__v4si){__i0, __i1, __i2, __i3};
3573}
3574
3575/// Initializes the 16-bit values in a 128-bit vector of [8 x i16] with
3576/// the specified 16-bit integer values.
3577///
3578/// \headerfile <x86intrin.h>
3579///
3580/// This intrinsic is a utility function and does not correspond to a specific
3581/// instruction.
3582///
3583/// \param __w7
3584/// A 16-bit integer value used to initialize bits [127:112] of the
3585/// destination vector.
3586/// \param __w6
3587/// A 16-bit integer value used to initialize bits [111:96] of the
3588/// destination vector.
3589/// \param __w5
3590/// A 16-bit integer value used to initialize bits [95:80] of the destination
3591/// vector.
3592/// \param __w4
3593/// A 16-bit integer value used to initialize bits [79:64] of the destination
3594/// vector.
3595/// \param __w3
3596/// A 16-bit integer value used to initialize bits [63:48] of the destination
3597/// vector.
3598/// \param __w2
3599/// A 16-bit integer value used to initialize bits [47:32] of the destination
3600/// vector.
3601/// \param __w1
3602/// A 16-bit integer value used to initialize bits [31:16] of the destination
3603/// vector.
3604/// \param __w0
3605/// A 16-bit integer value used to initialize bits [15:0] of the destination
3606/// vector.
3607/// \returns An initialized 128-bit vector of [8 x i16] containing the values
3608/// provided in the operands.
3609static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3610_mm_set_epi16(short __w7, short __w6, short __w5, short __w4, short __w3,
3611 short __w2, short __w1, short __w0) {
3612 return __extension__(__m128i)(__v8hi){__w0, __w1, __w2, __w3,
3613 __w4, __w5, __w6, __w7};
3614}
3615
3616/// Initializes the 8-bit values in a 128-bit vector of [16 x i8] with
3617/// the specified 8-bit integer values.
3618///
3619/// \headerfile <x86intrin.h>
3620///
3621/// This intrinsic is a utility function and does not correspond to a specific
3622/// instruction.
3623///
3624/// \param __b15
3625/// Initializes bits [127:120] of the destination vector.
3626/// \param __b14
3627/// Initializes bits [119:112] of the destination vector.
3628/// \param __b13
3629/// Initializes bits [111:104] of the destination vector.
3630/// \param __b12
3631/// Initializes bits [103:96] of the destination vector.
3632/// \param __b11
3633/// Initializes bits [95:88] of the destination vector.
3634/// \param __b10
3635/// Initializes bits [87:80] of the destination vector.
3636/// \param __b9
3637/// Initializes bits [79:72] of the destination vector.
3638/// \param __b8
3639/// Initializes bits [71:64] of the destination vector.
3640/// \param __b7
3641/// Initializes bits [63:56] of the destination vector.
3642/// \param __b6
3643/// Initializes bits [55:48] of the destination vector.
3644/// \param __b5
3645/// Initializes bits [47:40] of the destination vector.
3646/// \param __b4
3647/// Initializes bits [39:32] of the destination vector.
3648/// \param __b3
3649/// Initializes bits [31:24] of the destination vector.
3650/// \param __b2
3651/// Initializes bits [23:16] of the destination vector.
3652/// \param __b1
3653/// Initializes bits [15:8] of the destination vector.
3654/// \param __b0
3655/// Initializes bits [7:0] of the destination vector.
3656/// \returns An initialized 128-bit vector of [16 x i8] containing the values
3657/// provided in the operands.
3658static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3659_mm_set_epi8(char __b15, char __b14, char __b13, char __b12, char __b11,
3660 char __b10, char __b9, char __b8, char __b7, char __b6, char __b5,
3661 char __b4, char __b3, char __b2, char __b1, char __b0) {
3662 return __extension__(__m128i)(__v16qi){
3663 __b0, __b1, __b2, __b3, __b4, __b5, __b6, __b7,
3664 __b8, __b9, __b10, __b11, __b12, __b13, __b14, __b15};
3665}
3666
3667/// Initializes both values in a 128-bit integer vector with the
3668/// specified 64-bit integer value.
3669///
3670/// \headerfile <x86intrin.h>
3671///
3672/// This intrinsic is a utility function and does not correspond to a specific
3673/// instruction.
3674///
3675/// \param __q
3676/// Integer value used to initialize the elements of the destination integer
3677/// vector.
3678/// \returns An initialized 128-bit integer vector of [2 x i64] with both
3679/// elements containing the value provided in the operand.
3680static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3681_mm_set1_epi64x(long long __q) {
3682 return _mm_set_epi64x(__q, __q);
3683}
3684
3685/// Initializes both values in a 128-bit vector of [2 x i64] with the
3686/// specified 64-bit value.
3687///
3688/// \headerfile <x86intrin.h>
3689///
3690/// This intrinsic is a utility function and does not correspond to a specific
3691/// instruction.
3692///
3693/// \param __q
3694/// A 64-bit value used to initialize the elements of the destination integer
3695/// vector.
3696/// \returns An initialized 128-bit vector of [2 x i64] with all elements
3697/// containing the value provided in the operand.
3698static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3699_mm_set1_epi64(__m64 __q) {
3700 return _mm_set_epi64(__q, __q);
3701}
3702
3703/// Initializes all values in a 128-bit vector of [4 x i32] with the
3704/// specified 32-bit value.
3705///
3706/// \headerfile <x86intrin.h>
3707///
3708/// This intrinsic is a utility function and does not correspond to a specific
3709/// instruction.
3710///
3711/// \param __i
3712/// A 32-bit value used to initialize the elements of the destination integer
3713/// vector.
3714/// \returns An initialized 128-bit vector of [4 x i32] with all elements
3715/// containing the value provided in the operand.
3716static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_set1_epi32(int __i) {
3717 return _mm_set_epi32(__i, __i, __i, __i);
3718}
3719
3720/// Initializes all values in a 128-bit vector of [8 x i16] with the
3721/// specified 16-bit value.
3722///
3723/// \headerfile <x86intrin.h>
3724///
3725/// This intrinsic is a utility function and does not correspond to a specific
3726/// instruction.
3727///
3728/// \param __w
3729/// A 16-bit value used to initialize the elements of the destination integer
3730/// vector.
3731/// \returns An initialized 128-bit vector of [8 x i16] with all elements
3732/// containing the value provided in the operand.
3733static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3734_mm_set1_epi16(short __w) {
3735 return _mm_set_epi16(__w, __w, __w, __w, __w, __w, __w, __w);
3736}
3737
3738/// Initializes all values in a 128-bit vector of [16 x i8] with the
3739/// specified 8-bit value.
3740///
3741/// \headerfile <x86intrin.h>
3742///
3743/// This intrinsic is a utility function and does not correspond to a specific
3744/// instruction.
3745///
3746/// \param __b
3747/// An 8-bit value used to initialize the elements of the destination integer
3748/// vector.
3749/// \returns An initialized 128-bit vector of [16 x i8] with all elements
3750/// containing the value provided in the operand.
3751static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_set1_epi8(char __b) {
3752 return _mm_set_epi8(__b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b,
3753 __b, __b, __b, __b, __b);
3754}
3755
3756/// Constructs a 128-bit integer vector, initialized in reverse order
3757/// with the specified 64-bit integral values.
3758///
3759/// \headerfile <x86intrin.h>
3760///
3761/// This intrinsic does not correspond to a specific instruction.
3762///
3763/// \param __q0
3764/// A 64-bit integral value used to initialize the lower 64 bits of the
3765/// result.
3766/// \param __q1
3767/// A 64-bit integral value used to initialize the upper 64 bits of the
3768/// result.
3769/// \returns An initialized 128-bit integer vector.
3770static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3771_mm_setr_epi64(__m64 __q0, __m64 __q1) {
3772 return _mm_set_epi64(__q1, __q0);
3773}
3774
3775/// Constructs a 128-bit integer vector, initialized in reverse order
3776/// with the specified 32-bit integral values.
3777///
3778/// \headerfile <x86intrin.h>
3779///
3780/// This intrinsic is a utility function and does not correspond to a specific
3781/// instruction.
3782///
3783/// \param __i0
3784/// A 32-bit integral value used to initialize bits [31:0] of the result.
3785/// \param __i1
3786/// A 32-bit integral value used to initialize bits [63:32] of the result.
3787/// \param __i2
3788/// A 32-bit integral value used to initialize bits [95:64] of the result.
3789/// \param __i3
3790/// A 32-bit integral value used to initialize bits [127:96] of the result.
3791/// \returns An initialized 128-bit integer vector.
3792static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3793_mm_setr_epi32(int __i0, int __i1, int __i2, int __i3) {
3794 return _mm_set_epi32(__i3, __i2, __i1, __i0);
3795}
3796
3797/// Constructs a 128-bit integer vector, initialized in reverse order
3798/// with the specified 16-bit integral values.
3799///
3800/// \headerfile <x86intrin.h>
3801///
3802/// This intrinsic is a utility function and does not correspond to a specific
3803/// instruction.
3804///
3805/// \param __w0
3806/// A 16-bit integral value used to initialize bits [15:0] of the result.
3807/// \param __w1
3808/// A 16-bit integral value used to initialize bits [31:16] of the result.
3809/// \param __w2
3810/// A 16-bit integral value used to initialize bits [47:32] of the result.
3811/// \param __w3
3812/// A 16-bit integral value used to initialize bits [63:48] of the result.
3813/// \param __w4
3814/// A 16-bit integral value used to initialize bits [79:64] of the result.
3815/// \param __w5
3816/// A 16-bit integral value used to initialize bits [95:80] of the result.
3817/// \param __w6
3818/// A 16-bit integral value used to initialize bits [111:96] of the result.
3819/// \param __w7
3820/// A 16-bit integral value used to initialize bits [127:112] of the result.
3821/// \returns An initialized 128-bit integer vector.
3822static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3823_mm_setr_epi16(short __w0, short __w1, short __w2, short __w3, short __w4,
3824 short __w5, short __w6, short __w7) {
3825 return _mm_set_epi16(__w7, __w6, __w5, __w4, __w3, __w2, __w1, __w0);
3826}
3827
3828/// Constructs a 128-bit integer vector, initialized in reverse order
3829/// with the specified 8-bit integral values.
3830///
3831/// \headerfile <x86intrin.h>
3832///
3833/// This intrinsic is a utility function and does not correspond to a specific
3834/// instruction.
3835///
3836/// \param __b0
3837/// An 8-bit integral value used to initialize bits [7:0] of the result.
3838/// \param __b1
3839/// An 8-bit integral value used to initialize bits [15:8] of the result.
3840/// \param __b2
3841/// An 8-bit integral value used to initialize bits [23:16] of the result.
3842/// \param __b3
3843/// An 8-bit integral value used to initialize bits [31:24] of the result.
3844/// \param __b4
3845/// An 8-bit integral value used to initialize bits [39:32] of the result.
3846/// \param __b5
3847/// An 8-bit integral value used to initialize bits [47:40] of the result.
3848/// \param __b6
3849/// An 8-bit integral value used to initialize bits [55:48] of the result.
3850/// \param __b7
3851/// An 8-bit integral value used to initialize bits [63:56] of the result.
3852/// \param __b8
3853/// An 8-bit integral value used to initialize bits [71:64] of the result.
3854/// \param __b9
3855/// An 8-bit integral value used to initialize bits [79:72] of the result.
3856/// \param __b10
3857/// An 8-bit integral value used to initialize bits [87:80] of the result.
3858/// \param __b11
3859/// An 8-bit integral value used to initialize bits [95:88] of the result.
3860/// \param __b12
3861/// An 8-bit integral value used to initialize bits [103:96] of the result.
3862/// \param __b13
3863/// An 8-bit integral value used to initialize bits [111:104] of the result.
3864/// \param __b14
3865/// An 8-bit integral value used to initialize bits [119:112] of the result.
3866/// \param __b15
3867/// An 8-bit integral value used to initialize bits [127:120] of the result.
3868/// \returns An initialized 128-bit integer vector.
3869static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
3870_mm_setr_epi8(char __b0, char __b1, char __b2, char __b3, char __b4, char __b5,
3871 char __b6, char __b7, char __b8, char __b9, char __b10,
3872 char __b11, char __b12, char __b13, char __b14, char __b15) {
3873 return _mm_set_epi8(__b15, __b14, __b13, __b12, __b11, __b10, __b9, __b8,
3874 __b7, __b6, __b5, __b4, __b3, __b2, __b1, __b0);
3875}
3876
3877/// Creates a 128-bit integer vector initialized to zero.
3878///
3879/// \headerfile <x86intrin.h>
3880///
3881/// This intrinsic corresponds to the <c> VXORPS / XORPS </c> instruction.
3882///
3883/// \returns An initialized 128-bit integer vector with all elements set to
3884/// zero.
3885static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_setzero_si128(void) {
3886 return __extension__(__m128i)(__v2di){0LL, 0LL};
3887}
3888
3889/// Stores a 128-bit integer vector to a memory location aligned on a
3890/// 128-bit boundary.
3891///
3892/// \headerfile <x86intrin.h>
3893///
3894/// This intrinsic corresponds to the <c> VMOVAPS / MOVAPS </c> instruction.
3895///
3896/// \param __p
3897/// A pointer to an aligned memory location that will receive the integer
3898/// values.
3899/// \param __b
3900/// A 128-bit integer vector containing the values to be moved.
3901static __inline__ void __DEFAULT_FN_ATTRS _mm_store_si128(__m128i *__p,
3902 __m128i __b) {
3903 *__p = __b;
3904}
3905
3906/// Stores a 128-bit integer vector to an unaligned memory location.
3907///
3908/// \headerfile <x86intrin.h>
3909///
3910/// This intrinsic corresponds to the <c> VMOVUPS / MOVUPS </c> instruction.
3911///
3912/// \param __p
3913/// A pointer to a memory location that will receive the integer values.
3914/// \param __b
3915/// A 128-bit integer vector containing the values to be moved.
3916static __inline__ void __DEFAULT_FN_ATTRS _mm_storeu_si128(__m128i_u *__p,
3917 __m128i __b) {
3918 struct __storeu_si128 {
3919 __m128i_u __v;
3920 } __attribute__((__packed__, __may_alias__));
3921 ((struct __storeu_si128 *)__p)->__v = __b;
3922}
3923
3924/// Stores a 64-bit integer value from the low element of a 128-bit integer
3925/// vector.
3926///
3927/// \headerfile <x86intrin.h>
3928///
3929/// This intrinsic corresponds to the <c> VMOVQ / MOVQ </c> instruction.
3930///
3931/// \param __p
3932/// A pointer to a 64-bit memory location. The address of the memory
3933/// location does not have to be aligned.
3934/// \param __b
3935/// A 128-bit integer vector containing the value to be stored.
3936static __inline__ void __DEFAULT_FN_ATTRS _mm_storeu_si64(void *__p,
3937 __m128i __b) {
3938 struct __storeu_si64 {
3939 long long __v;
3940 } __attribute__((__packed__, __may_alias__));
3941 ((struct __storeu_si64 *)__p)->__v = ((__v2di)__b)[0];
3942}
3943
3944/// Stores a 32-bit integer value from the low element of a 128-bit integer
3945/// vector.
3946///
3947/// \headerfile <x86intrin.h>
3948///
3949/// This intrinsic corresponds to the <c> VMOVD / MOVD </c> instruction.
3950///
3951/// \param __p
3952/// A pointer to a 32-bit memory location. The address of the memory
3953/// location does not have to be aligned.
3954/// \param __b
3955/// A 128-bit integer vector containing the value to be stored.
3956static __inline__ void __DEFAULT_FN_ATTRS _mm_storeu_si32(void *__p,
3957 __m128i __b) {
3958 struct __storeu_si32 {
3959 int __v;
3960 } __attribute__((__packed__, __may_alias__));
3961 ((struct __storeu_si32 *)__p)->__v = ((__v4si)__b)[0];
3962}
3963
3964/// Stores a 16-bit integer value from the low element of a 128-bit integer
3965/// vector.
3966///
3967/// \headerfile <x86intrin.h>
3968///
3969/// This intrinsic does not correspond to a specific instruction.
3970///
3971/// \param __p
3972/// A pointer to a 16-bit memory location. The address of the memory
3973/// location does not have to be aligned.
3974/// \param __b
3975/// A 128-bit integer vector containing the value to be stored.
3976static __inline__ void __DEFAULT_FN_ATTRS _mm_storeu_si16(void *__p,
3977 __m128i __b) {
3978 struct __storeu_si16 {
3979 short __v;
3980 } __attribute__((__packed__, __may_alias__));
3981 ((struct __storeu_si16 *)__p)->__v = ((__v8hi)__b)[0];
3982}
3983
3984/// Moves bytes selected by the mask from the first operand to the
3985/// specified unaligned memory location. When a mask bit is 1, the
3986/// corresponding byte is written, otherwise it is not written.
3987///
3988/// To minimize caching, the data is flagged as non-temporal (unlikely to be
3989/// used again soon). Exception and trap behavior for elements not selected
3990/// for storage to memory are implementation dependent.
3991///
3992/// \headerfile <x86intrin.h>
3993///
3994/// This intrinsic corresponds to the <c> VMASKMOVDQU / MASKMOVDQU </c>
3995/// instruction.
3996///
3997/// \param __d
3998/// A 128-bit integer vector containing the values to be moved.
3999/// \param __n
4000/// A 128-bit integer vector containing the mask. The most significant bit of
4001/// each byte represents the mask bits.
4002/// \param __p
4003/// A pointer to an unaligned 128-bit memory location where the specified
4004/// values are moved.
4005static __inline__ void __DEFAULT_FN_ATTRS _mm_maskmoveu_si128(__m128i __d,
4006 __m128i __n,
4007 char *__p) {
4008 __builtin_ia32_maskmovdqu((__v16qi)__d, (__v16qi)__n, __p);
4009}
4010
4011/// Stores the lower 64 bits of a 128-bit integer vector of [2 x i64] to
4012/// a memory location.
4013///
4014/// \headerfile <x86intrin.h>
4015///
4016/// This intrinsic corresponds to the <c> VMOVLPS / MOVLPS </c> instruction.
4017///
4018/// \param __p
4019/// A pointer to a 64-bit memory location that will receive the lower 64 bits
4020/// of the integer vector parameter.
4021/// \param __a
4022/// A 128-bit integer vector of [2 x i64]. The lower 64 bits contain the
4023/// value to be stored.
4024static __inline__ void __DEFAULT_FN_ATTRS _mm_storel_epi64(__m128i_u *__p,
4025 __m128i __a) {
4026 struct __mm_storel_epi64_struct {
4027 long long __u;
4028 } __attribute__((__packed__, __may_alias__));
4029 ((struct __mm_storel_epi64_struct *)__p)->__u = __a[0];
4030}
4031
4032/// Stores a 128-bit floating point vector of [2 x double] to a 128-bit
4033/// aligned memory location.
4034///
4035/// To minimize caching, the data is flagged as non-temporal (unlikely to be
4036/// used again soon).
4037///
4038/// \headerfile <x86intrin.h>
4039///
4040/// This intrinsic corresponds to the <c> VMOVNTPS / MOVNTPS </c> instruction.
4041///
4042/// \param __p
4043/// A pointer to the 128-bit aligned memory location used to store the value.
4044/// \param __a
4045/// A vector of [2 x double] containing the 64-bit values to be stored.
4046static __inline__ void __DEFAULT_FN_ATTRS _mm_stream_pd(void *__p,
4047 __m128d __a) {
4048 __builtin_nontemporal_store((__v2df)__a, (__v2df *)__p);
4049}
4050
4051/// Stores a 128-bit integer vector to a 128-bit aligned memory location.
4052///
4053/// To minimize caching, the data is flagged as non-temporal (unlikely to be
4054/// used again soon).
4055///
4056/// \headerfile <x86intrin.h>
4057///
4058/// This intrinsic corresponds to the <c> VMOVNTPS / MOVNTPS </c> instruction.
4059///
4060/// \param __p
4061/// A pointer to the 128-bit aligned memory location used to store the value.
4062/// \param __a
4063/// A 128-bit integer vector containing the values to be stored.
4064static __inline__ void __DEFAULT_FN_ATTRS _mm_stream_si128(void *__p,
4065 __m128i __a) {
4066 __builtin_nontemporal_store((__v2di)__a, (__v2di *)__p);
4067}
4068
4069/// Stores a 32-bit integer value in the specified memory location.
4070///
4071/// To minimize caching, the data is flagged as non-temporal (unlikely to be
4072/// used again soon).
4073///
4074/// \headerfile <x86intrin.h>
4075///
4076/// This intrinsic corresponds to the <c> MOVNTI </c> instruction.
4077///
4078/// \param __p
4079/// A pointer to the 32-bit memory location used to store the value.
4080/// \param __a
4081/// A 32-bit integer containing the value to be stored.
4082static __inline__ void
4083 __attribute__((__always_inline__, __nodebug__, __target__("sse2")))
4084 _mm_stream_si32(void *__p, int __a) {
4085 __builtin_ia32_movnti((int *)__p, __a);
4086}
4087
4088#ifdef __x86_64__
4089/// Stores a 64-bit integer value in the specified memory location.
4090///
4091/// To minimize caching, the data is flagged as non-temporal (unlikely to be
4092/// used again soon).
4093///
4094/// \headerfile <x86intrin.h>
4095///
4096/// This intrinsic corresponds to the <c> MOVNTIQ </c> instruction.
4097///
4098/// \param __p
4099/// A pointer to the 64-bit memory location used to store the value.
4100/// \param __a
4101/// A 64-bit integer containing the value to be stored.
4102static __inline__ void
4103 __attribute__((__always_inline__, __nodebug__, __target__("sse2")))
4104 _mm_stream_si64(void *__p, long long __a) {
4105 __builtin_ia32_movnti64((long long *)__p, __a);
4106}
4107#endif
4108
4109#if defined(__cplusplus)
4110extern "C" {
4111#endif
4112
4113/// The cache line containing \a __p is flushed and invalidated from all
4114/// caches in the coherency domain.
4115///
4116/// \headerfile <x86intrin.h>
4117///
4118/// This intrinsic corresponds to the <c> CLFLUSH </c> instruction.
4119///
4120/// \param __p
4121/// A pointer to the memory location used to identify the cache line to be
4122/// flushed.
4123void _mm_clflush(void const *__p);
4124
4125/// Forces strong memory ordering (serialization) between load
4126/// instructions preceding this instruction and load instructions following
4127/// this instruction, ensuring the system completes all previous loads before
4128/// executing subsequent loads.
4129///
4130/// \headerfile <x86intrin.h>
4131///
4132/// This intrinsic corresponds to the <c> LFENCE </c> instruction.
4133///
4134void _mm_lfence(void);
4135
4136/// Forces strong memory ordering (serialization) between load and store
4137/// instructions preceding this instruction and load and store instructions
4138/// following this instruction, ensuring that the system completes all
4139/// previous memory accesses before executing subsequent memory accesses.
4140///
4141/// \headerfile <x86intrin.h>
4142///
4143/// This intrinsic corresponds to the <c> MFENCE </c> instruction.
4144///
4145void _mm_mfence(void);
4146
4147#if defined(__cplusplus)
4148} // extern "C"
4149#endif
4150
4151/// Converts, with saturation, 16-bit signed integers from both 128-bit integer
4152/// vector operands into 8-bit signed integers, and packs the results into
4153/// the destination.
4154///
4155/// Positive values greater than 0x7F are saturated to 0x7F. Negative values
4156/// less than 0x80 are saturated to 0x80.
4157///
4158/// \headerfile <x86intrin.h>
4159///
4160/// This intrinsic corresponds to the <c> VPACKSSWB / PACKSSWB </c> instruction.
4161///
4162/// \param __a
4163/// A 128-bit integer vector of [8 x i16]. The converted [8 x i8] values are
4164/// written to the lower 64 bits of the result.
4165/// \param __b
4166/// A 128-bit integer vector of [8 x i16]. The converted [8 x i8] values are
4167/// written to the higher 64 bits of the result.
4168/// \returns A 128-bit vector of [16 x i8] containing the converted values.
4169static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_packs_epi16(__m128i __a,
4170 __m128i __b) {
4171 return (__m128i)__builtin_ia32_packsswb128((__v8hi)__a, (__v8hi)__b);
4172}
4173
4174/// Converts, with saturation, 32-bit signed integers from both 128-bit integer
4175/// vector operands into 16-bit signed integers, and packs the results into
4176/// the destination.
4177///
4178/// Positive values greater than 0x7FFF are saturated to 0x7FFF. Negative
4179/// values less than 0x8000 are saturated to 0x8000.
4180///
4181/// \headerfile <x86intrin.h>
4182///
4183/// This intrinsic corresponds to the <c> VPACKSSDW / PACKSSDW </c> instruction.
4184///
4185/// \param __a
4186/// A 128-bit integer vector of [4 x i32]. The converted [4 x i16] values
4187/// are written to the lower 64 bits of the result.
4188/// \param __b
4189/// A 128-bit integer vector of [4 x i32]. The converted [4 x i16] values
4190/// are written to the higher 64 bits of the result.
4191/// \returns A 128-bit vector of [8 x i16] containing the converted values.
4192static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_packs_epi32(__m128i __a,
4193 __m128i __b) {
4194 return (__m128i)__builtin_ia32_packssdw128((__v4si)__a, (__v4si)__b);
4195}
4196
4197/// Converts, with saturation, 16-bit signed integers from both 128-bit integer
4198/// vector operands into 8-bit unsigned integers, and packs the results into
4199/// the destination.
4200///
4201/// Values greater than 0xFF are saturated to 0xFF. Values less than 0x00
4202/// are saturated to 0x00.
4203///
4204/// \headerfile <x86intrin.h>
4205///
4206/// This intrinsic corresponds to the <c> VPACKUSWB / PACKUSWB </c> instruction.
4207///
4208/// \param __a
4209/// A 128-bit integer vector of [8 x i16]. The converted [8 x i8] values are
4210/// written to the lower 64 bits of the result.
4211/// \param __b
4212/// A 128-bit integer vector of [8 x i16]. The converted [8 x i8] values are
4213/// written to the higher 64 bits of the result.
4214/// \returns A 128-bit vector of [16 x i8] containing the converted values.
4215static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_packus_epi16(__m128i __a,
4216 __m128i __b) {
4217 return (__m128i)__builtin_ia32_packuswb128((__v8hi)__a, (__v8hi)__b);
4218}
4219
4220/// Extracts 16 bits from a 128-bit integer vector of [8 x i16], using
4221/// the immediate-value parameter as a selector.
4222///
4223/// \headerfile <x86intrin.h>
4224///
4225/// \code
4226/// __m128i _mm_extract_epi16(__m128i a, const int imm);
4227/// \endcode
4228///
4229/// This intrinsic corresponds to the <c> VPEXTRW / PEXTRW </c> instruction.
4230///
4231/// \param a
4232/// A 128-bit integer vector.
4233/// \param imm
4234/// An immediate value. Bits [2:0] selects values from \a a to be assigned
4235/// to bits[15:0] of the result. \n
4236/// 000: assign values from bits [15:0] of \a a. \n
4237/// 001: assign values from bits [31:16] of \a a. \n
4238/// 010: assign values from bits [47:32] of \a a. \n
4239/// 011: assign values from bits [63:48] of \a a. \n
4240/// 100: assign values from bits [79:64] of \a a. \n
4241/// 101: assign values from bits [95:80] of \a a. \n
4242/// 110: assign values from bits [111:96] of \a a. \n
4243/// 111: assign values from bits [127:112] of \a a.
4244/// \returns An integer, whose lower 16 bits are selected from the 128-bit
4245/// integer vector parameter and the remaining bits are assigned zeros.
4246#define _mm_extract_epi16(a, imm) \
4247 ((int)(unsigned short)__builtin_ia32_vec_ext_v8hi((__v8hi)(__m128i)(a), \
4248 (int)(imm)))
4249
4250/// Constructs a 128-bit integer vector by first making a copy of the
4251/// 128-bit integer vector parameter, and then inserting the lower 16 bits
4252/// of an integer parameter into an offset specified by the immediate-value
4253/// parameter.
4254///
4255/// \headerfile <x86intrin.h>
4256///
4257/// \code
4258/// __m128i _mm_insert_epi16(__m128i a, int b, const int imm);
4259/// \endcode
4260///
4261/// This intrinsic corresponds to the <c> VPINSRW / PINSRW </c> instruction.
4262///
4263/// \param a
4264/// A 128-bit integer vector of [8 x i16]. This vector is copied to the
4265/// result and then one of the eight elements in the result is replaced by
4266/// the lower 16 bits of \a b.
4267/// \param b
4268/// An integer. The lower 16 bits of this parameter are written to the
4269/// result beginning at an offset specified by \a imm.
4270/// \param imm
4271/// An immediate value specifying the bit offset in the result at which the
4272/// lower 16 bits of \a b are written.
4273/// \returns A 128-bit integer vector containing the constructed values.
4274#define _mm_insert_epi16(a, b, imm) \
4275 ((__m128i)__builtin_ia32_vec_set_v8hi((__v8hi)(__m128i)(a), (int)(b), \
4276 (int)(imm)))
4277
4278/// Copies the values of the most significant bits from each 8-bit
4279/// element in a 128-bit integer vector of [16 x i8] to create a 16-bit mask
4280/// value, zero-extends the value, and writes it to the destination.
4281///
4282/// \headerfile <x86intrin.h>
4283///
4284/// This intrinsic corresponds to the <c> VPMOVMSKB / PMOVMSKB </c> instruction.
4285///
4286/// \param __a
4287/// A 128-bit integer vector containing the values with bits to be extracted.
4288/// \returns The most significant bits from each 8-bit element in \a __a,
4289/// written to bits [15:0]. The other bits are assigned zeros.
4290static __inline__ int __DEFAULT_FN_ATTRS _mm_movemask_epi8(__m128i __a) {
4291 return __builtin_ia32_pmovmskb128((__v16qi)__a);
4292}
4293
4294/// Constructs a 128-bit integer vector by shuffling four 32-bit
4295/// elements of a 128-bit integer vector parameter, using the immediate-value
4296/// parameter as a specifier.
4297///
4298/// \headerfile <x86intrin.h>
4299///
4300/// \code
4301/// __m128i _mm_shuffle_epi32(__m128i a, const int imm);
4302/// \endcode
4303///
4304/// This intrinsic corresponds to the <c> VPSHUFD / PSHUFD </c> instruction.
4305///
4306/// \param a
4307/// A 128-bit integer vector containing the values to be copied.
4308/// \param imm
4309/// An immediate value containing an 8-bit value specifying which elements to
4310/// copy from a. The destinations within the 128-bit destination are assigned
4311/// values as follows: \n
4312/// Bits [1:0] are used to assign values to bits [31:0] of the result. \n
4313/// Bits [3:2] are used to assign values to bits [63:32] of the result. \n
4314/// Bits [5:4] are used to assign values to bits [95:64] of the result. \n
4315/// Bits [7:6] are used to assign values to bits [127:96] of the result. \n
4316/// Bit value assignments: \n
4317/// 00: assign values from bits [31:0] of \a a. \n
4318/// 01: assign values from bits [63:32] of \a a. \n
4319/// 10: assign values from bits [95:64] of \a a. \n
4320/// 11: assign values from bits [127:96] of \a a. \n
4321/// Note: To generate a mask, you can use the \c _MM_SHUFFLE macro.
4322/// <c>_MM_SHUFFLE(b6, b4, b2, b0)</c> can create an 8-bit mask of the form
4323/// <c>[b6, b4, b2, b0]</c>.
4324/// \returns A 128-bit integer vector containing the shuffled values.
4325#define _mm_shuffle_epi32(a, imm) \
4326 ((__m128i)__builtin_ia32_pshufd((__v4si)(__m128i)(a), (int)(imm)))
4327
4328/// Constructs a 128-bit integer vector by shuffling four lower 16-bit
4329/// elements of a 128-bit integer vector of [8 x i16], using the immediate
4330/// value parameter as a specifier.
4331///
4332/// \headerfile <x86intrin.h>
4333///
4334/// \code
4335/// __m128i _mm_shufflelo_epi16(__m128i a, const int imm);
4336/// \endcode
4337///
4338/// This intrinsic corresponds to the <c> VPSHUFLW / PSHUFLW </c> instruction.
4339///
4340/// \param a
4341/// A 128-bit integer vector of [8 x i16]. Bits [127:64] are copied to bits
4342/// [127:64] of the result.
4343/// \param imm
4344/// An 8-bit immediate value specifying which elements to copy from \a a. \n
4345/// Bits[1:0] are used to assign values to bits [15:0] of the result. \n
4346/// Bits[3:2] are used to assign values to bits [31:16] of the result. \n
4347/// Bits[5:4] are used to assign values to bits [47:32] of the result. \n
4348/// Bits[7:6] are used to assign values to bits [63:48] of the result. \n
4349/// Bit value assignments: \n
4350/// 00: assign values from bits [15:0] of \a a. \n
4351/// 01: assign values from bits [31:16] of \a a. \n
4352/// 10: assign values from bits [47:32] of \a a. \n
4353/// 11: assign values from bits [63:48] of \a a. \n
4354/// Note: To generate a mask, you can use the \c _MM_SHUFFLE macro.
4355/// <c>_MM_SHUFFLE(b6, b4, b2, b0)</c> can create an 8-bit mask of the form
4356/// <c>[b6, b4, b2, b0]</c>.
4357/// \returns A 128-bit integer vector containing the shuffled values.
4358#define _mm_shufflelo_epi16(a, imm) \
4359 ((__m128i)__builtin_ia32_pshuflw((__v8hi)(__m128i)(a), (int)(imm)))
4360
4361/// Constructs a 128-bit integer vector by shuffling four upper 16-bit
4362/// elements of a 128-bit integer vector of [8 x i16], using the immediate
4363/// value parameter as a specifier.
4364///
4365/// \headerfile <x86intrin.h>
4366///
4367/// \code
4368/// __m128i _mm_shufflehi_epi16(__m128i a, const int imm);
4369/// \endcode
4370///
4371/// This intrinsic corresponds to the <c> VPSHUFHW / PSHUFHW </c> instruction.
4372///
4373/// \param a
4374/// A 128-bit integer vector of [8 x i16]. Bits [63:0] are copied to bits
4375/// [63:0] of the result.
4376/// \param imm
4377/// An 8-bit immediate value specifying which elements to copy from \a a. \n
4378/// Bits[1:0] are used to assign values to bits [79:64] of the result. \n
4379/// Bits[3:2] are used to assign values to bits [95:80] of the result. \n
4380/// Bits[5:4] are used to assign values to bits [111:96] of the result. \n
4381/// Bits[7:6] are used to assign values to bits [127:112] of the result. \n
4382/// Bit value assignments: \n
4383/// 00: assign values from bits [79:64] of \a a. \n
4384/// 01: assign values from bits [95:80] of \a a. \n
4385/// 10: assign values from bits [111:96] of \a a. \n
4386/// 11: assign values from bits [127:112] of \a a. \n
4387/// Note: To generate a mask, you can use the \c _MM_SHUFFLE macro.
4388/// <c>_MM_SHUFFLE(b6, b4, b2, b0)</c> can create an 8-bit mask of the form
4389/// <c>[b6, b4, b2, b0]</c>.
4390/// \returns A 128-bit integer vector containing the shuffled values.
4391#define _mm_shufflehi_epi16(a, imm) \
4392 ((__m128i)__builtin_ia32_pshufhw((__v8hi)(__m128i)(a), (int)(imm)))
4393
4394/// Unpacks the high-order (index 8-15) values from two 128-bit vectors
4395/// of [16 x i8] and interleaves them into a 128-bit vector of [16 x i8].
4396///
4397/// \headerfile <x86intrin.h>
4398///
4399/// This intrinsic corresponds to the <c> VPUNPCKHBW / PUNPCKHBW </c>
4400/// instruction.
4401///
4402/// \param __a
4403/// A 128-bit vector of [16 x i8].
4404/// Bits [71:64] are written to bits [7:0] of the result. \n
4405/// Bits [79:72] are written to bits [23:16] of the result. \n
4406/// Bits [87:80] are written to bits [39:32] of the result. \n
4407/// Bits [95:88] are written to bits [55:48] of the result. \n
4408/// Bits [103:96] are written to bits [71:64] of the result. \n
4409/// Bits [111:104] are written to bits [87:80] of the result. \n
4410/// Bits [119:112] are written to bits [103:96] of the result. \n
4411/// Bits [127:120] are written to bits [119:112] of the result.
4412/// \param __b
4413/// A 128-bit vector of [16 x i8]. \n
4414/// Bits [71:64] are written to bits [15:8] of the result. \n
4415/// Bits [79:72] are written to bits [31:24] of the result. \n
4416/// Bits [87:80] are written to bits [47:40] of the result. \n
4417/// Bits [95:88] are written to bits [63:56] of the result. \n
4418/// Bits [103:96] are written to bits [79:72] of the result. \n
4419/// Bits [111:104] are written to bits [95:88] of the result. \n
4420/// Bits [119:112] are written to bits [111:104] of the result. \n
4421/// Bits [127:120] are written to bits [127:120] of the result.
4422/// \returns A 128-bit vector of [16 x i8] containing the interleaved values.
4423static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
4424_mm_unpackhi_epi8(__m128i __a, __m128i __b) {
4425 return (__m128i)__builtin_shufflevector(
4426 (__v16qi)__a, (__v16qi)__b, 8, 16 + 8, 9, 16 + 9, 10, 16 + 10, 11,
4427 16 + 11, 12, 16 + 12, 13, 16 + 13, 14, 16 + 14, 15, 16 + 15);
4428}
4429
4430/// Unpacks the high-order (index 4-7) values from two 128-bit vectors of
4431/// [8 x i16] and interleaves them into a 128-bit vector of [8 x i16].
4432///
4433/// \headerfile <x86intrin.h>
4434///
4435/// This intrinsic corresponds to the <c> VPUNPCKHWD / PUNPCKHWD </c>
4436/// instruction.
4437///
4438/// \param __a
4439/// A 128-bit vector of [8 x i16].
4440/// Bits [79:64] are written to bits [15:0] of the result. \n
4441/// Bits [95:80] are written to bits [47:32] of the result. \n
4442/// Bits [111:96] are written to bits [79:64] of the result. \n
4443/// Bits [127:112] are written to bits [111:96] of the result.
4444/// \param __b
4445/// A 128-bit vector of [8 x i16].
4446/// Bits [79:64] are written to bits [31:16] of the result. \n
4447/// Bits [95:80] are written to bits [63:48] of the result. \n
4448/// Bits [111:96] are written to bits [95:80] of the result. \n
4449/// Bits [127:112] are written to bits [127:112] of the result.
4450/// \returns A 128-bit vector of [8 x i16] containing the interleaved values.
4451static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
4452_mm_unpackhi_epi16(__m128i __a, __m128i __b) {
4453 return (__m128i)__builtin_shufflevector((__v8hi)__a, (__v8hi)__b, 4, 8 + 4, 5,
4454 8 + 5, 6, 8 + 6, 7, 8 + 7);
4455}
4456
4457/// Unpacks the high-order (index 2,3) values from two 128-bit vectors of
4458/// [4 x i32] and interleaves them into a 128-bit vector of [4 x i32].
4459///
4460/// \headerfile <x86intrin.h>
4461///
4462/// This intrinsic corresponds to the <c> VPUNPCKHDQ / PUNPCKHDQ </c>
4463/// instruction.
4464///
4465/// \param __a
4466/// A 128-bit vector of [4 x i32]. \n
4467/// Bits [95:64] are written to bits [31:0] of the destination. \n
4468/// Bits [127:96] are written to bits [95:64] of the destination.
4469/// \param __b
4470/// A 128-bit vector of [4 x i32]. \n
4471/// Bits [95:64] are written to bits [64:32] of the destination. \n
4472/// Bits [127:96] are written to bits [127:96] of the destination.
4473/// \returns A 128-bit vector of [4 x i32] containing the interleaved values.
4474static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
4475_mm_unpackhi_epi32(__m128i __a, __m128i __b) {
4476 return (__m128i)__builtin_shufflevector((__v4si)__a, (__v4si)__b, 2, 4 + 2, 3,
4477 4 + 3);
4478}
4479
4480/// Unpacks the high-order 64-bit elements from two 128-bit vectors of
4481/// [2 x i64] and interleaves them into a 128-bit vector of [2 x i64].
4482///
4483/// \headerfile <x86intrin.h>
4484///
4485/// This intrinsic corresponds to the <c> VPUNPCKHQDQ / PUNPCKHQDQ </c>
4486/// instruction.
4487///
4488/// \param __a
4489/// A 128-bit vector of [2 x i64]. \n
4490/// Bits [127:64] are written to bits [63:0] of the destination.
4491/// \param __b
4492/// A 128-bit vector of [2 x i64]. \n
4493/// Bits [127:64] are written to bits [127:64] of the destination.
4494/// \returns A 128-bit vector of [2 x i64] containing the interleaved values.
4495static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
4496_mm_unpackhi_epi64(__m128i __a, __m128i __b) {
4497 return (__m128i)__builtin_shufflevector((__v2di)__a, (__v2di)__b, 1, 2 + 1);
4498}
4499
4500/// Unpacks the low-order (index 0-7) values from two 128-bit vectors of
4501/// [16 x i8] and interleaves them into a 128-bit vector of [16 x i8].
4502///
4503/// \headerfile <x86intrin.h>
4504///
4505/// This intrinsic corresponds to the <c> VPUNPCKLBW / PUNPCKLBW </c>
4506/// instruction.
4507///
4508/// \param __a
4509/// A 128-bit vector of [16 x i8]. \n
4510/// Bits [7:0] are written to bits [7:0] of the result. \n
4511/// Bits [15:8] are written to bits [23:16] of the result. \n
4512/// Bits [23:16] are written to bits [39:32] of the result. \n
4513/// Bits [31:24] are written to bits [55:48] of the result. \n
4514/// Bits [39:32] are written to bits [71:64] of the result. \n
4515/// Bits [47:40] are written to bits [87:80] of the result. \n
4516/// Bits [55:48] are written to bits [103:96] of the result. \n
4517/// Bits [63:56] are written to bits [119:112] of the result.
4518/// \param __b
4519/// A 128-bit vector of [16 x i8].
4520/// Bits [7:0] are written to bits [15:8] of the result. \n
4521/// Bits [15:8] are written to bits [31:24] of the result. \n
4522/// Bits [23:16] are written to bits [47:40] of the result. \n
4523/// Bits [31:24] are written to bits [63:56] of the result. \n
4524/// Bits [39:32] are written to bits [79:72] of the result. \n
4525/// Bits [47:40] are written to bits [95:88] of the result. \n
4526/// Bits [55:48] are written to bits [111:104] of the result. \n
4527/// Bits [63:56] are written to bits [127:120] of the result.
4528/// \returns A 128-bit vector of [16 x i8] containing the interleaved values.
4529static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
4530_mm_unpacklo_epi8(__m128i __a, __m128i __b) {
4531 return (__m128i)__builtin_shufflevector(
4532 (__v16qi)__a, (__v16qi)__b, 0, 16 + 0, 1, 16 + 1, 2, 16 + 2, 3, 16 + 3, 4,
4533 16 + 4, 5, 16 + 5, 6, 16 + 6, 7, 16 + 7);
4534}
4535
4536/// Unpacks the low-order (index 0-3) values from each of the two 128-bit
4537/// vectors of [8 x i16] and interleaves them into a 128-bit vector of
4538/// [8 x i16].
4539///
4540/// \headerfile <x86intrin.h>
4541///
4542/// This intrinsic corresponds to the <c> VPUNPCKLWD / PUNPCKLWD </c>
4543/// instruction.
4544///
4545/// \param __a
4546/// A 128-bit vector of [8 x i16].
4547/// Bits [15:0] are written to bits [15:0] of the result. \n
4548/// Bits [31:16] are written to bits [47:32] of the result. \n
4549/// Bits [47:32] are written to bits [79:64] of the result. \n
4550/// Bits [63:48] are written to bits [111:96] of the result.
4551/// \param __b
4552/// A 128-bit vector of [8 x i16].
4553/// Bits [15:0] are written to bits [31:16] of the result. \n
4554/// Bits [31:16] are written to bits [63:48] of the result. \n
4555/// Bits [47:32] are written to bits [95:80] of the result. \n
4556/// Bits [63:48] are written to bits [127:112] of the result.
4557/// \returns A 128-bit vector of [8 x i16] containing the interleaved values.
4558static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
4559_mm_unpacklo_epi16(__m128i __a, __m128i __b) {
4560 return (__m128i)__builtin_shufflevector((__v8hi)__a, (__v8hi)__b, 0, 8 + 0, 1,
4561 8 + 1, 2, 8 + 2, 3, 8 + 3);
4562}
4563
4564/// Unpacks the low-order (index 0,1) values from two 128-bit vectors of
4565/// [4 x i32] and interleaves them into a 128-bit vector of [4 x i32].
4566///
4567/// \headerfile <x86intrin.h>
4568///
4569/// This intrinsic corresponds to the <c> VPUNPCKLDQ / PUNPCKLDQ </c>
4570/// instruction.
4571///
4572/// \param __a
4573/// A 128-bit vector of [4 x i32]. \n
4574/// Bits [31:0] are written to bits [31:0] of the destination. \n
4575/// Bits [63:32] are written to bits [95:64] of the destination.
4576/// \param __b
4577/// A 128-bit vector of [4 x i32]. \n
4578/// Bits [31:0] are written to bits [64:32] of the destination. \n
4579/// Bits [63:32] are written to bits [127:96] of the destination.
4580/// \returns A 128-bit vector of [4 x i32] containing the interleaved values.
4581static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
4582_mm_unpacklo_epi32(__m128i __a, __m128i __b) {
4583 return (__m128i)__builtin_shufflevector((__v4si)__a, (__v4si)__b, 0, 4 + 0, 1,
4584 4 + 1);
4585}
4586
4587/// Unpacks the low-order 64-bit elements from two 128-bit vectors of
4588/// [2 x i64] and interleaves them into a 128-bit vector of [2 x i64].
4589///
4590/// \headerfile <x86intrin.h>
4591///
4592/// This intrinsic corresponds to the <c> VPUNPCKLQDQ / PUNPCKLQDQ </c>
4593/// instruction.
4594///
4595/// \param __a
4596/// A 128-bit vector of [2 x i64]. \n
4597/// Bits [63:0] are written to bits [63:0] of the destination. \n
4598/// \param __b
4599/// A 128-bit vector of [2 x i64]. \n
4600/// Bits [63:0] are written to bits [127:64] of the destination. \n
4601/// \returns A 128-bit vector of [2 x i64] containing the interleaved values.
4602static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
4603_mm_unpacklo_epi64(__m128i __a, __m128i __b) {
4604 return (__m128i)__builtin_shufflevector((__v2di)__a, (__v2di)__b, 0, 2 + 0);
4605}
4606
4607/// Returns the lower 64 bits of a 128-bit integer vector as a 64-bit
4608/// integer.
4609///
4610/// \headerfile <x86intrin.h>
4611///
4612/// This intrinsic corresponds to the <c> MOVDQ2Q </c> instruction.
4613///
4614/// \param __a
4615/// A 128-bit integer vector operand. The lower 64 bits are moved to the
4616/// destination.
4617/// \returns A 64-bit integer containing the lower 64 bits of the parameter.
4618static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR
4620 return (__m64)__a[0];
4621}
4622
4623/// Moves the 64-bit operand to a 128-bit integer vector, zeroing the
4624/// upper bits.
4625///
4626/// \headerfile <x86intrin.h>
4627///
4628/// This intrinsic corresponds to the <c> MOVD+VMOVQ </c> instruction.
4629///
4630/// \param __a
4631/// A 64-bit value.
4632/// \returns A 128-bit integer vector. The lower 64 bits contain the value from
4633/// the operand. The upper 64 bits are assigned zeros.
4634static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
4636 return __builtin_shufflevector((__v1di)__a, _mm_setzero_si64(), 0, 1);
4637}
4638
4639/// Moves the lower 64 bits of a 128-bit integer vector to a 128-bit
4640/// integer vector, zeroing the upper bits.
4641///
4642/// \headerfile <x86intrin.h>
4643///
4644/// This intrinsic corresponds to the <c> VMOVQ / MOVQ </c> instruction.
4645///
4646/// \param __a
4647/// A 128-bit integer vector operand. The lower 64 bits are moved to the
4648/// destination.
4649/// \returns A 128-bit integer vector. The lower 64 bits contain the value from
4650/// the operand. The upper 64 bits are assigned zeros.
4651static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
4653 return __builtin_shufflevector((__v2di)__a, _mm_setzero_si128(), 0, 2);
4654}
4655
4656/// Unpacks the high-order 64-bit elements from two 128-bit vectors of
4657/// [2 x double] and interleaves them into a 128-bit vector of [2 x
4658/// double].
4659///
4660/// \headerfile <x86intrin.h>
4661///
4662/// This intrinsic corresponds to the <c> VUNPCKHPD / UNPCKHPD </c> instruction.
4663///
4664/// \param __a
4665/// A 128-bit vector of [2 x double]. \n
4666/// Bits [127:64] are written to bits [63:0] of the destination.
4667/// \param __b
4668/// A 128-bit vector of [2 x double]. \n
4669/// Bits [127:64] are written to bits [127:64] of the destination.
4670/// \returns A 128-bit vector of [2 x double] containing the interleaved values.
4671static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR
4672_mm_unpackhi_pd(__m128d __a, __m128d __b) {
4673 return __builtin_shufflevector((__v2df)__a, (__v2df)__b, 1, 2 + 1);
4674}
4675
4676/// Unpacks the low-order 64-bit elements from two 128-bit vectors
4677/// of [2 x double] and interleaves them into a 128-bit vector of [2 x
4678/// double].
4679///
4680/// \headerfile <x86intrin.h>
4681///
4682/// This intrinsic corresponds to the <c> VUNPCKLPD / UNPCKLPD </c> instruction.
4683///
4684/// \param __a
4685/// A 128-bit vector of [2 x double]. \n
4686/// Bits [63:0] are written to bits [63:0] of the destination.
4687/// \param __b
4688/// A 128-bit vector of [2 x double]. \n
4689/// Bits [63:0] are written to bits [127:64] of the destination.
4690/// \returns A 128-bit vector of [2 x double] containing the interleaved values.
4691static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR
4692_mm_unpacklo_pd(__m128d __a, __m128d __b) {
4693 return __builtin_shufflevector((__v2df)__a, (__v2df)__b, 0, 2 + 0);
4694}
4695
4696/// Extracts the sign bits of the double-precision values in the 128-bit
4697/// vector of [2 x double], zero-extends the value, and writes it to the
4698/// low-order bits of the destination.
4699///
4700/// \headerfile <x86intrin.h>
4701///
4702/// This intrinsic corresponds to the <c> VMOVMSKPD / MOVMSKPD </c> instruction.
4703///
4704/// \param __a
4705/// A 128-bit vector of [2 x double] containing the values with sign bits to
4706/// be extracted.
4707/// \returns The sign bits from each of the double-precision elements in \a __a,
4708/// written to bits [1:0]. The remaining bits are assigned values of zero.
4709static __inline__ int __DEFAULT_FN_ATTRS _mm_movemask_pd(__m128d __a) {
4710 return __builtin_ia32_movmskpd((__v2df)__a);
4711}
4712
4713/// Constructs a 128-bit floating-point vector of [2 x double] from two
4714/// 128-bit vector parameters of [2 x double], using the immediate-value
4715/// parameter as a specifier.
4716///
4717/// \headerfile <x86intrin.h>
4718///
4719/// \code
4720/// __m128d _mm_shuffle_pd(__m128d a, __m128d b, const int i);
4721/// \endcode
4722///
4723/// This intrinsic corresponds to the <c> VSHUFPD / SHUFPD </c> instruction.
4724///
4725/// \param a
4726/// A 128-bit vector of [2 x double].
4727/// \param b
4728/// A 128-bit vector of [2 x double].
4729/// \param i
4730/// An 8-bit immediate value. The least significant two bits specify which
4731/// elements to copy from \a a and \a b: \n
4732/// Bit[0] = 0: lower element of \a a copied to lower element of result. \n
4733/// Bit[0] = 1: upper element of \a a copied to lower element of result. \n
4734/// Bit[1] = 0: lower element of \a b copied to upper element of result. \n
4735/// Bit[1] = 1: upper element of \a b copied to upper element of result. \n
4736/// Note: To generate a mask, you can use the \c _MM_SHUFFLE2 macro.
4737/// <c>_MM_SHUFFLE2(b1, b0)</c> can create a 2-bit mask of the form
4738/// <c>[b1, b0]</c>.
4739/// \returns A 128-bit vector of [2 x double] containing the shuffled values.
4740#define _mm_shuffle_pd(a, b, i) \
4741 ((__m128d)__builtin_ia32_shufpd((__v2df)(__m128d)(a), (__v2df)(__m128d)(b), \
4742 (int)(i)))
4743
4744/// Casts a 128-bit floating-point vector of [2 x double] into a 128-bit
4745/// floating-point vector of [4 x float].
4746///
4747/// \headerfile <x86intrin.h>
4748///
4749/// This intrinsic has no corresponding instruction.
4750///
4751/// \param __a
4752/// A 128-bit floating-point vector of [2 x double].
4753/// \returns A 128-bit floating-point vector of [4 x float] containing the same
4754/// bitwise pattern as the parameter.
4755static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
4757 return (__m128)__a;
4758}
4759
4760/// Casts a 128-bit floating-point vector of [2 x double] into a 128-bit
4761/// integer vector.
4762///
4763/// \headerfile <x86intrin.h>
4764///
4765/// This intrinsic has no corresponding instruction.
4766///
4767/// \param __a
4768/// A 128-bit floating-point vector of [2 x double].
4769/// \returns A 128-bit integer vector containing the same bitwise pattern as the
4770/// parameter.
4771static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
4773 return (__m128i)__a;
4774}
4775
4776/// Casts a 128-bit floating-point vector of [4 x float] into a 128-bit
4777/// floating-point vector of [2 x double].
4778///
4779/// \headerfile <x86intrin.h>
4780///
4781/// This intrinsic has no corresponding instruction.
4782///
4783/// \param __a
4784/// A 128-bit floating-point vector of [4 x float].
4785/// \returns A 128-bit floating-point vector of [2 x double] containing the same
4786/// bitwise pattern as the parameter.
4787static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR
4789 return (__m128d)__a;
4790}
4791
4792/// Casts a 128-bit floating-point vector of [4 x float] into a 128-bit
4793/// integer vector.
4794///
4795/// \headerfile <x86intrin.h>
4796///
4797/// This intrinsic has no corresponding instruction.
4798///
4799/// \param __a
4800/// A 128-bit floating-point vector of [4 x float].
4801/// \returns A 128-bit integer vector containing the same bitwise pattern as the
4802/// parameter.
4803static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
4805 return (__m128i)__a;
4806}
4807
4808/// Casts a 128-bit integer vector into a 128-bit floating-point vector
4809/// of [4 x float].
4810///
4811/// \headerfile <x86intrin.h>
4812///
4813/// This intrinsic has no corresponding instruction.
4814///
4815/// \param __a
4816/// A 128-bit integer vector.
4817/// \returns A 128-bit floating-point vector of [4 x float] containing the same
4818/// bitwise pattern as the parameter.
4819static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
4821 return (__m128)__a;
4822}
4823
4824/// Casts a 128-bit integer vector into a 128-bit floating-point vector
4825/// of [2 x double].
4826///
4827/// \headerfile <x86intrin.h>
4828///
4829/// This intrinsic has no corresponding instruction.
4830///
4831/// \param __a
4832/// A 128-bit integer vector.
4833/// \returns A 128-bit floating-point vector of [2 x double] containing the same
4834/// bitwise pattern as the parameter.
4835static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR
4837 return (__m128d)__a;
4838}
4839
4840/// Compares each of the corresponding double-precision values of two
4841/// 128-bit vectors of [2 x double], using the operation specified by the
4842/// immediate integer operand.
4843///
4844/// Each comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
4845/// If either value in a comparison is NaN, comparisons that are ordered
4846/// return false, and comparisons that are unordered return true.
4847///
4848/// \headerfile <x86intrin.h>
4849///
4850/// \code
4851/// __m128d _mm_cmp_pd(__m128d a, __m128d b, const int c);
4852/// \endcode
4853///
4854/// This intrinsic corresponds to the <c> (V)CMPPD </c> instruction.
4855///
4856/// \param a
4857/// A 128-bit vector of [2 x double].
4858/// \param b
4859/// A 128-bit vector of [2 x double].
4860/// \param c
4861/// An immediate integer operand, with bits [4:0] specifying which comparison
4862/// operation to use: \n
4863/// 0x00: Equal (ordered, non-signaling) \n
4864/// 0x01: Less-than (ordered, signaling) \n
4865/// 0x02: Less-than-or-equal (ordered, signaling) \n
4866/// 0x03: Unordered (non-signaling) \n
4867/// 0x04: Not-equal (unordered, non-signaling) \n
4868/// 0x05: Not-less-than (unordered, signaling) \n
4869/// 0x06: Not-less-than-or-equal (unordered, signaling) \n
4870/// 0x07: Ordered (non-signaling) \n
4871/// \returns A 128-bit vector of [2 x double] containing the comparison results.
4872#define _mm_cmp_pd(a, b, c) \
4873 ((__m128d)__builtin_ia32_cmppd((__v2df)(__m128d)(a), (__v2df)(__m128d)(b), \
4874 (c)))
4875
4876/// Compares each of the corresponding scalar double-precision values of
4877/// two 128-bit vectors of [2 x double], using the operation specified by the
4878/// immediate integer operand.
4879///
4880/// Each comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
4881/// If either value in a comparison is NaN, comparisons that are ordered
4882/// return false, and comparisons that are unordered return true.
4883///
4884/// \headerfile <x86intrin.h>
4885///
4886/// \code
4887/// __m128d _mm_cmp_sd(__m128d a, __m128d b, const int c);
4888/// \endcode
4889///
4890/// This intrinsic corresponds to the <c> (V)CMPSD </c> instruction.
4891///
4892/// \param a
4893/// A 128-bit vector of [2 x double].
4894/// \param b
4895/// A 128-bit vector of [2 x double].
4896/// \param c
4897/// An immediate integer operand, with bits [4:0] specifying which comparison
4898/// operation to use: \n
4899/// 0x00: Equal (ordered, non-signaling) \n
4900/// 0x01: Less-than (ordered, signaling) \n
4901/// 0x02: Less-than-or-equal (ordered, signaling) \n
4902/// 0x03: Unordered (non-signaling) \n
4903/// 0x04: Not-equal (unordered, non-signaling) \n
4904/// 0x05: Not-less-than (unordered, signaling) \n
4905/// 0x06: Not-less-than-or-equal (unordered, signaling) \n
4906/// 0x07: Ordered (non-signaling) \n
4907/// \returns A 128-bit vector of [2 x double] containing the comparison results.
4908#define _mm_cmp_sd(a, b, c) \
4909 ((__m128d)__builtin_ia32_cmpsd((__v2df)(__m128d)(a), (__v2df)(__m128d)(b), \
4910 (c)))
4911
4912#if defined(__cplusplus)
4913extern "C" {
4914#endif
4915
4916/// Indicates that a spin loop is being executed for the purposes of
4917/// optimizing power consumption during the loop.
4918///
4919/// \headerfile <x86intrin.h>
4920///
4921/// This intrinsic corresponds to the <c> PAUSE </c> instruction.
4922///
4923void _mm_pause(void);
4924
4925#if defined(__cplusplus)
4926} // extern "C"
4927#endif
4928
4929#undef __anyext128
4930#undef __trunc64
4931#undef __DEFAULT_FN_ATTRS
4932#undef __DEFAULT_FN_ATTRS_CONSTEXPR
4933
4934#define _MM_SHUFFLE2(x, y) (((x) << 1) | (y))
4935
4936#define _MM_DENORMALS_ZERO_ON (0x0040U)
4937#define _MM_DENORMALS_ZERO_OFF (0x0000U)
4938
4939#define _MM_DENORMALS_ZERO_MASK (0x0040U)
4940
4941#define _MM_GET_DENORMALS_ZERO_MODE() (_mm_getcsr() & _MM_DENORMALS_ZERO_MASK)
4942#define _MM_SET_DENORMALS_ZERO_MODE(x) \
4943 (_mm_setcsr((_mm_getcsr() & ~_MM_DENORMALS_ZERO_MASK) | (x)))
4944
4945#endif /* __EMMINTRIN_H */
__device__ _Float16
static __inline__ vector float vector float vector float __c
Definition: altivec.h:4800
static __inline__ vector float vector float __b
Definition: altivec.h:578
static __inline__ uint32_t volatile uint32_t * __p
Definition: arm_acle.h:57
return __v
Definition: arm_acle.h:88
static __inline__ double __DEFAULT_FN_ATTRS_CONSTEXPR _mm_cvtsd_f64(__m128d __a)
Returns the low-order element of a 128-bit vector of [2 x double] as a double-precision floating-poin...
Definition: emmintrin.h:1555
static __inline__ int __DEFAULT_FN_ATTRS _mm_comile_sd(__m128d __a, __m128d __b)
Compares the lower double-precision floating-point values in each of the two 128-bit floating-point v...
Definition: emmintrin.h:1057
static __inline__ void __DEFAULT_FN_ATTRS _mm_store_pd1(double *__dp, __m128d __a)
Moves the lower 64 bits of a 128-bit vector of [2 x double] twice to the upper and lower 64 bits of a...
Definition: emmintrin.h:1970
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_castpd_si128(__m128d __a)
Casts a 128-bit floating-point vector of [2 x double] into a 128-bit integer vector.
Definition: emmintrin.h:4772
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_subs_epu16(__m128i __a, __m128i __b)
Subtracts, with saturation, corresponding 16-bit unsigned integer values in the input and returns the...
Definition: emmintrin.h:2664
static __inline__ int __DEFAULT_FN_ATTRS _mm_comilt_sd(__m128d __a, __m128d __b)
Compares the lower double-precision floating-point values in each of the two 128-bit floating-point v...
Definition: emmintrin.h:1033
static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_movepi64_pi64(__m128i __a)
Returns the lower 64 bits of a 128-bit integer vector as a 64-bit integer.
Definition: emmintrin.h:4619
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_div_pd(__m128d __a, __m128d __b)
Performs an element-by-element division of two 128-bit vectors of [2 x double].
Definition: emmintrin.h:225
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_cvtsi64_si128(long long __a)
Returns a vector of [2 x i64] where the lower element is the input operand and the upper element is z...
Definition: emmintrin.h:3400
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_setr_pd(double __w, double __x)
Constructs a 128-bit floating-point vector of [2 x double], initialized in reverse order with the spe...
Definition: emmintrin.h:1860
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_packus_epi16(__m128i __a, __m128i __b)
Converts, with saturation, 16-bit signed integers from both 128-bit integer vector operands into 8-bi...
Definition: emmintrin.h:4215
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_sub_sd(__m128d __a, __m128d __b)
Subtracts the lower double-precision value of the second operand from the lower double-precision valu...
Definition: emmintrin.h:127
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epu8(__m128i __a, __m128i __b)
Compares corresponding elements of two 128-bit unsigned [16 x i8] vectors, saving the smaller value f...
Definition: emmintrin.h:2376
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpneq_pd(__m128d __a, __m128d __b)
Compares each of the corresponding double-precision values of the 128-bit vectors of [2 x double] to ...
Definition: emmintrin.h:598
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_srli_epi64(__m128i __a, int __count)
Right-shifts each of 64-bit values in the 128-bit integer vector operand by the specified number of b...
Definition: emmintrin.h:3057
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_srai_epi16(__m128i __a, int __count)
Right-shifts each 16-bit value in the 128-bit integer vector operand by the specified number of bits.
Definition: emmintrin.h:2885
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_loadu_si32(void const *__a)
Loads a 32-bit integer value to the low element of a 128-bit integer vector and clears the upper elem...
Definition: emmintrin.h:1663
static __inline__ void __DEFAULT_FN_ATTRS _mm_stream_si128(void *__p, __m128i __a)
Stores a 128-bit integer vector to a 128-bit aligned memory location.
Definition: emmintrin.h:4064
static __inline__ int __DEFAULT_FN_ATTRS _mm_movemask_epi8(__m128i __a)
Copies the values of the most significant bits from each 8-bit element in a 128-bit integer vector of...
Definition: emmintrin.h:4290
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sll_epi32(__m128i __a, __m128i __count)
Left-shifts each 32-bit value in the 128-bit integer vector operand by the specified number of bits.
Definition: emmintrin.h:2829
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpord_sd(__m128d __a, __m128d __b)
Compares the lower double-precision floating-point values in each of the two 128-bit floating-point v...
Definition: emmintrin.h:833
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_div_sd(__m128d __a, __m128d __b)
Divides the lower double-precision value of the first operand by the lower double-precision value of ...
Definition: emmintrin.h:206
static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomile_sd(__m128d __a, __m128d __b)
Compares the lower double-precision floating-point values in each of the two 128-bit floating-point v...
Definition: emmintrin.h:1199
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_loadu_pd(double const *__dp)
Loads a 128-bit floating-point vector of [2 x double] from an unaligned memory location.
Definition: emmintrin.h:1626
static __inline__ void __DEFAULT_FN_ATTRS _mm_maskmoveu_si128(__m128i __d, __m128i __n, char *__p)
Moves bytes selected by the mask from the first operand to the specified unaligned memory location.
Definition: emmintrin.h:4005
static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomilt_sd(__m128d __a, __m128d __b)
Compares the lower double-precision floating-point values in each of the two 128-bit floating-point v...
Definition: emmintrin.h:1175
static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomigt_sd(__m128d __a, __m128d __b)
Compares the lower double-precision floating-point values in each of the two 128-bit floating-point v...
Definition: emmintrin.h:1223
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_set_sd(double __w)
Constructs a 128-bit floating-point vector of [2 x double].
Definition: emmintrin.h:1790
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_set_pd1(double __w)
Constructs a 128-bit floating-point vector of [2 x double], with each of the two double-precision flo...
Definition: emmintrin.h:1822
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_load_pd(double const *__dp)
Loads a 128-bit floating-point vector of [2 x double] from an aligned memory location.
Definition: emmintrin.h:1570
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_unpacklo_epi8(__m128i __a, __m128i __b)
Unpacks the low-order (index 0-7) values from two 128-bit vectors of [16 x i8] and interleaves them i...
Definition: emmintrin.h:4530
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_cmpeq_epi32(__m128i __a, __m128i __b)
Compares each of the corresponding 32-bit values of the 128-bit integer vectors for equality.
Definition: emmintrin.h:3132
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_cmplt_epi32(__m128i __a, __m128i __b)
Compares each of the corresponding signed 32-bit values of the 128-bit integer vectors to determine i...
Definition: emmintrin.h:3254
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sub_epi16(__m128i __a, __m128i __b)
Subtracts the corresponding 16-bit integer values in the operands.
Definition: emmintrin.h:2525
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmple_sd(__m128d __a, __m128d __b)
Compares the lower double-precision floating-point values in each of the two 128-bit floating-point v...
Definition: emmintrin.h:755
static __inline__ void __DEFAULT_FN_ATTRS _mm_storel_epi64(__m128i_u *__p, __m128i __a)
Stores the lower 64 bits of a 128-bit integer vector of [2 x i64] to a memory location.
Definition: emmintrin.h:4024
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_add_sd(__m128d __a, __m128d __b)
Adds lower double-precision values in both operands and returns the sum in the lower 64 bits of the r...
Definition: emmintrin.h:87
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpge_pd(__m128d __a, __m128d __b)
Compares each of the corresponding double-precision values of the 128-bit vectors of [2 x double] to ...
Definition: emmintrin.h:532
static __inline__ void __DEFAULT_FN_ATTRS _mm_storeu_si16(void *__p, __m128i __b)
Stores a 16-bit integer value from the low element of a 128-bit integer vector.
Definition: emmintrin.h:3976
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_xor_pd(__m128d __a, __m128d __b)
Performs a bitwise XOR of two 128-bit vectors of [2 x double].
Definition: emmintrin.h:428
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_min_pd(__m128d __a, __m128d __b)
Performs element-by-element comparison of the two 128-bit vectors of [2 x double] and returns a vecto...
Definition: emmintrin.h:311
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_load_sd(double const *__dp)
Loads a 64-bit double-precision value to the low element of a 128-bit integer vector and clears the u...
Definition: emmintrin.h:1701
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_cvtsi32_si128(int __a)
Returns a vector of [4 x i32] where the lowest element is the input operand and the remaining element...
Definition: emmintrin.h:3384
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_unpacklo_epi16(__m128i __a, __m128i __b)
Unpacks the low-order (index 0-3) values from each of the two 128-bit vectors of [8 x i16] and interl...
Definition: emmintrin.h:4559
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_loadu_si16(void const *__a)
Loads a 16-bit integer value to the low element of a 128-bit integer vector and clears the upper elem...
Definition: emmintrin.h:1682
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpgt_sd(__m128d __a, __m128d __b)
Compares the lower double-precision floating-point values in each of the two 128-bit floating-point v...
Definition: emmintrin.h:780
static __inline__ long long __DEFAULT_FN_ATTRS_CONSTEXPR _mm_cvtsi128_si64(__m128i __a)
Moves the least significant 64 bits of a vector of [2 x i64] to a 64-bit signed integer value.
Definition: emmintrin.h:3433
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srl_epi32(__m128i __a, __m128i __count)
Right-shifts each of 32-bit values in the 128-bit integer vector operand by the specified number of b...
Definition: emmintrin.h:3038
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_set1_epi16(short __w)
Initializes all values in a 128-bit vector of [8 x i16] with the specified 16-bit value.
Definition: emmintrin.h:3734
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_sub_epi32(__m128i __a, __m128i __b)
Subtracts the corresponding 32-bit integer values in the operands.
Definition: emmintrin.h:2543
static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomieq_sd(__m128d __a, __m128d __b)
Compares the lower double-precision floating-point values in each of the two 128-bit floating-point v...
Definition: emmintrin.h:1151
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_mullo_epi16(__m128i __a, __m128i __b)
Multiplies the corresponding elements of two signed [8 x i16] vectors, saving the lower 16 bits of ea...
Definition: emmintrin.h:2434
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epu8(__m128i __a, __m128i __b)
Compares corresponding elements of two 128-bit unsigned [16 x i8] vectors, saving the greater value f...
Definition: emmintrin.h:2338
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_avg_epu16(__m128i __a, __m128i __b)
Computes the rounded averages of corresponding elements of two 128-bit unsigned [8 x i16] vectors,...
Definition: emmintrin.h:2275
static __inline__ void __DEFAULT_FN_ATTRS _mm_store1_pd(double *__dp, __m128d __a)
Moves the lower 64 bits of a 128-bit vector of [2 x double] twice to the upper and lower 64 bits of a...
Definition: emmintrin.h:1950
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_slli_epi64(__m128i __a, int __count)
Left-shifts each 64-bit value in the 128-bit integer vector operand by the specified number of bits.
Definition: emmintrin.h:2848
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srl_epi16(__m128i __a, __m128i __count)
Right-shifts each of 16-bit values in the 128-bit integer vector operand by the specified number of b...
Definition: emmintrin.h:3002
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_or_pd(__m128d __a, __m128d __b)
Performs a bitwise OR of two 128-bit vectors of [2 x double].
Definition: emmintrin.h:411
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpge_sd(__m128d __a, __m128d __b)
Compares the lower double-precision floating-point values in each of the two 128-bit floating-point v...
Definition: emmintrin.h:806
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_cvtepi32_pd(__m128i __a)
Converts the lower two integer elements of a 128-bit vector of [4 x i32] into two double-precision fl...
Definition: emmintrin.h:1330
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpnge_sd(__m128d __a, __m128d __b)
Compares the lower double-precision floating-point values in each of the two 128-bit floating-point v...
Definition: emmintrin.h:986
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_set_epi64(__m64 __q1, __m64 __q0)
Initializes both 64-bit values in a 128-bit vector of [2 x i64] with the specified 64-bit integer val...
Definition: emmintrin.h:3542
#define __DEFAULT_FN_ATTRS
Definition: emmintrin.h:52
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmplt_sd(__m128d __a, __m128d __b)
Compares the lower double-precision floating-point values in each of the two 128-bit floating-point v...
Definition: emmintrin.h:730
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_setzero_si128(void)
Creates a 128-bit integer vector initialized to zero.
Definition: emmintrin.h:3885
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpnge_pd(__m128d __a, __m128d __b)
Compares each of the corresponding double-precision values of the 128-bit vectors of [2 x double] to ...
Definition: emmintrin.h:682
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_set_epi64x(long long __q1, long long __q0)
Initializes both 64-bit values in a 128-bit vector of [2 x i64] with the specified 64-bit integer val...
Definition: emmintrin.h:3521
static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_castpd_ps(__m128d __a)
Casts a 128-bit floating-point vector of [2 x double] into a 128-bit floating-point vector of [4 x fl...
Definition: emmintrin.h:4756
static __inline__ int __DEFAULT_FN_ATTRS _mm_movemask_pd(__m128d __a)
Extracts the sign bits of the double-precision values in the 128-bit vector of [2 x double],...
Definition: emmintrin.h:4709
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_castps_pd(__m128 __a)
Casts a 128-bit floating-point vector of [4 x float] into a 128-bit floating-point vector of [2 x dou...
Definition: emmintrin.h:4788
static __inline__ void int __a
Definition: emmintrin.h:4084
void _mm_mfence(void)
Forces strong memory ordering (serialization) between load and store instructions preceding this inst...
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_cmpeq_epi8(__m128i __a, __m128i __b)
Compares each of the corresponding 8-bit values of the 128-bit integer vectors for equality.
Definition: emmintrin.h:3094
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_set_pd(double __w, double __x)
Constructs a 128-bit floating-point vector of [2 x double] initialized with the specified double-prec...
Definition: emmintrin.h:1840
static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_add_si64(__m64 __a, __m64 __b)
Adds two signed or unsigned 64-bit integer values, returning the lower 64 bits of the sum.
Definition: emmintrin.h:2128
static __inline__ void __DEFAULT_FN_ATTRS _mm_storeu_si32(void *__p, __m128i __b)
Stores a 32-bit integer value from the low element of a 128-bit integer vector.
Definition: emmintrin.h:3956
static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_cvtpd_pi32(__m128d __a)
Converts the two double-precision floating-point elements of a 128-bit vector of [2 x double] into tw...
Definition: emmintrin.h:1504
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_andnot_si128(__m128i __a, __m128i __b)
Performs a bitwise AND of two 128-bit integer vectors, using the one's complement of the values conta...
Definition: emmintrin.h:2700
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_setr_epi64(__m64 __q0, __m64 __q1)
Constructs a 128-bit integer vector, initialized in reverse order with the specified 64-bit integral ...
Definition: emmintrin.h:3771
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmple_pd(__m128d __a, __m128d __b)
Compares each of the corresponding double-precision values of the 128-bit vectors of [2 x double] to ...
Definition: emmintrin.h:490
static __inline__ int __DEFAULT_FN_ATTRS _mm_cvttsd_si32(__m128d __a)
Converts the low-order element of a [2 x double] vector into a 32-bit signed truncated (rounded towar...
Definition: emmintrin.h:1485
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_sub_epi64(__m128i __a, __m128i __b)
Subtracts the corresponding elements of two [2 x i64] vectors.
Definition: emmintrin.h:2578
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_cvtss_sd(__m128d __a, __m128 __b)
Converts the lower single-precision floating-point element of a 128-bit vector of [4 x float],...
Definition: emmintrin.h:1442
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_sqrt_pd(__m128d __a)
Calculates the square root of the each of two values stored in a 128-bit vector of [2 x double].
Definition: emmintrin.h:266
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_subs_epi8(__m128i __a, __m128i __b)
Subtracts, with saturation, corresponding 8-bit signed integer values in the input and returns the di...
Definition: emmintrin.h:2600
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_mul_pd(__m128d __a, __m128d __b)
Multiplies two 128-bit vectors of [2 x double].
Definition: emmintrin.h:184
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtpd_epi32(__m128d __a)
Converts the two double-precision floating-point elements of a 128-bit vector of [2 x double] into tw...
Definition: emmintrin.h:1352
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_undefined_si128(void)
Generates a 128-bit vector of [4 x i32] with unspecified content.
Definition: emmintrin.h:3500
static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomige_sd(__m128d __a, __m128d __b)
Compares the lower double-precision floating-point values in each of the two 128-bit floating-point v...
Definition: emmintrin.h:1247
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_madd_epi16(__m128i __a, __m128i __b)
Multiplies the corresponding elements of two 128-bit signed [8 x i16] vectors, producing eight interm...
Definition: emmintrin.h:2300
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_or_si128(__m128i __a, __m128i __b)
Performs a bitwise OR of two 128-bit integer vectors.
Definition: emmintrin.h:2716
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_set1_epi64x(long long __q)
Initializes both values in a 128-bit integer vector with the specified 64-bit integer value.
Definition: emmintrin.h:3681
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_loadu_si64(void const *__a)
Loads a 64-bit integer value to the low element of a 128-bit integer vector and clears the upper elem...
Definition: emmintrin.h:1644
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _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)
Constructs a 128-bit integer vector, initialized in reverse order with the specified 8-bit integral v...
Definition: emmintrin.h:3870
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_adds_epu8(__m128i __a, __m128i __b)
Adds, with saturation, the corresponding elements of two 128-bit unsigned [16 x i8] vectors,...
Definition: emmintrin.h:2216
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpnlt_pd(__m128d __a, __m128d __b)
Compares each of the corresponding double-precision values of the 128-bit vectors of [2 x double] to ...
Definition: emmintrin.h:619
static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtsd_ss(__m128 __a, __m128d __b)
Converts the lower double-precision floating-point element of a 128-bit vector of [2 x double],...
Definition: emmintrin.h:1394
static __inline__ int __DEFAULT_FN_ATTRS _mm_cvtsd_si32(__m128d __a)
Converts the low-order element of a 128-bit vector of [2 x double] into a 32-bit signed integer value...
Definition: emmintrin.h:1371
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_loadl_pd(__m128d __a, double const *__dp)
Loads a double-precision value into the low-order bits of a 128-bit vector of [2 x double].
Definition: emmintrin.h:1752
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_slli_epi16(__m128i __a, int __count)
Left-shifts each 16-bit value in the 128-bit integer vector operand by the specified number of bits.
Definition: emmintrin.h:2776
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sub_epi8(__m128i __a, __m128i __b)
Subtracts the corresponding 8-bit integer values in the operands.
Definition: emmintrin.h:2508
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_undefined_pd(void)
Constructs a 128-bit floating-point vector of [2 x double] with unspecified content.
Definition: emmintrin.h:1772
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_unpacklo_epi32(__m128i __a, __m128i __b)
Unpacks the low-order (index 0,1) values from two 128-bit vectors of [4 x i32] and interleaves them i...
Definition: emmintrin.h:4582
static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtpd_ps(__m128d __a)
Converts the two double-precision floating-point elements of a 128-bit vector of [2 x double] into tw...
Definition: emmintrin.h:1289
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_move_epi64(__m128i __a)
Moves the lower 64 bits of a 128-bit integer vector to a 128-bit integer vector, zeroing the upper bi...
Definition: emmintrin.h:4652
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_adds_epu16(__m128i __a, __m128i __b)
Adds, with saturation, the corresponding elements of two 128-bit unsigned [8 x i16] vectors,...
Definition: emmintrin.h:2238
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_castps_si128(__m128 __a)
Casts a 128-bit floating-point vector of [4 x float] into a 128-bit integer vector.
Definition: emmintrin.h:4804
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_cmplt_epi16(__m128i __a, __m128i __b)
Compares each of the corresponding signed 16-bit values of the 128-bit integer vectors to determine i...
Definition: emmintrin.h:3234
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_srli_epi16(__m128i __a, int __count)
Right-shifts each of 16-bit values in the 128-bit integer vector operand by the specified number of b...
Definition: emmintrin.h:2985
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_set1_epi64(__m64 __q)
Initializes both values in a 128-bit vector of [2 x i64] with the specified 64-bit value.
Definition: emmintrin.h:3699
static __inline__ int __DEFAULT_FN_ATTRS _mm_comige_sd(__m128d __a, __m128d __b)
Compares the lower double-precision floating-point values in each of the two 128-bit floating-point v...
Definition: emmintrin.h:1105
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpunord_pd(__m128d __a, __m128d __b)
Compares each of the corresponding double-precision values of the 128-bit vectors of [2 x double] to ...
Definition: emmintrin.h:577
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_srli_epi32(__m128i __a, int __count)
Right-shifts each of 32-bit values in the 128-bit integer vector operand by the specified number of b...
Definition: emmintrin.h:3021
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_and_pd(__m128d __a, __m128d __b)
Performs a bitwise AND of two 128-bit vectors of [2 x double].
Definition: emmintrin.h:374
static __inline__ int __DEFAULT_FN_ATTRS _mm_comieq_sd(__m128d __a, __m128d __b)
Compares the lower double-precision floating-point values in each of the two 128-bit floating-point v...
Definition: emmintrin.h:1009
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_cmplt_epi8(__m128i __a, __m128i __b)
Compares each of the corresponding signed 8-bit values of the 128-bit integer vectors to determine if...
Definition: emmintrin.h:3214
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_cmpeq_epi16(__m128i __a, __m128i __b)
Compares each of the corresponding 16-bit values of the 128-bit integer vectors for equality.
Definition: emmintrin.h:3113
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_move_sd(__m128d __a, __m128d __b)
Constructs a 128-bit floating-point vector of [2 x double].
Definition: emmintrin.h:1894
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epi16(__m128i __a, __m128i __b)
Compares corresponding elements of two 128-bit signed [8 x i16] vectors, saving the greater value fro...
Definition: emmintrin.h:2319
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sll_epi64(__m128i __a, __m128i __count)
Left-shifts each 64-bit value in the 128-bit integer vector operand by the specified number of bits.
Definition: emmintrin.h:2865
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_packs_epi16(__m128i __a, __m128i __b)
Converts, with saturation, 16-bit signed integers from both 128-bit integer vector operands into 8-bi...
Definition: emmintrin.h:4169
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sra_epi16(__m128i __a, __m128i __count)
Right-shifts each 16-bit value in the 128-bit integer vector operand by the specified number of bits.
Definition: emmintrin.h:2903
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_loadr_pd(double const *__dp)
Loads two double-precision values, in reverse order, from an aligned memory location into a 128-bit v...
Definition: emmintrin.h:1610
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_unpacklo_epi64(__m128i __a, __m128i __b)
Unpacks the low-order 64-bit elements from two 128-bit vectors of [2 x i64] and interleaves them into...
Definition: emmintrin.h:4603
static __inline__ int __DEFAULT_FN_ATTRS _mm_comigt_sd(__m128d __a, __m128d __b)
Compares the lower double-precision floating-point values in each of the two 128-bit floating-point v...
Definition: emmintrin.h:1081
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_setzero_pd(void)
Constructs a 128-bit floating-point vector of [2 x double] initialized to zero.
Definition: emmintrin.h:1874
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpngt_pd(__m128d __a, __m128d __b)
Compares each of the corresponding double-precision values of the 128-bit vectors of [2 x double] to ...
Definition: emmintrin.h:661
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_cmpgt_epi32(__m128i __a, __m128i __b)
Compares each of the corresponding signed 32-bit values of the 128-bit integer vectors to determine i...
Definition: emmintrin.h:3194
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_cmpgt_epi8(__m128i __a, __m128i __b)
Compares each of the corresponding signed 8-bit values of the 128-bit integer vectors to determine if...
Definition: emmintrin.h:3152
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_set_epi32(int __i3, int __i2, int __i1, int __i0)
Initializes the 32-bit values in a 128-bit vector of [4 x i32] with the specified 32-bit integer valu...
Definition: emmintrin.h:3568
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_mul_sd(__m128d __a, __m128d __b)
Multiplies lower double-precision values in both operands and returns the product in the lower 64 bit...
Definition: emmintrin.h:166
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_set_epi16(short __w7, short __w6, short __w5, short __w4, short __w3, short __w2, short __w1, short __w0)
Initializes the 16-bit values in a 128-bit vector of [8 x i16] with the specified 16-bit integer valu...
Definition: emmintrin.h:3610
static __inline__ void __DEFAULT_FN_ATTRS _mm_storeh_pd(double *__dp, __m128d __a)
Stores the upper 64 bits of a 128-bit vector of [2 x double] to a memory location.
Definition: emmintrin.h:2026
void _mm_lfence(void)
Forces strong memory ordering (serialization) between load instructions preceding this instruction an...
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_setr_epi16(short __w0, short __w1, short __w2, short __w3, short __w4, short __w5, short __w6, short __w7)
Constructs a 128-bit integer vector, initialized in reverse order with the specified 16-bit integral ...
Definition: emmintrin.h:3823
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sad_epu8(__m128i __a, __m128i __b)
Computes the absolute differences of corresponding 8-bit integer values in two 128-bit vectors.
Definition: emmintrin.h:2491
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_unpackhi_epi8(__m128i __a, __m128i __b)
Unpacks the high-order (index 8-15) values from two 128-bit vectors of [16 x i8] and interleaves them...
Definition: emmintrin.h:4424
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpngt_sd(__m128d __a, __m128d __b)
Compares the lower double-precision floating-point values in each of the two 128-bit floating-point v...
Definition: emmintrin.h:960
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpunord_sd(__m128d __a, __m128d __b)
Compares the lower double-precision floating-point values in each of the two 128-bit floating-point v...
Definition: emmintrin.h:860
#define __DEFAULT_FN_ATTRS_CONSTEXPR
Definition: emmintrin.h:60
static __inline__ void __DEFAULT_FN_ATTRS _mm_storel_pd(double *__dp, __m128d __a)
Stores the lower 64 bits of a 128-bit vector of [2 x double] to a memory location.
Definition: emmintrin.h:2045
static __inline__ void __DEFAULT_FN_ATTRS _mm_store_pd(double *__dp, __m128d __a)
Moves packed double-precision values from a 128-bit vector of [2 x double] to a memory location.
Definition: emmintrin.h:1931
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_loadu_si128(__m128i_u const *__p)
Moves packed integer values from an unaligned 128-bit memory location to elements in a 128-bit intege...
Definition: emmintrin.h:3463
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_adds_epi8(__m128i __a, __m128i __b)
Adds, with saturation, the corresponding elements of two 128-bit signed [16 x i8] vectors,...
Definition: emmintrin.h:2172
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_packs_epi32(__m128i __a, __m128i __b)
Converts, with saturation, 32-bit signed integers from both 128-bit integer vector operands into 16-b...
Definition: emmintrin.h:4192
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sll_epi16(__m128i __a, __m128i __count)
Left-shifts each 16-bit value in the 128-bit integer vector operand by the specified number of bits.
Definition: emmintrin.h:2793
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_add_epi8(__m128i __a, __m128i __b)
Adds the corresponding elements of two 128-bit vectors of [16 x i8], saving the lower 8 bits of each ...
Definition: emmintrin.h:2069
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpnle_sd(__m128d __a, __m128d __b)
Compares the lower double-precision floating-point values in each of the two 128-bit floating-point v...
Definition: emmintrin.h:935
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpgt_pd(__m128d __a, __m128d __b)
Compares each of the corresponding double-precision values of the 128-bit vectors of [2 x double] to ...
Definition: emmintrin.h:511
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_mulhi_epi16(__m128i __a, __m128i __b)
Multiplies the corresponding elements of two signed [8 x i16] vectors, saving the upper 16 bits of ea...
Definition: emmintrin.h:2396
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_load_si128(__m128i const *__p)
Moves packed integer values from an aligned 128-bit memory location to elements in a 128-bit integer ...
Definition: emmintrin.h:3448
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpeq_sd(__m128d __a, __m128d __b)
Compares the lower double-precision floating-point values in each of the two 128-bit floating-point v...
Definition: emmintrin.h:705
static __inline__ void __DEFAULT_FN_ATTRS _mm_stream_pd(void *__p, __m128d __a)
Stores a 128-bit floating point vector of [2 x double] to a 128-bit aligned memory location.
Definition: emmintrin.h:4046
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_mul_epu32(__m128i __a, __m128i __b)
Multiplies 32-bit unsigned integer values contained in the lower bits of the corresponding elements o...
Definition: emmintrin.h:2471
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_add_epi32(__m128i __a, __m128i __b)
Adds the corresponding elements of two 128-bit vectors of [4 x i32], saving the lower 32 bits of each...
Definition: emmintrin.h:2112
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpnlt_sd(__m128d __a, __m128d __b)
Compares the lower double-precision floating-point values in each of the two 128-bit floating-point v...
Definition: emmintrin.h:910
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srl_epi64(__m128i __a, __m128i __count)
Right-shifts each of 64-bit values in the 128-bit integer vector operand by the specified number of b...
Definition: emmintrin.h:3074
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_cvtps_pd(__m128 __a)
Converts the lower two single-precision floating-point elements of a 128-bit vector of [4 x float] in...
Definition: emmintrin.h:1308
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpneq_sd(__m128d __a, __m128d __b)
Compares the lower double-precision floating-point values in each of the two 128-bit floating-point v...
Definition: emmintrin.h:885
static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_mul_su32(__m64 __a, __m64 __b)
Multiplies 32-bit unsigned integer values contained in the lower bits of the two 64-bit integer vecto...
Definition: emmintrin.h:2451
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvttps_epi32(__m128 __a)
Converts a vector of [4 x float] into four signed truncated (rounded toward zero) 32-bit integers,...
Definition: emmintrin.h:3369
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_unpackhi_epi32(__m128i __a, __m128i __b)
Unpacks the high-order (index 2,3) values from two 128-bit vectors of [4 x i32] and interleaves them ...
Definition: emmintrin.h:4475
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_loadh_pd(__m128d __a, double const *__dp)
Loads a double-precision value into the high-order bits of a 128-bit vector of [2 x double].
Definition: emmintrin.h:1726
#define __trunc64(x)
Definition: emmintrin.h:63
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_sqrt_sd(__m128d __a, __m128d __b)
Calculates the square root of the lower double-precision value of the second operand and returns it i...
Definition: emmintrin.h:249
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_cvtsi32_sd(__m128d __a, int __b)
Converts a 32-bit signed integer value, in the second parameter, into a double-precision floating-poi...
Definition: emmintrin.h:1417
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_min_sd(__m128d __a, __m128d __b)
Compares lower 64-bit double-precision values of both operands, and returns the lesser of the pair of...
Definition: emmintrin.h:290
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_add_pd(__m128d __a, __m128d __b)
Adds two 128-bit vectors of [2 x double].
Definition: emmintrin.h:105
static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR _mm_cvtsi128_si32(__m128i __a)
Moves the least significant 32 bits of a vector of [4 x i32] to a 32-bit signed integer value.
Definition: emmintrin.h:3416
static __inline__ void __DEFAULT_FN_ATTRS _mm_storeu_si64(void *__p, __m128i __b)
Stores a 64-bit integer value from the low element of a 128-bit integer vector.
Definition: emmintrin.h:3936
static __inline__ void __DEFAULT_FN_ATTRS _mm_store_sd(double *__dp, __m128d __a)
Stores the lower 64 bits of a 128-bit vector of [2 x double] to a memory location.
Definition: emmintrin.h:1910
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_movpi64_epi64(__m64 __a)
Moves the 64-bit operand to a 128-bit integer vector, zeroing the upper bits.
Definition: emmintrin.h:4635
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_load1_pd(double const *__dp)
Loads a double-precision floating-point value from a specified memory location and duplicates it to b...
Definition: emmintrin.h:1586
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_unpackhi_epi16(__m128i __a, __m128i __b)
Unpacks the high-order (index 4-7) values from two 128-bit vectors of [8 x i16] and interleaves them ...
Definition: emmintrin.h:4452
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_unpackhi_pd(__m128d __a, __m128d __b)
Unpacks the high-order 64-bit elements from two 128-bit vectors of [2 x double] and interleaves them ...
Definition: emmintrin.h:4672
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_and_si128(__m128i __a, __m128i __b)
Performs a bitwise AND of two 128-bit integer vectors.
Definition: emmintrin.h:2681
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_max_pd(__m128d __a, __m128d __b)
Performs element-by-element comparison of the two 128-bit vectors of [2 x double] and returns a vecto...
Definition: emmintrin.h:357
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epi16(__m128i __a, __m128i __b)
Compares corresponding elements of two 128-bit signed [8 x i16] vectors, saving the smaller value fro...
Definition: emmintrin.h:2357
static __inline__ void __DEFAULT_FN_ATTRS _mm_store_si128(__m128i *__p, __m128i __b)
Stores a 128-bit integer vector to a memory location aligned on a 128-bit boundary.
Definition: emmintrin.h:3901
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_setr_epi32(int __i0, int __i1, int __i2, int __i3)
Constructs a 128-bit integer vector, initialized in reverse order with the specified 32-bit integral ...
Definition: emmintrin.h:3793
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_unpacklo_pd(__m128d __a, __m128d __b)
Unpacks the low-order 64-bit elements from two 128-bit vectors of [2 x double] and interleaves them i...
Definition: emmintrin.h:4692
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_unpackhi_epi64(__m128i __a, __m128i __b)
Unpacks the high-order 64-bit elements from two 128-bit vectors of [2 x i64] and interleaves them int...
Definition: emmintrin.h:4496
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_slli_epi32(__m128i __a, int __count)
Left-shifts each 32-bit value in the 128-bit integer vector operand by the specified number of bits.
Definition: emmintrin.h:2812
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpeq_pd(__m128d __a, __m128d __b)
Compares each of the corresponding double-precision values of the 128-bit vectors of [2 x double] for...
Definition: emmintrin.h:448
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_mulhi_epu16(__m128i __a, __m128i __b)
Multiplies the corresponding elements of two unsigned [8 x i16] vectors, saving the upper 16 bits of ...
Definition: emmintrin.h:2415
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_max_sd(__m128d __a, __m128d __b)
Compares lower 64-bit double-precision values of both operands, and returns the greater of the pair o...
Definition: emmintrin.h:336
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_loadl_epi64(__m128i_u const *__p)
Returns a vector of [2 x i64] where the lower element is taken from the lower element of the operand,...
Definition: emmintrin.h:3483
void _mm_pause(void)
Indicates that a spin loop is being executed for the purposes of optimizing power consumption during ...
static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_castsi128_ps(__m128i __a)
Casts a 128-bit integer vector into a 128-bit floating-point vector of [4 x float].
Definition: emmintrin.h:4820
static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_sub_si64(__m64 __a, __m64 __b)
Subtracts signed or unsigned 64-bit integer values and writes the difference to the corresponding bit...
Definition: emmintrin.h:2560
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_avg_epu8(__m128i __a, __m128i __b)
Computes the rounded averages of corresponding elements of two 128-bit unsigned [16 x i8] vectors,...
Definition: emmintrin.h:2256
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_subs_epi16(__m128i __a, __m128i __b)
Subtracts, with saturation, corresponding 16-bit signed integer values in the input and returns the d...
Definition: emmintrin.h:2622
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_castsi128_pd(__m128i __a)
Casts a 128-bit integer vector into a 128-bit floating-point vector of [2 x double].
Definition: emmintrin.h:4836
#define __zext128(x)
Definition: emmintrin.h:65
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_add_epi64(__m128i __a, __m128i __b)
Adds the corresponding elements of two 128-bit vectors of [2 x i64], saving the lower 64 bits of each...
Definition: emmintrin.h:2150
static __inline__ void __DEFAULT_FN_ATTRS _mm_storer_pd(double *__dp, __m128d __a)
Stores two double-precision values, in reverse order, from a 128-bit vector of [2 x double] to a 16-b...
Definition: emmintrin.h:2009
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_andnot_pd(__m128d __a, __m128d __b)
Performs a bitwise AND of two 128-bit vectors of [2 x double], using the one's complement of the valu...
Definition: emmintrin.h:395
static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_cvttpd_pi32(__m128d __a)
Converts the two double-precision floating-point elements of a 128-bit vector of [2 x double] into tw...
Definition: emmintrin.h:1523
static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_cvtepi32_ps(__m128i __a)
Converts a vector of [4 x i32] into a vector of [4 x float].
Definition: emmintrin.h:3332
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_cvtpi32_pd(__m64 __a)
Converts the two signed 32-bit integer elements of a 64-bit vector of [2 x i32] into two double-preci...
Definition: emmintrin.h:1539
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_cmpgt_epi16(__m128i __a, __m128i __b)
Compares each of the corresponding signed 16-bit values of the 128-bit integer vectors to determine i...
Definition: emmintrin.h:3174
static __inline__ void __DEFAULT_FN_ATTRS _mm_storeu_pd(double *__dp, __m128d __a)
Stores a 128-bit vector of [2 x double] into an unaligned memory location.
Definition: emmintrin.h:1987
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_set1_epi32(int __i)
Initializes all values in a 128-bit vector of [4 x i32] with the specified 32-bit value.
Definition: emmintrin.h:3716
static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomineq_sd(__m128d __a, __m128d __b)
Compares the lower double-precision floating-point values in each of the two 128-bit floating-point v...
Definition: emmintrin.h:1271
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _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)
Initializes the 8-bit values in a 128-bit vector of [16 x i8] with the specified 8-bit integer values...
Definition: emmintrin.h:3659
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_add_epi16(__m128i __a, __m128i __b)
Adds the corresponding elements of two 128-bit vectors of [8 x i16], saving the lower 16 bits of each...
Definition: emmintrin.h:2090
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_set1_pd(double __w)
Constructs a 128-bit floating-point vector of [2 x double], with each of the two double-precision flo...
Definition: emmintrin.h:1806
static __inline__ int __DEFAULT_FN_ATTRS _mm_comineq_sd(__m128d __a, __m128d __b)
Compares the lower double-precision floating-point values in each of the two 128-bit floating-point v...
Definition: emmintrin.h:1129
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpord_pd(__m128d __a, __m128d __b)
Compares each of the corresponding double-precision values of the 128-bit vectors of [2 x double] to ...
Definition: emmintrin.h:554
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmplt_pd(__m128d __a, __m128d __b)
Compares each of the corresponding double-precision values of the 128-bit vectors of [2 x double] to ...
Definition: emmintrin.h:469
static __inline__ void __DEFAULT_FN_ATTRS _mm_storeu_si128(__m128i_u *__p, __m128i __b)
Stores a 128-bit integer vector to an unaligned memory location.
Definition: emmintrin.h:3916
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_adds_epi16(__m128i __a, __m128i __b)
Adds, with saturation, the corresponding elements of two 128-bit signed [8 x i16] vectors,...
Definition: emmintrin.h:2194
double __m128d __attribute__((__vector_size__(16), __aligned__(16)))
Definition: emmintrin.h:19
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sra_epi32(__m128i __a, __m128i __count)
Right-shifts each 32-bit value in the 128-bit integer vector operand by the specified number of bits.
Definition: emmintrin.h:2941
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_sub_pd(__m128d __a, __m128d __b)
Subtracts two 128-bit vectors of [2 x double].
Definition: emmintrin.h:145
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvttpd_epi32(__m128d __a)
Converts the two double-precision floating-point elements of a 128-bit vector of [2 x double] into tw...
Definition: emmintrin.h:1465
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_subs_epu8(__m128i __a, __m128i __b)
Subtracts, with saturation, corresponding 8-bit unsigned integer values in the input and returns the ...
Definition: emmintrin.h:2643
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_srai_epi32(__m128i __a, int __count)
Right-shifts each 32-bit value in the 128-bit integer vector operand by the specified number of bits.
Definition: emmintrin.h:2923
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtps_epi32(__m128 __a)
Converts a vector of [4 x float] into a vector of [4 x i32].
Definition: emmintrin.h:3350
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_set1_epi8(char __b)
Initializes all values in a 128-bit vector of [16 x i8] with the specified 8-bit value.
Definition: emmintrin.h:3751
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_xor_si128(__m128i __a, __m128i __b)
Performs a bitwise exclusive OR of two 128-bit integer vectors.
Definition: emmintrin.h:2733
void _mm_clflush(void const *__p)
The cache line containing __p is flushed and invalidated from all caches in the coherency domain.
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpnle_pd(__m128d __a, __m128d __b)
Compares each of the corresponding double-precision values of the 128-bit vectors of [2 x double] to ...
Definition: emmintrin.h:640
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_setzero_si64(void)
Constructs a 64-bit integer vector initialized to zero.
Definition: mmintrin.h:1313