clang 22.0.0git
mmintrin.h
Go to the documentation of this file.
1/*===---- mmintrin.h - MMX 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 __MMINTRIN_H
11#define __MMINTRIN_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
17typedef long long __m64 __attribute__((__vector_size__(8), __aligned__(8)));
18
19typedef long long __v1di __attribute__((__vector_size__(8)));
20typedef int __v2si __attribute__((__vector_size__(8)));
21typedef short __v4hi __attribute__((__vector_size__(8)));
22typedef char __v8qi __attribute__((__vector_size__(8)));
23
24/* Unsigned types */
25typedef unsigned long long __v1du __attribute__ ((__vector_size__ (8)));
26typedef unsigned int __v2su __attribute__ ((__vector_size__ (8)));
27typedef unsigned short __v4hu __attribute__((__vector_size__(8)));
28typedef unsigned char __v8qu __attribute__((__vector_size__(8)));
29
30/* We need an explicitly signed variant for char. Note that this shouldn't
31 * appear in the interface though. */
32typedef signed char __v8qs __attribute__((__vector_size__(8)));
33
34/* SSE/SSE2 types */
35typedef long long __m128i __attribute__((__vector_size__(16), __aligned__(16)));
36typedef long long __v2di __attribute__ ((__vector_size__ (16)));
37typedef int __v4si __attribute__((__vector_size__(16)));
38typedef short __v8hi __attribute__((__vector_size__(16)));
39typedef char __v16qi __attribute__((__vector_size__(16)));
40
41/* Define the default attributes for the functions in this file. */
42#define __DEFAULT_FN_ATTRS_SSE2 \
43 __attribute__((__always_inline__, __nodebug__, __target__("sse2"), \
44 __min_vector_width__(128)))
45
46#if defined(__cplusplus) && (__cplusplus >= 201103L)
47#define __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR __DEFAULT_FN_ATTRS_SSE2 constexpr
48#else
49#define __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR __DEFAULT_FN_ATTRS_SSE2
50#endif
51
52#define __trunc64(x) \
53 (__m64) __builtin_shufflevector((__v2di)(x), __extension__(__v2di){}, 0)
54#define __zext128(x) \
55 (__m128i) __builtin_shufflevector((__v2si)(x), __extension__(__v2si){}, 0, \
56 1, 2, 3)
57#define __anyext128(x) \
58 (__m128i) __builtin_shufflevector((__v2si)(x), __extension__(__v2si){}, 0, \
59 1, -1, -1)
60
61/// Clears the MMX state by setting the state of the x87 stack registers
62/// to empty.
63///
64/// \headerfile <x86intrin.h>
65///
66/// This intrinsic corresponds to the <c> EMMS </c> instruction.
67///
68static __inline__ void
69 __attribute__((__always_inline__, __nodebug__, __target__("mmx")))
70 _mm_empty(void) {
71 __builtin_ia32_emms();
72}
73
74/// Constructs a 64-bit integer vector, setting the lower 32 bits to the
75/// value of the 32-bit integer parameter and setting the upper 32 bits to 0.
76///
77/// \headerfile <x86intrin.h>
78///
79/// This intrinsic corresponds to the <c> MOVD </c> instruction.
80///
81/// \param __i
82/// A 32-bit integer value.
83/// \returns A 64-bit integer vector. The lower 32 bits contain the value of the
84/// parameter. The upper 32 bits are set to 0.
85static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
87{
88 return __extension__ (__m64)(__v2si){__i, 0};
89}
90
91/// Returns the lower 32 bits of a 64-bit integer vector as a 32-bit
92/// signed integer.
93///
94/// \headerfile <x86intrin.h>
95///
96/// This intrinsic corresponds to the <c> MOVD </c> instruction.
97///
98/// \param __m
99/// A 64-bit integer vector.
100/// \returns A 32-bit signed integer value containing the lower 32 bits of the
101/// parameter.
102static __inline__ int __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
104{
105 return ((__v2si)__m)[0];
106}
107
108/// Casts a 64-bit signed integer value into a 64-bit integer vector.
109///
110/// \headerfile <x86intrin.h>
111///
112/// This intrinsic corresponds to the <c> MOVQ </c> instruction.
113///
114/// \param __i
115/// A 64-bit signed integer.
116/// \returns A 64-bit integer vector containing the same bitwise pattern as the
117/// parameter.
118static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
119_mm_cvtsi64_m64(long long __i)
120{
121 return __extension__ (__m64)(__v1di){__i};
122}
123
124/// Casts a 64-bit integer vector into a 64-bit signed integer value.
125///
126/// \headerfile <x86intrin.h>
127///
128/// This intrinsic corresponds to the <c> MOVQ </c> instruction.
129///
130/// \param __m
131/// A 64-bit integer vector.
132/// \returns A 64-bit signed integer containing the same bitwise pattern as the
133/// parameter.
134static __inline__ long long __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
136{
137 return ((__v1di)__m)[0];
138}
139
140/// Converts, with saturation, 16-bit signed integers from both 64-bit integer
141/// vector parameters of [4 x i16] into 8-bit signed integer values, and
142/// constructs a 64-bit integer vector of [8 x i8] as the result.
143///
144/// Positive values greater than 0x7F are saturated to 0x7F. Negative values
145/// less than 0x80 are saturated to 0x80.
146///
147/// \headerfile <x86intrin.h>
148///
149/// This intrinsic corresponds to the <c> PACKSSWB </c> instruction.
150///
151/// \param __m1
152/// A 64-bit integer vector of [4 x i16]. The converted [4 x i8] values are
153/// written to the lower 32 bits of the result.
154/// \param __m2
155/// A 64-bit integer vector of [4 x i16]. The converted [4 x i8] values are
156/// written to the upper 32 bits of the result.
157/// \returns A 64-bit integer vector of [8 x i8] containing the converted
158/// values.
159static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
160_mm_packs_pi16(__m64 __m1, __m64 __m2)
161{
162 return __trunc64(__builtin_ia32_packsswb128(
163 (__v8hi)__builtin_shufflevector(__m1, __m2, 0, 1), (__v8hi){}));
164}
165
166/// Converts, with saturation, 32-bit signed integers from both 64-bit integer
167/// vector parameters of [2 x i32] into 16-bit signed integer values, and
168/// constructs a 64-bit integer vector of [4 x i16] as the result.
169///
170/// Positive values greater than 0x7FFF are saturated to 0x7FFF. Negative
171/// values less than 0x8000 are saturated to 0x8000.
172///
173/// \headerfile <x86intrin.h>
174///
175/// This intrinsic corresponds to the <c> PACKSSDW </c> instruction.
176///
177/// \param __m1
178/// A 64-bit integer vector of [2 x i32]. The converted [2 x i16] values are
179/// written to the lower 32 bits of the result.
180/// \param __m2
181/// A 64-bit integer vector of [2 x i32]. The converted [2 x i16] values are
182/// written to the upper 32 bits of the result.
183/// \returns A 64-bit integer vector of [4 x i16] containing the converted
184/// values.
185static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
186_mm_packs_pi32(__m64 __m1, __m64 __m2)
187{
188 return __trunc64(__builtin_ia32_packssdw128(
189 (__v4si)__builtin_shufflevector(__m1, __m2, 0, 1), (__v4si){}));
190}
191
192/// Converts, with saturation, 16-bit signed integers from both 64-bit integer
193/// vector parameters of [4 x i16] into 8-bit unsigned integer values, and
194/// constructs a 64-bit integer vector of [8 x i8] as the result.
195///
196/// Values greater than 0xFF are saturated to 0xFF. Values less than 0 are
197/// saturated to 0.
198///
199/// \headerfile <x86intrin.h>
200///
201/// This intrinsic corresponds to the <c> PACKUSWB </c> instruction.
202///
203/// \param __m1
204/// A 64-bit integer vector of [4 x i16]. The converted [4 x i8] values are
205/// written to the lower 32 bits of the result.
206/// \param __m2
207/// A 64-bit integer vector of [4 x i16]. The converted [4 x i8] values are
208/// written to the upper 32 bits of the result.
209/// \returns A 64-bit integer vector of [8 x i8] containing the converted
210/// values.
211static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
212_mm_packs_pu16(__m64 __m1, __m64 __m2)
213{
214 return __trunc64(__builtin_ia32_packuswb128(
215 (__v8hi)__builtin_shufflevector(__m1, __m2, 0, 1), (__v8hi){}));
216}
217
218/// Unpacks the upper 32 bits from two 64-bit integer vectors of [8 x i8]
219/// and interleaves them into a 64-bit integer vector of [8 x i8].
220///
221/// \headerfile <x86intrin.h>
222///
223/// This intrinsic corresponds to the <c> PUNPCKHBW </c> instruction.
224///
225/// \param __m1
226/// A 64-bit integer vector of [8 x i8]. \n
227/// Bits [39:32] are written to bits [7:0] of the result. \n
228/// Bits [47:40] are written to bits [23:16] of the result. \n
229/// Bits [55:48] are written to bits [39:32] of the result. \n
230/// Bits [63:56] are written to bits [55:48] of the result.
231/// \param __m2
232/// A 64-bit integer vector of [8 x i8].
233/// Bits [39:32] are written to bits [15:8] of the result. \n
234/// Bits [47:40] are written to bits [31:24] of the result. \n
235/// Bits [55:48] are written to bits [47:40] of the result. \n
236/// Bits [63:56] are written to bits [63:56] of the result.
237/// \returns A 64-bit integer vector of [8 x i8] containing the interleaved
238/// values.
239static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
240_mm_unpackhi_pi8(__m64 __m1, __m64 __m2) {
241 return (__m64)__builtin_shufflevector((__v8qi)__m1, (__v8qi)__m2, 4, 12, 5,
242 13, 6, 14, 7, 15);
243}
244
245/// Unpacks the upper 32 bits from two 64-bit integer vectors of
246/// [4 x i16] and interleaves them into a 64-bit integer vector of [4 x i16].
247///
248/// \headerfile <x86intrin.h>
249///
250/// This intrinsic corresponds to the <c> PUNPCKHWD </c> instruction.
251///
252/// \param __m1
253/// A 64-bit integer vector of [4 x i16].
254/// Bits [47:32] are written to bits [15:0] of the result. \n
255/// Bits [63:48] are written to bits [47:32] of the result.
256/// \param __m2
257/// A 64-bit integer vector of [4 x i16].
258/// Bits [47:32] are written to bits [31:16] of the result. \n
259/// Bits [63:48] are written to bits [63:48] of the result.
260/// \returns A 64-bit integer vector of [4 x i16] containing the interleaved
261/// values.
262static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
263_mm_unpackhi_pi16(__m64 __m1, __m64 __m2) {
264 return (__m64)__builtin_shufflevector((__v4hi)__m1, (__v4hi)__m2, 2, 6, 3, 7);
265}
266
267/// Unpacks the upper 32 bits from two 64-bit integer vectors of
268/// [2 x i32] and interleaves them into a 64-bit integer vector of [2 x i32].
269///
270/// \headerfile <x86intrin.h>
271///
272/// This intrinsic corresponds to the <c> PUNPCKHDQ </c> instruction.
273///
274/// \param __m1
275/// A 64-bit integer vector of [2 x i32]. The upper 32 bits are written to
276/// the lower 32 bits of the result.
277/// \param __m2
278/// A 64-bit integer vector of [2 x i32]. The upper 32 bits are written to
279/// the upper 32 bits of the result.
280/// \returns A 64-bit integer vector of [2 x i32] containing the interleaved
281/// values.
282static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
283_mm_unpackhi_pi32(__m64 __m1, __m64 __m2) {
284 return (__m64)__builtin_shufflevector((__v2si)__m1, (__v2si)__m2, 1, 3);
285}
286
287/// Unpacks the lower 32 bits from two 64-bit integer vectors of [8 x i8]
288/// and interleaves them into a 64-bit integer vector of [8 x i8].
289///
290/// \headerfile <x86intrin.h>
291///
292/// This intrinsic corresponds to the <c> PUNPCKLBW </c> instruction.
293///
294/// \param __m1
295/// A 64-bit integer vector of [8 x i8].
296/// Bits [7:0] are written to bits [7:0] of the result. \n
297/// Bits [15:8] are written to bits [23:16] of the result. \n
298/// Bits [23:16] are written to bits [39:32] of the result. \n
299/// Bits [31:24] are written to bits [55:48] of the result.
300/// \param __m2
301/// A 64-bit integer vector of [8 x i8].
302/// Bits [7:0] are written to bits [15:8] of the result. \n
303/// Bits [15:8] are written to bits [31:24] of the result. \n
304/// Bits [23:16] are written to bits [47:40] of the result. \n
305/// Bits [31:24] are written to bits [63:56] of the result.
306/// \returns A 64-bit integer vector of [8 x i8] containing the interleaved
307/// values.
308static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
309_mm_unpacklo_pi8(__m64 __m1, __m64 __m2) {
310 return (__m64)__builtin_shufflevector((__v8qi)__m1, (__v8qi)__m2, 0, 8, 1, 9,
311 2, 10, 3, 11);
312}
313
314/// Unpacks the lower 32 bits from two 64-bit integer vectors of
315/// [4 x i16] and interleaves them into a 64-bit integer vector of [4 x i16].
316///
317/// \headerfile <x86intrin.h>
318///
319/// This intrinsic corresponds to the <c> PUNPCKLWD </c> instruction.
320///
321/// \param __m1
322/// A 64-bit integer vector of [4 x i16].
323/// Bits [15:0] are written to bits [15:0] of the result. \n
324/// Bits [31:16] are written to bits [47:32] of the result.
325/// \param __m2
326/// A 64-bit integer vector of [4 x i16].
327/// Bits [15:0] are written to bits [31:16] of the result. \n
328/// Bits [31:16] are written to bits [63:48] of the result.
329/// \returns A 64-bit integer vector of [4 x i16] containing the interleaved
330/// values.
331static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
332_mm_unpacklo_pi16(__m64 __m1, __m64 __m2) {
333 return (__m64)__builtin_shufflevector((__v4hi)__m1, (__v4hi)__m2, 0, 4, 1, 5);
334}
335
336/// Unpacks the lower 32 bits from two 64-bit integer vectors of
337/// [2 x i32] and interleaves them into a 64-bit integer vector of [2 x i32].
338///
339/// \headerfile <x86intrin.h>
340///
341/// This intrinsic corresponds to the <c> PUNPCKLDQ </c> instruction.
342///
343/// \param __m1
344/// A 64-bit integer vector of [2 x i32]. The lower 32 bits are written to
345/// the lower 32 bits of the result.
346/// \param __m2
347/// A 64-bit integer vector of [2 x i32]. The lower 32 bits are written to
348/// the upper 32 bits of the result.
349/// \returns A 64-bit integer vector of [2 x i32] containing the interleaved
350/// values.
351static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
352_mm_unpacklo_pi32(__m64 __m1, __m64 __m2) {
353 return (__m64)__builtin_shufflevector((__v2si)__m1, (__v2si)__m2, 0, 2);
354}
355
356/// Adds each 8-bit integer element of the first 64-bit integer vector
357/// of [8 x i8] to the corresponding 8-bit integer element of the second
358/// 64-bit integer vector of [8 x i8]. The lower 8 bits of the results are
359/// packed into a 64-bit integer vector of [8 x i8].
360///
361/// \headerfile <x86intrin.h>
362///
363/// This intrinsic corresponds to the <c> PADDB </c> instruction.
364///
365/// \param __m1
366/// A 64-bit integer vector of [8 x i8].
367/// \param __m2
368/// A 64-bit integer vector of [8 x i8].
369/// \returns A 64-bit integer vector of [8 x i8] containing the sums of both
370/// parameters.
371static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
372_mm_add_pi8(__m64 __m1, __m64 __m2)
373{
374 return (__m64)(((__v8qu)__m1) + ((__v8qu)__m2));
375}
376
377/// Adds each 16-bit integer element of the first 64-bit integer vector
378/// of [4 x i16] to the corresponding 16-bit integer element of the second
379/// 64-bit integer vector of [4 x i16]. The lower 16 bits of the results are
380/// packed into a 64-bit integer vector of [4 x i16].
381///
382/// \headerfile <x86intrin.h>
383///
384/// This intrinsic corresponds to the <c> PADDW </c> instruction.
385///
386/// \param __m1
387/// A 64-bit integer vector of [4 x i16].
388/// \param __m2
389/// A 64-bit integer vector of [4 x i16].
390/// \returns A 64-bit integer vector of [4 x i16] containing the sums of both
391/// parameters.
392static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
393_mm_add_pi16(__m64 __m1, __m64 __m2)
394{
395 return (__m64)(((__v4hu)__m1) + ((__v4hu)__m2));
396}
397
398/// Adds each 32-bit integer element of the first 64-bit integer vector
399/// of [2 x i32] to the corresponding 32-bit integer element of the second
400/// 64-bit integer vector of [2 x i32]. The lower 32 bits of the results are
401/// packed into a 64-bit integer vector of [2 x i32].
402///
403/// \headerfile <x86intrin.h>
404///
405/// This intrinsic corresponds to the <c> PADDD </c> instruction.
406///
407/// \param __m1
408/// A 64-bit integer vector of [2 x i32].
409/// \param __m2
410/// A 64-bit integer vector of [2 x i32].
411/// \returns A 64-bit integer vector of [2 x i32] containing the sums of both
412/// parameters.
413static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
414_mm_add_pi32(__m64 __m1, __m64 __m2)
415{
416 return (__m64)(((__v2su)__m1) + ((__v2su)__m2));
417}
418
419/// Adds, with saturation, each 8-bit signed integer element of the first
420/// 64-bit integer vector of [8 x i8] to the corresponding 8-bit signed
421/// integer element of the second 64-bit integer vector of [8 x i8].
422///
423/// Positive sums greater than 0x7F are saturated to 0x7F. Negative sums
424/// less than 0x80 are saturated to 0x80. The results are packed into a
425/// 64-bit integer vector of [8 x i8].
426///
427/// \headerfile <x86intrin.h>
428///
429/// This intrinsic corresponds to the <c> PADDSB </c> instruction.
430///
431/// \param __m1
432/// A 64-bit integer vector of [8 x i8].
433/// \param __m2
434/// A 64-bit integer vector of [8 x i8].
435/// \returns A 64-bit integer vector of [8 x i8] containing the saturated sums
436/// of both parameters.
437static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
438_mm_adds_pi8(__m64 __m1, __m64 __m2) {
439 return (__m64)__builtin_elementwise_add_sat((__v8qs)__m1, (__v8qs)__m2);
440}
441
442/// Adds, with saturation, each 16-bit signed integer element of the first
443/// 64-bit integer vector of [4 x i16] to the corresponding 16-bit signed
444/// integer element of the second 64-bit integer vector of [4 x i16].
445///
446/// Positive sums greater than 0x7FFF are saturated to 0x7FFF. Negative sums
447/// less than 0x8000 are saturated to 0x8000. The results are packed into a
448/// 64-bit integer vector of [4 x i16].
449///
450/// \headerfile <x86intrin.h>
451///
452/// This intrinsic corresponds to the <c> PADDSW </c> instruction.
453///
454/// \param __m1
455/// A 64-bit integer vector of [4 x i16].
456/// \param __m2
457/// A 64-bit integer vector of [4 x i16].
458/// \returns A 64-bit integer vector of [4 x i16] containing the saturated sums
459/// of both parameters.
460static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
461_mm_adds_pi16(__m64 __m1, __m64 __m2) {
462 return (__m64)__builtin_elementwise_add_sat((__v4hi)__m1, (__v4hi)__m2);
463}
464
465/// Adds, with saturation, each 8-bit unsigned integer element of the first
466/// 64-bit integer vector of [8 x i8] to the corresponding 8-bit unsigned
467/// integer element of the second 64-bit integer vector of [8 x i8].
468///
469/// Sums greater than 0xFF are saturated to 0xFF. The results are packed
470/// into a 64-bit integer vector of [8 x i8].
471///
472/// \headerfile <x86intrin.h>
473///
474/// This intrinsic corresponds to the <c> PADDUSB </c> instruction.
475///
476/// \param __m1
477/// A 64-bit integer vector of [8 x i8].
478/// \param __m2
479/// A 64-bit integer vector of [8 x i8].
480/// \returns A 64-bit integer vector of [8 x i8] containing the saturated
481/// unsigned sums of both parameters.
482static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
483_mm_adds_pu8(__m64 __m1, __m64 __m2) {
484 return (__m64)__builtin_elementwise_add_sat((__v8qu)__m1, (__v8qu)__m2);
485}
486
487/// Adds, with saturation, each 16-bit unsigned integer element of the first
488/// 64-bit integer vector of [4 x i16] to the corresponding 16-bit unsigned
489/// integer element of the second 64-bit integer vector of [4 x i16].
490///
491/// Sums greater than 0xFFFF are saturated to 0xFFFF. The results are packed
492/// into a 64-bit integer vector of [4 x i16].
493///
494/// \headerfile <x86intrin.h>
495///
496/// This intrinsic corresponds to the <c> PADDUSW </c> instruction.
497///
498/// \param __m1
499/// A 64-bit integer vector of [4 x i16].
500/// \param __m2
501/// A 64-bit integer vector of [4 x i16].
502/// \returns A 64-bit integer vector of [4 x i16] containing the saturated
503/// unsigned sums of both parameters.
504static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
505_mm_adds_pu16(__m64 __m1, __m64 __m2) {
506 return (__m64)__builtin_elementwise_add_sat((__v4hu)__m1, (__v4hu)__m2);
507}
508
509/// Subtracts each 8-bit integer element of the second 64-bit integer
510/// vector of [8 x i8] from the corresponding 8-bit integer element of the
511/// first 64-bit integer vector of [8 x i8]. The lower 8 bits of the results
512/// are packed into a 64-bit integer vector of [8 x i8].
513///
514/// \headerfile <x86intrin.h>
515///
516/// This intrinsic corresponds to the <c> PSUBB </c> instruction.
517///
518/// \param __m1
519/// A 64-bit integer vector of [8 x i8] containing the minuends.
520/// \param __m2
521/// A 64-bit integer vector of [8 x i8] containing the subtrahends.
522/// \returns A 64-bit integer vector of [8 x i8] containing the differences of
523/// both parameters.
524static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
525_mm_sub_pi8(__m64 __m1, __m64 __m2)
526{
527 return (__m64)(((__v8qu)__m1) - ((__v8qu)__m2));
528}
529
530/// Subtracts each 16-bit integer element of the second 64-bit integer
531/// vector of [4 x i16] from the corresponding 16-bit integer element of the
532/// first 64-bit integer vector of [4 x i16]. The lower 16 bits of the
533/// results are packed into a 64-bit integer vector of [4 x i16].
534///
535/// \headerfile <x86intrin.h>
536///
537/// This intrinsic corresponds to the <c> PSUBW </c> instruction.
538///
539/// \param __m1
540/// A 64-bit integer vector of [4 x i16] containing the minuends.
541/// \param __m2
542/// A 64-bit integer vector of [4 x i16] containing the subtrahends.
543/// \returns A 64-bit integer vector of [4 x i16] containing the differences of
544/// both parameters.
545static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
546_mm_sub_pi16(__m64 __m1, __m64 __m2)
547{
548 return (__m64)(((__v4hu)__m1) - ((__v4hu)__m2));
549}
550
551/// Subtracts each 32-bit integer element of the second 64-bit integer
552/// vector of [2 x i32] from the corresponding 32-bit integer element of the
553/// first 64-bit integer vector of [2 x i32]. The lower 32 bits of the
554/// results are packed into a 64-bit integer vector of [2 x i32].
555///
556/// \headerfile <x86intrin.h>
557///
558/// This intrinsic corresponds to the <c> PSUBD </c> instruction.
559///
560/// \param __m1
561/// A 64-bit integer vector of [2 x i32] containing the minuends.
562/// \param __m2
563/// A 64-bit integer vector of [2 x i32] containing the subtrahends.
564/// \returns A 64-bit integer vector of [2 x i32] containing the differences of
565/// both parameters.
566static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
567_mm_sub_pi32(__m64 __m1, __m64 __m2)
568{
569 return (__m64)(((__v2su)__m1) - ((__v2su)__m2));
570}
571
572/// Subtracts, with saturation, each 8-bit signed integer element of the second
573/// 64-bit integer vector of [8 x i8] from the corresponding 8-bit signed
574/// integer element of the first 64-bit integer vector of [8 x i8].
575///
576/// Positive results greater than 0x7F are saturated to 0x7F. Negative
577/// results less than 0x80 are saturated to 0x80. The results are packed
578/// into a 64-bit integer vector of [8 x i8].
579///
580/// \headerfile <x86intrin.h>
581///
582/// This intrinsic corresponds to the <c> PSUBSB </c> instruction.
583///
584/// \param __m1
585/// A 64-bit integer vector of [8 x i8] containing the minuends.
586/// \param __m2
587/// A 64-bit integer vector of [8 x i8] containing the subtrahends.
588/// \returns A 64-bit integer vector of [8 x i8] containing the saturated
589/// differences of both parameters.
590static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
591_mm_subs_pi8(__m64 __m1, __m64 __m2) {
592 return (__m64)__builtin_elementwise_sub_sat((__v8qs)__m1, (__v8qs)__m2);
593}
594
595/// Subtracts, with saturation, each 16-bit signed integer element of the
596/// second 64-bit integer vector of [4 x i16] from the corresponding 16-bit
597/// signed integer element of the first 64-bit integer vector of [4 x i16].
598///
599/// Positive results greater than 0x7FFF are saturated to 0x7FFF. Negative
600/// results less than 0x8000 are saturated to 0x8000. The results are packed
601/// into a 64-bit integer vector of [4 x i16].
602///
603/// \headerfile <x86intrin.h>
604///
605/// This intrinsic corresponds to the <c> PSUBSW </c> instruction.
606///
607/// \param __m1
608/// A 64-bit integer vector of [4 x i16] containing the minuends.
609/// \param __m2
610/// A 64-bit integer vector of [4 x i16] containing the subtrahends.
611/// \returns A 64-bit integer vector of [4 x i16] containing the saturated
612/// differences of both parameters.
613static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
614_mm_subs_pi16(__m64 __m1, __m64 __m2) {
615 return (__m64)__builtin_elementwise_sub_sat((__v4hi)__m1, (__v4hi)__m2);
616}
617
618/// Subtracts each 8-bit unsigned integer element of the second 64-bit
619/// integer vector of [8 x i8] from the corresponding 8-bit unsigned integer
620/// element of the first 64-bit integer vector of [8 x i8].
621///
622/// If an element of the first vector is less than the corresponding element
623/// of the second vector, the result is saturated to 0. The results are
624/// packed into a 64-bit integer vector of [8 x i8].
625///
626/// \headerfile <x86intrin.h>
627///
628/// This intrinsic corresponds to the <c> PSUBUSB </c> instruction.
629///
630/// \param __m1
631/// A 64-bit integer vector of [8 x i8] containing the minuends.
632/// \param __m2
633/// A 64-bit integer vector of [8 x i8] containing the subtrahends.
634/// \returns A 64-bit integer vector of [8 x i8] containing the saturated
635/// differences of both parameters.
636static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
637_mm_subs_pu8(__m64 __m1, __m64 __m2) {
638 return (__m64)__builtin_elementwise_sub_sat((__v8qu)__m1, (__v8qu)__m2);
639}
640
641/// Subtracts each 16-bit unsigned integer element of the second 64-bit
642/// integer vector of [4 x i16] from the corresponding 16-bit unsigned
643/// integer element of the first 64-bit integer vector of [4 x i16].
644///
645/// If an element of the first vector is less than the corresponding element
646/// of the second vector, the result is saturated to 0. The results are
647/// packed into a 64-bit integer vector of [4 x i16].
648///
649/// \headerfile <x86intrin.h>
650///
651/// This intrinsic corresponds to the <c> PSUBUSW </c> instruction.
652///
653/// \param __m1
654/// A 64-bit integer vector of [4 x i16] containing the minuends.
655/// \param __m2
656/// A 64-bit integer vector of [4 x i16] containing the subtrahends.
657/// \returns A 64-bit integer vector of [4 x i16] containing the saturated
658/// differences of both parameters.
659static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
660_mm_subs_pu16(__m64 __m1, __m64 __m2) {
661 return (__m64)__builtin_elementwise_sub_sat((__v4hu)__m1, (__v4hu)__m2);
662}
663
664/// Multiplies each 16-bit signed integer element of the first 64-bit
665/// integer vector of [4 x i16] by the corresponding 16-bit signed integer
666/// element of the second 64-bit integer vector of [4 x i16] and get four
667/// 32-bit products. Adds adjacent pairs of products to get two 32-bit sums.
668/// The lower 32 bits of these two sums are packed into a 64-bit integer
669/// vector of [2 x i32].
670///
671/// For example, bits [15:0] of both parameters are multiplied, bits [31:16]
672/// of both parameters are multiplied, and the sum of both results is written
673/// to bits [31:0] of the result.
674///
675/// \headerfile <x86intrin.h>
676///
677/// This intrinsic corresponds to the <c> PMADDWD </c> instruction.
678///
679/// \param __m1
680/// A 64-bit integer vector of [4 x i16].
681/// \param __m2
682/// A 64-bit integer vector of [4 x i16].
683/// \returns A 64-bit integer vector of [2 x i32] containing the sums of
684/// products of both parameters.
685static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
686_mm_madd_pi16(__m64 __m1, __m64 __m2)
687{
688 return __trunc64(__builtin_ia32_pmaddwd128((__v8hi)__anyext128(__m1),
689 (__v8hi)__anyext128(__m2)));
690}
691
692/// Multiplies each 16-bit signed integer element of the first 64-bit
693/// integer vector of [4 x i16] by the corresponding 16-bit signed integer
694/// element of the second 64-bit integer vector of [4 x i16]. Packs the upper
695/// 16 bits of the 32-bit products into a 64-bit integer vector of [4 x i16].
696///
697/// \headerfile <x86intrin.h>
698///
699/// This intrinsic corresponds to the <c> PMULHW </c> instruction.
700///
701/// \param __m1
702/// A 64-bit integer vector of [4 x i16].
703/// \param __m2
704/// A 64-bit integer vector of [4 x i16].
705/// \returns A 64-bit integer vector of [4 x i16] containing the upper 16 bits
706/// of the products of both parameters.
707static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
708_mm_mulhi_pi16(__m64 __m1, __m64 __m2)
709{
710 return __trunc64(__builtin_ia32_pmulhw128((__v8hi)__zext128(__m1),
711 (__v8hi)__zext128(__m2)));
712}
713
714/// Multiplies each 16-bit signed integer element of the first 64-bit
715/// integer vector of [4 x i16] by the corresponding 16-bit signed integer
716/// element of the second 64-bit integer vector of [4 x i16]. Packs the lower
717/// 16 bits of the 32-bit products into a 64-bit integer vector of [4 x i16].
718///
719/// \headerfile <x86intrin.h>
720///
721/// This intrinsic corresponds to the <c> PMULLW </c> instruction.
722///
723/// \param __m1
724/// A 64-bit integer vector of [4 x i16].
725/// \param __m2
726/// A 64-bit integer vector of [4 x i16].
727/// \returns A 64-bit integer vector of [4 x i16] containing the lower 16 bits
728/// of the products of both parameters.
729static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
730_mm_mullo_pi16(__m64 __m1, __m64 __m2)
731{
732 return (__m64)(((__v4hu)__m1) * ((__v4hu)__m2));
733}
734
735/// Left-shifts each 16-bit signed integer element of the first
736/// parameter, which is a 64-bit integer vector of [4 x i16], by the number
737/// of bits specified by the second parameter, which is a 64-bit integer. The
738/// lower 16 bits of the results are packed into a 64-bit integer vector of
739/// [4 x i16].
740///
741/// \headerfile <x86intrin.h>
742///
743/// This intrinsic corresponds to the <c> PSLLW </c> instruction.
744///
745/// \param __m
746/// A 64-bit integer vector of [4 x i16].
747/// \param __count
748/// A 64-bit integer vector interpreted as a single 64-bit integer.
749/// \returns A 64-bit integer vector of [4 x i16] containing the left-shifted
750/// values. If \a __count is greater or equal to 16, the result is set to all
751/// 0.
752static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
753_mm_sll_pi16(__m64 __m, __m64 __count)
754{
755 return __trunc64(__builtin_ia32_psllw128((__v8hi)__anyext128(__m),
756 (__v8hi)__anyext128(__count)));
757}
758
759/// Left-shifts each 16-bit signed integer element of a 64-bit integer
760/// vector of [4 x i16] by the number of bits specified by a 32-bit integer.
761/// The lower 16 bits of the results are packed into a 64-bit integer vector
762/// of [4 x i16].
763///
764/// \headerfile <x86intrin.h>
765///
766/// This intrinsic corresponds to the <c> PSLLW </c> instruction.
767///
768/// \param __m
769/// A 64-bit integer vector of [4 x i16].
770/// \param __count
771/// A 32-bit integer value.
772/// \returns A 64-bit integer vector of [4 x i16] containing the left-shifted
773/// values. If \a __count is greater or equal to 16, the result is set to all
774/// 0.
775static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
776_mm_slli_pi16(__m64 __m, int __count) {
777 return __trunc64(__builtin_ia32_psllwi128((__v8hi)__zext128(__m), __count));
778}
779
780/// Left-shifts each 32-bit signed integer element of the first
781/// parameter, which is a 64-bit integer vector of [2 x i32], by the number
782/// of bits specified by the second parameter, which is a 64-bit integer. The
783/// lower 32 bits of the results are packed into a 64-bit integer vector of
784/// [2 x i32].
785///
786/// \headerfile <x86intrin.h>
787///
788/// This intrinsic corresponds to the <c> PSLLD </c> instruction.
789///
790/// \param __m
791/// A 64-bit integer vector of [2 x i32].
792/// \param __count
793/// A 64-bit integer vector interpreted as a single 64-bit integer.
794/// \returns A 64-bit integer vector of [2 x i32] containing the left-shifted
795/// values. If \a __count is greater or equal to 32, the result is set to all
796/// 0.
797static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
798_mm_sll_pi32(__m64 __m, __m64 __count)
799{
800 return __trunc64(__builtin_ia32_pslld128((__v4si)__anyext128(__m),
801 (__v4si)__anyext128(__count)));
802}
803
804/// Left-shifts each 32-bit signed integer element of a 64-bit integer
805/// vector of [2 x i32] by the number of bits specified by a 32-bit integer.
806/// The lower 32 bits of the results are packed into a 64-bit integer vector
807/// of [2 x i32].
808///
809/// \headerfile <x86intrin.h>
810///
811/// This intrinsic corresponds to the <c> PSLLD </c> instruction.
812///
813/// \param __m
814/// A 64-bit integer vector of [2 x i32].
815/// \param __count
816/// A 32-bit integer value.
817/// \returns A 64-bit integer vector of [2 x i32] containing the left-shifted
818/// values. If \a __count is greater or equal to 32, the result is set to all
819/// 0.
820static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
821_mm_slli_pi32(__m64 __m, int __count) {
822 return __trunc64(__builtin_ia32_pslldi128((__v4si)__zext128(__m), __count));
823}
824
825/// Left-shifts the first 64-bit integer parameter by the number of bits
826/// specified by the second 64-bit integer parameter. The lower 64 bits of
827/// result are returned.
828///
829/// \headerfile <x86intrin.h>
830///
831/// This intrinsic corresponds to the <c> PSLLQ </c> instruction.
832///
833/// \param __m
834/// A 64-bit integer vector interpreted as a single 64-bit integer.
835/// \param __count
836/// A 64-bit integer vector interpreted as a single 64-bit integer.
837/// \returns A 64-bit integer vector containing the left-shifted value. If
838/// \a __count is greater or equal to 64, the result is set to 0.
839static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
840_mm_sll_si64(__m64 __m, __m64 __count)
841{
842 return __trunc64(__builtin_ia32_psllq128((__v2di)__anyext128(__m),
843 (__v2di)__anyext128(__count)));
844}
845
846/// Left-shifts the first parameter, which is a 64-bit integer, by the
847/// number of bits specified by the second parameter, which is a 32-bit
848/// integer. The lower 64 bits of result are returned.
849///
850/// \headerfile <x86intrin.h>
851///
852/// This intrinsic corresponds to the <c> PSLLQ </c> instruction.
853///
854/// \param __m
855/// A 64-bit integer vector interpreted as a single 64-bit integer.
856/// \param __count
857/// A 32-bit integer value.
858/// \returns A 64-bit integer vector containing the left-shifted value. If
859/// \a __count is greater or equal to 64, the result is set to 0.
860static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
861_mm_slli_si64(__m64 __m, int __count) {
862 return __trunc64(__builtin_ia32_psllqi128((__v2di)__zext128(__m), __count));
863}
864
865/// Right-shifts each 16-bit integer element of the first parameter,
866/// which is a 64-bit integer vector of [4 x i16], by the number of bits
867/// specified by the second parameter, which is a 64-bit integer.
868///
869/// High-order bits are filled with the sign bit of the initial value of each
870/// 16-bit element. The 16-bit results are packed into a 64-bit integer
871/// vector of [4 x i16].
872///
873/// \headerfile <x86intrin.h>
874///
875/// This intrinsic corresponds to the <c> PSRAW </c> instruction.
876///
877/// \param __m
878/// A 64-bit integer vector of [4 x i16].
879/// \param __count
880/// A 64-bit integer vector interpreted as a single 64-bit integer.
881/// \returns A 64-bit integer vector of [4 x i16] containing the right-shifted
882/// values.
883static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
884_mm_sra_pi16(__m64 __m, __m64 __count)
885{
886 return __trunc64(__builtin_ia32_psraw128((__v8hi)__anyext128(__m),
887 (__v8hi)__anyext128(__count)));
888}
889
890/// Right-shifts each 16-bit integer element of a 64-bit integer vector
891/// of [4 x i16] by the number of bits specified by a 32-bit integer.
892///
893/// High-order bits are filled with the sign bit of the initial value of each
894/// 16-bit element. The 16-bit results are packed into a 64-bit integer
895/// vector of [4 x i16].
896///
897/// \headerfile <x86intrin.h>
898///
899/// This intrinsic corresponds to the <c> PSRAW </c> instruction.
900///
901/// \param __m
902/// A 64-bit integer vector of [4 x i16].
903/// \param __count
904/// A 32-bit integer value.
905/// \returns A 64-bit integer vector of [4 x i16] containing the right-shifted
906/// values.
907static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
908_mm_srai_pi16(__m64 __m, int __count) {
909 return __trunc64(__builtin_ia32_psrawi128((__v8hi)__zext128(__m), __count));
910}
911
912/// Right-shifts each 32-bit integer element of the first parameter,
913/// which is a 64-bit integer vector of [2 x i32], by the number of bits
914/// specified by the second parameter, which is a 64-bit integer.
915///
916/// High-order bits are filled with the sign bit of the initial value of each
917/// 32-bit element. The 32-bit results are packed into a 64-bit integer
918/// vector of [2 x i32].
919///
920/// \headerfile <x86intrin.h>
921///
922/// This intrinsic corresponds to the <c> PSRAD </c> instruction.
923///
924/// \param __m
925/// A 64-bit integer vector of [2 x i32].
926/// \param __count
927/// A 64-bit integer vector interpreted as a single 64-bit integer.
928/// \returns A 64-bit integer vector of [2 x i32] containing the right-shifted
929/// values.
930static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
931_mm_sra_pi32(__m64 __m, __m64 __count)
932{
933 return __trunc64(__builtin_ia32_psrad128((__v4si)__anyext128(__m),
934 (__v4si)__anyext128(__count)));
935}
936
937/// Right-shifts each 32-bit integer element of a 64-bit integer vector
938/// of [2 x i32] by the number of bits specified by a 32-bit integer.
939///
940/// High-order bits are filled with the sign bit of the initial value of each
941/// 32-bit element. The 32-bit results are packed into a 64-bit integer
942/// vector of [2 x i32].
943///
944/// \headerfile <x86intrin.h>
945///
946/// This intrinsic corresponds to the <c> PSRAD </c> instruction.
947///
948/// \param __m
949/// A 64-bit integer vector of [2 x i32].
950/// \param __count
951/// A 32-bit integer value.
952/// \returns A 64-bit integer vector of [2 x i32] containing the right-shifted
953/// values.
954static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
955_mm_srai_pi32(__m64 __m, int __count) {
956 return __trunc64(__builtin_ia32_psradi128((__v4si)__zext128(__m), __count));
957}
958
959/// Right-shifts each 16-bit integer element of the first parameter,
960/// which is a 64-bit integer vector of [4 x i16], by the number of bits
961/// specified by the second parameter, which is a 64-bit integer.
962///
963/// High-order bits are cleared. The 16-bit results are packed into a 64-bit
964/// integer vector of [4 x i16].
965///
966/// \headerfile <x86intrin.h>
967///
968/// This intrinsic corresponds to the <c> PSRLW </c> instruction.
969///
970/// \param __m
971/// A 64-bit integer vector of [4 x i16].
972/// \param __count
973/// A 64-bit integer vector interpreted as a single 64-bit integer.
974/// \returns A 64-bit integer vector of [4 x i16] containing the right-shifted
975/// values.
976static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
977_mm_srl_pi16(__m64 __m, __m64 __count)
978{
979 return __trunc64(__builtin_ia32_psrlw128((__v8hi)__anyext128(__m),
980 (__v8hi)__anyext128(__count)));
981}
982
983/// Right-shifts each 16-bit integer element of a 64-bit integer vector
984/// of [4 x i16] by the number of bits specified by a 32-bit integer.
985///
986/// High-order bits are cleared. The 16-bit results are packed into a 64-bit
987/// integer vector of [4 x i16].
988///
989/// \headerfile <x86intrin.h>
990///
991/// This intrinsic corresponds to the <c> PSRLW </c> instruction.
992///
993/// \param __m
994/// A 64-bit integer vector of [4 x i16].
995/// \param __count
996/// A 32-bit integer value.
997/// \returns A 64-bit integer vector of [4 x i16] containing the right-shifted
998/// values.
999static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1000_mm_srli_pi16(__m64 __m, int __count) {
1001 return __trunc64(__builtin_ia32_psrlwi128((__v8hi)__zext128(__m), __count));
1002}
1003
1004/// Right-shifts each 32-bit integer element of the first parameter,
1005/// which is a 64-bit integer vector of [2 x i32], by the number of bits
1006/// specified by the second parameter, which is a 64-bit integer.
1007///
1008/// High-order bits are cleared. The 32-bit results are packed into a 64-bit
1009/// integer vector of [2 x i32].
1010///
1011/// \headerfile <x86intrin.h>
1012///
1013/// This intrinsic corresponds to the <c> PSRLD </c> instruction.
1014///
1015/// \param __m
1016/// A 64-bit integer vector of [2 x i32].
1017/// \param __count
1018/// A 64-bit integer vector interpreted as a single 64-bit integer.
1019/// \returns A 64-bit integer vector of [2 x i32] containing the right-shifted
1020/// values.
1021static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
1022_mm_srl_pi32(__m64 __m, __m64 __count)
1023{
1024 return __trunc64(__builtin_ia32_psrld128((__v4si)__anyext128(__m),
1025 (__v4si)__anyext128(__count)));
1026}
1027
1028/// Right-shifts each 32-bit integer element of a 64-bit integer vector
1029/// of [2 x i32] by the number of bits specified by a 32-bit integer.
1030///
1031/// High-order bits are cleared. The 32-bit results are packed into a 64-bit
1032/// integer vector of [2 x i32].
1033///
1034/// \headerfile <x86intrin.h>
1035///
1036/// This intrinsic corresponds to the <c> PSRLD </c> instruction.
1037///
1038/// \param __m
1039/// A 64-bit integer vector of [2 x i32].
1040/// \param __count
1041/// A 32-bit integer value.
1042/// \returns A 64-bit integer vector of [2 x i32] containing the right-shifted
1043/// values.
1044static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1045_mm_srli_pi32(__m64 __m, int __count) {
1046 return __trunc64(__builtin_ia32_psrldi128((__v4si)__zext128(__m), __count));
1047}
1048
1049/// Right-shifts the first 64-bit integer parameter by the number of bits
1050/// specified by the second 64-bit integer parameter.
1051///
1052/// High-order bits are cleared.
1053///
1054/// \headerfile <x86intrin.h>
1055///
1056/// This intrinsic corresponds to the <c> PSRLQ </c> instruction.
1057///
1058/// \param __m
1059/// A 64-bit integer vector interpreted as a single 64-bit integer.
1060/// \param __count
1061/// A 64-bit integer vector interpreted as a single 64-bit integer.
1062/// \returns A 64-bit integer vector containing the right-shifted value.
1063static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
1064_mm_srl_si64(__m64 __m, __m64 __count)
1065{
1066 return __trunc64(__builtin_ia32_psrlq128((__v2di)__anyext128(__m),
1067 (__v2di)__anyext128(__count)));
1068}
1069
1070/// Right-shifts the first parameter, which is a 64-bit integer, by the
1071/// number of bits specified by the second parameter, which is a 32-bit
1072/// integer.
1073///
1074/// High-order bits are cleared.
1075///
1076/// \headerfile <x86intrin.h>
1077///
1078/// This intrinsic corresponds to the <c> PSRLQ </c> instruction.
1079///
1080/// \param __m
1081/// A 64-bit integer vector interpreted as a single 64-bit integer.
1082/// \param __count
1083/// A 32-bit integer value.
1084/// \returns A 64-bit integer vector containing the right-shifted value.
1085static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1086_mm_srli_si64(__m64 __m, int __count) {
1087 return __trunc64(__builtin_ia32_psrlqi128((__v2di)__zext128(__m), __count));
1088}
1089
1090/// Performs a bitwise AND of two 64-bit integer vectors.
1091///
1092/// \headerfile <x86intrin.h>
1093///
1094/// This intrinsic corresponds to the <c> PAND </c> instruction.
1095///
1096/// \param __m1
1097/// A 64-bit integer vector.
1098/// \param __m2
1099/// A 64-bit integer vector.
1100/// \returns A 64-bit integer vector containing the bitwise AND of both
1101/// parameters.
1102static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1103_mm_and_si64(__m64 __m1, __m64 __m2)
1104{
1105 return (__m64)(((__v1du)__m1) & ((__v1du)__m2));
1106}
1107
1108/// Performs a bitwise NOT of the first 64-bit integer vector, and then
1109/// performs a bitwise AND of the intermediate result and the second 64-bit
1110/// integer vector.
1111///
1112/// \headerfile <x86intrin.h>
1113///
1114/// This intrinsic corresponds to the <c> PANDN </c> instruction.
1115///
1116/// \param __m1
1117/// A 64-bit integer vector. The one's complement of this parameter is used
1118/// in the bitwise AND.
1119/// \param __m2
1120/// A 64-bit integer vector.
1121/// \returns A 64-bit integer vector containing the bitwise AND of the second
1122/// parameter and the one's complement of the first parameter.
1123static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1124_mm_andnot_si64(__m64 __m1, __m64 __m2)
1125{
1126 return (__m64)(~((__v1du)__m1) & ((__v1du)__m2));
1127}
1128
1129/// Performs a bitwise OR of two 64-bit integer vectors.
1130///
1131/// \headerfile <x86intrin.h>
1132///
1133/// This intrinsic corresponds to the <c> POR </c> instruction.
1134///
1135/// \param __m1
1136/// A 64-bit integer vector.
1137/// \param __m2
1138/// A 64-bit integer vector.
1139/// \returns A 64-bit integer vector containing the bitwise OR of both
1140/// parameters.
1141static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1142_mm_or_si64(__m64 __m1, __m64 __m2)
1143{
1144 return (__m64)(((__v1du)__m1) | ((__v1du)__m2));
1145}
1146
1147/// Performs a bitwise exclusive OR of two 64-bit integer vectors.
1148///
1149/// \headerfile <x86intrin.h>
1150///
1151/// This intrinsic corresponds to the <c> PXOR </c> instruction.
1152///
1153/// \param __m1
1154/// A 64-bit integer vector.
1155/// \param __m2
1156/// A 64-bit integer vector.
1157/// \returns A 64-bit integer vector containing the bitwise exclusive OR of both
1158/// parameters.
1159static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1160_mm_xor_si64(__m64 __m1, __m64 __m2)
1161{
1162 return (__m64)(((__v1du)__m1) ^ ((__v1du)__m2));
1163}
1164
1165/// Compares the 8-bit integer elements of two 64-bit integer vectors of
1166/// [8 x i8] to determine if the element of the first vector is equal to the
1167/// corresponding element of the second vector.
1168///
1169/// Each comparison returns 0 for false, 0xFF for true.
1170///
1171/// \headerfile <x86intrin.h>
1172///
1173/// This intrinsic corresponds to the <c> PCMPEQB </c> instruction.
1174///
1175/// \param __m1
1176/// A 64-bit integer vector of [8 x i8].
1177/// \param __m2
1178/// A 64-bit integer vector of [8 x i8].
1179/// \returns A 64-bit integer vector of [8 x i8] containing the comparison
1180/// results.
1181static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1182_mm_cmpeq_pi8(__m64 __m1, __m64 __m2)
1183{
1184 return (__m64)(((__v8qi)__m1) == ((__v8qi)__m2));
1185}
1186
1187/// Compares the 16-bit integer elements of two 64-bit integer vectors of
1188/// [4 x i16] to determine if the element of the first vector is equal to the
1189/// corresponding element of the second vector.
1190///
1191/// Each comparison returns 0 for false, 0xFFFF for true.
1192///
1193/// \headerfile <x86intrin.h>
1194///
1195/// This intrinsic corresponds to the <c> PCMPEQW </c> instruction.
1196///
1197/// \param __m1
1198/// A 64-bit integer vector of [4 x i16].
1199/// \param __m2
1200/// A 64-bit integer vector of [4 x i16].
1201/// \returns A 64-bit integer vector of [4 x i16] containing the comparison
1202/// results.
1203static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1204_mm_cmpeq_pi16(__m64 __m1, __m64 __m2)
1205{
1206 return (__m64)(((__v4hi)__m1) == ((__v4hi)__m2));
1207}
1208
1209/// Compares the 32-bit integer elements of two 64-bit integer vectors of
1210/// [2 x i32] to determine if the element of the first vector is equal to the
1211/// corresponding element of the second vector.
1212///
1213/// Each comparison returns 0 for false, 0xFFFFFFFF for true.
1214///
1215/// \headerfile <x86intrin.h>
1216///
1217/// This intrinsic corresponds to the <c> PCMPEQD </c> instruction.
1218///
1219/// \param __m1
1220/// A 64-bit integer vector of [2 x i32].
1221/// \param __m2
1222/// A 64-bit integer vector of [2 x i32].
1223/// \returns A 64-bit integer vector of [2 x i32] containing the comparison
1224/// results.
1225static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1226_mm_cmpeq_pi32(__m64 __m1, __m64 __m2)
1227{
1228 return (__m64)(((__v2si)__m1) == ((__v2si)__m2));
1229}
1230
1231/// Compares the 8-bit integer elements of two 64-bit integer vectors of
1232/// [8 x i8] to determine if the element of the first vector is greater than
1233/// the corresponding element of the second vector.
1234///
1235/// Each comparison returns 0 for false, 0xFF for true.
1236///
1237/// \headerfile <x86intrin.h>
1238///
1239/// This intrinsic corresponds to the <c> PCMPGTB </c> instruction.
1240///
1241/// \param __m1
1242/// A 64-bit integer vector of [8 x i8].
1243/// \param __m2
1244/// A 64-bit integer vector of [8 x i8].
1245/// \returns A 64-bit integer vector of [8 x i8] containing the comparison
1246/// results.
1247static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1248_mm_cmpgt_pi8(__m64 __m1, __m64 __m2)
1249{
1250 /* This function always performs a signed comparison, but __v8qi is a char
1251 which may be signed or unsigned, so use __v8qs. */
1252 return (__m64)((__v8qs)__m1 > (__v8qs)__m2);
1253}
1254
1255/// Compares the 16-bit integer elements of two 64-bit integer vectors of
1256/// [4 x i16] to determine if the element of the first vector is greater than
1257/// the corresponding element of the second vector.
1258///
1259/// Each comparison returns 0 for false, 0xFFFF for true.
1260///
1261/// \headerfile <x86intrin.h>
1262///
1263/// This intrinsic corresponds to the <c> PCMPGTW </c> instruction.
1264///
1265/// \param __m1
1266/// A 64-bit integer vector of [4 x i16].
1267/// \param __m2
1268/// A 64-bit integer vector of [4 x i16].
1269/// \returns A 64-bit integer vector of [4 x i16] containing the comparison
1270/// results.
1271static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1272_mm_cmpgt_pi16(__m64 __m1, __m64 __m2)
1273{
1274 return (__m64)((__v4hi)__m1 > (__v4hi)__m2);
1275}
1276
1277/// Compares the 32-bit integer elements of two 64-bit integer vectors of
1278/// [2 x i32] to determine if the element of the first vector is greater than
1279/// the corresponding element of the second vector.
1280///
1281/// Each comparison returns 0 for false, 0xFFFFFFFF for true.
1282///
1283/// \headerfile <x86intrin.h>
1284///
1285/// This intrinsic corresponds to the <c> PCMPGTD </c> instruction.
1286///
1287/// \param __m1
1288/// A 64-bit integer vector of [2 x i32].
1289/// \param __m2
1290/// A 64-bit integer vector of [2 x i32].
1291/// \returns A 64-bit integer vector of [2 x i32] containing the comparison
1292/// results.
1293static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1294_mm_cmpgt_pi32(__m64 __m1, __m64 __m2)
1295{
1296 return (__m64)((__v2si)__m1 > (__v2si)__m2);
1297}
1298
1299/// Constructs a 64-bit integer vector initialized to zero.
1300///
1301/// \headerfile <x86intrin.h>
1302///
1303/// This intrinsic corresponds to the <c> PXOR </c> instruction.
1304///
1305/// \returns An initialized 64-bit integer vector with all elements set to zero.
1306static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1308 return __extension__(__m64){0LL};
1309}
1310
1311/// Constructs a 64-bit integer vector initialized with the specified
1312/// 32-bit integer values.
1313///
1314/// \headerfile <x86intrin.h>
1315///
1316/// This intrinsic is a utility function and does not correspond to a specific
1317/// instruction.
1318///
1319/// \param __i1
1320/// A 32-bit integer value used to initialize the upper 32 bits of the
1321/// result.
1322/// \param __i0
1323/// A 32-bit integer value used to initialize the lower 32 bits of the
1324/// result.
1325/// \returns An initialized 64-bit integer vector.
1326static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1327_mm_set_pi32(int __i1, int __i0) {
1328 return __extension__(__m64)(__v2si){__i0, __i1};
1329}
1330
1331/// Constructs a 64-bit integer vector initialized with the specified
1332/// 16-bit integer values.
1333///
1334/// \headerfile <x86intrin.h>
1335///
1336/// This intrinsic is a utility function and does not correspond to a specific
1337/// instruction.
1338///
1339/// \param __s3
1340/// A 16-bit integer value used to initialize bits [63:48] of the result.
1341/// \param __s2
1342/// A 16-bit integer value used to initialize bits [47:32] of the result.
1343/// \param __s1
1344/// A 16-bit integer value used to initialize bits [31:16] of the result.
1345/// \param __s0
1346/// A 16-bit integer value used to initialize bits [15:0] of the result.
1347/// \returns An initialized 64-bit integer vector.
1348static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1349_mm_set_pi16(short __s3, short __s2, short __s1, short __s0) {
1350 return __extension__(__m64)(__v4hi){__s0, __s1, __s2, __s3};
1351}
1352
1353/// Constructs a 64-bit integer vector initialized with the specified
1354/// 8-bit integer values.
1355///
1356/// \headerfile <x86intrin.h>
1357///
1358/// This intrinsic is a utility function and does not correspond to a specific
1359/// instruction.
1360///
1361/// \param __b7
1362/// An 8-bit integer value used to initialize bits [63:56] of the result.
1363/// \param __b6
1364/// An 8-bit integer value used to initialize bits [55:48] of the result.
1365/// \param __b5
1366/// An 8-bit integer value used to initialize bits [47:40] of the result.
1367/// \param __b4
1368/// An 8-bit integer value used to initialize bits [39:32] of the result.
1369/// \param __b3
1370/// An 8-bit integer value used to initialize bits [31:24] of the result.
1371/// \param __b2
1372/// An 8-bit integer value used to initialize bits [23:16] of the result.
1373/// \param __b1
1374/// An 8-bit integer value used to initialize bits [15:8] of the result.
1375/// \param __b0
1376/// An 8-bit integer value used to initialize bits [7:0] of the result.
1377/// \returns An initialized 64-bit integer vector.
1378static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1379_mm_set_pi8(char __b7, char __b6, char __b5, char __b4, char __b3, char __b2,
1380 char __b1, char __b0) {
1381 return __extension__(__m64)(__v8qi){__b0, __b1, __b2, __b3,
1382 __b4, __b5, __b6, __b7};
1383}
1384
1385/// Constructs a 64-bit integer vector of [2 x i32], with each of the
1386/// 32-bit integer vector elements set to the specified 32-bit integer
1387/// value.
1388///
1389/// \headerfile <x86intrin.h>
1390///
1391/// This intrinsic is a utility function and does not correspond to a specific
1392/// instruction.
1393///
1394/// \param __i
1395/// A 32-bit integer value used to initialize each vector element of the
1396/// result.
1397/// \returns An initialized 64-bit integer vector of [2 x i32].
1398static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1400 return _mm_set_pi32(__i, __i);
1401}
1402
1403/// Constructs a 64-bit integer vector of [4 x i16], with each of the
1404/// 16-bit integer vector elements set to the specified 16-bit integer
1405/// value.
1406///
1407/// \headerfile <x86intrin.h>
1408///
1409/// This intrinsic is a utility function and does not correspond to a specific
1410/// instruction.
1411///
1412/// \param __w
1413/// A 16-bit integer value used to initialize each vector element of the
1414/// result.
1415/// \returns An initialized 64-bit integer vector of [4 x i16].
1416static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1417_mm_set1_pi16(short __w) {
1418 return _mm_set_pi16(__w, __w, __w, __w);
1419}
1420
1421/// Constructs a 64-bit integer vector of [8 x i8], with each of the
1422/// 8-bit integer vector elements set to the specified 8-bit integer value.
1423///
1424/// \headerfile <x86intrin.h>
1425///
1426/// This intrinsic is a utility function and does not correspond to a specific
1427/// instruction.
1428///
1429/// \param __b
1430/// An 8-bit integer value used to initialize each vector element of the
1431/// result.
1432/// \returns An initialized 64-bit integer vector of [8 x i8].
1433static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1435 return _mm_set_pi8(__b, __b, __b, __b, __b, __b, __b, __b);
1436}
1437
1438/// Constructs a 64-bit integer vector, initialized in reverse order with
1439/// the specified 32-bit integer values.
1440///
1441/// \headerfile <x86intrin.h>
1442///
1443/// This intrinsic is a utility function and does not correspond to a specific
1444/// instruction.
1445///
1446/// \param __i0
1447/// A 32-bit integer value used to initialize the lower 32 bits of the
1448/// result.
1449/// \param __i1
1450/// A 32-bit integer value used to initialize the upper 32 bits of the
1451/// result.
1452/// \returns An initialized 64-bit integer vector.
1453static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1454_mm_setr_pi32(int __i0, int __i1) {
1455 return _mm_set_pi32(__i1, __i0);
1456}
1457
1458/// Constructs a 64-bit integer vector, initialized in reverse order with
1459/// the specified 16-bit integer values.
1460///
1461/// \headerfile <x86intrin.h>
1462///
1463/// This intrinsic is a utility function and does not correspond to a specific
1464/// instruction.
1465///
1466/// \param __w0
1467/// A 16-bit integer value used to initialize bits [15:0] of the result.
1468/// \param __w1
1469/// A 16-bit integer value used to initialize bits [31:16] of the result.
1470/// \param __w2
1471/// A 16-bit integer value used to initialize bits [47:32] of the result.
1472/// \param __w3
1473/// A 16-bit integer value used to initialize bits [63:48] of the result.
1474/// \returns An initialized 64-bit integer vector.
1475static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1476_mm_setr_pi16(short __w0, short __w1, short __w2, short __w3) {
1477 return _mm_set_pi16(__w3, __w2, __w1, __w0);
1478}
1479
1480/// Constructs a 64-bit integer vector, initialized in reverse order with
1481/// the specified 8-bit integer values.
1482///
1483/// \headerfile <x86intrin.h>
1484///
1485/// This intrinsic is a utility function and does not correspond to a specific
1486/// instruction.
1487///
1488/// \param __b0
1489/// An 8-bit integer value used to initialize bits [7:0] of the result.
1490/// \param __b1
1491/// An 8-bit integer value used to initialize bits [15:8] of the result.
1492/// \param __b2
1493/// An 8-bit integer value used to initialize bits [23:16] of the result.
1494/// \param __b3
1495/// An 8-bit integer value used to initialize bits [31:24] of the result.
1496/// \param __b4
1497/// An 8-bit integer value used to initialize bits [39:32] of the result.
1498/// \param __b5
1499/// An 8-bit integer value used to initialize bits [47:40] of the result.
1500/// \param __b6
1501/// An 8-bit integer value used to initialize bits [55:48] of the result.
1502/// \param __b7
1503/// An 8-bit integer value used to initialize bits [63:56] of the result.
1504/// \returns An initialized 64-bit integer vector.
1505static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1506_mm_setr_pi8(char __b0, char __b1, char __b2, char __b3, char __b4, char __b5,
1507 char __b6, char __b7) {
1508 return _mm_set_pi8(__b7, __b6, __b5, __b4, __b3, __b2, __b1, __b0);
1509}
1510
1511#undef __anyext128
1512#undef __trunc64
1513#undef __DEFAULT_FN_ATTRS_SSE2
1514
1515/* Aliases for compatibility. */
1516#define _m_empty _mm_empty
1517#define _m_from_int _mm_cvtsi32_si64
1518#define _m_from_int64 _mm_cvtsi64_m64
1519#define _m_to_int _mm_cvtsi64_si32
1520#define _m_to_int64 _mm_cvtm64_si64
1521#define _m_packsswb _mm_packs_pi16
1522#define _m_packssdw _mm_packs_pi32
1523#define _m_packuswb _mm_packs_pu16
1524#define _m_punpckhbw _mm_unpackhi_pi8
1525#define _m_punpckhwd _mm_unpackhi_pi16
1526#define _m_punpckhdq _mm_unpackhi_pi32
1527#define _m_punpcklbw _mm_unpacklo_pi8
1528#define _m_punpcklwd _mm_unpacklo_pi16
1529#define _m_punpckldq _mm_unpacklo_pi32
1530#define _m_paddb _mm_add_pi8
1531#define _m_paddw _mm_add_pi16
1532#define _m_paddd _mm_add_pi32
1533#define _m_paddsb _mm_adds_pi8
1534#define _m_paddsw _mm_adds_pi16
1535#define _m_paddusb _mm_adds_pu8
1536#define _m_paddusw _mm_adds_pu16
1537#define _m_psubb _mm_sub_pi8
1538#define _m_psubw _mm_sub_pi16
1539#define _m_psubd _mm_sub_pi32
1540#define _m_psubsb _mm_subs_pi8
1541#define _m_psubsw _mm_subs_pi16
1542#define _m_psubusb _mm_subs_pu8
1543#define _m_psubusw _mm_subs_pu16
1544#define _m_pmaddwd _mm_madd_pi16
1545#define _m_pmulhw _mm_mulhi_pi16
1546#define _m_pmullw _mm_mullo_pi16
1547#define _m_psllw _mm_sll_pi16
1548#define _m_psllwi _mm_slli_pi16
1549#define _m_pslld _mm_sll_pi32
1550#define _m_pslldi _mm_slli_pi32
1551#define _m_psllq _mm_sll_si64
1552#define _m_psllqi _mm_slli_si64
1553#define _m_psraw _mm_sra_pi16
1554#define _m_psrawi _mm_srai_pi16
1555#define _m_psrad _mm_sra_pi32
1556#define _m_psradi _mm_srai_pi32
1557#define _m_psrlw _mm_srl_pi16
1558#define _m_psrlwi _mm_srli_pi16
1559#define _m_psrld _mm_srl_pi32
1560#define _m_psrldi _mm_srli_pi32
1561#define _m_psrlq _mm_srl_si64
1562#define _m_psrlqi _mm_srli_si64
1563#define _m_pand _mm_and_si64
1564#define _m_pandn _mm_andnot_si64
1565#define _m_por _mm_or_si64
1566#define _m_pxor _mm_xor_si64
1567#define _m_pcmpeqb _mm_cmpeq_pi8
1568#define _m_pcmpeqw _mm_cmpeq_pi16
1569#define _m_pcmpeqd _mm_cmpeq_pi32
1570#define _m_pcmpgtb _mm_cmpgt_pi8
1571#define _m_pcmpgtw _mm_cmpgt_pi16
1572#define _m_pcmpgtd _mm_cmpgt_pi32
1573
1574#endif /* __MMINTRIN_H */
1575
static __inline__ vector float vector float __b
Definition altivec.h:578
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_cvtsi32_si64(int __i)
Constructs a 64-bit integer vector, setting the lower 32 bits to the value of the 32-bit integer para...
Definition mmintrin.h:86
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_packs_pi32(__m64 __m1, __m64 __m2)
Converts, with saturation, 32-bit signed integers from both 64-bit integer vector parameters of [2 x ...
Definition mmintrin.h:186
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_adds_pu16(__m64 __m1, __m64 __m2)
Adds, with saturation, each 16-bit unsigned integer element of the first 64-bit integer vector of [4 ...
Definition mmintrin.h:505
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_setr_pi8(char __b0, char __b1, char __b2, char __b3, char __b4, char __b5, char __b6, char __b7)
Constructs a 64-bit integer vector, initialized in reverse order with the specified 8-bit integer val...
Definition mmintrin.h:1506
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_set1_pi8(char __b)
Constructs a 64-bit integer vector of [8 x i8], with each of the 8-bit integer vector elements set to...
Definition mmintrin.h:1434
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_setr_pi32(int __i0, int __i1)
Constructs a 64-bit integer vector, initialized in reverse order with the specified 32-bit integer va...
Definition mmintrin.h:1454
#define __anyext128(x)
Definition mmintrin.h:57
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_subs_pu8(__m64 __m1, __m64 __m2)
Subtracts each 8-bit unsigned integer element of the second 64-bit integer vector of [8 x i8] from th...
Definition mmintrin.h:637
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_cmpgt_pi8(__m64 __m1, __m64 __m2)
Compares the 8-bit integer elements of two 64-bit integer vectors of [8 x i8] to determine if the ele...
Definition mmintrin.h:1248
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_sub_pi32(__m64 __m1, __m64 __m2)
Subtracts each 32-bit integer element of the second 64-bit integer vector of [2 x i32] from the corre...
Definition mmintrin.h:567
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_adds_pi8(__m64 __m1, __m64 __m2)
Adds, with saturation, each 8-bit signed integer element of the first 64-bit integer vector of [8 x i...
Definition mmintrin.h:438
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_packs_pi16(__m64 __m1, __m64 __m2)
Converts, with saturation, 16-bit signed integers from both 64-bit integer vector parameters of [4 x ...
Definition mmintrin.h:160
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_unpacklo_pi16(__m64 __m1, __m64 __m2)
Unpacks the lower 32 bits from two 64-bit integer vectors of [4 x i16] and interleaves them into a 64...
Definition mmintrin.h:332
#define __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
Definition mmintrin.h:49
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_setr_pi16(short __w0, short __w1, short __w2, short __w3)
Constructs a 64-bit integer vector, initialized in reverse order with the specified 16-bit integer va...
Definition mmintrin.h:1476
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_unpacklo_pi8(__m64 __m1, __m64 __m2)
Unpacks the lower 32 bits from two 64-bit integer vectors of [8 x i8] and interleaves them into a 64-...
Definition mmintrin.h:309
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_srli_pi32(__m64 __m, int __count)
Right-shifts each 32-bit integer element of a 64-bit integer vector of [2 x i32] by the number of bit...
Definition mmintrin.h:1045
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_and_si64(__m64 __m1, __m64 __m2)
Performs a bitwise AND of two 64-bit integer vectors.
Definition mmintrin.h:1103
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_sub_pi8(__m64 __m1, __m64 __m2)
Subtracts each 8-bit integer element of the second 64-bit integer vector of [8 x i8] from the corresp...
Definition mmintrin.h:525
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_xor_si64(__m64 __m1, __m64 __m2)
Performs a bitwise exclusive OR of two 64-bit integer vectors.
Definition mmintrin.h:1160
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_mulhi_pi16(__m64 __m1, __m64 __m2)
Multiplies each 16-bit signed integer element of the first 64-bit integer vector of [4 x i16] by the ...
Definition mmintrin.h:708
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_set_pi16(short __s3, short __s2, short __s1, short __s0)
Constructs a 64-bit integer vector initialized with the specified 16-bit integer values.
Definition mmintrin.h:1349
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_slli_pi16(__m64 __m, int __count)
Left-shifts each 16-bit signed integer element of a 64-bit integer vector of [4 x i16] by the number ...
Definition mmintrin.h:776
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_unpackhi_pi32(__m64 __m1, __m64 __m2)
Unpacks the upper 32 bits from two 64-bit integer vectors of [2 x i32] and interleaves them into a 64...
Definition mmintrin.h:283
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_andnot_si64(__m64 __m1, __m64 __m2)
Performs a bitwise NOT of the first 64-bit integer vector, and then performs a bitwise AND of the int...
Definition mmintrin.h:1124
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_cmpeq_pi16(__m64 __m1, __m64 __m2)
Compares the 16-bit integer elements of two 64-bit integer vectors of [4 x i16] to determine if the e...
Definition mmintrin.h:1204
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_or_si64(__m64 __m1, __m64 __m2)
Performs a bitwise OR of two 64-bit integer vectors.
Definition mmintrin.h:1142
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_set1_pi32(int __i)
Constructs a 64-bit integer vector of [2 x i32], with each of the 32-bit integer vector elements set ...
Definition mmintrin.h:1399
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_adds_pu8(__m64 __m1, __m64 __m2)
Adds, with saturation, each 8-bit unsigned integer element of the first 64-bit integer vector of [8 x...
Definition mmintrin.h:483
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_cmpeq_pi8(__m64 __m1, __m64 __m2)
Compares the 8-bit integer elements of two 64-bit integer vectors of [8 x i8] to determine if the ele...
Definition mmintrin.h:1182
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_srli_pi16(__m64 __m, int __count)
Right-shifts each 16-bit integer element of a 64-bit integer vector of [4 x i16] by the number of bit...
Definition mmintrin.h:1000
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_sll_pi16(__m64 __m, __m64 __count)
Left-shifts each 16-bit signed integer element of the first parameter, which is a 64-bit integer vect...
Definition mmintrin.h:753
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_cmpeq_pi32(__m64 __m1, __m64 __m2)
Compares the 32-bit integer elements of two 64-bit integer vectors of [2 x i32] to determine if the e...
Definition mmintrin.h:1226
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_srl_pi16(__m64 __m, __m64 __count)
Right-shifts each 16-bit integer element of the first parameter, which is a 64-bit integer vector of ...
Definition mmintrin.h:977
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_cmpgt_pi32(__m64 __m1, __m64 __m2)
Compares the 32-bit integer elements of two 64-bit integer vectors of [2 x i32] to determine if the e...
Definition mmintrin.h:1294
static __inline__ int __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_cvtsi64_si32(__m64 __m)
Returns the lower 32 bits of a 64-bit integer vector as a 32-bit signed integer.
Definition mmintrin.h:103
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_sra_pi32(__m64 __m, __m64 __count)
Right-shifts each 32-bit integer element of the first parameter, which is a 64-bit integer vector of ...
Definition mmintrin.h:931
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_srl_si64(__m64 __m, __m64 __count)
Right-shifts the first 64-bit integer parameter by the number of bits specified by the second 64-bit ...
Definition mmintrin.h:1064
long long __m64 __attribute__((__vector_size__(8), __aligned__(8)))
Definition mmintrin.h:17
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_unpacklo_pi32(__m64 __m1, __m64 __m2)
Unpacks the lower 32 bits from two 64-bit integer vectors of [2 x i32] and interleaves them into a 64...
Definition mmintrin.h:352
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_srai_pi16(__m64 __m, int __count)
Right-shifts each 16-bit integer element of a 64-bit integer vector of [4 x i16] by the number of bit...
Definition mmintrin.h:908
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_srai_pi32(__m64 __m, int __count)
Right-shifts each 32-bit integer element of a 64-bit integer vector of [2 x i32] by the number of bit...
Definition mmintrin.h:955
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_mullo_pi16(__m64 __m1, __m64 __m2)
Multiplies each 16-bit signed integer element of the first 64-bit integer vector of [4 x i16] by the ...
Definition mmintrin.h:730
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_setzero_si64(void)
Constructs a 64-bit integer vector initialized to zero.
Definition mmintrin.h:1307
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_packs_pu16(__m64 __m1, __m64 __m2)
Converts, with saturation, 16-bit signed integers from both 64-bit integer vector parameters of [4 x ...
Definition mmintrin.h:212
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_madd_pi16(__m64 __m1, __m64 __m2)
Multiplies each 16-bit signed integer element of the first 64-bit integer vector of [4 x i16] by the ...
Definition mmintrin.h:686
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_srl_pi32(__m64 __m, __m64 __count)
Right-shifts each 32-bit integer element of the first parameter, which is a 64-bit integer vector of ...
Definition mmintrin.h:1022
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_slli_si64(__m64 __m, int __count)
Left-shifts the first parameter, which is a 64-bit integer, by the number of bits specified by the se...
Definition mmintrin.h:861
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_cvtsi64_m64(long long __i)
Casts a 64-bit signed integer value into a 64-bit integer vector.
Definition mmintrin.h:119
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_add_pi32(__m64 __m1, __m64 __m2)
Adds each 32-bit integer element of the first 64-bit integer vector of [2 x i32] to the corresponding...
Definition mmintrin.h:414
static __inline__ long long __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_cvtm64_si64(__m64 __m)
Casts a 64-bit integer vector into a 64-bit signed integer value.
Definition mmintrin.h:135
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_sll_si64(__m64 __m, __m64 __count)
Left-shifts the first 64-bit integer parameter by the number of bits specified by the second 64-bit i...
Definition mmintrin.h:840
#define __trunc64(x)
Definition mmintrin.h:52
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_sub_pi16(__m64 __m1, __m64 __m2)
Subtracts each 16-bit integer element of the second 64-bit integer vector of [4 x i16] from the corre...
Definition mmintrin.h:546
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_set_pi32(int __i1, int __i0)
Constructs a 64-bit integer vector initialized with the specified 32-bit integer values.
Definition mmintrin.h:1327
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_subs_pi16(__m64 __m1, __m64 __m2)
Subtracts, with saturation, each 16-bit signed integer element of the second 64-bit integer vector of...
Definition mmintrin.h:614
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_srli_si64(__m64 __m, int __count)
Right-shifts the first parameter, which is a 64-bit integer, by the number of bits specified by the s...
Definition mmintrin.h:1086
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_set1_pi16(short __w)
Constructs a 64-bit integer vector of [4 x i16], with each of the 16-bit integer vector elements set ...
Definition mmintrin.h:1417
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_sra_pi16(__m64 __m, __m64 __count)
Right-shifts each 16-bit integer element of the first parameter, which is a 64-bit integer vector of ...
Definition mmintrin.h:884
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_subs_pi8(__m64 __m1, __m64 __m2)
Subtracts, with saturation, each 8-bit signed integer element of the second 64-bit integer vector of ...
Definition mmintrin.h:591
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_subs_pu16(__m64 __m1, __m64 __m2)
Subtracts each 16-bit unsigned integer element of the second 64-bit integer vector of [4 x i16] from ...
Definition mmintrin.h:660
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2 _mm_sll_pi32(__m64 __m, __m64 __count)
Left-shifts each 32-bit signed integer element of the first parameter, which is a 64-bit integer vect...
Definition mmintrin.h:798
#define __zext128(x)
Definition mmintrin.h:54
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_add_pi16(__m64 __m1, __m64 __m2)
Adds each 16-bit integer element of the first 64-bit integer vector of [4 x i16] to the corresponding...
Definition mmintrin.h:393
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_adds_pi16(__m64 __m1, __m64 __m2)
Adds, with saturation, each 16-bit signed integer element of the first 64-bit integer vector of [4 x ...
Definition mmintrin.h:461
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_set_pi8(char __b7, char __b6, char __b5, char __b4, char __b3, char __b2, char __b1, char __b0)
Constructs a 64-bit integer vector initialized with the specified 8-bit integer values.
Definition mmintrin.h:1379
#define __DEFAULT_FN_ATTRS_SSE2
Definition mmintrin.h:42
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_unpackhi_pi8(__m64 __m1, __m64 __m2)
Unpacks the upper 32 bits from two 64-bit integer vectors of [8 x i8] and interleaves them into a 64-...
Definition mmintrin.h:240
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_add_pi8(__m64 __m1, __m64 __m2)
Adds each 8-bit integer element of the first 64-bit integer vector of [8 x i8] to the corresponding 8...
Definition mmintrin.h:372
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_cmpgt_pi16(__m64 __m1, __m64 __m2)
Compares the 16-bit integer elements of two 64-bit integer vectors of [4 x i16] to determine if the e...
Definition mmintrin.h:1272
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_unpackhi_pi16(__m64 __m1, __m64 __m2)
Unpacks the upper 32 bits from two 64-bit integer vectors of [4 x i16] and interleaves them into a 64...
Definition mmintrin.h:263
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_slli_pi32(__m64 __m, int __count)
Left-shifts each 32-bit signed integer element of a 64-bit integer vector of [2 x i32] by the number ...
Definition mmintrin.h:821