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