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