Lines Matching +full:x +full:- +full:mask +full:-
1 /*===---- smmintrin.h - SSE4 intrinsics ------------------------------------===
5 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 *===-----------------------------------------------------------------------===
22 __target__("sse4.1,no-evex512"), __min_vector_width__(128)))
41 /// Rounds up each element of the 128-bit vector of [4 x float] to an
42 /// integer and returns the rounded values in a 128-bit vector of
43 /// [4 x float].
48 /// __m128 _mm_ceil_ps(__m128 X);
53 /// \param X
54 /// A 128-bit vector of [4 x float] values to be rounded up.
55 /// \returns A 128-bit vector of [4 x float] containing the rounded values.
56 #define _mm_ceil_ps(X) _mm_round_ps((X), _MM_FROUND_CEIL) argument
58 /// Rounds up each element of the 128-bit vector of [2 x double] to an
59 /// integer and returns the rounded values in a 128-bit vector of
60 /// [2 x double].
65 /// __m128d _mm_ceil_pd(__m128d X);
70 /// \param X
71 /// A 128-bit vector of [2 x double] values to be rounded up.
72 /// \returns A 128-bit vector of [2 x double] containing the rounded values.
73 #define _mm_ceil_pd(X) _mm_round_pd((X), _MM_FROUND_CEIL) argument
75 /// Copies three upper elements of the first 128-bit vector operand to
76 /// the corresponding three upper elements of the 128-bit result vector of
77 /// [4 x float]. Rounds up the lowest element of the second 128-bit vector
78 /// operand to an integer and copies it to the lowest element of the 128-bit
79 /// result vector of [4 x float].
84 /// __m128 _mm_ceil_ss(__m128 X, __m128 Y);
89 /// \param X
90 /// A 128-bit vector of [4 x float]. The values stored in bits [127:32] are
93 /// A 128-bit vector of [4 x float]. The value stored in bits [31:0] is
96 /// \returns A 128-bit vector of [4 x float] containing the copied and rounded
98 #define _mm_ceil_ss(X, Y) _mm_round_ss((X), (Y), _MM_FROUND_CEIL) argument
100 /// Copies the upper element of the first 128-bit vector operand to the
101 /// corresponding upper element of the 128-bit result vector of [2 x double].
102 /// Rounds up the lower element of the second 128-bit vector operand to an
103 /// integer and copies it to the lower element of the 128-bit result vector
104 /// of [2 x double].
109 /// __m128d _mm_ceil_sd(__m128d X, __m128d Y);
114 /// \param X
115 /// A 128-bit vector of [2 x double]. The value stored in bits [127:64] is
118 /// A 128-bit vector of [2 x double]. The value stored in bits [63:0] is
121 /// \returns A 128-bit vector of [2 x double] containing the copied and rounded
123 #define _mm_ceil_sd(X, Y) _mm_round_sd((X), (Y), _MM_FROUND_CEIL) argument
125 /// Rounds down each element of the 128-bit vector of [4 x float] to an
126 /// an integer and returns the rounded values in a 128-bit vector of
127 /// [4 x float].
132 /// __m128 _mm_floor_ps(__m128 X);
137 /// \param X
138 /// A 128-bit vector of [4 x float] values to be rounded down.
139 /// \returns A 128-bit vector of [4 x float] containing the rounded values.
140 #define _mm_floor_ps(X) _mm_round_ps((X), _MM_FROUND_FLOOR) argument
142 /// Rounds down each element of the 128-bit vector of [2 x double] to an
143 /// integer and returns the rounded values in a 128-bit vector of
144 /// [2 x double].
149 /// __m128d _mm_floor_pd(__m128d X);
154 /// \param X
155 /// A 128-bit vector of [2 x double].
156 /// \returns A 128-bit vector of [2 x double] containing the rounded values.
157 #define _mm_floor_pd(X) _mm_round_pd((X), _MM_FROUND_FLOOR) argument
159 /// Copies three upper elements of the first 128-bit vector operand to
160 /// the corresponding three upper elements of the 128-bit result vector of
161 /// [4 x float]. Rounds down the lowest element of the second 128-bit vector
162 /// operand to an integer and copies it to the lowest element of the 128-bit
163 /// result vector of [4 x float].
168 /// __m128 _mm_floor_ss(__m128 X, __m128 Y);
173 /// \param X
174 /// A 128-bit vector of [4 x float]. The values stored in bits [127:32] are
177 /// A 128-bit vector of [4 x float]. The value stored in bits [31:0] is
180 /// \returns A 128-bit vector of [4 x float] containing the copied and rounded
182 #define _mm_floor_ss(X, Y) _mm_round_ss((X), (Y), _MM_FROUND_FLOOR) argument
184 /// Copies the upper element of the first 128-bit vector operand to the
185 /// corresponding upper element of the 128-bit result vector of [2 x double].
186 /// Rounds down the lower element of the second 128-bit vector operand to an
187 /// integer and copies it to the lower element of the 128-bit result vector
188 /// of [2 x double].
193 /// __m128d _mm_floor_sd(__m128d X, __m128d Y);
198 /// \param X
199 /// A 128-bit vector of [2 x double]. The value stored in bits [127:64] is
202 /// A 128-bit vector of [2 x double]. The value stored in bits [63:0] is
205 /// \returns A 128-bit vector of [2 x double] containing the copied and rounded
207 #define _mm_floor_sd(X, Y) _mm_round_sd((X), (Y), _MM_FROUND_FLOOR) argument
209 /// Rounds each element of the 128-bit vector of [4 x float] to an
211 /// argument and returns the rounded values in a 128-bit vector of
212 /// [4 x float].
217 /// __m128 _mm_round_ps(__m128 X, const int M);
222 /// \param X
223 /// A 128-bit vector of [4 x float].
238 /// \returns A 128-bit vector of [4 x float] containing the rounded values.
239 #define _mm_round_ps(X, M) \ argument
240 ((__m128)__builtin_ia32_roundps((__v4sf)(__m128)(X), (M)))
242 /// Copies three upper elements of the first 128-bit vector operand to
243 /// the corresponding three upper elements of the 128-bit result vector of
244 /// [4 x float]. Rounds the lowest element of the second 128-bit vector
246 /// by the third argument and copies it to the lowest element of the 128-bit
247 /// result vector of [4 x float].
252 /// __m128 _mm_round_ss(__m128 X, __m128 Y, const int M);
257 /// \param X
258 /// A 128-bit vector of [4 x float]. The values stored in bits [127:32] are
261 /// A 128-bit vector of [4 x float]. The value stored in bits [31:0] is
278 /// \returns A 128-bit vector of [4 x float] containing the copied and rounded
280 #define _mm_round_ss(X, Y, M) \ argument
281 ((__m128)__builtin_ia32_roundss((__v4sf)(__m128)(X), (__v4sf)(__m128)(Y), \
284 /// Rounds each element of the 128-bit vector of [2 x double] to an
286 /// argument and returns the rounded values in a 128-bit vector of
287 /// [2 x double].
292 /// __m128d _mm_round_pd(__m128d X, const int M);
297 /// \param X
298 /// A 128-bit vector of [2 x double].
313 /// \returns A 128-bit vector of [2 x double] containing the rounded values.
314 #define _mm_round_pd(X, M) \ argument
315 ((__m128d)__builtin_ia32_roundpd((__v2df)(__m128d)(X), (M)))
317 /// Copies the upper element of the first 128-bit vector operand to the
318 /// corresponding upper element of the 128-bit result vector of [2 x double].
319 /// Rounds the lower element of the second 128-bit vector operand to an
321 /// argument and copies it to the lower element of the 128-bit result vector
322 /// of [2 x double].
327 /// __m128d _mm_round_sd(__m128d X, __m128d Y, const int M);
332 /// \param X
333 /// A 128-bit vector of [2 x double]. The value stored in bits [127:64] is
336 /// A 128-bit vector of [2 x double]. The value stored in bits [63:0] is
353 /// \returns A 128-bit vector of [2 x double] containing the copied and rounded
355 #define _mm_round_sd(X, Y, M) \ argument
356 ((__m128d)__builtin_ia32_roundsd((__v2df)(__m128d)(X), (__v2df)(__m128d)(Y), \
360 /// Returns a 128-bit vector of [2 x double] where the values are
362 /// third operand, the control mask.
373 /// A 128-bit vector of [2 x double].
375 /// A 128-bit vector of [2 x double].
377 /// An immediate integer operand, with mask bits [1:0] specifying how the
378 /// values are to be copied. The position of the mask bit corresponds to the
379 /// index of a copied value. When a mask bit is 0, the corresponding 64-bit
381 /// When a mask bit is 1, the corresponding 64-bit element in operand \a V2
383 /// \returns A 128-bit vector of [2 x double] containing the copied values.
388 /// Returns a 128-bit vector of [4 x float] where the values are selected
390 /// operand, the control mask.
401 /// A 128-bit vector of [4 x float].
403 /// A 128-bit vector of [4 x float].
405 /// An immediate integer operand, with mask bits [3:0] specifying how the
406 /// values are to be copied. The position of the mask bit corresponds to the
407 /// index of a copied value. When a mask bit is 0, the corresponding 32-bit
409 /// When a mask bit is 1, the corresponding 32-bit element in operand \a V2
411 /// \returns A 128-bit vector of [4 x float] containing the copied values.
416 /// Returns a 128-bit vector of [2 x double] where the values are
418 /// third operand, the control mask.
425 /// A 128-bit vector of [2 x double].
427 /// A 128-bit vector of [2 x double].
429 /// A 128-bit vector operand, with mask bits 127 and 63 specifying how the
430 /// values are to be copied. The position of the mask bit corresponds to the
431 /// most significant bit of a copied value. When a mask bit is 0, the
432 /// corresponding 64-bit element in operand \a __V1 is copied to the same
433 /// position in the result. When a mask bit is 1, the corresponding 64-bit
435 /// \returns A 128-bit vector of [2 x double] containing the copied values.
443 /// Returns a 128-bit vector of [4 x float] where the values are
445 /// third operand, the control mask.
452 /// A 128-bit vector of [4 x float].
454 /// A 128-bit vector of [4 x float].
456 /// A 128-bit vector operand, with mask bits 127, 95, 63, and 31 specifying
457 /// how the values are to be copied. The position of the mask bit corresponds
458 /// to the most significant bit of a copied value. When a mask bit is 0, the
459 /// corresponding 32-bit element in operand \a __V1 is copied to the same
460 /// position in the result. When a mask bit is 1, the corresponding 32-bit
462 /// \returns A 128-bit vector of [4 x float] containing the copied values.
470 /// Returns a 128-bit vector of [16 x i8] where the values are selected
472 /// operand, the control mask.
479 /// A 128-bit vector of [16 x i8].
481 /// A 128-bit vector of [16 x i8].
483 /// A 128-bit vector operand, with mask bits 127, 119, 111...7 specifying
484 /// how the values are to be copied. The position of the mask bit corresponds
485 /// to the most significant bit of a copied value. When a mask bit is 0, the
486 /// corresponding 8-bit element in operand \a __V1 is copied to the same
487 /// position in the result. When a mask bit is 1, the corresponding 8-bit
489 /// \returns A 128-bit vector of [16 x i8] containing the copied values.
497 /// Returns a 128-bit vector of [8 x i16] where the values are selected
499 /// operand, the control mask.
510 /// A 128-bit vector of [8 x i16].
512 /// A 128-bit vector of [8 x i16].
514 /// An immediate integer operand, with mask bits [7:0] specifying how the
515 /// values are to be copied. The position of the mask bit corresponds to the
516 /// index of a copied value. When a mask bit is 0, the corresponding 16-bit
518 /// When a mask bit is 1, the corresponding 16-bit element in operand \a V2
520 /// \returns A 128-bit vector of [8 x i16] containing the copied values.
526 /// Multiples corresponding elements of two 128-bit vectors of [4 x i32]
527 /// and returns the lower 32 bits of the each product in a 128-bit vector of
528 /// [4 x i32].
535 /// A 128-bit integer vector.
537 /// A 128-bit integer vector.
538 /// \returns A 128-bit integer vector containing the products of both operands.
544 /// Multiplies corresponding even-indexed elements of two 128-bit
545 /// vectors of [4 x i32] and returns a 128-bit vector of [2 x i64]
553 /// A 128-bit vector of [4 x i32].
555 /// A 128-bit vector of [4 x i32].
556 /// \returns A 128-bit vector of [2 x i64] containing the products of both
564 /// Computes the dot product of the two 128-bit vectors of [4 x float]
565 /// and returns it in the elements of the 128-bit result vector of
566 /// [4 x float].
575 /// __m128 _mm_dp_ps(__m128 X, __m128 Y, const int M);
580 /// \param X
581 /// A 128-bit vector of [4 x float].
583 /// A 128-bit vector of [4 x float].
585 /// An immediate integer operand. Mask bits [7:4] determine which elements
587 /// element and bit [7] corresponding to the highest element of each [4 x
593 /// each [4 x float] subvector. If a bit is set, the dot product is returned
595 /// \returns A 128-bit vector of [4 x float] containing the dot product.
596 #define _mm_dp_ps(X, Y, M) \ argument
597 ((__m128)__builtin_ia32_dpps((__v4sf)(__m128)(X), (__v4sf)(__m128)(Y), (M)))
599 /// Computes the dot product of the two 128-bit vectors of [2 x double]
600 /// and returns it in the elements of the 128-bit result vector of
601 /// [2 x double].
610 /// __m128d _mm_dp_pd(__m128d X, __m128d Y, const int M);
615 /// \param X
616 /// A 128-bit vector of [2 x double].
618 /// A 128-bit vector of [2 x double].
620 /// An immediate integer operand. Mask bits [5:4] determine which elements
622 /// element and bit [5] corresponding to the highest element of each of [2 x
628 /// each [2 x double] vector. If a bit is set, the dot product is returned in
630 #define _mm_dp_pd(X, Y, M) \ argument
631 ((__m128d)__builtin_ia32_dppd((__v2df)(__m128d)(X), (__v2df)(__m128d)(Y), \
635 /// Loads integer values from a 128-bit aligned memory location to a
636 /// 128-bit integer vector.
643 /// A pointer to a 128-bit aligned memory location that contains the integer
645 /// \returns A 128-bit integer vector containing the data stored at the
653 /// Compares the corresponding elements of two 128-bit vectors of
654 /// [16 x i8] and returns a 128-bit vector of [16 x i8] containing the lesser
662 /// A 128-bit vector of [16 x i8].
664 /// A 128-bit vector of [16 x i8]
665 /// \returns A 128-bit vector of [16 x i8] containing the lesser values.
671 /// Compares the corresponding elements of two 128-bit vectors of
672 /// [16 x i8] and returns a 128-bit vector of [16 x i8] containing the
680 /// A 128-bit vector of [16 x i8].
682 /// A 128-bit vector of [16 x i8].
683 /// \returns A 128-bit vector of [16 x i8] containing the greater values.
689 /// Compares the corresponding elements of two 128-bit vectors of
690 /// [8 x u16] and returns a 128-bit vector of [8 x u16] containing the lesser
698 /// A 128-bit vector of [8 x u16].
700 /// A 128-bit vector of [8 x u16].
701 /// \returns A 128-bit vector of [8 x u16] containing the lesser values.
707 /// Compares the corresponding elements of two 128-bit vectors of
708 /// [8 x u16] and returns a 128-bit vector of [8 x u16] containing the
716 /// A 128-bit vector of [8 x u16].
718 /// A 128-bit vector of [8 x u16].
719 /// \returns A 128-bit vector of [8 x u16] containing the greater values.
725 /// Compares the corresponding elements of two 128-bit vectors of
726 /// [4 x i32] and returns a 128-bit vector of [4 x i32] containing the lesser
734 /// A 128-bit vector of [4 x i32].
736 /// A 128-bit vector of [4 x i32].
737 /// \returns A 128-bit vector of [4 x i32] containing the lesser values.
743 /// Compares the corresponding elements of two 128-bit vectors of
744 /// [4 x i32] and returns a 128-bit vector of [4 x i32] containing the
752 /// A 128-bit vector of [4 x i32].
754 /// A 128-bit vector of [4 x i32].
755 /// \returns A 128-bit vector of [4 x i32] containing the greater values.
761 /// Compares the corresponding elements of two 128-bit vectors of
762 /// [4 x u32] and returns a 128-bit vector of [4 x u32] containing the lesser
770 /// A 128-bit vector of [4 x u32].
772 /// A 128-bit vector of [4 x u32].
773 /// \returns A 128-bit vector of [4 x u32] containing the lesser values.
779 /// Compares the corresponding elements of two 128-bit vectors of
780 /// [4 x u32] and returns a 128-bit vector of [4 x u32] containing the
788 /// A 128-bit vector of [4 x u32].
790 /// A 128-bit vector of [4 x u32].
791 /// \returns A 128-bit vector of [4 x u32] containing the greater values.
798 /// Takes the first argument \a X and inserts an element from the second
801 /// resulting 128-bit vector of [4 x float] is then returned.
806 /// __m128 _mm_insert_ps(__m128 X, __m128 Y, const int N);
811 /// \param X
812 /// A 128-bit vector source operand of [4 x float]. With the exception of
816 /// A 128-bit vector source operand of [4 x float]. One single-precision
817 /// floating-point element from this source, as determined by the immediate
836 /// \returns A 128-bit vector of [4 x float] containing the copied
837 /// single-precision floating point elements from the operands.
838 #define _mm_insert_ps(X, Y, N) __builtin_ia32_insertps128((X), (Y), (N)) argument
840 /// Extracts a 32-bit integer from a 128-bit vector of [4 x float] and
846 /// int _mm_extract_ps(__m128 X, const int N);
852 /// \param X
853 /// A 128-bit vector of [4 x float].
856 /// \a X are extracted and returned: \n
857 /// 00: Bits [31:0] of parameter \a X are returned. \n
858 /// 01: Bits [63:32] of parameter \a X are returned. \n
859 /// 10: Bits [95:64] of parameter \a X are returned. \n
860 /// 11: Bits [127:96] of parameter \a X are returned.
861 /// \returns A 32-bit integer containing the extracted 32 bits of float data.
862 #define _mm_extract_ps(X, N) \ argument
864 int, __builtin_ia32_vec_ext_v4sf((__v4sf)(__m128)(X), (int)(N)))
867 /* Extract a single-precision float from X at index N into D. */
868 #define _MM_EXTRACT_FLOAT(D, X, N) \ argument
870 (D) = __builtin_ia32_vec_ext_v4sf((__v4sf)(__m128)(X), (int)(N)); \
873 /* Or together 2 sets of indexes (X and Y) with the zeroing bits (Z) to create
875 #define _MM_MK_INSERTPS_NDX(X, Y, Z) (((X) << 6) | ((Y) << 4) | (Z)) argument
877 /* Extract a float from X at index N into the first index of the return. */
878 #define _MM_PICK_OUT_PS(X, N) \ argument
879 _mm_insert_ps(_mm_setzero_ps(), (X), _MM_MK_INSERTPS_NDX((N), 0, 0x0e))
882 /// Constructs a 128-bit vector of [16 x i8] by first making a copy of
883 /// the 128-bit integer vector parameter, and then inserting the lower 8 bits
890 /// __m128i _mm_insert_epi8(__m128i X, int I, const int N);
895 /// \param X
896 /// A 128-bit integer vector of [16 x i8]. This vector is copied to the
921 /// \returns A 128-bit integer vector containing the constructed values.
922 #define _mm_insert_epi8(X, I, N) \ argument
923 ((__m128i)__builtin_ia32_vec_set_v16qi((__v16qi)(__m128i)(X), (int)(I), \
926 /// Constructs a 128-bit vector of [4 x i32] by first making a copy of
927 /// the 128-bit integer vector parameter, and then inserting the 32-bit
934 /// __m128i _mm_insert_epi32(__m128i X, int I, const int N);
939 /// \param X
940 /// A 128-bit integer vector of [4 x i32]. This vector is copied to the
944 /// A 32-bit integer that is written to the result beginning at the offset
953 /// \returns A 128-bit integer vector containing the constructed values.
954 #define _mm_insert_epi32(X, I, N) \ argument
955 ((__m128i)__builtin_ia32_vec_set_v4si((__v4si)(__m128i)(X), (int)(I), \
959 /// Constructs a 128-bit vector of [2 x i64] by first making a copy of
960 /// the 128-bit integer vector parameter, and then inserting the 64-bit
967 /// __m128i _mm_insert_epi64(__m128i X, long long I, const int N);
972 /// \param X
973 /// A 128-bit integer vector of [2 x i64]. This vector is copied to the
977 /// A 64-bit integer that is written to the result beginning at the offset
984 /// \returns A 128-bit integer vector containing the constructed values.
985 #define _mm_insert_epi64(X, I, N) \ argument
986 ((__m128i)__builtin_ia32_vec_set_v2di((__v2di)(__m128i)(X), (long long)(I), \
993 /// Extracts an 8-bit element from the 128-bit integer vector of
994 /// [16 x i8], using the immediate value parameter \a N as a selector.
999 /// int _mm_extract_epi8(__m128i X, const int N);
1004 /// \param X
1005 /// A 128-bit integer vector.
1007 /// An immediate value. Bits [3:0] specify which 8-bit vector element from
1008 /// the argument \a X to extract and copy to the result. \n
1009 /// 0000: Bits [7:0] of parameter \a X are extracted. \n
1010 /// 0001: Bits [15:8] of the parameter \a X are extracted. \n
1011 /// 0010: Bits [23:16] of the parameter \a X are extracted. \n
1012 /// 0011: Bits [31:24] of the parameter \a X are extracted. \n
1013 /// 0100: Bits [39:32] of the parameter \a X are extracted. \n
1014 /// 0101: Bits [47:40] of the parameter \a X are extracted. \n
1015 /// 0110: Bits [55:48] of the parameter \a X are extracted. \n
1016 /// 0111: Bits [63:56] of the parameter \a X are extracted. \n
1017 /// 1000: Bits [71:64] of the parameter \a X are extracted. \n
1018 /// 1001: Bits [79:72] of the parameter \a X are extracted. \n
1019 /// 1010: Bits [87:80] of the parameter \a X are extracted. \n
1020 /// 1011: Bits [95:88] of the parameter \a X are extracted. \n
1021 /// 1100: Bits [103:96] of the parameter \a X are extracted. \n
1022 /// 1101: Bits [111:104] of the parameter \a X are extracted. \n
1023 /// 1110: Bits [119:112] of the parameter \a X are extracted. \n
1024 /// 1111: Bits [127:120] of the parameter \a X are extracted.
1026 /// 128-bit integer vector parameter and the remaining bits are assigned
1028 #define _mm_extract_epi8(X, N) \ argument
1029 ((int)(unsigned char)__builtin_ia32_vec_ext_v16qi((__v16qi)(__m128i)(X), \
1032 /// Extracts a 32-bit element from the 128-bit integer vector of
1033 /// [4 x i32], using the immediate value parameter \a N as a selector.
1038 /// int _mm_extract_epi32(__m128i X, const int N);
1043 /// \param X
1044 /// A 128-bit integer vector.
1046 /// An immediate value. Bits [1:0] specify which 32-bit vector element from
1047 /// the argument \a X to extract and copy to the result. \n
1048 /// 00: Bits [31:0] of the parameter \a X are extracted. \n
1049 /// 01: Bits [63:32] of the parameter \a X are extracted. \n
1050 /// 10: Bits [95:64] of the parameter \a X are extracted. \n
1051 /// 11: Bits [127:96] of the parameter \a X are exracted.
1052 /// \returns An integer, whose lower 32 bits are selected from the 128-bit
1054 #define _mm_extract_epi32(X, N) \ argument
1055 ((int)__builtin_ia32_vec_ext_v4si((__v4si)(__m128i)(X), (int)(N)))
1057 /// Extracts a 64-bit element from the 128-bit integer vector of
1058 /// [2 x i64], using the immediate value parameter \a N as a selector.
1063 /// long long _mm_extract_epi64(__m128i X, const int N);
1067 /// in 64-bit mode.
1069 /// \param X
1070 /// A 128-bit integer vector.
1072 /// An immediate value. Bit [0] specifies which 64-bit vector element from
1073 /// the argument \a X to return. \n
1076 /// \returns A 64-bit integer.
1077 #define _mm_extract_epi64(X, N) \ argument
1078 ((long long)__builtin_ia32_vec_ext_v2di((__v2di)(__m128i)(X), (int)(N)))
1080 /* SSE4 128-bit Packed Integer Comparisons. */
1081 /// Tests whether the specified bits in a 128-bit integer vector are all
1089 /// A 128-bit integer vector containing the bits to be tested.
1091 /// A 128-bit integer vector selecting which bits to test in operand \a __M.
1098 /// Tests whether the specified bits in a 128-bit integer vector are all
1106 /// A 128-bit integer vector containing the bits to be tested.
1108 /// A 128-bit integer vector selecting which bits to test in operand \a __M.
1115 /// Tests whether the specified bits in a 128-bit integer vector are
1123 /// A 128-bit integer vector containing the bits to be tested.
1125 /// A 128-bit integer vector selecting which bits to test in operand \a __M.
1133 /// Tests whether the specified bits in a 128-bit integer vector are all
1145 /// A 128-bit integer vector containing the bits to be tested.
1148 #define _mm_test_all_ones(V) _mm_testc_si128((V), _mm_set1_epi32(-1))
1150 /// Tests whether the specified bits in a 128-bit integer vector are
1162 /// A 128-bit integer vector containing the bits to be tested.
1164 /// A 128-bit integer vector selecting which bits to test in operand \a M.
1169 /// Tests whether the specified bits in a 128-bit integer vector are all
1181 /// A 128-bit integer vector containing the bits to be tested.
1183 /// A 128-bit integer vector selecting which bits to test in operand \a M.
1187 /* SSE4 64-bit Packed Integer Comparisons. */
1188 /// Compares each of the corresponding 64-bit values of the 128-bit
1198 /// A 128-bit integer vector.
1200 /// A 128-bit integer vector.
1201 /// \returns A 128-bit integer vector containing the comparison results.
1207 /* SSE4 Packed Integer Sign-Extension. */
1208 /// Sign-extends each of the lower eight 8-bit integer elements of a
1209 /// 128-bit vector of [16 x i8] to 16-bit values and returns them in a
1210 /// 128-bit vector of [8 x i16]. The upper eight elements of the input vector
1218 /// A 128-bit vector of [16 x i8]. The lower eight 8-bit elements are
1219 /// sign-extended to 16-bit values.
1220 /// \returns A 128-bit vector of [8 x i16] containing the sign-extended values.
1230 /// Sign-extends each of the lower four 8-bit integer elements of a
1231 /// 128-bit vector of [16 x i8] to 32-bit values and returns them in a
1232 /// 128-bit vector of [4 x i32]. The upper twelve elements of the input
1240 /// A 128-bit vector of [16 x i8]. The lower four 8-bit elements are
1241 /// sign-extended to 32-bit values.
1242 /// \returns A 128-bit vector of [4 x i32] containing the sign-extended values.
1250 /// Sign-extends each of the lower two 8-bit integer elements of a
1251 /// 128-bit integer vector of [16 x i8] to 64-bit values and returns them in
1252 /// a 128-bit vector of [2 x i64]. The upper fourteen elements of the input
1260 /// A 128-bit vector of [16 x i8]. The lower two 8-bit elements are
1261 /// sign-extended to 64-bit values.
1262 /// \returns A 128-bit vector of [2 x i64] containing the sign-extended values.
1270 /// Sign-extends each of the lower four 16-bit integer elements of a
1271 /// 128-bit integer vector of [8 x i16] to 32-bit values and returns them in
1272 /// a 128-bit vector of [4 x i32]. The upper four elements of the input
1280 /// A 128-bit vector of [8 x i16]. The lower four 16-bit elements are
1281 /// sign-extended to 32-bit values.
1282 /// \returns A 128-bit vector of [4 x i32] containing the sign-extended values.
1288 /// Sign-extends each of the lower two 16-bit integer elements of a
1289 /// 128-bit integer vector of [8 x i16] to 64-bit values and returns them in
1290 /// a 128-bit vector of [2 x i64]. The upper six elements of the input
1298 /// A 128-bit vector of [8 x i16]. The lower two 16-bit elements are
1299 /// sign-extended to 64-bit values.
1300 /// \returns A 128-bit vector of [2 x i64] containing the sign-extended values.
1306 /// Sign-extends each of the lower two 32-bit integer elements of a
1307 /// 128-bit integer vector of [4 x i32] to 64-bit values and returns them in
1308 /// a 128-bit vector of [2 x i64]. The upper two elements of the input vector
1316 /// A 128-bit vector of [4 x i32]. The lower two 32-bit elements are
1317 /// sign-extended to 64-bit values.
1318 /// \returns A 128-bit vector of [2 x i64] containing the sign-extended values.
1324 /* SSE4 Packed Integer Zero-Extension. */
1325 /// Zero-extends each of the lower eight 8-bit integer elements of a
1326 /// 128-bit vector of [16 x i8] to 16-bit values and returns them in a
1327 /// 128-bit vector of [8 x i16]. The upper eight elements of the input vector
1335 /// A 128-bit vector of [16 x i8]. The lower eight 8-bit elements are
1336 /// zero-extended to 16-bit values.
1337 /// \returns A 128-bit vector of [8 x i16] containing the zero-extended values.
1345 /// Zero-extends each of the lower four 8-bit integer elements of a
1346 /// 128-bit vector of [16 x i8] to 32-bit values and returns them in a
1347 /// 128-bit vector of [4 x i32]. The upper twelve elements of the input
1355 /// A 128-bit vector of [16 x i8]. The lower four 8-bit elements are
1356 /// zero-extended to 32-bit values.
1357 /// \returns A 128-bit vector of [4 x i32] containing the zero-extended values.
1363 /// Zero-extends each of the lower two 8-bit integer elements of a
1364 /// 128-bit integer vector of [16 x i8] to 64-bit values and returns them in
1365 /// a 128-bit vector of [2 x i64]. The upper fourteen elements of the input
1373 /// A 128-bit vector of [16 x i8]. The lower two 8-bit elements are
1374 /// zero-extended to 64-bit values.
1375 /// \returns A 128-bit vector of [2 x i64] containing the zero-extended values.
1381 /// Zero-extends each of the lower four 16-bit integer elements of a
1382 /// 128-bit integer vector of [8 x i16] to 32-bit values and returns them in
1383 /// a 128-bit vector of [4 x i32]. The upper four elements of the input
1391 /// A 128-bit vector of [8 x i16]. The lower four 16-bit elements are
1392 /// zero-extended to 32-bit values.
1393 /// \returns A 128-bit vector of [4 x i32] containing the zero-extended values.
1399 /// Zero-extends each of the lower two 16-bit integer elements of a
1400 /// 128-bit integer vector of [8 x i16] to 64-bit values and returns them in
1401 /// a 128-bit vector of [2 x i64]. The upper six elements of the input vector
1409 /// A 128-bit vector of [8 x i16]. The lower two 16-bit elements are
1410 /// zero-extended to 64-bit values.
1411 /// \returns A 128-bit vector of [2 x i64] containing the zero-extended values.
1417 /// Zero-extends each of the lower two 32-bit integer elements of a
1418 /// 128-bit integer vector of [4 x i32] to 64-bit values and returns them in
1419 /// a 128-bit vector of [2 x i64]. The upper two elements of the input vector
1427 /// A 128-bit vector of [4 x i32]. The lower two 32-bit elements are
1428 /// zero-extended to 64-bit values.
1429 /// \returns A 128-bit vector of [2 x i64] containing the zero-extended values.
1436 /// Converts, with saturation, 32-bit signed integers from both 128-bit integer
1437 /// vector operands into 16-bit unsigned integers, and returns the packed
1448 /// A 128-bit vector of [4 x i32]. The converted [4 x i16] values are
1451 /// A 128-bit vector of [4 x i32]. The converted [4 x i16] values are
1453 /// \returns A 128-bit vector of [8 x i16] containing the converted values.
1460 /// Subtracts 8-bit unsigned integer values and computes the absolute
1468 /// __m128i _mm_mpsadbw_epu8(__m128i X, __m128i Y, const int M);
1473 /// \param X
1474 /// A 128-bit vector of [16 x i8].
1476 /// A 128-bit vector of [16 x i8].
1478 /// An 8-bit immediate operand specifying how the absolute differences are to
1486 /// d0 = abs(X[i + k + 0] - Y[j + 0]);
1487 /// d1 = abs(X[i + k + 1] - Y[j + 1]);
1488 /// d2 = abs(X[i + k + 2] - Y[j + 2]);
1489 /// d3 = abs(X[i + k + 3] - Y[j + 3]);
1493 /// \returns A 128-bit integer vector containing the sums of the sets of
1495 #define _mm_mpsadbw_epu8(X, Y, M) \ argument
1496 ((__m128i)__builtin_ia32_mpsadbw128((__v16qi)(__m128i)(X), \
1499 /// Finds the minimum unsigned 16-bit element in the input 128-bit
1500 /// vector of [8 x u16] and returns it and along with its index.
1508 /// A 128-bit vector of [8 x u16].
1509 /// \returns A 128-bit value where bits [15:0] contain the minimum value found
1554 /// \a A and \a B. Returns a 128-bit integer vector representing the result
1555 /// mask of the comparison.
1567 /// A 128-bit integer vector containing one of the source operands to be
1570 /// A 128-bit integer vector containing one of the source operands to be
1573 /// An 8-bit immediate operand specifying whether the characters are bytes or
1585 /// basis is greater than or equal for even-indexed elements in \a A,
1586 /// and less than or equal for odd-indexed elements in \a A. \n
1591 /// mask of the comparison results. \n
1593 /// 01: Negate the bit mask. \n
1595 /// 11: Negate the bit mask only for bits with an index less than or equal
1597 /// Bit [6]: Determines whether the result is zero-extended or expanded to 16
1599 /// 0: The result is zero-extended to 16 bytes. \n
1602 /// \returns Returns a 128-bit integer vector representing the result mask of
1623 /// A 128-bit integer vector containing one of the source operands to be
1626 /// A 128-bit integer vector containing one of the source operands to be
1629 /// An 8-bit immediate operand specifying whether the characters are bytes or
1641 /// basis is greater than or equal for even-indexed elements in \a A,
1642 /// and less than or equal for odd-indexed elements in \a A. \n
1647 /// mask of the comparison results. \n
1649 /// 01: Negate the bit mask. \n
1651 /// 11: Negate the bit mask only for bits with an index less than or equal
1664 /// \a A and \a B. Returns a 128-bit integer vector representing the result
1665 /// mask of the comparison.
1677 /// A 128-bit integer vector containing one of the source operands to be
1682 /// A 128-bit integer vector containing one of the source operands to be
1687 /// An 8-bit immediate operand specifying whether the characters are bytes or
1699 /// basis is greater than or equal for even-indexed elements in \a A,
1700 /// and less than or equal for odd-indexed elements in \a A. \n
1705 /// mask of the comparison results. \n
1707 /// 01: Negate the bit mask. \n
1709 /// 11: Negate the bit mask only for bits with an index less than or equal
1711 /// Bit [6]: Determines whether the result is zero-extended or expanded to 16
1713 /// 0: The result is zero-extended to 16 bytes. \n
1716 /// \returns Returns a 128-bit integer vector representing the result mask of
1738 /// A 128-bit integer vector containing one of the source operands to be
1743 /// A 128-bit integer vector containing one of the source operands to be
1748 /// An 8-bit immediate operand specifying whether the characters are bytes or
1760 /// basis is greater than or equal for even-indexed elements in \a A,
1761 /// and less than or equal for odd-indexed elements in \a A. \n
1766 /// mask of the comparison results. \n
1768 /// 01: Negate the bit mask. \n
1770 /// 11: Negate the bit mask only for bits with an index less than or equal
1785 /// \a A and \a B. Returns 1 if the bit mask is zero and the length of the
1798 /// A 128-bit integer vector containing one of the source operands to be
1801 /// A 128-bit integer vector containing one of the source operands to be
1804 /// An 8-bit immediate operand specifying whether the characters are bytes or
1815 /// basis is greater than or equal for even-indexed elements in \a A,
1816 /// and less than or equal for odd-indexed elements in \a A. \n
1821 /// mask of the comparison results. \n
1823 /// 01: Negate the bit mask. \n
1825 /// 11: Negate the bit mask only for bits with an index less than or equal
1827 /// \returns Returns 1 if the bit mask is zero and the length of the string in
1835 /// \a A and \a B. Returns 1 if the bit mask is non-zero, otherwise, returns
1848 /// A 128-bit integer vector containing one of the source operands to be
1851 /// A 128-bit integer vector containing one of the source operands to be
1854 /// An 8-bit immediate operand specifying whether the characters are bytes or
1865 /// basis is greater than or equal for even-indexed elements in \a A,
1866 /// and less than or equal for odd-indexed elements in \a A. \n
1871 /// mask of the comparison results. \n
1873 /// 01: Negate the bit mask. \n
1875 /// 11: Negate the bit mask only for bits with an index less than or equal
1877 /// \returns Returns 1 if the bit mask is non-zero, otherwise, returns 0.
1884 /// \a A and \a B. Returns bit 0 of the resulting bit mask.
1896 /// A 128-bit integer vector containing one of the source operands to be
1899 /// A 128-bit integer vector containing one of the source operands to be
1902 /// An 8-bit immediate operand specifying whether the characters are bytes or
1913 /// basis is greater than or equal for even-indexed elements in \a A,
1914 /// and less than or equal for odd-indexed elements in \a A. \n
1919 /// mask of the comparison results. \n
1921 /// 01: Negate the bit mask. \n
1923 /// 11: Negate the bit mask only for bits with an index less than or equal
1925 /// \returns Returns bit 0 of the resulting bit mask.
1945 /// A 128-bit integer vector containing one of the source operands to be
1948 /// A 128-bit integer vector containing one of the source operands to be
1951 /// An 8-bit immediate operand specifying whether the characters are bytes or
1962 /// basis is greater than or equal for even-indexed elements in \a A,
1963 /// and less than or equal for odd-indexed elements in \a A. \n
1968 /// mask of the comparison results. \n
1970 /// 01: Negate the bit mask. \n
1972 /// 11: Negate the bit mask only for bits with an index less than or equal
1995 /// A 128-bit integer vector containing one of the source operands to be
1998 /// A 128-bit integer vector containing one of the source operands to be
2001 /// An 8-bit immediate operand specifying whether the characters are bytes or
2012 /// basis is greater than or equal for even-indexed elements in \a A,
2013 /// and less than or equal for odd-indexed elements in \a A. \n
2018 /// mask of the comparison results. \n
2020 /// 01: Negate the bit mask. \n
2022 /// 11: Negate the bit mask only for bits with an index less than or equal
2032 /// \a A and \a B. Returns 1 if the bit mask is zero and the length of the
2045 /// A 128-bit integer vector containing one of the source operands to be
2050 /// A 128-bit integer vector containing one of the source operands to be
2055 /// An 8-bit immediate operand specifying whether the characters are bytes or
2066 /// basis is greater than or equal for even-indexed elements in \a A,
2067 /// and less than or equal for odd-indexed elements in \a A. \n
2072 /// mask of the comparison results. \n
2074 /// 01: Negate the bit mask. \n
2076 /// 11: Negate the bit mask only for bits with an index less than or equal
2078 /// \returns Returns 1 if the bit mask is zero and the length of the string in
2087 /// \a A and \a B. Returns 1 if the resulting mask is non-zero, otherwise,
2100 /// A 128-bit integer vector containing one of the source operands to be
2105 /// A 128-bit integer vector containing one of the source operands to be
2110 /// An 8-bit immediate operand specifying whether the characters are bytes or
2121 /// basis is greater than or equal for even-indexed elements in \a A,
2122 /// and less than or equal for odd-indexed elements in \a A. \n
2127 /// mask of the comparison results. \n
2129 /// 01: Negate the bit mask. \n
2131 /// 11: Negate the bit mask only for bits with an index less than or equal
2133 /// \returns Returns 1 if the resulting mask is non-zero, otherwise, returns 0.
2141 /// \a A and \a B. Returns bit 0 of the resulting bit mask.
2153 /// A 128-bit integer vector containing one of the source operands to be
2158 /// A 128-bit integer vector containing one of the source operands to be
2163 /// An 8-bit immediate operand specifying whether the characters are bytes or
2174 /// basis is greater than or equal for even-indexed elements in \a A,
2175 /// and less than or equal for odd-indexed elements in \a A. \n
2180 /// mask of the comparison results. \n
2182 /// 01: Negate the bit mask. \n
2184 /// 11: Negate the bit mask only for bits with an index less than or equal
2186 /// \returns Returns bit 0 of the resulting bit mask.
2207 /// A 128-bit integer vector containing one of the source operands to be
2212 /// A 128-bit integer vector containing one of the source operands to be
2217 /// An 8-bit immediate operand specifying whether the characters are bytes or
2228 /// basis is greater than or equal for even-indexed elements in \a A,
2229 /// and less than or equal for odd-indexed elements in \a A. \n
2234 /// mask of the comparison results. \n
2236 /// 01: Negate the bit mask. \n
2238 /// 11: Negate the bit mask only for bits with an index less than or equal
2261 /// A 128-bit integer vector containing one of the source operands to be
2266 /// A 128-bit integer vector containing one of the source operands to be
2271 /// An 8-bit immediate operand specifying whether the characters are bytes or
2282 /// basis is greater than or equal for even-indexed elements in \a A,
2283 /// and less than or equal for odd-indexed elements in \a A. \n
2288 /// mask of the comparison results. \n
2290 /// 01: Negate the bit mask. \n
2292 /// 11: Negate the bit mask only for bits with an index less than or equal
2301 /* SSE4.2 Compare Packed Data -- Greater Than. */
2302 /// Compares each of the corresponding 64-bit values of the 128-bit
2313 /// A 128-bit integer vector.
2315 /// A 128-bit integer vector.
2316 /// \returns A 128-bit integer vector containing the comparison results.