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