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_CONSTEXPR
683_mm_madd_pi16(__m64 __m1, __m64 __m2) {
684 return __trunc64(__builtin_ia32_pmaddwd128((__v8hi)__zext128(__m1),
685 (__v8hi)__zext128(__m2)));
686}
687
688/// Multiplies each 16-bit signed integer element of the first 64-bit
689/// integer vector of [4 x i16] by the corresponding 16-bit signed integer
690/// element of the second 64-bit integer vector of [4 x i16]. Packs the upper
691/// 16 bits of the 32-bit products into a 64-bit integer vector of [4 x i16].
692///
693/// \headerfile <x86intrin.h>
694///
695/// This intrinsic corresponds to the <c> PMULHW </c> instruction.
696///
697/// \param __m1
698/// A 64-bit integer vector of [4 x i16].
699/// \param __m2
700/// A 64-bit integer vector of [4 x i16].
701/// \returns A 64-bit integer vector of [4 x i16] containing the upper 16 bits
702/// of the products of both parameters.
703static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
704_mm_mulhi_pi16(__m64 __m1, __m64 __m2)
705{
706 return __trunc64(__builtin_ia32_pmulhw128((__v8hi)__zext128(__m1),
707 (__v8hi)__zext128(__m2)));
708}
709
710/// Multiplies each 16-bit signed integer element of the first 64-bit
711/// integer vector of [4 x i16] by the corresponding 16-bit signed integer
712/// element of the second 64-bit integer vector of [4 x i16]. Packs the lower
713/// 16 bits of the 32-bit products into a 64-bit integer vector of [4 x i16].
714///
715/// \headerfile <x86intrin.h>
716///
717/// This intrinsic corresponds to the <c> PMULLW </c> instruction.
718///
719/// \param __m1
720/// A 64-bit integer vector of [4 x i16].
721/// \param __m2
722/// A 64-bit integer vector of [4 x i16].
723/// \returns A 64-bit integer vector of [4 x i16] containing the lower 16 bits
724/// of the products of both parameters.
725static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
726_mm_mullo_pi16(__m64 __m1, __m64 __m2)
727{
728 return (__m64)(((__v4hu)__m1) * ((__v4hu)__m2));
729}
730
731/// Left-shifts each 16-bit signed integer element of the first
732/// parameter, which is a 64-bit integer vector of [4 x i16], by the number
733/// of bits specified by the second parameter, which is a 64-bit integer. The
734/// lower 16 bits of the results are packed into a 64-bit integer vector of
735/// [4 x i16].
736///
737/// \headerfile <x86intrin.h>
738///
739/// This intrinsic corresponds to the <c> PSLLW </c> instruction.
740///
741/// \param __m
742/// A 64-bit integer vector of [4 x i16].
743/// \param __count
744/// A 64-bit integer vector interpreted as a single 64-bit integer.
745/// \returns A 64-bit integer vector of [4 x i16] containing the left-shifted
746/// values. If \a __count is greater or equal to 16, the result is set to all
747/// 0.
748static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
749_mm_sll_pi16(__m64 __m, __m64 __count)
750{
751 return __trunc64(__builtin_ia32_psllw128((__v8hi)__anyext128(__m),
752 (__v8hi)__anyext128(__count)));
753}
754
755/// Left-shifts each 16-bit signed integer element of a 64-bit integer
756/// vector of [4 x i16] by the number of bits specified by a 32-bit integer.
757/// The lower 16 bits of the results are packed into a 64-bit integer vector
758/// of [4 x i16].
759///
760/// \headerfile <x86intrin.h>
761///
762/// This intrinsic corresponds to the <c> PSLLW </c> instruction.
763///
764/// \param __m
765/// A 64-bit integer vector of [4 x i16].
766/// \param __count
767/// A 32-bit integer value.
768/// \returns A 64-bit integer vector of [4 x i16] containing the left-shifted
769/// values. If \a __count is greater or equal to 16, the result is set to all
770/// 0.
771static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
772_mm_slli_pi16(__m64 __m, int __count) {
773 return __trunc64(__builtin_ia32_psllwi128((__v8hi)__zext128(__m), __count));
774}
775
776/// Left-shifts each 32-bit signed integer element of the first
777/// parameter, which is a 64-bit integer vector of [2 x i32], by the number
778/// of bits specified by the second parameter, which is a 64-bit integer. The
779/// lower 32 bits of the results are packed into a 64-bit integer vector of
780/// [2 x i32].
781///
782/// \headerfile <x86intrin.h>
783///
784/// This intrinsic corresponds to the <c> PSLLD </c> instruction.
785///
786/// \param __m
787/// A 64-bit integer vector of [2 x i32].
788/// \param __count
789/// A 64-bit integer vector interpreted as a single 64-bit integer.
790/// \returns A 64-bit integer vector of [2 x i32] containing the left-shifted
791/// values. If \a __count is greater or equal to 32, the result is set to all
792/// 0.
793static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
794_mm_sll_pi32(__m64 __m, __m64 __count)
795{
796 return __trunc64(__builtin_ia32_pslld128((__v4si)__anyext128(__m),
797 (__v4si)__anyext128(__count)));
798}
799
800/// Left-shifts each 32-bit signed integer element of a 64-bit integer
801/// vector of [2 x i32] by the number of bits specified by a 32-bit integer.
802/// The lower 32 bits of the results are packed into a 64-bit integer vector
803/// of [2 x i32].
804///
805/// \headerfile <x86intrin.h>
806///
807/// This intrinsic corresponds to the <c> PSLLD </c> instruction.
808///
809/// \param __m
810/// A 64-bit integer vector of [2 x i32].
811/// \param __count
812/// A 32-bit integer value.
813/// \returns A 64-bit integer vector of [2 x i32] containing the left-shifted
814/// values. If \a __count is greater or equal to 32, the result is set to all
815/// 0.
816static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
817_mm_slli_pi32(__m64 __m, int __count) {
818 return __trunc64(__builtin_ia32_pslldi128((__v4si)__zext128(__m), __count));
819}
820
821/// Left-shifts the first 64-bit integer parameter by the number of bits
822/// specified by the second 64-bit integer parameter. The lower 64 bits of
823/// result are returned.
824///
825/// \headerfile <x86intrin.h>
826///
827/// This intrinsic corresponds to the <c> PSLLQ </c> instruction.
828///
829/// \param __m
830/// A 64-bit integer vector interpreted as a single 64-bit integer.
831/// \param __count
832/// A 64-bit integer vector interpreted as a single 64-bit integer.
833/// \returns A 64-bit integer vector containing the left-shifted value. If
834/// \a __count is greater or equal to 64, the result is set to 0.
835static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
836_mm_sll_si64(__m64 __m, __m64 __count)
837{
838 return __trunc64(__builtin_ia32_psllq128((__v2di)__anyext128(__m),
839 (__v2di)__anyext128(__count)));
840}
841
842/// Left-shifts the first parameter, which is a 64-bit integer, by the
843/// number of bits specified by the second parameter, which is a 32-bit
844/// integer. The lower 64 bits of result are returned.
845///
846/// \headerfile <x86intrin.h>
847///
848/// This intrinsic corresponds to the <c> PSLLQ </c> instruction.
849///
850/// \param __m
851/// A 64-bit integer vector interpreted as a single 64-bit integer.
852/// \param __count
853/// A 32-bit integer value.
854/// \returns A 64-bit integer vector containing the left-shifted value. If
855/// \a __count is greater or equal to 64, the result is set to 0.
856static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
857_mm_slli_si64(__m64 __m, int __count) {
858 return __trunc64(__builtin_ia32_psllqi128((__v2di)__zext128(__m), __count));
859}
860
861/// Right-shifts each 16-bit integer element of the first parameter,
862/// which is a 64-bit integer vector of [4 x i16], by the number of bits
863/// specified by the second parameter, which is a 64-bit integer.
864///
865/// High-order bits are filled with the sign bit of the initial value of each
866/// 16-bit element. The 16-bit results are packed into a 64-bit integer
867/// vector of [4 x i16].
868///
869/// \headerfile <x86intrin.h>
870///
871/// This intrinsic corresponds to the <c> PSRAW </c> instruction.
872///
873/// \param __m
874/// A 64-bit integer vector of [4 x i16].
875/// \param __count
876/// A 64-bit integer vector interpreted as a single 64-bit integer.
877/// \returns A 64-bit integer vector of [4 x i16] containing the right-shifted
878/// values.
879static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
880_mm_sra_pi16(__m64 __m, __m64 __count)
881{
882 return __trunc64(__builtin_ia32_psraw128((__v8hi)__anyext128(__m),
883 (__v8hi)__anyext128(__count)));
884}
885
886/// Right-shifts each 16-bit integer element of a 64-bit integer vector
887/// of [4 x i16] by the number of bits specified by a 32-bit integer.
888///
889/// High-order bits are filled with the sign bit of the initial value of each
890/// 16-bit element. The 16-bit results are packed into a 64-bit integer
891/// vector of [4 x i16].
892///
893/// \headerfile <x86intrin.h>
894///
895/// This intrinsic corresponds to the <c> PSRAW </c> instruction.
896///
897/// \param __m
898/// A 64-bit integer vector of [4 x i16].
899/// \param __count
900/// A 32-bit integer value.
901/// \returns A 64-bit integer vector of [4 x i16] containing the right-shifted
902/// values.
903static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
904_mm_srai_pi16(__m64 __m, int __count) {
905 return __trunc64(__builtin_ia32_psrawi128((__v8hi)__zext128(__m), __count));
906}
907
908/// Right-shifts each 32-bit integer element of the first parameter,
909/// which is a 64-bit integer vector of [2 x i32], by the number of bits
910/// specified by the second parameter, which is a 64-bit integer.
911///
912/// High-order bits are filled with the sign bit of the initial value of each
913/// 32-bit element. The 32-bit results are packed into a 64-bit integer
914/// vector of [2 x i32].
915///
916/// \headerfile <x86intrin.h>
917///
918/// This intrinsic corresponds to the <c> PSRAD </c> instruction.
919///
920/// \param __m
921/// A 64-bit integer vector of [2 x i32].
922/// \param __count
923/// A 64-bit integer vector interpreted as a single 64-bit integer.
924/// \returns A 64-bit integer vector of [2 x i32] containing the right-shifted
925/// values.
926static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
927_mm_sra_pi32(__m64 __m, __m64 __count)
928{
929 return __trunc64(__builtin_ia32_psrad128((__v4si)__anyext128(__m),
930 (__v4si)__anyext128(__count)));
931}
932
933/// Right-shifts each 32-bit integer element of a 64-bit integer vector
934/// of [2 x i32] by the number of bits specified by a 32-bit integer.
935///
936/// High-order bits are filled with the sign bit of the initial value of each
937/// 32-bit element. The 32-bit results are packed into a 64-bit integer
938/// vector of [2 x i32].
939///
940/// \headerfile <x86intrin.h>
941///
942/// This intrinsic corresponds to the <c> PSRAD </c> instruction.
943///
944/// \param __m
945/// A 64-bit integer vector of [2 x i32].
946/// \param __count
947/// A 32-bit integer value.
948/// \returns A 64-bit integer vector of [2 x i32] containing the right-shifted
949/// values.
950static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
951_mm_srai_pi32(__m64 __m, int __count) {
952 return __trunc64(__builtin_ia32_psradi128((__v4si)__zext128(__m), __count));
953}
954
955/// Right-shifts each 16-bit integer element of the first parameter,
956/// which is a 64-bit integer vector of [4 x i16], by the number of bits
957/// specified by the second parameter, which is a 64-bit integer.
958///
959/// High-order bits are cleared. The 16-bit results are packed into a 64-bit
960/// integer vector of [4 x i16].
961///
962/// \headerfile <x86intrin.h>
963///
964/// This intrinsic corresponds to the <c> PSRLW </c> instruction.
965///
966/// \param __m
967/// A 64-bit integer vector of [4 x i16].
968/// \param __count
969/// A 64-bit integer vector interpreted as a single 64-bit integer.
970/// \returns A 64-bit integer vector of [4 x i16] containing the right-shifted
971/// values.
972static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
973_mm_srl_pi16(__m64 __m, __m64 __count)
974{
975 return __trunc64(__builtin_ia32_psrlw128((__v8hi)__anyext128(__m),
976 (__v8hi)__anyext128(__count)));
977}
978
979/// Right-shifts each 16-bit integer element of a 64-bit integer vector
980/// of [4 x i16] by the number of bits specified by a 32-bit integer.
981///
982/// High-order bits are cleared. The 16-bit results are packed into a 64-bit
983/// integer vector of [4 x i16].
984///
985/// \headerfile <x86intrin.h>
986///
987/// This intrinsic corresponds to the <c> PSRLW </c> instruction.
988///
989/// \param __m
990/// A 64-bit integer vector of [4 x i16].
991/// \param __count
992/// A 32-bit integer value.
993/// \returns A 64-bit integer vector of [4 x i16] containing the right-shifted
994/// values.
995static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
996_mm_srli_pi16(__m64 __m, int __count) {
997 return __trunc64(__builtin_ia32_psrlwi128((__v8hi)__zext128(__m), __count));
998}
999
1000/// Right-shifts each 32-bit integer element of the first parameter,
1001/// which is a 64-bit integer vector of [2 x i32], by the number of bits
1002/// specified by the second parameter, which is a 64-bit integer.
1003///
1004/// High-order bits are cleared. The 32-bit results are packed into a 64-bit
1005/// integer vector of [2 x i32].
1006///
1007/// \headerfile <x86intrin.h>
1008///
1009/// This intrinsic corresponds to the <c> PSRLD </c> instruction.
1010///
1011/// \param __m
1012/// A 64-bit integer vector of [2 x i32].
1013/// \param __count
1014/// A 64-bit integer vector interpreted as a single 64-bit integer.
1015/// \returns A 64-bit integer vector of [2 x i32] containing the right-shifted
1016/// values.
1017static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
1018_mm_srl_pi32(__m64 __m, __m64 __count)
1019{
1020 return __trunc64(__builtin_ia32_psrld128((__v4si)__anyext128(__m),
1021 (__v4si)__anyext128(__count)));
1022}
1023
1024/// Right-shifts each 32-bit integer element of a 64-bit integer vector
1025/// of [2 x i32] by the number of bits specified by a 32-bit integer.
1026///
1027/// High-order bits are cleared. The 32-bit results are packed into a 64-bit
1028/// integer vector of [2 x i32].
1029///
1030/// \headerfile <x86intrin.h>
1031///
1032/// This intrinsic corresponds to the <c> PSRLD </c> instruction.
1033///
1034/// \param __m
1035/// A 64-bit integer vector of [2 x i32].
1036/// \param __count
1037/// A 32-bit integer value.
1038/// \returns A 64-bit integer vector of [2 x i32] containing the right-shifted
1039/// values.
1040static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1041_mm_srli_pi32(__m64 __m, int __count) {
1042 return __trunc64(__builtin_ia32_psrldi128((__v4si)__zext128(__m), __count));
1043}
1044
1045/// Right-shifts the first 64-bit integer parameter by the number of bits
1046/// specified by the second 64-bit integer parameter.
1047///
1048/// High-order bits are cleared.
1049///
1050/// \headerfile <x86intrin.h>
1051///
1052/// This intrinsic corresponds to the <c> PSRLQ </c> instruction.
1053///
1054/// \param __m
1055/// A 64-bit integer vector interpreted as a single 64-bit integer.
1056/// \param __count
1057/// A 64-bit integer vector interpreted as a single 64-bit integer.
1058/// \returns A 64-bit integer vector containing the right-shifted value.
1059static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
1060_mm_srl_si64(__m64 __m, __m64 __count)
1061{
1062 return __trunc64(__builtin_ia32_psrlq128((__v2di)__anyext128(__m),
1063 (__v2di)__anyext128(__count)));
1064}
1065
1066/// Right-shifts the first parameter, which is a 64-bit integer, by the
1067/// number of bits specified by the second parameter, which is a 32-bit
1068/// integer.
1069///
1070/// High-order bits are cleared.
1071///
1072/// \headerfile <x86intrin.h>
1073///
1074/// This intrinsic corresponds to the <c> PSRLQ </c> instruction.
1075///
1076/// \param __m
1077/// A 64-bit integer vector interpreted as a single 64-bit integer.
1078/// \param __count
1079/// A 32-bit integer value.
1080/// \returns A 64-bit integer vector containing the right-shifted value.
1081static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1082_mm_srli_si64(__m64 __m, int __count) {
1083 return __trunc64(__builtin_ia32_psrlqi128((__v2di)__zext128(__m), __count));
1084}
1085
1086/// Performs a bitwise AND of two 64-bit integer vectors.
1087///
1088/// \headerfile <x86intrin.h>
1089///
1090/// This intrinsic corresponds to the <c> PAND </c> instruction.
1091///
1092/// \param __m1
1093/// A 64-bit integer vector.
1094/// \param __m2
1095/// A 64-bit integer vector.
1096/// \returns A 64-bit integer vector containing the bitwise AND of both
1097/// parameters.
1098static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1099_mm_and_si64(__m64 __m1, __m64 __m2)
1100{
1101 return (__m64)(((__v1du)__m1) & ((__v1du)__m2));
1102}
1103
1104/// Performs a bitwise NOT of the first 64-bit integer vector, and then
1105/// performs a bitwise AND of the intermediate result and the second 64-bit
1106/// integer vector.
1107///
1108/// \headerfile <x86intrin.h>
1109///
1110/// This intrinsic corresponds to the <c> PANDN </c> instruction.
1111///
1112/// \param __m1
1113/// A 64-bit integer vector. The one's complement of this parameter is used
1114/// in the bitwise AND.
1115/// \param __m2
1116/// A 64-bit integer vector.
1117/// \returns A 64-bit integer vector containing the bitwise AND of the second
1118/// parameter and the one's complement of the first parameter.
1119static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1120_mm_andnot_si64(__m64 __m1, __m64 __m2)
1121{
1122 return (__m64)(~((__v1du)__m1) & ((__v1du)__m2));
1123}
1124
1125/// Performs a bitwise OR of two 64-bit integer vectors.
1126///
1127/// \headerfile <x86intrin.h>
1128///
1129/// This intrinsic corresponds to the <c> POR </c> instruction.
1130///
1131/// \param __m1
1132/// A 64-bit integer vector.
1133/// \param __m2
1134/// A 64-bit integer vector.
1135/// \returns A 64-bit integer vector containing the bitwise OR of both
1136/// parameters.
1137static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1138_mm_or_si64(__m64 __m1, __m64 __m2)
1139{
1140 return (__m64)(((__v1du)__m1) | ((__v1du)__m2));
1141}
1142
1143/// Performs a bitwise exclusive OR of two 64-bit integer vectors.
1144///
1145/// \headerfile <x86intrin.h>
1146///
1147/// This intrinsic corresponds to the <c> PXOR </c> instruction.
1148///
1149/// \param __m1
1150/// A 64-bit integer vector.
1151/// \param __m2
1152/// A 64-bit integer vector.
1153/// \returns A 64-bit integer vector containing the bitwise exclusive OR of both
1154/// parameters.
1155static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1156_mm_xor_si64(__m64 __m1, __m64 __m2)
1157{
1158 return (__m64)(((__v1du)__m1) ^ ((__v1du)__m2));
1159}
1160
1161/// Compares the 8-bit integer elements of two 64-bit integer vectors of
1162/// [8 x i8] to determine if the element of the first vector is equal to the
1163/// corresponding element of the second vector.
1164///
1165/// Each comparison returns 0 for false, 0xFF for true.
1166///
1167/// \headerfile <x86intrin.h>
1168///
1169/// This intrinsic corresponds to the <c> PCMPEQB </c> instruction.
1170///
1171/// \param __m1
1172/// A 64-bit integer vector of [8 x i8].
1173/// \param __m2
1174/// A 64-bit integer vector of [8 x i8].
1175/// \returns A 64-bit integer vector of [8 x i8] containing the comparison
1176/// results.
1177static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1178_mm_cmpeq_pi8(__m64 __m1, __m64 __m2)
1179{
1180 return (__m64)(((__v8qi)__m1) == ((__v8qi)__m2));
1181}
1182
1183/// Compares the 16-bit integer elements of two 64-bit integer vectors of
1184/// [4 x i16] to determine if the element of the first vector is equal to the
1185/// corresponding element of the second vector.
1186///
1187/// Each comparison returns 0 for false, 0xFFFF for true.
1188///
1189/// \headerfile <x86intrin.h>
1190///
1191/// This intrinsic corresponds to the <c> PCMPEQW </c> instruction.
1192///
1193/// \param __m1
1194/// A 64-bit integer vector of [4 x i16].
1195/// \param __m2
1196/// A 64-bit integer vector of [4 x i16].
1197/// \returns A 64-bit integer vector of [4 x i16] containing the comparison
1198/// results.
1199static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1200_mm_cmpeq_pi16(__m64 __m1, __m64 __m2)
1201{
1202 return (__m64)(((__v4hi)__m1) == ((__v4hi)__m2));
1203}
1204
1205/// Compares the 32-bit integer elements of two 64-bit integer vectors of
1206/// [2 x i32] to determine if the element of the first vector is equal to the
1207/// corresponding element of the second vector.
1208///
1209/// Each comparison returns 0 for false, 0xFFFFFFFF for true.
1210///
1211/// \headerfile <x86intrin.h>
1212///
1213/// This intrinsic corresponds to the <c> PCMPEQD </c> instruction.
1214///
1215/// \param __m1
1216/// A 64-bit integer vector of [2 x i32].
1217/// \param __m2
1218/// A 64-bit integer vector of [2 x i32].
1219/// \returns A 64-bit integer vector of [2 x i32] containing the comparison
1220/// results.
1221static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1222_mm_cmpeq_pi32(__m64 __m1, __m64 __m2)
1223{
1224 return (__m64)(((__v2si)__m1) == ((__v2si)__m2));
1225}
1226
1227/// Compares the 8-bit integer elements of two 64-bit integer vectors of
1228/// [8 x i8] to determine if the element of the first vector is greater than
1229/// the corresponding element of the second vector.
1230///
1231/// Each comparison returns 0 for false, 0xFF for true.
1232///
1233/// \headerfile <x86intrin.h>
1234///
1235/// This intrinsic corresponds to the <c> PCMPGTB </c> instruction.
1236///
1237/// \param __m1
1238/// A 64-bit integer vector of [8 x i8].
1239/// \param __m2
1240/// A 64-bit integer vector of [8 x i8].
1241/// \returns A 64-bit integer vector of [8 x i8] containing the comparison
1242/// results.
1243static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1244_mm_cmpgt_pi8(__m64 __m1, __m64 __m2)
1245{
1246 /* This function always performs a signed comparison, but __v8qi is a char
1247 which may be signed or unsigned, so use __v8qs. */
1248 return (__m64)((__v8qs)__m1 > (__v8qs)__m2);
1249}
1250
1251/// Compares the 16-bit integer elements of two 64-bit integer vectors of
1252/// [4 x i16] to determine if the element of the first vector is greater than
1253/// the corresponding element of the second vector.
1254///
1255/// Each comparison returns 0 for false, 0xFFFF for true.
1256///
1257/// \headerfile <x86intrin.h>
1258///
1259/// This intrinsic corresponds to the <c> PCMPGTW </c> instruction.
1260///
1261/// \param __m1
1262/// A 64-bit integer vector of [4 x i16].
1263/// \param __m2
1264/// A 64-bit integer vector of [4 x i16].
1265/// \returns A 64-bit integer vector of [4 x i16] containing the comparison
1266/// results.
1267static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1268_mm_cmpgt_pi16(__m64 __m1, __m64 __m2)
1269{
1270 return (__m64)((__v4hi)__m1 > (__v4hi)__m2);
1271}
1272
1273/// Compares the 32-bit integer elements of two 64-bit integer vectors of
1274/// [2 x i32] to determine if the element of the first vector is greater than
1275/// the corresponding element of the second vector.
1276///
1277/// Each comparison returns 0 for false, 0xFFFFFFFF for true.
1278///
1279/// \headerfile <x86intrin.h>
1280///
1281/// This intrinsic corresponds to the <c> PCMPGTD </c> instruction.
1282///
1283/// \param __m1
1284/// A 64-bit integer vector of [2 x i32].
1285/// \param __m2
1286/// A 64-bit integer vector of [2 x i32].
1287/// \returns A 64-bit integer vector of [2 x i32] containing the comparison
1288/// results.
1289static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1290_mm_cmpgt_pi32(__m64 __m1, __m64 __m2)
1291{
1292 return (__m64)((__v2si)__m1 > (__v2si)__m2);
1293}
1294
1295/// Constructs a 64-bit integer vector initialized to zero.
1296///
1297/// \headerfile <x86intrin.h>
1298///
1299/// This intrinsic corresponds to the <c> PXOR </c> instruction.
1300///
1301/// \returns An initialized 64-bit integer vector with all elements set to zero.
1302static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1304 return __extension__(__m64){0LL};
1305}
1306
1307/// Constructs a 64-bit integer vector initialized with the specified
1308/// 32-bit integer values.
1309///
1310/// \headerfile <x86intrin.h>
1311///
1312/// This intrinsic is a utility function and does not correspond to a specific
1313/// instruction.
1314///
1315/// \param __i1
1316/// A 32-bit integer value used to initialize the upper 32 bits of the
1317/// result.
1318/// \param __i0
1319/// A 32-bit integer value used to initialize the lower 32 bits of the
1320/// result.
1321/// \returns An initialized 64-bit integer vector.
1322static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1323_mm_set_pi32(int __i1, int __i0) {
1324 return __extension__(__m64)(__v2si){__i0, __i1};
1325}
1326
1327/// Constructs a 64-bit integer vector initialized with the specified
1328/// 16-bit integer values.
1329///
1330/// \headerfile <x86intrin.h>
1331///
1332/// This intrinsic is a utility function and does not correspond to a specific
1333/// instruction.
1334///
1335/// \param __s3
1336/// A 16-bit integer value used to initialize bits [63:48] of the result.
1337/// \param __s2
1338/// A 16-bit integer value used to initialize bits [47:32] of the result.
1339/// \param __s1
1340/// A 16-bit integer value used to initialize bits [31:16] of the result.
1341/// \param __s0
1342/// A 16-bit integer value used to initialize bits [15:0] of the result.
1343/// \returns An initialized 64-bit integer vector.
1344static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1345_mm_set_pi16(short __s3, short __s2, short __s1, short __s0) {
1346 return __extension__(__m64)(__v4hi){__s0, __s1, __s2, __s3};
1347}
1348
1349/// Constructs a 64-bit integer vector initialized with the specified
1350/// 8-bit integer values.
1351///
1352/// \headerfile <x86intrin.h>
1353///
1354/// This intrinsic is a utility function and does not correspond to a specific
1355/// instruction.
1356///
1357/// \param __b7
1358/// An 8-bit integer value used to initialize bits [63:56] of the result.
1359/// \param __b6
1360/// An 8-bit integer value used to initialize bits [55:48] of the result.
1361/// \param __b5
1362/// An 8-bit integer value used to initialize bits [47:40] of the result.
1363/// \param __b4
1364/// An 8-bit integer value used to initialize bits [39:32] of the result.
1365/// \param __b3
1366/// An 8-bit integer value used to initialize bits [31:24] of the result.
1367/// \param __b2
1368/// An 8-bit integer value used to initialize bits [23:16] of the result.
1369/// \param __b1
1370/// An 8-bit integer value used to initialize bits [15:8] of the result.
1371/// \param __b0
1372/// An 8-bit integer value used to initialize bits [7:0] of the result.
1373/// \returns An initialized 64-bit integer vector.
1374static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1375_mm_set_pi8(char __b7, char __b6, char __b5, char __b4, char __b3, char __b2,
1376 char __b1, char __b0) {
1377 return __extension__(__m64)(__v8qi){__b0, __b1, __b2, __b3,
1378 __b4, __b5, __b6, __b7};
1379}
1380
1381/// Constructs a 64-bit integer vector of [2 x i32], with each of the
1382/// 32-bit integer vector elements set to the specified 32-bit integer
1383/// value.
1384///
1385/// \headerfile <x86intrin.h>
1386///
1387/// This intrinsic is a utility function and does not correspond to a specific
1388/// instruction.
1389///
1390/// \param __i
1391/// A 32-bit integer value used to initialize each vector element of the
1392/// result.
1393/// \returns An initialized 64-bit integer vector of [2 x i32].
1394static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1396 return _mm_set_pi32(__i, __i);
1397}
1398
1399/// Constructs a 64-bit integer vector of [4 x i16], with each of the
1400/// 16-bit integer vector elements set to the specified 16-bit integer
1401/// value.
1402///
1403/// \headerfile <x86intrin.h>
1404///
1405/// This intrinsic is a utility function and does not correspond to a specific
1406/// instruction.
1407///
1408/// \param __w
1409/// A 16-bit integer value used to initialize each vector element of the
1410/// result.
1411/// \returns An initialized 64-bit integer vector of [4 x i16].
1412static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1413_mm_set1_pi16(short __w) {
1414 return _mm_set_pi16(__w, __w, __w, __w);
1415}
1416
1417/// Constructs a 64-bit integer vector of [8 x i8], with each of the
1418/// 8-bit integer vector elements set to the specified 8-bit integer value.
1419///
1420/// \headerfile <x86intrin.h>
1421///
1422/// This intrinsic is a utility function and does not correspond to a specific
1423/// instruction.
1424///
1425/// \param __b
1426/// An 8-bit integer value used to initialize each vector element of the
1427/// result.
1428/// \returns An initialized 64-bit integer vector of [8 x i8].
1429static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1431 return _mm_set_pi8(__b, __b, __b, __b, __b, __b, __b, __b);
1432}
1433
1434/// Constructs a 64-bit integer vector, initialized in reverse order with
1435/// the specified 32-bit integer values.
1436///
1437/// \headerfile <x86intrin.h>
1438///
1439/// This intrinsic is a utility function and does not correspond to a specific
1440/// instruction.
1441///
1442/// \param __i0
1443/// A 32-bit integer value used to initialize the lower 32 bits of the
1444/// result.
1445/// \param __i1
1446/// A 32-bit integer value used to initialize the upper 32 bits of the
1447/// result.
1448/// \returns An initialized 64-bit integer vector.
1449static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1450_mm_setr_pi32(int __i0, int __i1) {
1451 return _mm_set_pi32(__i1, __i0);
1452}
1453
1454/// Constructs a 64-bit integer vector, initialized in reverse order with
1455/// the specified 16-bit integer values.
1456///
1457/// \headerfile <x86intrin.h>
1458///
1459/// This intrinsic is a utility function and does not correspond to a specific
1460/// instruction.
1461///
1462/// \param __w0
1463/// A 16-bit integer value used to initialize bits [15:0] of the result.
1464/// \param __w1
1465/// A 16-bit integer value used to initialize bits [31:16] of the result.
1466/// \param __w2
1467/// A 16-bit integer value used to initialize bits [47:32] of the result.
1468/// \param __w3
1469/// A 16-bit integer value used to initialize bits [63:48] of the result.
1470/// \returns An initialized 64-bit integer vector.
1471static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1472_mm_setr_pi16(short __w0, short __w1, short __w2, short __w3) {
1473 return _mm_set_pi16(__w3, __w2, __w1, __w0);
1474}
1475
1476/// Constructs a 64-bit integer vector, initialized in reverse order with
1477/// the specified 8-bit integer values.
1478///
1479/// \headerfile <x86intrin.h>
1480///
1481/// This intrinsic is a utility function and does not correspond to a specific
1482/// instruction.
1483///
1484/// \param __b0
1485/// An 8-bit integer value used to initialize bits [7:0] of the result.
1486/// \param __b1
1487/// An 8-bit integer value used to initialize bits [15:8] of the result.
1488/// \param __b2
1489/// An 8-bit integer value used to initialize bits [23:16] of the result.
1490/// \param __b3
1491/// An 8-bit integer value used to initialize bits [31:24] of the result.
1492/// \param __b4
1493/// An 8-bit integer value used to initialize bits [39:32] of the result.
1494/// \param __b5
1495/// An 8-bit integer value used to initialize bits [47:40] of the result.
1496/// \param __b6
1497/// An 8-bit integer value used to initialize bits [55:48] of the result.
1498/// \param __b7
1499/// An 8-bit integer value used to initialize bits [63:56] of the result.
1500/// \returns An initialized 64-bit integer vector.
1501static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1502_mm_setr_pi8(char __b0, char __b1, char __b2, char __b3, char __b4, char __b5,
1503 char __b6, char __b7) {
1504 return _mm_set_pi8(__b7, __b6, __b5, __b4, __b3, __b2, __b1, __b0);
1505}
1506
1507#undef __anyext128
1508#undef __trunc64
1509#undef __DEFAULT_FN_ATTRS_SSE2
1510
1511/* Aliases for compatibility. */
1512#define _m_empty _mm_empty
1513#define _m_from_int _mm_cvtsi32_si64
1514#define _m_from_int64 _mm_cvtsi64_m64
1515#define _m_to_int _mm_cvtsi64_si32
1516#define _m_to_int64 _mm_cvtm64_si64
1517#define _m_packsswb _mm_packs_pi16
1518#define _m_packssdw _mm_packs_pi32
1519#define _m_packuswb _mm_packs_pu16
1520#define _m_punpckhbw _mm_unpackhi_pi8
1521#define _m_punpckhwd _mm_unpackhi_pi16
1522#define _m_punpckhdq _mm_unpackhi_pi32
1523#define _m_punpcklbw _mm_unpacklo_pi8
1524#define _m_punpcklwd _mm_unpacklo_pi16
1525#define _m_punpckldq _mm_unpacklo_pi32
1526#define _m_paddb _mm_add_pi8
1527#define _m_paddw _mm_add_pi16
1528#define _m_paddd _mm_add_pi32
1529#define _m_paddsb _mm_adds_pi8
1530#define _m_paddsw _mm_adds_pi16
1531#define _m_paddusb _mm_adds_pu8
1532#define _m_paddusw _mm_adds_pu16
1533#define _m_psubb _mm_sub_pi8
1534#define _m_psubw _mm_sub_pi16
1535#define _m_psubd _mm_sub_pi32
1536#define _m_psubsb _mm_subs_pi8
1537#define _m_psubsw _mm_subs_pi16
1538#define _m_psubusb _mm_subs_pu8
1539#define _m_psubusw _mm_subs_pu16
1540#define _m_pmaddwd _mm_madd_pi16
1541#define _m_pmulhw _mm_mulhi_pi16
1542#define _m_pmullw _mm_mullo_pi16
1543#define _m_psllw _mm_sll_pi16
1544#define _m_psllwi _mm_slli_pi16
1545#define _m_pslld _mm_sll_pi32
1546#define _m_pslldi _mm_slli_pi32
1547#define _m_psllq _mm_sll_si64
1548#define _m_psllqi _mm_slli_si64
1549#define _m_psraw _mm_sra_pi16
1550#define _m_psrawi _mm_srai_pi16
1551#define _m_psrad _mm_sra_pi32
1552#define _m_psradi _mm_srai_pi32
1553#define _m_psrlw _mm_srl_pi16
1554#define _m_psrlwi _mm_srli_pi16
1555#define _m_psrld _mm_srl_pi32
1556#define _m_psrldi _mm_srli_pi32
1557#define _m_psrlq _mm_srl_si64
1558#define _m_psrlqi _mm_srli_si64
1559#define _m_pand _mm_and_si64
1560#define _m_pandn _mm_andnot_si64
1561#define _m_por _mm_or_si64
1562#define _m_pxor _mm_xor_si64
1563#define _m_pcmpeqb _mm_cmpeq_pi8
1564#define _m_pcmpeqw _mm_cmpeq_pi16
1565#define _m_pcmpeqd _mm_cmpeq_pi32
1566#define _m_pcmpgtb _mm_cmpgt_pi8
1567#define _m_pcmpgtw _mm_cmpgt_pi16
1568#define _m_pcmpgtd _mm_cmpgt_pi32
1569
1570#endif /* __MMINTRIN_H */
1571
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:1502
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:1430
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:1450
#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:1244
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:1472
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:1041
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:1099
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:1156
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:704
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:1345
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:772
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:1120
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:1200
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:1138
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:1395
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:1178
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:996
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _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_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:749
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:1222
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:973
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:1290
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:927
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:1060
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:904
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:951
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:726
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR _mm_setzero_si64(void)
Constructs a 64-bit integer vector initialized to zero.
Definition mmintrin.h:1303
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_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:1018
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:857
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:836
#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:1323
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:1082
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:1413
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:880
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:794
#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:1375
#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:1268
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:817