Benjamin Kramer | ae8ea1f | 2010-08-20 16:47:17 +0000 | [diff] [blame] | 1 | /*===---- emmintrin.h - SSE2 intrinsics ------------------------------------=== |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 2 | * |
| 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 4 | * of this software and associated documentation files (the "Software"), to deal |
| 5 | * in the Software without restriction, including without limitation the rights |
| 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 7 | * copies of the Software, and to permit persons to whom the Software is |
| 8 | * furnished to do so, subject to the following conditions: |
| 9 | * |
| 10 | * The above copyright notice and this permission notice shall be included in |
| 11 | * all copies or substantial portions of the Software. |
| 12 | * |
| 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 19 | * THE SOFTWARE. |
| 20 | * |
| 21 | *===-----------------------------------------------------------------------=== |
| 22 | */ |
Benjamin Kramer | ae8ea1f | 2010-08-20 16:47:17 +0000 | [diff] [blame] | 23 | |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 24 | #ifndef __EMMINTRIN_H |
| 25 | #define __EMMINTRIN_H |
| 26 | |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 27 | #include <xmmintrin.h> |
| 28 | |
| 29 | typedef double __m128d __attribute__((__vector_size__(16))); |
| 30 | typedef long long __m128i __attribute__((__vector_size__(16))); |
| 31 | |
Eric Christopher | 2a9898f | 2010-08-26 02:09:25 +0000 | [diff] [blame] | 32 | /* Type defines. */ |
| 33 | typedef double __v2df __attribute__ ((__vector_size__ (16))); |
| 34 | typedef long long __v2di __attribute__ ((__vector_size__ (16))); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 35 | typedef short __v8hi __attribute__((__vector_size__(16))); |
Anders Carlsson | 327c8df | 2009-09-18 19:18:19 +0000 | [diff] [blame] | 36 | typedef char __v16qi __attribute__((__vector_size__(16))); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 37 | |
Simon Pilgrim | 6d1a0c4 | 2016-05-29 18:49:08 +0000 | [diff] [blame] | 38 | /* Unsigned types */ |
| 39 | typedef unsigned long long __v2du __attribute__ ((__vector_size__ (16))); |
Simon Pilgrim | 6d1a0c4 | 2016-05-29 18:49:08 +0000 | [diff] [blame] | 40 | typedef unsigned short __v8hu __attribute__((__vector_size__(16))); |
| 41 | typedef unsigned char __v16qu __attribute__((__vector_size__(16))); |
| 42 | |
Chandler Carruth | cbe6411 | 2015-10-01 23:40:12 +0000 | [diff] [blame] | 43 | /* We need an explicitly signed variant for char. Note that this shouldn't |
| 44 | * appear in the interface though. */ |
| 45 | typedef signed char __v16qs __attribute__((__vector_size__(16))); |
| 46 | |
Michael Kuperstein | a10dff9 | 2015-09-21 13:34:47 +0000 | [diff] [blame] | 47 | #include <f16cintrin.h> |
| 48 | |
Eric Christopher | 4d185168 | 2015-06-17 07:09:20 +0000 | [diff] [blame] | 49 | /* Define the default attributes for the functions in this file. */ |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 50 | #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) |
Eric Christopher | 4d185168 | 2015-06-17 07:09:20 +0000 | [diff] [blame] | 51 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 52 | /// \brief Adds lower double-precision values in both operands and returns the |
| 53 | /// sum in the lower 64 bits of the result. The upper 64 bits of the result |
| 54 | /// are copied from the upper double-precision value of the first operand. |
| 55 | /// |
| 56 | /// \headerfile <x86intrin.h> |
| 57 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 58 | /// This intrinsic corresponds to the <c> VADDSD / ADDSD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 59 | /// |
| 60 | /// \param __a |
| 61 | /// A 128-bit vector of [2 x double] containing one of the source operands. |
| 62 | /// \param __b |
| 63 | /// A 128-bit vector of [2 x double] containing one of the source operands. |
| 64 | /// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the |
| 65 | /// sum of the lower 64 bits of both operands. The upper 64 bits are copied |
| 66 | /// from the upper 64 bits of the first source operand. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 67 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 68 | _mm_add_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 69 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 70 | __a[0] += __b[0]; |
| 71 | return __a; |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 72 | } |
| 73 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 74 | /// \brief Adds two 128-bit vectors of [2 x double]. |
| 75 | /// |
| 76 | /// \headerfile <x86intrin.h> |
| 77 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 78 | /// This intrinsic corresponds to the <c> VADDPD / ADDPD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 79 | /// |
| 80 | /// \param __a |
| 81 | /// A 128-bit vector of [2 x double] containing one of the source operands. |
| 82 | /// \param __b |
| 83 | /// A 128-bit vector of [2 x double] containing one of the source operands. |
| 84 | /// \returns A 128-bit vector of [2 x double] containing the sums of both |
| 85 | /// operands. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 86 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 87 | _mm_add_pd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 88 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 89 | return (__m128d)((__v2df)__a + (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 90 | } |
| 91 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 92 | /// \brief Subtracts the lower double-precision value of the second operand |
| 93 | /// from the lower double-precision value of the first operand and returns |
| 94 | /// the difference in the lower 64 bits of the result. The upper 64 bits of |
| 95 | /// the result are copied from the upper double-precision value of the first |
| 96 | /// operand. |
| 97 | /// |
| 98 | /// \headerfile <x86intrin.h> |
| 99 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 100 | /// This intrinsic corresponds to the <c> VSUBSD / SUBSD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 101 | /// |
| 102 | /// \param __a |
| 103 | /// A 128-bit vector of [2 x double] containing the minuend. |
| 104 | /// \param __b |
| 105 | /// A 128-bit vector of [2 x double] containing the subtrahend. |
| 106 | /// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the |
| 107 | /// difference of the lower 64 bits of both operands. The upper 64 bits are |
| 108 | /// copied from the upper 64 bits of the first source operand. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 109 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 110 | _mm_sub_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 111 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 112 | __a[0] -= __b[0]; |
| 113 | return __a; |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 114 | } |
| 115 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 116 | /// \brief Subtracts two 128-bit vectors of [2 x double]. |
| 117 | /// |
| 118 | /// \headerfile <x86intrin.h> |
| 119 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 120 | /// This intrinsic corresponds to the <c> VSUBPD / SUBPD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 121 | /// |
| 122 | /// \param __a |
| 123 | /// A 128-bit vector of [2 x double] containing the minuend. |
| 124 | /// \param __b |
| 125 | /// A 128-bit vector of [2 x double] containing the subtrahend. |
| 126 | /// \returns A 128-bit vector of [2 x double] containing the differences between |
| 127 | /// both operands. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 128 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 129 | _mm_sub_pd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 130 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 131 | return (__m128d)((__v2df)__a - (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 132 | } |
| 133 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 134 | /// \brief Multiplies lower double-precision values in both operands and returns |
| 135 | /// the product in the lower 64 bits of the result. The upper 64 bits of the |
| 136 | /// result are copied from the upper double-precision value of the first |
| 137 | /// operand. |
| 138 | /// |
| 139 | /// \headerfile <x86intrin.h> |
| 140 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 141 | /// This intrinsic corresponds to the <c> VMULSD / MULSD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 142 | /// |
| 143 | /// \param __a |
| 144 | /// A 128-bit vector of [2 x double] containing one of the source operands. |
| 145 | /// \param __b |
| 146 | /// A 128-bit vector of [2 x double] containing one of the source operands. |
| 147 | /// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the |
| 148 | /// product of the lower 64 bits of both operands. The upper 64 bits are |
| 149 | /// copied from the upper 64 bits of the first source operand. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 150 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 151 | _mm_mul_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 152 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 153 | __a[0] *= __b[0]; |
| 154 | return __a; |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 155 | } |
| 156 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 157 | /// \brief Multiplies two 128-bit vectors of [2 x double]. |
| 158 | /// |
| 159 | /// \headerfile <x86intrin.h> |
| 160 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 161 | /// This intrinsic corresponds to the <c> VMULPD / MULPD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 162 | /// |
| 163 | /// \param __a |
| 164 | /// A 128-bit vector of [2 x double] containing one of the operands. |
| 165 | /// \param __b |
| 166 | /// A 128-bit vector of [2 x double] containing one of the operands. |
| 167 | /// \returns A 128-bit vector of [2 x double] containing the products of both |
| 168 | /// operands. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 169 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 170 | _mm_mul_pd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 171 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 172 | return (__m128d)((__v2df)__a * (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 173 | } |
| 174 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 175 | /// \brief Divides the lower double-precision value of the first operand by the |
| 176 | /// lower double-precision value of the second operand and returns the |
| 177 | /// quotient in the lower 64 bits of the result. The upper 64 bits of the |
| 178 | /// result are copied from the upper double-precision value of the first |
| 179 | /// operand. |
| 180 | /// |
| 181 | /// \headerfile <x86intrin.h> |
| 182 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 183 | /// This intrinsic corresponds to the <c> VDIVSD / DIVSD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 184 | /// |
| 185 | /// \param __a |
| 186 | /// A 128-bit vector of [2 x double] containing the dividend. |
| 187 | /// \param __b |
| 188 | /// A 128-bit vector of [2 x double] containing divisor. |
| 189 | /// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the |
| 190 | /// quotient of the lower 64 bits of both operands. The upper 64 bits are |
| 191 | /// copied from the upper 64 bits of the first source operand. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 192 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 193 | _mm_div_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 194 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 195 | __a[0] /= __b[0]; |
| 196 | return __a; |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 197 | } |
| 198 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 199 | /// \brief Performs an element-by-element division of two 128-bit vectors of |
| 200 | /// [2 x double]. |
| 201 | /// |
| 202 | /// \headerfile <x86intrin.h> |
| 203 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 204 | /// This intrinsic corresponds to the <c> VDIVPD / DIVPD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 205 | /// |
| 206 | /// \param __a |
| 207 | /// A 128-bit vector of [2 x double] containing the dividend. |
| 208 | /// \param __b |
| 209 | /// A 128-bit vector of [2 x double] containing the divisor. |
| 210 | /// \returns A 128-bit vector of [2 x double] containing the quotients of both |
| 211 | /// operands. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 212 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 213 | _mm_div_pd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 214 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 215 | return (__m128d)((__v2df)__a / (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 216 | } |
| 217 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 218 | /// \brief Calculates the square root of the lower double-precision value of |
| 219 | /// the second operand and returns it in the lower 64 bits of the result. |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 220 | /// The upper 64 bits of the result are copied from the upper |
| 221 | /// double-precision value of the first operand. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 222 | /// |
| 223 | /// \headerfile <x86intrin.h> |
| 224 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 225 | /// This intrinsic corresponds to the <c> VSQRTSD / SQRTSD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 226 | /// |
| 227 | /// \param __a |
| 228 | /// A 128-bit vector of [2 x double] containing one of the operands. The |
| 229 | /// upper 64 bits of this operand are copied to the upper 64 bits of the |
| 230 | /// result. |
| 231 | /// \param __b |
| 232 | /// A 128-bit vector of [2 x double] containing one of the operands. The |
| 233 | /// square root is calculated using the lower 64 bits of this operand. |
| 234 | /// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 235 | /// square root of the lower 64 bits of operand \a __b, and whose upper 64 |
| 236 | /// bits are copied from the upper 64 bits of operand \a __a. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 237 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 238 | _mm_sqrt_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 239 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 240 | __m128d __c = __builtin_ia32_sqrtsd((__v2df)__b); |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 241 | return (__m128d) { __c[0], __a[1] }; |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 242 | } |
| 243 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 244 | /// \brief Calculates the square root of the each of two values stored in a |
| 245 | /// 128-bit vector of [2 x double]. |
| 246 | /// |
| 247 | /// \headerfile <x86intrin.h> |
| 248 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 249 | /// This intrinsic corresponds to the <c> VSQRTPD / SQRTPD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 250 | /// |
| 251 | /// \param __a |
| 252 | /// A 128-bit vector of [2 x double]. |
| 253 | /// \returns A 128-bit vector of [2 x double] containing the square roots of the |
| 254 | /// values in the operand. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 255 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 256 | _mm_sqrt_pd(__m128d __a) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 257 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 258 | return __builtin_ia32_sqrtpd((__v2df)__a); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 259 | } |
| 260 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 261 | /// \brief Compares lower 64-bit double-precision values of both operands, and |
| 262 | /// returns the lesser of the pair of values in the lower 64-bits of the |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 263 | /// result. The upper 64 bits of the result are copied from the upper |
| 264 | /// double-precision value of the first operand. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 265 | /// |
| 266 | /// \headerfile <x86intrin.h> |
| 267 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 268 | /// This intrinsic corresponds to the <c> VMINSD / MINSD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 269 | /// |
| 270 | /// \param __a |
| 271 | /// A 128-bit vector of [2 x double] containing one of the operands. The |
| 272 | /// lower 64 bits of this operand are used in the comparison. |
| 273 | /// \param __b |
| 274 | /// A 128-bit vector of [2 x double] containing one of the operands. The |
| 275 | /// lower 64 bits of this operand are used in the comparison. |
| 276 | /// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the |
| 277 | /// minimum value between both operands. The upper 64 bits are copied from |
| 278 | /// the upper 64 bits of the first source operand. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 279 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 280 | _mm_min_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 281 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 282 | return __builtin_ia32_minsd((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 283 | } |
| 284 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 285 | /// \brief Performs element-by-element comparison of the two 128-bit vectors of |
| 286 | /// [2 x double] and returns the vector containing the lesser of each pair of |
| 287 | /// values. |
| 288 | /// |
| 289 | /// \headerfile <x86intrin.h> |
| 290 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 291 | /// This intrinsic corresponds to the <c> VMINPD / MINPD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 292 | /// |
| 293 | /// \param __a |
| 294 | /// A 128-bit vector of [2 x double] containing one of the operands. |
| 295 | /// \param __b |
| 296 | /// A 128-bit vector of [2 x double] containing one of the operands. |
| 297 | /// \returns A 128-bit vector of [2 x double] containing the minimum values |
| 298 | /// between both operands. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 299 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 300 | _mm_min_pd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 301 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 302 | return __builtin_ia32_minpd((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 303 | } |
| 304 | |
Ekaterina Romanova | cb3603a | 2017-06-06 22:58:01 +0000 | [diff] [blame] | 305 | /// \brief Compares lower 64-bit double-precision values of both operands, and |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 306 | /// returns the greater of the pair of values in the lower 64-bits of the |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 307 | /// result. The upper 64 bits of the result are copied from the upper |
| 308 | /// double-precision value of the first operand. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 309 | /// |
| 310 | /// \headerfile <x86intrin.h> |
| 311 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 312 | /// This intrinsic corresponds to the <c> VMAXSD / MAXSD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 313 | /// |
| 314 | /// \param __a |
| 315 | /// A 128-bit vector of [2 x double] containing one of the operands. The |
| 316 | /// lower 64 bits of this operand are used in the comparison. |
| 317 | /// \param __b |
| 318 | /// A 128-bit vector of [2 x double] containing one of the operands. The |
| 319 | /// lower 64 bits of this operand are used in the comparison. |
| 320 | /// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the |
| 321 | /// maximum value between both operands. The upper 64 bits are copied from |
| 322 | /// the upper 64 bits of the first source operand. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 323 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 324 | _mm_max_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 325 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 326 | return __builtin_ia32_maxsd((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 327 | } |
| 328 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 329 | /// \brief Performs element-by-element comparison of the two 128-bit vectors of |
| 330 | /// [2 x double] and returns the vector containing the greater of each pair |
| 331 | /// of values. |
| 332 | /// |
| 333 | /// \headerfile <x86intrin.h> |
| 334 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 335 | /// This intrinsic corresponds to the <c> VMAXPD / MAXPD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 336 | /// |
| 337 | /// \param __a |
| 338 | /// A 128-bit vector of [2 x double] containing one of the operands. |
| 339 | /// \param __b |
| 340 | /// A 128-bit vector of [2 x double] containing one of the operands. |
| 341 | /// \returns A 128-bit vector of [2 x double] containing the maximum values |
| 342 | /// between both operands. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 343 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 344 | _mm_max_pd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 345 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 346 | return __builtin_ia32_maxpd((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 347 | } |
| 348 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 349 | /// \brief Performs a bitwise AND of two 128-bit vectors of [2 x double]. |
| 350 | /// |
| 351 | /// \headerfile <x86intrin.h> |
| 352 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 353 | /// This intrinsic corresponds to the <c> VPAND / PAND </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 354 | /// |
| 355 | /// \param __a |
| 356 | /// A 128-bit vector of [2 x double] containing one of the source operands. |
| 357 | /// \param __b |
| 358 | /// A 128-bit vector of [2 x double] containing one of the source operands. |
| 359 | /// \returns A 128-bit vector of [2 x double] containing the bitwise AND of the |
| 360 | /// values between both operands. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 361 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 362 | _mm_and_pd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 363 | { |
Craig Topper | d0681d5 | 2016-08-31 05:38:55 +0000 | [diff] [blame] | 364 | return (__m128d)((__v2du)__a & (__v2du)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 365 | } |
| 366 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 367 | /// \brief Performs a bitwise AND of two 128-bit vectors of [2 x double], using |
| 368 | /// the one's complement of the values contained in the first source operand. |
| 369 | /// |
| 370 | /// \headerfile <x86intrin.h> |
| 371 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 372 | /// This intrinsic corresponds to the <c> VPANDN / PANDN </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 373 | /// |
| 374 | /// \param __a |
| 375 | /// A 128-bit vector of [2 x double] containing the left source operand. The |
| 376 | /// one's complement of this value is used in the bitwise AND. |
| 377 | /// \param __b |
| 378 | /// A 128-bit vector of [2 x double] containing the right source operand. |
| 379 | /// \returns A 128-bit vector of [2 x double] containing the bitwise AND of the |
| 380 | /// values in the second operand and the one's complement of the first |
| 381 | /// operand. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 382 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 383 | _mm_andnot_pd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 384 | { |
Craig Topper | d0681d5 | 2016-08-31 05:38:55 +0000 | [diff] [blame] | 385 | return (__m128d)(~(__v2du)__a & (__v2du)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 386 | } |
| 387 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 388 | /// \brief Performs a bitwise OR of two 128-bit vectors of [2 x double]. |
| 389 | /// |
| 390 | /// \headerfile <x86intrin.h> |
| 391 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 392 | /// This intrinsic corresponds to the <c> VPOR / POR </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 393 | /// |
| 394 | /// \param __a |
| 395 | /// A 128-bit vector of [2 x double] containing one of the source operands. |
| 396 | /// \param __b |
| 397 | /// A 128-bit vector of [2 x double] containing one of the source operands. |
| 398 | /// \returns A 128-bit vector of [2 x double] containing the bitwise OR of the |
| 399 | /// values between both operands. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 400 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 401 | _mm_or_pd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 402 | { |
Craig Topper | d0681d5 | 2016-08-31 05:38:55 +0000 | [diff] [blame] | 403 | return (__m128d)((__v2du)__a | (__v2du)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 404 | } |
| 405 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 406 | /// \brief Performs a bitwise XOR of two 128-bit vectors of [2 x double]. |
| 407 | /// |
| 408 | /// \headerfile <x86intrin.h> |
| 409 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 410 | /// This intrinsic corresponds to the <c> VPXOR / PXOR </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 411 | /// |
| 412 | /// \param __a |
| 413 | /// A 128-bit vector of [2 x double] containing one of the source operands. |
| 414 | /// \param __b |
| 415 | /// A 128-bit vector of [2 x double] containing one of the source operands. |
| 416 | /// \returns A 128-bit vector of [2 x double] containing the bitwise XOR of the |
| 417 | /// values between both operands. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 418 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 419 | _mm_xor_pd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 420 | { |
Craig Topper | d0681d5 | 2016-08-31 05:38:55 +0000 | [diff] [blame] | 421 | return (__m128d)((__v2du)__a ^ (__v2du)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 422 | } |
| 423 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 424 | /// \brief Compares each of the corresponding double-precision values of the |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 425 | /// 128-bit vectors of [2 x double] for equality. Each comparison yields 0x0 |
| 426 | /// for false, 0xFFFFFFFFFFFFFFFF for true. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 427 | /// |
| 428 | /// \headerfile <x86intrin.h> |
| 429 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 430 | /// This intrinsic corresponds to the <c> VCMPEQPD / CMPEQPD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 431 | /// |
| 432 | /// \param __a |
| 433 | /// A 128-bit vector of [2 x double]. |
| 434 | /// \param __b |
| 435 | /// A 128-bit vector of [2 x double]. |
| 436 | /// \returns A 128-bit vector containing the comparison results. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 437 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 438 | _mm_cmpeq_pd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 439 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 440 | return (__m128d)__builtin_ia32_cmpeqpd((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 441 | } |
| 442 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 443 | /// \brief Compares each of the corresponding double-precision values of the |
| 444 | /// 128-bit vectors of [2 x double] to determine if the values in the first |
| 445 | /// operand are less than those in the second operand. Each comparison |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 446 | /// yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 447 | /// |
| 448 | /// \headerfile <x86intrin.h> |
| 449 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 450 | /// This intrinsic corresponds to the <c> VCMPLTPD / CMPLTPD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 451 | /// |
| 452 | /// \param __a |
| 453 | /// A 128-bit vector of [2 x double]. |
| 454 | /// \param __b |
| 455 | /// A 128-bit vector of [2 x double]. |
| 456 | /// \returns A 128-bit vector containing the comparison results. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 457 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 458 | _mm_cmplt_pd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 459 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 460 | return (__m128d)__builtin_ia32_cmpltpd((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 461 | } |
| 462 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 463 | /// \brief Compares each of the corresponding double-precision values of the |
| 464 | /// 128-bit vectors of [2 x double] to determine if the values in the first |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 465 | /// operand are less than or equal to those in the second operand. |
| 466 | /// |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 467 | /// Each comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 468 | /// |
| 469 | /// \headerfile <x86intrin.h> |
| 470 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 471 | /// This intrinsic corresponds to the <c> VCMPLEPD / CMPLEPD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 472 | /// |
| 473 | /// \param __a |
| 474 | /// A 128-bit vector of [2 x double]. |
| 475 | /// \param __b |
| 476 | /// A 128-bit vector of [2 x double]. |
| 477 | /// \returns A 128-bit vector containing the comparison results. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 478 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 479 | _mm_cmple_pd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 480 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 481 | return (__m128d)__builtin_ia32_cmplepd((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 482 | } |
| 483 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 484 | /// \brief Compares each of the corresponding double-precision values of the |
| 485 | /// 128-bit vectors of [2 x double] to determine if the values in the first |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 486 | /// operand are greater than those in the second operand. |
| 487 | /// |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 488 | /// Each comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 489 | /// |
| 490 | /// \headerfile <x86intrin.h> |
| 491 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 492 | /// This intrinsic corresponds to the <c> VCMPLTPD / CMPLTPD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 493 | /// |
| 494 | /// \param __a |
| 495 | /// A 128-bit vector of [2 x double]. |
| 496 | /// \param __b |
| 497 | /// A 128-bit vector of [2 x double]. |
| 498 | /// \returns A 128-bit vector containing the comparison results. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 499 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 500 | _mm_cmpgt_pd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 501 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 502 | return (__m128d)__builtin_ia32_cmpltpd((__v2df)__b, (__v2df)__a); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 503 | } |
| 504 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 505 | /// \brief Compares each of the corresponding double-precision values of the |
| 506 | /// 128-bit vectors of [2 x double] to determine if the values in the first |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 507 | /// operand are greater than or equal to those in the second operand. |
| 508 | /// |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 509 | /// Each comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 510 | /// |
| 511 | /// \headerfile <x86intrin.h> |
| 512 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 513 | /// This intrinsic corresponds to the <c> VCMPLEPD / CMPLEPD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 514 | /// |
| 515 | /// \param __a |
| 516 | /// A 128-bit vector of [2 x double]. |
| 517 | /// \param __b |
| 518 | /// A 128-bit vector of [2 x double]. |
| 519 | /// \returns A 128-bit vector containing the comparison results. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 520 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 521 | _mm_cmpge_pd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 522 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 523 | return (__m128d)__builtin_ia32_cmplepd((__v2df)__b, (__v2df)__a); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 524 | } |
| 525 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 526 | /// \brief Compares each of the corresponding double-precision values of the |
| 527 | /// 128-bit vectors of [2 x double] to determine if the values in the first |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 528 | /// operand are ordered with respect to those in the second operand. |
| 529 | /// |
| 530 | /// A pair of double-precision values are "ordered" with respect to each |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 531 | /// other if neither value is a NaN. Each comparison yields 0x0 for false, |
| 532 | /// 0xFFFFFFFFFFFFFFFF for true. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 533 | /// |
| 534 | /// \headerfile <x86intrin.h> |
| 535 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 536 | /// This intrinsic corresponds to the <c> VCMPORDPD / CMPORDPD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 537 | /// |
| 538 | /// \param __a |
| 539 | /// A 128-bit vector of [2 x double]. |
| 540 | /// \param __b |
| 541 | /// A 128-bit vector of [2 x double]. |
| 542 | /// \returns A 128-bit vector containing the comparison results. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 543 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 544 | _mm_cmpord_pd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 545 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 546 | return (__m128d)__builtin_ia32_cmpordpd((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 547 | } |
| 548 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 549 | /// \brief Compares each of the corresponding double-precision values of the |
| 550 | /// 128-bit vectors of [2 x double] to determine if the values in the first |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 551 | /// operand are unordered with respect to those in the second operand. |
| 552 | /// |
| 553 | /// A pair of double-precision values are "unordered" with respect to each |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 554 | /// other if one or both values are NaN. Each comparison yields 0x0 for |
| 555 | /// false, 0xFFFFFFFFFFFFFFFF for true. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 556 | /// |
| 557 | /// \headerfile <x86intrin.h> |
| 558 | /// |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 559 | /// This intrinsic corresponds to the <c> VCMPUNORDPD / CMPUNORDPD </c> |
| 560 | /// instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 561 | /// |
| 562 | /// \param __a |
| 563 | /// A 128-bit vector of [2 x double]. |
| 564 | /// \param __b |
| 565 | /// A 128-bit vector of [2 x double]. |
| 566 | /// \returns A 128-bit vector containing the comparison results. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 567 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 568 | _mm_cmpunord_pd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 569 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 570 | return (__m128d)__builtin_ia32_cmpunordpd((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 571 | } |
| 572 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 573 | /// \brief Compares each of the corresponding double-precision values of the |
| 574 | /// 128-bit vectors of [2 x double] to determine if the values in the first |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 575 | /// operand are unequal to those in the second operand. |
| 576 | /// |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 577 | /// Each comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 578 | /// |
| 579 | /// \headerfile <x86intrin.h> |
| 580 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 581 | /// This intrinsic corresponds to the <c> VCMPNEQPD / CMPNEQPD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 582 | /// |
| 583 | /// \param __a |
| 584 | /// A 128-bit vector of [2 x double]. |
| 585 | /// \param __b |
| 586 | /// A 128-bit vector of [2 x double]. |
| 587 | /// \returns A 128-bit vector containing the comparison results. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 588 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 589 | _mm_cmpneq_pd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 590 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 591 | return (__m128d)__builtin_ia32_cmpneqpd((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 592 | } |
| 593 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 594 | /// \brief Compares each of the corresponding double-precision values of the |
| 595 | /// 128-bit vectors of [2 x double] to determine if the values in the first |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 596 | /// operand are not less than those in the second operand. |
| 597 | /// |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 598 | /// Each comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 599 | /// |
| 600 | /// \headerfile <x86intrin.h> |
| 601 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 602 | /// This intrinsic corresponds to the <c> VCMPNLTPD / CMPNLTPD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 603 | /// |
| 604 | /// \param __a |
| 605 | /// A 128-bit vector of [2 x double]. |
| 606 | /// \param __b |
| 607 | /// A 128-bit vector of [2 x double]. |
| 608 | /// \returns A 128-bit vector containing the comparison results. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 609 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 610 | _mm_cmpnlt_pd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 611 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 612 | return (__m128d)__builtin_ia32_cmpnltpd((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 613 | } |
| 614 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 615 | /// \brief Compares each of the corresponding double-precision values of the |
| 616 | /// 128-bit vectors of [2 x double] to determine if the values in the first |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 617 | /// operand are not less than or equal to those in the second operand. |
| 618 | /// |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 619 | /// Each comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 620 | /// |
| 621 | /// \headerfile <x86intrin.h> |
| 622 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 623 | /// This intrinsic corresponds to the <c> VCMPNLEPD / CMPNLEPD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 624 | /// |
| 625 | /// \param __a |
| 626 | /// A 128-bit vector of [2 x double]. |
| 627 | /// \param __b |
| 628 | /// A 128-bit vector of [2 x double]. |
| 629 | /// \returns A 128-bit vector containing the comparison results. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 630 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 631 | _mm_cmpnle_pd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 632 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 633 | return (__m128d)__builtin_ia32_cmpnlepd((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 634 | } |
| 635 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 636 | /// \brief Compares each of the corresponding double-precision values of the |
| 637 | /// 128-bit vectors of [2 x double] to determine if the values in the first |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 638 | /// operand are not greater than those in the second operand. |
| 639 | /// |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 640 | /// Each comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 641 | /// |
| 642 | /// \headerfile <x86intrin.h> |
| 643 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 644 | /// This intrinsic corresponds to the <c> VCMPNLTPD / CMPNLTPD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 645 | /// |
| 646 | /// \param __a |
| 647 | /// A 128-bit vector of [2 x double]. |
| 648 | /// \param __b |
| 649 | /// A 128-bit vector of [2 x double]. |
| 650 | /// \returns A 128-bit vector containing the comparison results. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 651 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 652 | _mm_cmpngt_pd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 653 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 654 | return (__m128d)__builtin_ia32_cmpnltpd((__v2df)__b, (__v2df)__a); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 655 | } |
| 656 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 657 | /// \brief Compares each of the corresponding double-precision values of the |
| 658 | /// 128-bit vectors of [2 x double] to determine if the values in the first |
| 659 | /// operand are not greater than or equal to those in the second operand. |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 660 | /// |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 661 | /// Each comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 662 | /// |
| 663 | /// \headerfile <x86intrin.h> |
| 664 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 665 | /// This intrinsic corresponds to the <c> VCMPNLEPD / CMPNLEPD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 666 | /// |
| 667 | /// \param __a |
| 668 | /// A 128-bit vector of [2 x double]. |
| 669 | /// \param __b |
| 670 | /// A 128-bit vector of [2 x double]. |
| 671 | /// \returns A 128-bit vector containing the comparison results. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 672 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 673 | _mm_cmpnge_pd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 674 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 675 | return (__m128d)__builtin_ia32_cmpnlepd((__v2df)__b, (__v2df)__a); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 676 | } |
| 677 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 678 | /// \brief Compares the lower double-precision floating-point values in each of |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 679 | /// the two 128-bit floating-point vectors of [2 x double] for equality. |
| 680 | /// |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 681 | /// The comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 682 | /// |
| 683 | /// \headerfile <x86intrin.h> |
| 684 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 685 | /// This intrinsic corresponds to the <c> VCMPEQSD / CMPEQSD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 686 | /// |
| 687 | /// \param __a |
| 688 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 689 | /// compared to the lower double-precision value of \a __b. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 690 | /// \param __b |
| 691 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 692 | /// compared to the lower double-precision value of \a __a. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 693 | /// \returns A 128-bit vector. The lower 64 bits contains the comparison |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 694 | /// results. The upper 64 bits are copied from the upper 64 bits of \a __a. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 695 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 696 | _mm_cmpeq_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 697 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 698 | return (__m128d)__builtin_ia32_cmpeqsd((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 699 | } |
| 700 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 701 | /// \brief Compares the lower double-precision floating-point values in each of |
| 702 | /// the two 128-bit floating-point vectors of [2 x double] to determine if |
| 703 | /// the value in the first parameter is less than the corresponding value in |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 704 | /// the second parameter. |
| 705 | /// |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 706 | /// The comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 707 | /// |
| 708 | /// \headerfile <x86intrin.h> |
| 709 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 710 | /// This intrinsic corresponds to the <c> VCMPLTSD / CMPLTSD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 711 | /// |
| 712 | /// \param __a |
| 713 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 714 | /// compared to the lower double-precision value of \a __b. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 715 | /// \param __b |
| 716 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 717 | /// compared to the lower double-precision value of \a __a. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 718 | /// \returns A 128-bit vector. The lower 64 bits contains the comparison |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 719 | /// results. The upper 64 bits are copied from the upper 64 bits of \a __a. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 720 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 721 | _mm_cmplt_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 722 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 723 | return (__m128d)__builtin_ia32_cmpltsd((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 724 | } |
| 725 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 726 | /// \brief Compares the lower double-precision floating-point values in each of |
| 727 | /// the two 128-bit floating-point vectors of [2 x double] to determine if |
| 728 | /// the value in the first parameter is less than or equal to the |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 729 | /// corresponding value in the second parameter. |
| 730 | /// |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 731 | /// The comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 732 | /// |
| 733 | /// \headerfile <x86intrin.h> |
| 734 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 735 | /// This intrinsic corresponds to the <c> VCMPLESD / CMPLESD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 736 | /// |
| 737 | /// \param __a |
| 738 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 739 | /// compared to the lower double-precision value of \a __b. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 740 | /// \param __b |
| 741 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 742 | /// compared to the lower double-precision value of \a __a. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 743 | /// \returns A 128-bit vector. The lower 64 bits contains the comparison |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 744 | /// results. The upper 64 bits are copied from the upper 64 bits of \a __a. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 745 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 746 | _mm_cmple_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 747 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 748 | return (__m128d)__builtin_ia32_cmplesd((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 749 | } |
| 750 | |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 751 | /// \brief Compares the lower double-precision floating-point values in each of |
| 752 | /// the two 128-bit floating-point vectors of [2 x double] to determine if |
| 753 | /// the value in the first parameter is greater than the corresponding value |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 754 | /// in the second parameter. |
| 755 | /// |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 756 | /// The comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 757 | /// |
| 758 | /// \headerfile <x86intrin.h> |
| 759 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 760 | /// This intrinsic corresponds to the <c> VCMPLTSD / CMPLTSD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 761 | /// |
| 762 | /// \param __a |
| 763 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 764 | /// compared to the lower double-precision value of \a __b. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 765 | /// \param __b |
| 766 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 767 | /// compared to the lower double-precision value of \a __a. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 768 | /// \returns A 128-bit vector. The lower 64 bits contains the comparison |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 769 | /// results. The upper 64 bits are copied from the upper 64 bits of \a __a. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 770 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 771 | _mm_cmpgt_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 772 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 773 | __m128d __c = __builtin_ia32_cmpltsd((__v2df)__b, (__v2df)__a); |
Manman Ren | 9bb34d6 | 2013-06-17 19:42:49 +0000 | [diff] [blame] | 774 | return (__m128d) { __c[0], __a[1] }; |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 775 | } |
| 776 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 777 | /// \brief Compares the lower double-precision floating-point values in each of |
| 778 | /// the two 128-bit floating-point vectors of [2 x double] to determine if |
| 779 | /// the value in the first parameter is greater than or equal to the |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 780 | /// corresponding value in the second parameter. |
| 781 | /// |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 782 | /// The comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 783 | /// |
| 784 | /// \headerfile <x86intrin.h> |
| 785 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 786 | /// This intrinsic corresponds to the <c> VCMPLESD / CMPLESD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 787 | /// |
| 788 | /// \param __a |
| 789 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 790 | /// compared to the lower double-precision value of \a __b. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 791 | /// \param __b |
| 792 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 793 | /// compared to the lower double-precision value of \a __a. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 794 | /// \returns A 128-bit vector. The lower 64 bits contains the comparison |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 795 | /// results. The upper 64 bits are copied from the upper 64 bits of \a __a. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 796 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 797 | _mm_cmpge_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 798 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 799 | __m128d __c = __builtin_ia32_cmplesd((__v2df)__b, (__v2df)__a); |
Manman Ren | 9bb34d6 | 2013-06-17 19:42:49 +0000 | [diff] [blame] | 800 | return (__m128d) { __c[0], __a[1] }; |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 801 | } |
| 802 | |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 803 | /// \brief Compares the lower double-precision floating-point values in each of |
| 804 | /// the two 128-bit floating-point vectors of [2 x double] to determine if |
| 805 | /// the value in the first parameter is "ordered" with respect to the |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 806 | /// corresponding value in the second parameter. |
| 807 | /// |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 808 | /// The comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true. A pair |
| 809 | /// of double-precision values are "ordered" with respect to each other if |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 810 | /// neither value is a NaN. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 811 | /// |
| 812 | /// \headerfile <x86intrin.h> |
| 813 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 814 | /// This intrinsic corresponds to the <c> VCMPORDSD / CMPORDSD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 815 | /// |
| 816 | /// \param __a |
| 817 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 818 | /// compared to the lower double-precision value of \a __b. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 819 | /// \param __b |
| 820 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 821 | /// compared to the lower double-precision value of \a __a. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 822 | /// \returns A 128-bit vector. The lower 64 bits contains the comparison |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 823 | /// results. The upper 64 bits are copied from the upper 64 bits of \a __a. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 824 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 825 | _mm_cmpord_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 826 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 827 | return (__m128d)__builtin_ia32_cmpordsd((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 828 | } |
| 829 | |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 830 | /// \brief Compares the lower double-precision floating-point values in each of |
| 831 | /// the two 128-bit floating-point vectors of [2 x double] to determine if |
| 832 | /// the value in the first parameter is "unordered" with respect to the |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 833 | /// corresponding value in the second parameter. |
| 834 | /// |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 835 | /// The comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true. A pair |
| 836 | /// of double-precision values are "unordered" with respect to each other if |
| 837 | /// one or both values are NaN. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 838 | /// |
| 839 | /// \headerfile <x86intrin.h> |
| 840 | /// |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 841 | /// This intrinsic corresponds to the <c> VCMPUNORDSD / CMPUNORDSD </c> |
| 842 | /// instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 843 | /// |
| 844 | /// \param __a |
| 845 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 846 | /// compared to the lower double-precision value of \a __b. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 847 | /// \param __b |
| 848 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 849 | /// compared to the lower double-precision value of \a __a. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 850 | /// \returns A 128-bit vector. The lower 64 bits contains the comparison |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 851 | /// results. The upper 64 bits are copied from the upper 64 bits of \a __a. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 852 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 853 | _mm_cmpunord_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 854 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 855 | return (__m128d)__builtin_ia32_cmpunordsd((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 856 | } |
| 857 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 858 | /// \brief Compares the lower double-precision floating-point values in each of |
| 859 | /// the two 128-bit floating-point vectors of [2 x double] to determine if |
| 860 | /// the value in the first parameter is unequal to the corresponding value in |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 861 | /// the second parameter. |
| 862 | /// |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 863 | /// The comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 864 | /// |
| 865 | /// \headerfile <x86intrin.h> |
| 866 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 867 | /// This intrinsic corresponds to the <c> VCMPNEQSD / CMPNEQSD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 868 | /// |
| 869 | /// \param __a |
| 870 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 871 | /// compared to the lower double-precision value of \a __b. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 872 | /// \param __b |
| 873 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 874 | /// compared to the lower double-precision value of \a __a. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 875 | /// \returns A 128-bit vector. The lower 64 bits contains the comparison |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 876 | /// results. The upper 64 bits are copied from the upper 64 bits of \a __a. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 877 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 878 | _mm_cmpneq_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 879 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 880 | return (__m128d)__builtin_ia32_cmpneqsd((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 881 | } |
| 882 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 883 | /// \brief Compares the lower double-precision floating-point values in each of |
| 884 | /// the two 128-bit floating-point vectors of [2 x double] to determine if |
| 885 | /// the value in the first parameter is not less than the corresponding |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 886 | /// value in the second parameter. |
| 887 | /// |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 888 | /// The comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 889 | /// |
| 890 | /// \headerfile <x86intrin.h> |
| 891 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 892 | /// This intrinsic corresponds to the <c> VCMPNLTSD / CMPNLTSD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 893 | /// |
| 894 | /// \param __a |
| 895 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 896 | /// compared to the lower double-precision value of \a __b. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 897 | /// \param __b |
| 898 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 899 | /// compared to the lower double-precision value of \a __a. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 900 | /// \returns A 128-bit vector. The lower 64 bits contains the comparison |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 901 | /// results. The upper 64 bits are copied from the upper 64 bits of \a __a. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 902 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 903 | _mm_cmpnlt_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 904 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 905 | return (__m128d)__builtin_ia32_cmpnltsd((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 906 | } |
| 907 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 908 | /// \brief Compares the lower double-precision floating-point values in each of |
| 909 | /// the two 128-bit floating-point vectors of [2 x double] to determine if |
| 910 | /// the value in the first parameter is not less than or equal to the |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 911 | /// corresponding value in the second parameter. |
| 912 | /// |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 913 | /// The comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 914 | /// |
| 915 | /// \headerfile <x86intrin.h> |
| 916 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 917 | /// This intrinsic corresponds to the <c> VCMPNLESD / CMPNLESD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 918 | /// |
| 919 | /// \param __a |
| 920 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 921 | /// compared to the lower double-precision value of \a __b. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 922 | /// \param __b |
| 923 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 924 | /// compared to the lower double-precision value of \a __a. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 925 | /// \returns A 128-bit vector. The lower 64 bits contains the comparison |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 926 | /// results. The upper 64 bits are copied from the upper 64 bits of \a __a. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 927 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 928 | _mm_cmpnle_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 929 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 930 | return (__m128d)__builtin_ia32_cmpnlesd((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 931 | } |
| 932 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 933 | /// \brief Compares the lower double-precision floating-point values in each of |
| 934 | /// the two 128-bit floating-point vectors of [2 x double] to determine if |
| 935 | /// the value in the first parameter is not greater than the corresponding |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 936 | /// value in the second parameter. |
| 937 | /// |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 938 | /// The comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 939 | /// |
| 940 | /// \headerfile <x86intrin.h> |
| 941 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 942 | /// This intrinsic corresponds to the <c> VCMPNLTSD / CMPNLTSD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 943 | /// |
| 944 | /// \param __a |
| 945 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 946 | /// compared to the lower double-precision value of \a __b. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 947 | /// \param __b |
| 948 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 949 | /// compared to the lower double-precision value of \a __a. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 950 | /// \returns A 128-bit vector. The lower 64 bits contains the comparison |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 951 | /// results. The upper 64 bits are copied from the upper 64 bits of \a __a. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 952 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 953 | _mm_cmpngt_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 954 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 955 | __m128d __c = __builtin_ia32_cmpnltsd((__v2df)__b, (__v2df)__a); |
Manman Ren | 9bb34d6 | 2013-06-17 19:42:49 +0000 | [diff] [blame] | 956 | return (__m128d) { __c[0], __a[1] }; |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 957 | } |
| 958 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 959 | /// \brief Compares the lower double-precision floating-point values in each of |
| 960 | /// the two 128-bit floating-point vectors of [2 x double] to determine if |
| 961 | /// the value in the first parameter is not greater than or equal to the |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 962 | /// corresponding value in the second parameter. |
| 963 | /// |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 964 | /// The comparison yields 0x0 for false, 0xFFFFFFFFFFFFFFFF for true. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 965 | /// |
| 966 | /// \headerfile <x86intrin.h> |
| 967 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 968 | /// This intrinsic corresponds to the <c> VCMPNLESD / CMPNLESD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 969 | /// |
| 970 | /// \param __a |
| 971 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 972 | /// compared to the lower double-precision value of \a __b. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 973 | /// \param __b |
| 974 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 975 | /// compared to the lower double-precision value of \a __a. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 976 | /// \returns A 128-bit vector. The lower 64 bits contains the comparison |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 977 | /// results. The upper 64 bits are copied from the upper 64 bits of \a __a. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 978 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 979 | _mm_cmpnge_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 980 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 981 | __m128d __c = __builtin_ia32_cmpnlesd((__v2df)__b, (__v2df)__a); |
Manman Ren | 9bb34d6 | 2013-06-17 19:42:49 +0000 | [diff] [blame] | 982 | return (__m128d) { __c[0], __a[1] }; |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 983 | } |
| 984 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 985 | /// \brief Compares the lower double-precision floating-point values in each of |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 986 | /// the two 128-bit floating-point vectors of [2 x double] for equality. |
| 987 | /// |
| 988 | /// The comparison yields 0 for false, 1 for true. If either of the two |
| 989 | /// lower double-precision values is NaN, 0 is returned. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 990 | /// |
| 991 | /// \headerfile <x86intrin.h> |
| 992 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 993 | /// This intrinsic corresponds to the <c> VCOMISD / COMISD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 994 | /// |
| 995 | /// \param __a |
| 996 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 997 | /// compared to the lower double-precision value of \a __b. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 998 | /// \param __b |
| 999 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 1000 | /// compared to the lower double-precision value of \a __a. |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 1001 | /// \returns An integer containing the comparison results. If either of the two |
| 1002 | /// lower double-precision values is NaN, 0 is returned. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1003 | static __inline__ int __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1004 | _mm_comieq_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1005 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 1006 | return __builtin_ia32_comisdeq((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1007 | } |
| 1008 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1009 | /// \brief Compares the lower double-precision floating-point values in each of |
| 1010 | /// the two 128-bit floating-point vectors of [2 x double] to determine if |
| 1011 | /// the value in the first parameter is less than the corresponding value in |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 1012 | /// the second parameter. |
| 1013 | /// |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 1014 | /// The comparison yields 0 for false, 1 for true. If either of the two |
| 1015 | /// lower double-precision values is NaN, 0 is returned. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1016 | /// |
| 1017 | /// \headerfile <x86intrin.h> |
| 1018 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1019 | /// This intrinsic corresponds to the <c> VCOMISD / COMISD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1020 | /// |
| 1021 | /// \param __a |
| 1022 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 1023 | /// compared to the lower double-precision value of \a __b. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1024 | /// \param __b |
| 1025 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 1026 | /// compared to the lower double-precision value of \a __a. |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 1027 | /// \returns An integer containing the comparison results. If either of the two |
| 1028 | /// lower double-precision values is NaN, 0 is returned. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1029 | static __inline__ int __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1030 | _mm_comilt_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1031 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 1032 | return __builtin_ia32_comisdlt((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1033 | } |
| 1034 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1035 | /// \brief Compares the lower double-precision floating-point values in each of |
| 1036 | /// the two 128-bit floating-point vectors of [2 x double] to determine if |
| 1037 | /// the value in the first parameter is less than or equal to the |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 1038 | /// corresponding value in the second parameter. |
| 1039 | /// |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 1040 | /// The comparison yields 0 for false, 1 for true. If either of the two |
| 1041 | /// lower double-precision values is NaN, 0 is returned. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1042 | /// |
| 1043 | /// \headerfile <x86intrin.h> |
| 1044 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1045 | /// This intrinsic corresponds to the <c> VCOMISD / COMISD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1046 | /// |
| 1047 | /// \param __a |
| 1048 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 1049 | /// compared to the lower double-precision value of \a __b. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1050 | /// \param __b |
| 1051 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 1052 | /// compared to the lower double-precision value of \a __a. |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 1053 | /// \returns An integer containing the comparison results. If either of the two |
| 1054 | /// lower double-precision values is NaN, 0 is returned. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1055 | static __inline__ int __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1056 | _mm_comile_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1057 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 1058 | return __builtin_ia32_comisdle((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1059 | } |
| 1060 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1061 | /// \brief Compares the lower double-precision floating-point values in each of |
| 1062 | /// the two 128-bit floating-point vectors of [2 x double] to determine if |
| 1063 | /// the value in the first parameter is greater than the corresponding value |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 1064 | /// in the second parameter. |
| 1065 | /// |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 1066 | /// The comparison yields 0 for false, 1 for true. If either of the two |
| 1067 | /// lower double-precision values is NaN, 0 is returned. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1068 | /// |
| 1069 | /// \headerfile <x86intrin.h> |
| 1070 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1071 | /// This intrinsic corresponds to the <c> VCOMISD / COMISD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1072 | /// |
| 1073 | /// \param __a |
| 1074 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 1075 | /// compared to the lower double-precision value of \a __b. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1076 | /// \param __b |
| 1077 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 1078 | /// compared to the lower double-precision value of \a __a. |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 1079 | /// \returns An integer containing the comparison results. If either of the two |
| 1080 | /// lower double-precision values is NaN, 0 is returned. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1081 | static __inline__ int __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1082 | _mm_comigt_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1083 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 1084 | return __builtin_ia32_comisdgt((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1085 | } |
| 1086 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1087 | /// \brief Compares the lower double-precision floating-point values in each of |
| 1088 | /// the two 128-bit floating-point vectors of [2 x double] to determine if |
| 1089 | /// the value in the first parameter is greater than or equal to the |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 1090 | /// corresponding value in the second parameter. |
| 1091 | /// |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 1092 | /// The comparison yields 0 for false, 1 for true. If either of the two |
| 1093 | /// lower double-precision values is NaN, 0 is returned. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1094 | /// |
| 1095 | /// \headerfile <x86intrin.h> |
| 1096 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1097 | /// This intrinsic corresponds to the <c> VCOMISD / COMISD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1098 | /// |
| 1099 | /// \param __a |
| 1100 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 1101 | /// compared to the lower double-precision value of \a __b. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1102 | /// \param __b |
| 1103 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 1104 | /// compared to the lower double-precision value of \a __a. |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 1105 | /// \returns An integer containing the comparison results. If either of the two |
| 1106 | /// lower double-precision values is NaN, 0 is returned. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1107 | static __inline__ int __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1108 | _mm_comige_sd(__m128d __a, __m128d __b) |
Eli Friedman | 89c1133 | 2011-10-06 20:31:50 +0000 | [diff] [blame] | 1109 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 1110 | return __builtin_ia32_comisdge((__v2df)__a, (__v2df)__b); |
Eli Friedman | 89c1133 | 2011-10-06 20:31:50 +0000 | [diff] [blame] | 1111 | } |
| 1112 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1113 | /// \brief Compares the lower double-precision floating-point values in each of |
| 1114 | /// the two 128-bit floating-point vectors of [2 x double] to determine if |
| 1115 | /// the value in the first parameter is unequal to the corresponding value in |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 1116 | /// the second parameter. |
| 1117 | /// |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 1118 | /// The comparison yields 0 for false, 1 for true. If either of the two |
| 1119 | /// lower double-precision values is NaN, 1 is returned. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1120 | /// |
| 1121 | /// \headerfile <x86intrin.h> |
| 1122 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1123 | /// This intrinsic corresponds to the <c> VCOMISD / COMISD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1124 | /// |
| 1125 | /// \param __a |
| 1126 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 1127 | /// compared to the lower double-precision value of \a __b. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1128 | /// \param __b |
| 1129 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 1130 | /// compared to the lower double-precision value of \a __a. |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 1131 | /// \returns An integer containing the comparison results. If either of the two |
| 1132 | /// lower double-precision values is NaN, 1 is returned. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1133 | static __inline__ int __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1134 | _mm_comineq_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1135 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 1136 | return __builtin_ia32_comisdneq((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1137 | } |
| 1138 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1139 | /// \brief Compares the lower double-precision floating-point values in each of |
| 1140 | /// the two 128-bit floating-point vectors of [2 x double] for equality. The |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 1141 | /// comparison yields 0 for false, 1 for true. |
| 1142 | /// |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 1143 | /// If either of the two lower double-precision values is NaN, 0 is returned. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1144 | /// |
| 1145 | /// \headerfile <x86intrin.h> |
| 1146 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1147 | /// This intrinsic corresponds to the <c> VUCOMISD / UCOMISD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1148 | /// |
| 1149 | /// \param __a |
| 1150 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 1151 | /// compared to the lower double-precision value of \a __b. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1152 | /// \param __b |
| 1153 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 1154 | /// compared to the lower double-precision value of \a __a. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1155 | /// \returns An integer containing the comparison results. If either of the two |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 1156 | /// lower double-precision values is NaN, 0 is returned. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1157 | static __inline__ int __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1158 | _mm_ucomieq_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1159 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 1160 | return __builtin_ia32_ucomisdeq((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1161 | } |
| 1162 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1163 | /// \brief Compares the lower double-precision floating-point values in each of |
| 1164 | /// the two 128-bit floating-point vectors of [2 x double] to determine if |
| 1165 | /// the value in the first parameter is less than the corresponding value in |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 1166 | /// the second parameter. |
| 1167 | /// |
| 1168 | /// The comparison yields 0 for false, 1 for true. If either of the two lower |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 1169 | /// double-precision values is NaN, 0 is returned. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1170 | /// |
| 1171 | /// \headerfile <x86intrin.h> |
| 1172 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1173 | /// This intrinsic corresponds to the <c> VUCOMISD / UCOMISD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1174 | /// |
| 1175 | /// \param __a |
| 1176 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 1177 | /// compared to the lower double-precision value of \a __b. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1178 | /// \param __b |
| 1179 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 1180 | /// compared to the lower double-precision value of \a __a. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1181 | /// \returns An integer containing the comparison results. If either of the two |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 1182 | /// lower double-precision values is NaN, 0 is returned. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1183 | static __inline__ int __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1184 | _mm_ucomilt_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1185 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 1186 | return __builtin_ia32_ucomisdlt((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1187 | } |
| 1188 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1189 | /// \brief Compares the lower double-precision floating-point values in each of |
| 1190 | /// the two 128-bit floating-point vectors of [2 x double] to determine if |
| 1191 | /// the value in the first parameter is less than or equal to the |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 1192 | /// corresponding value in the second parameter. |
| 1193 | /// |
| 1194 | /// The comparison yields 0 for false, 1 for true. If either of the two lower |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 1195 | /// double-precision values is NaN, 0 is returned. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1196 | /// |
| 1197 | /// \headerfile <x86intrin.h> |
| 1198 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1199 | /// This intrinsic corresponds to the <c> VUCOMISD / UCOMISD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1200 | /// |
| 1201 | /// \param __a |
| 1202 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 1203 | /// compared to the lower double-precision value of \a __b. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1204 | /// \param __b |
| 1205 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 1206 | /// compared to the lower double-precision value of \a __a. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1207 | /// \returns An integer containing the comparison results. If either of the two |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 1208 | /// lower double-precision values is NaN, 0 is returned. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1209 | static __inline__ int __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1210 | _mm_ucomile_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1211 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 1212 | return __builtin_ia32_ucomisdle((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1213 | } |
| 1214 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1215 | /// \brief Compares the lower double-precision floating-point values in each of |
| 1216 | /// the two 128-bit floating-point vectors of [2 x double] to determine if |
| 1217 | /// the value in the first parameter is greater than the corresponding value |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 1218 | /// in the second parameter. |
| 1219 | /// |
| 1220 | /// The comparison yields 0 for false, 1 for true. If either of the two lower |
| 1221 | /// double-precision values is NaN, 0 is returned. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1222 | /// |
| 1223 | /// \headerfile <x86intrin.h> |
| 1224 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1225 | /// This intrinsic corresponds to the <c> VUCOMISD / UCOMISD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1226 | /// |
| 1227 | /// \param __a |
| 1228 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 1229 | /// compared to the lower double-precision value of \a __b. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1230 | /// \param __b |
| 1231 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 1232 | /// compared to the lower double-precision value of \a __a. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1233 | /// \returns An integer containing the comparison results. If either of the two |
| 1234 | /// lower double-precision values is NaN, 0 is returned. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1235 | static __inline__ int __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1236 | _mm_ucomigt_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1237 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 1238 | return __builtin_ia32_ucomisdgt((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1239 | } |
| 1240 | |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1241 | /// \brief Compares the lower double-precision floating-point values in each of |
| 1242 | /// the two 128-bit floating-point vectors of [2 x double] to determine if |
| 1243 | /// the value in the first parameter is greater than or equal to the |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 1244 | /// corresponding value in the second parameter. |
| 1245 | /// |
| 1246 | /// The comparison yields 0 for false, 1 for true. If either of the two |
| 1247 | /// lower double-precision values is NaN, 0 is returned. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1248 | /// |
| 1249 | /// \headerfile <x86intrin.h> |
| 1250 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1251 | /// This intrinsic corresponds to the <c> VUCOMISD / UCOMISD </c> instruction. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1252 | /// |
| 1253 | /// \param __a |
| 1254 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 1255 | /// compared to the lower double-precision value of \a __b. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1256 | /// \param __b |
| 1257 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 1258 | /// compared to the lower double-precision value of \a __a. |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 1259 | /// \returns An integer containing the comparison results. If either of the two |
| 1260 | /// lower double-precision values is NaN, 0 is returned. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1261 | static __inline__ int __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1262 | _mm_ucomige_sd(__m128d __a, __m128d __b) |
Eli Friedman | f8cb480 | 2011-08-29 21:26:24 +0000 | [diff] [blame] | 1263 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 1264 | return __builtin_ia32_ucomisdge((__v2df)__a, (__v2df)__b); |
Eli Friedman | f8cb480 | 2011-08-29 21:26:24 +0000 | [diff] [blame] | 1265 | } |
| 1266 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1267 | /// \brief Compares the lower double-precision floating-point values in each of |
| 1268 | /// the two 128-bit floating-point vectors of [2 x double] to determine if |
| 1269 | /// the value in the first parameter is unequal to the corresponding value in |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 1270 | /// the second parameter. |
| 1271 | /// |
| 1272 | /// The comparison yields 0 for false, 1 for true. If either of the two lower |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 1273 | /// double-precision values is NaN, 1 is returned. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1274 | /// |
| 1275 | /// \headerfile <x86intrin.h> |
| 1276 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1277 | /// This intrinsic corresponds to the <c> VUCOMISD / UCOMISD </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1278 | /// |
| 1279 | /// \param __a |
| 1280 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 1281 | /// compared to the lower double-precision value of \a __b. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1282 | /// \param __b |
| 1283 | /// A 128-bit vector of [2 x double]. The lower double-precision value is |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 1284 | /// compared to the lower double-precision value of \a __a. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1285 | /// \returns An integer containing the comparison result. If either of the two |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 1286 | /// lower double-precision values is NaN, 1 is returned. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1287 | static __inline__ int __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1288 | _mm_ucomineq_sd(__m128d __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1289 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 1290 | return __builtin_ia32_ucomisdneq((__v2df)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1291 | } |
| 1292 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1293 | /// \brief Converts the two double-precision floating-point elements of a |
| 1294 | /// 128-bit vector of [2 x double] into two single-precision floating-point |
| 1295 | /// values, returned in the lower 64 bits of a 128-bit vector of [4 x float]. |
| 1296 | /// The upper 64 bits of the result vector are set to zero. |
| 1297 | /// |
| 1298 | /// \headerfile <x86intrin.h> |
| 1299 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1300 | /// This intrinsic corresponds to the <c> VCVTPD2PS / CVTPD2PS </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1301 | /// |
| 1302 | /// \param __a |
| 1303 | /// A 128-bit vector of [2 x double]. |
| 1304 | /// \returns A 128-bit vector of [4 x float] whose lower 64 bits contain the |
| 1305 | /// converted values. The upper 64 bits are set to zero. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1306 | static __inline__ __m128 __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1307 | _mm_cvtpd_ps(__m128d __a) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1308 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 1309 | return __builtin_ia32_cvtpd2ps((__v2df)__a); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1310 | } |
| 1311 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1312 | /// \brief Converts the lower two single-precision floating-point elements of a |
| 1313 | /// 128-bit vector of [4 x float] into two double-precision floating-point |
| 1314 | /// values, returned in a 128-bit vector of [2 x double]. The upper two |
| 1315 | /// elements of the input vector are unused. |
| 1316 | /// |
| 1317 | /// \headerfile <x86intrin.h> |
| 1318 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1319 | /// This intrinsic corresponds to the <c> VCVTPS2PD / CVTPS2PD </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1320 | /// |
| 1321 | /// \param __a |
| 1322 | /// A 128-bit vector of [4 x float]. The lower two single-precision |
| 1323 | /// floating-point elements are converted to double-precision values. The |
| 1324 | /// upper two elements are unused. |
| 1325 | /// \returns A 128-bit vector of [2 x double] containing the converted values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1326 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1327 | _mm_cvtps_pd(__m128 __a) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1328 | { |
Simon Pilgrim | 90770c7 | 2016-05-23 22:13:02 +0000 | [diff] [blame] | 1329 | return (__m128d) __builtin_convertvector( |
| 1330 | __builtin_shufflevector((__v4sf)__a, (__v4sf)__a, 0, 1), __v2df); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1331 | } |
| 1332 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1333 | /// \brief Converts the lower two integer elements of a 128-bit vector of |
| 1334 | /// [4 x i32] into two double-precision floating-point values, returned in a |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 1335 | /// 128-bit vector of [2 x double]. |
| 1336 | /// |
| 1337 | /// The upper two elements of the input vector are unused. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1338 | /// |
| 1339 | /// \headerfile <x86intrin.h> |
| 1340 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1341 | /// This intrinsic corresponds to the <c> VCVTDQ2PD / CVTDQ2PD </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1342 | /// |
| 1343 | /// \param __a |
| 1344 | /// A 128-bit integer vector of [4 x i32]. The lower two integer elements are |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 1345 | /// converted to double-precision values. |
| 1346 | /// |
| 1347 | /// The upper two elements are unused. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1348 | /// \returns A 128-bit vector of [2 x double] containing the converted values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1349 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1350 | _mm_cvtepi32_pd(__m128i __a) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1351 | { |
Simon Pilgrim | 90770c7 | 2016-05-23 22:13:02 +0000 | [diff] [blame] | 1352 | return (__m128d) __builtin_convertvector( |
| 1353 | __builtin_shufflevector((__v4si)__a, (__v4si)__a, 0, 1), __v2df); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1354 | } |
| 1355 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1356 | /// \brief Converts the two double-precision floating-point elements of a |
| 1357 | /// 128-bit vector of [2 x double] into two signed 32-bit integer values, |
| 1358 | /// returned in the lower 64 bits of a 128-bit vector of [4 x i32]. The upper |
| 1359 | /// 64 bits of the result vector are set to zero. |
| 1360 | /// |
| 1361 | /// \headerfile <x86intrin.h> |
| 1362 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1363 | /// This intrinsic corresponds to the <c> VCVTPD2DQ / CVTPD2DQ </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1364 | /// |
| 1365 | /// \param __a |
| 1366 | /// A 128-bit vector of [2 x double]. |
| 1367 | /// \returns A 128-bit vector of [4 x i32] whose lower 64 bits contain the |
| 1368 | /// converted values. The upper 64 bits are set to zero. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1369 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1370 | _mm_cvtpd_epi32(__m128d __a) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1371 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 1372 | return __builtin_ia32_cvtpd2dq((__v2df)__a); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1373 | } |
| 1374 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1375 | /// \brief Converts the low-order element of a 128-bit vector of [2 x double] |
| 1376 | /// into a 32-bit signed integer value. |
| 1377 | /// |
| 1378 | /// \headerfile <x86intrin.h> |
| 1379 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1380 | /// This intrinsic corresponds to the <c> VCVTSD2SI / CVTSD2SI </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1381 | /// |
| 1382 | /// \param __a |
| 1383 | /// A 128-bit vector of [2 x double]. The lower 64 bits are used in the |
| 1384 | /// conversion. |
| 1385 | /// \returns A 32-bit signed integer containing the converted value. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1386 | static __inline__ int __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1387 | _mm_cvtsd_si32(__m128d __a) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1388 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 1389 | return __builtin_ia32_cvtsd2si((__v2df)__a); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1390 | } |
| 1391 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1392 | /// \brief Converts the lower double-precision floating-point element of a |
| 1393 | /// 128-bit vector of [2 x double], in the second parameter, into a |
| 1394 | /// single-precision floating-point value, returned in the lower 32 bits of a |
| 1395 | /// 128-bit vector of [4 x float]. The upper 96 bits of the result vector are |
| 1396 | /// copied from the upper 96 bits of the first parameter. |
| 1397 | /// |
| 1398 | /// \headerfile <x86intrin.h> |
| 1399 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1400 | /// This intrinsic corresponds to the <c> VCVTSD2SS / CVTSD2SS </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1401 | /// |
| 1402 | /// \param __a |
| 1403 | /// A 128-bit vector of [4 x float]. The upper 96 bits of this parameter are |
| 1404 | /// copied to the upper 96 bits of the result. |
| 1405 | /// \param __b |
| 1406 | /// A 128-bit vector of [2 x double]. The lower double-precision |
| 1407 | /// floating-point element is used in the conversion. |
| 1408 | /// \returns A 128-bit vector of [4 x float]. The lower 32 bits contain the |
| 1409 | /// converted value from the second parameter. The upper 96 bits are copied |
| 1410 | /// from the upper 96 bits of the first parameter. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1411 | static __inline__ __m128 __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1412 | _mm_cvtsd_ss(__m128 __a, __m128d __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1413 | { |
Simon Pilgrim | e3b9ee0 | 2016-07-20 10:18:01 +0000 | [diff] [blame] | 1414 | return (__m128)__builtin_ia32_cvtsd2ss((__v4sf)__a, (__v2df)__b); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1415 | } |
| 1416 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1417 | /// \brief Converts a 32-bit signed integer value, in the second parameter, into |
| 1418 | /// a double-precision floating-point value, returned in the lower 64 bits of |
| 1419 | /// a 128-bit vector of [2 x double]. The upper 64 bits of the result vector |
| 1420 | /// are copied from the upper 64 bits of the first parameter. |
| 1421 | /// |
| 1422 | /// \headerfile <x86intrin.h> |
| 1423 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1424 | /// This intrinsic corresponds to the <c> VCVTSI2SD / CVTSI2SD </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1425 | /// |
| 1426 | /// \param __a |
| 1427 | /// A 128-bit vector of [2 x double]. The upper 64 bits of this parameter are |
| 1428 | /// copied to the upper 64 bits of the result. |
| 1429 | /// \param __b |
| 1430 | /// A 32-bit signed integer containing the value to be converted. |
| 1431 | /// \returns A 128-bit vector of [2 x double]. The lower 64 bits contain the |
| 1432 | /// converted value from the second parameter. The upper 64 bits are copied |
| 1433 | /// from the upper 64 bits of the first parameter. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1434 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1435 | _mm_cvtsi32_sd(__m128d __a, int __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1436 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1437 | __a[0] = __b; |
| 1438 | return __a; |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1439 | } |
| 1440 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1441 | /// \brief Converts the lower single-precision floating-point element of a |
| 1442 | /// 128-bit vector of [4 x float], in the second parameter, into a |
| 1443 | /// double-precision floating-point value, returned in the lower 64 bits of |
| 1444 | /// a 128-bit vector of [2 x double]. The upper 64 bits of the result vector |
| 1445 | /// are copied from the upper 64 bits of the first parameter. |
| 1446 | /// |
| 1447 | /// \headerfile <x86intrin.h> |
| 1448 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1449 | /// This intrinsic corresponds to the <c> VCVTSS2SD / CVTSS2SD </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1450 | /// |
| 1451 | /// \param __a |
| 1452 | /// A 128-bit vector of [2 x double]. The upper 64 bits of this parameter are |
| 1453 | /// copied to the upper 64 bits of the result. |
| 1454 | /// \param __b |
| 1455 | /// A 128-bit vector of [4 x float]. The lower single-precision |
| 1456 | /// floating-point element is used in the conversion. |
| 1457 | /// \returns A 128-bit vector of [2 x double]. The lower 64 bits contain the |
| 1458 | /// converted value from the second parameter. The upper 64 bits are copied |
| 1459 | /// from the upper 64 bits of the first parameter. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1460 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1461 | _mm_cvtss_sd(__m128d __a, __m128 __b) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1462 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1463 | __a[0] = __b[0]; |
| 1464 | return __a; |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1465 | } |
| 1466 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1467 | /// \brief Converts the two double-precision floating-point elements of a |
| 1468 | /// 128-bit vector of [2 x double] into two signed 32-bit integer values, |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 1469 | /// returned in the lower 64 bits of a 128-bit vector of [4 x i32]. |
| 1470 | /// |
| 1471 | /// If the result of either conversion is inexact, the result is truncated |
| 1472 | /// (rounded towards zero) regardless of the current MXCSR setting. The upper |
| 1473 | /// 64 bits of the result vector are set to zero. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1474 | /// |
| 1475 | /// \headerfile <x86intrin.h> |
| 1476 | /// |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 1477 | /// This intrinsic corresponds to the <c> VCVTTPD2DQ / CVTTPD2DQ </c> |
| 1478 | /// instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1479 | /// |
| 1480 | /// \param __a |
| 1481 | /// A 128-bit vector of [2 x double]. |
| 1482 | /// \returns A 128-bit vector of [4 x i32] whose lower 64 bits contain the |
| 1483 | /// converted values. The upper 64 bits are set to zero. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1484 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1485 | _mm_cvttpd_epi32(__m128d __a) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1486 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 1487 | return (__m128i)__builtin_ia32_cvttpd2dq((__v2df)__a); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1488 | } |
| 1489 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1490 | /// \brief Converts the low-order element of a [2 x double] vector into a 32-bit |
| 1491 | /// signed integer value, truncating the result when it is inexact. |
| 1492 | /// |
| 1493 | /// \headerfile <x86intrin.h> |
| 1494 | /// |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 1495 | /// This intrinsic corresponds to the <c> VCVTTSD2SI / CVTTSD2SI </c> |
| 1496 | /// instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1497 | /// |
| 1498 | /// \param __a |
| 1499 | /// A 128-bit vector of [2 x double]. The lower 64 bits are used in the |
| 1500 | /// conversion. |
| 1501 | /// \returns A 32-bit signed integer containing the converted value. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1502 | static __inline__ int __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1503 | _mm_cvttsd_si32(__m128d __a) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1504 | { |
Simon Pilgrim | e3b9ee0 | 2016-07-20 10:18:01 +0000 | [diff] [blame] | 1505 | return __builtin_ia32_cvttsd2si((__v2df)__a); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1506 | } |
| 1507 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1508 | /// \brief Converts the two double-precision floating-point elements of a |
| 1509 | /// 128-bit vector of [2 x double] into two signed 32-bit integer values, |
| 1510 | /// returned in a 64-bit vector of [2 x i32]. |
| 1511 | /// |
| 1512 | /// \headerfile <x86intrin.h> |
| 1513 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1514 | /// This intrinsic corresponds to the <c> CVTPD2PI </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1515 | /// |
| 1516 | /// \param __a |
| 1517 | /// A 128-bit vector of [2 x double]. |
| 1518 | /// \returns A 64-bit vector of [2 x i32] containing the converted values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1519 | static __inline__ __m64 __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1520 | _mm_cvtpd_pi32(__m128d __a) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1521 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 1522 | return (__m64)__builtin_ia32_cvtpd2pi((__v2df)__a); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1523 | } |
| 1524 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1525 | /// \brief Converts the two double-precision floating-point elements of a |
| 1526 | /// 128-bit vector of [2 x double] into two signed 32-bit integer values, |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 1527 | /// returned in a 64-bit vector of [2 x i32]. |
| 1528 | /// |
| 1529 | /// If the result of either conversion is inexact, the result is truncated |
| 1530 | /// (rounded towards zero) regardless of the current MXCSR setting. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1531 | /// |
| 1532 | /// \headerfile <x86intrin.h> |
| 1533 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1534 | /// This intrinsic corresponds to the <c> CVTTPD2PI </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1535 | /// |
| 1536 | /// \param __a |
| 1537 | /// A 128-bit vector of [2 x double]. |
| 1538 | /// \returns A 64-bit vector of [2 x i32] containing the converted values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1539 | static __inline__ __m64 __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1540 | _mm_cvttpd_pi32(__m128d __a) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1541 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 1542 | return (__m64)__builtin_ia32_cvttpd2pi((__v2df)__a); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1543 | } |
| 1544 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1545 | /// \brief Converts the two signed 32-bit integer elements of a 64-bit vector of |
| 1546 | /// [2 x i32] into two double-precision floating-point values, returned in a |
| 1547 | /// 128-bit vector of [2 x double]. |
| 1548 | /// |
| 1549 | /// \headerfile <x86intrin.h> |
| 1550 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1551 | /// This intrinsic corresponds to the <c> CVTPI2PD </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1552 | /// |
| 1553 | /// \param __a |
| 1554 | /// A 64-bit vector of [2 x i32]. |
| 1555 | /// \returns A 128-bit vector of [2 x double] containing the converted values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1556 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1557 | _mm_cvtpi32_pd(__m64 __a) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1558 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1559 | return __builtin_ia32_cvtpi2pd((__v2si)__a); |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1560 | } |
| 1561 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1562 | /// \brief Returns the low-order element of a 128-bit vector of [2 x double] as |
| 1563 | /// a double-precision floating-point value. |
| 1564 | /// |
| 1565 | /// \headerfile <x86intrin.h> |
| 1566 | /// |
| 1567 | /// This intrinsic has no corresponding instruction. |
| 1568 | /// |
| 1569 | /// \param __a |
| 1570 | /// A 128-bit vector of [2 x double]. The lower 64 bits are returned. |
| 1571 | /// \returns A double-precision floating-point value copied from the lower 64 |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 1572 | /// bits of \a __a. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1573 | static __inline__ double __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1574 | _mm_cvtsd_f64(__m128d __a) |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1575 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1576 | return __a[0]; |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 1577 | } |
| 1578 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1579 | /// \brief Loads a 128-bit floating-point vector of [2 x double] from an aligned |
| 1580 | /// memory location. |
| 1581 | /// |
| 1582 | /// \headerfile <x86intrin.h> |
| 1583 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1584 | /// This intrinsic corresponds to the <c> VMOVAPD / MOVAPD </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1585 | /// |
| 1586 | /// \param __dp |
| 1587 | /// A pointer to a 128-bit memory location. The address of the memory |
| 1588 | /// location has to be 16-byte aligned. |
| 1589 | /// \returns A 128-bit vector of [2 x double] containing the loaded values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1590 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1591 | _mm_load_pd(double const *__dp) |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1592 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1593 | return *(__m128d*)__dp; |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1594 | } |
| 1595 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1596 | /// \brief Loads a double-precision floating-point value from a specified memory |
| 1597 | /// location and duplicates it to both vector elements of a 128-bit vector of |
| 1598 | /// [2 x double]. |
| 1599 | /// |
| 1600 | /// \headerfile <x86intrin.h> |
| 1601 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1602 | /// This intrinsic corresponds to the <c> VMOVDDUP / MOVDDUP </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1603 | /// |
| 1604 | /// \param __dp |
| 1605 | /// A pointer to a memory location containing a double-precision value. |
| 1606 | /// \returns A 128-bit vector of [2 x double] containing the loaded and |
| 1607 | /// duplicated values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1608 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1609 | _mm_load1_pd(double const *__dp) |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1610 | { |
Eli Friedman | 9bb51ad | 2011-09-15 23:15:27 +0000 | [diff] [blame] | 1611 | struct __mm_load1_pd_struct { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1612 | double __u; |
Eli Friedman | 9bb51ad | 2011-09-15 23:15:27 +0000 | [diff] [blame] | 1613 | } __attribute__((__packed__, __may_alias__)); |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1614 | double __u = ((struct __mm_load1_pd_struct*)__dp)->__u; |
| 1615 | return (__m128d){ __u, __u }; |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1616 | } |
| 1617 | |
Eli Friedman | f83c258 | 2009-06-02 05:55:48 +0000 | [diff] [blame] | 1618 | #define _mm_load_pd1(dp) _mm_load1_pd(dp) |
| 1619 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1620 | /// \brief Loads two double-precision values, in reverse order, from an aligned |
| 1621 | /// memory location into a 128-bit vector of [2 x double]. |
| 1622 | /// |
| 1623 | /// \headerfile <x86intrin.h> |
| 1624 | /// |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 1625 | /// This intrinsic corresponds to the <c> VMOVAPD / MOVAPD </c> instruction + |
| 1626 | /// needed shuffling instructions. In AVX mode, the shuffling may be combined |
| 1627 | /// with the \c VMOVAPD, resulting in only a \c VPERMILPD instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1628 | /// |
| 1629 | /// \param __dp |
| 1630 | /// A 16-byte aligned pointer to an array of double-precision values to be |
| 1631 | /// loaded in reverse order. |
| 1632 | /// \returns A 128-bit vector of [2 x double] containing the reversed loaded |
| 1633 | /// values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1634 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1635 | _mm_loadr_pd(double const *__dp) |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1636 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1637 | __m128d __u = *(__m128d*)__dp; |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 1638 | return __builtin_shufflevector((__v2df)__u, (__v2df)__u, 1, 0); |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1639 | } |
| 1640 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1641 | /// \brief Loads a 128-bit floating-point vector of [2 x double] from an |
| 1642 | /// unaligned memory location. |
| 1643 | /// |
| 1644 | /// \headerfile <x86intrin.h> |
| 1645 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1646 | /// This intrinsic corresponds to the <c> VMOVUPD / MOVUPD </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1647 | /// |
| 1648 | /// \param __dp |
| 1649 | /// A pointer to a 128-bit memory location. The address of the memory |
| 1650 | /// location does not have to be aligned. |
| 1651 | /// \returns A 128-bit vector of [2 x double] containing the loaded values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1652 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1653 | _mm_loadu_pd(double const *__dp) |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1654 | { |
Bill Wendling | 502931f | 2011-05-13 00:11:39 +0000 | [diff] [blame] | 1655 | struct __loadu_pd { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1656 | __m128d __v; |
David Majnemer | 1cf22e6 | 2015-02-04 00:26:10 +0000 | [diff] [blame] | 1657 | } __attribute__((__packed__, __may_alias__)); |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1658 | return ((struct __loadu_pd*)__dp)->__v; |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1659 | } |
| 1660 | |
Ekaterina Romanova | 2e041c9 | 2017-01-13 01:14:08 +0000 | [diff] [blame] | 1661 | /// \brief Loads a 64-bit integer value to the low element of a 128-bit integer |
| 1662 | /// vector and clears the upper element. |
| 1663 | /// |
| 1664 | /// \headerfile <x86intrin.h> |
| 1665 | /// |
| 1666 | /// This intrinsic corresponds to the <c> VMOVQ / MOVQ </c> instruction. |
| 1667 | /// |
Ekaterina Romanova | cb3603a | 2017-06-06 22:58:01 +0000 | [diff] [blame] | 1668 | /// \param __a |
Ekaterina Romanova | 2e041c9 | 2017-01-13 01:14:08 +0000 | [diff] [blame] | 1669 | /// A pointer to a 64-bit memory location. The address of the memory |
| 1670 | /// location does not have to be aligned. |
| 1671 | /// \returns A 128-bit vector of [2 x i64] containing the loaded value. |
Asaf Badouh | 57819aa | 2016-06-26 13:51:54 +0000 | [diff] [blame] | 1672 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
| 1673 | _mm_loadu_si64(void const *__a) |
| 1674 | { |
| 1675 | struct __loadu_si64 { |
| 1676 | long long __v; |
| 1677 | } __attribute__((__packed__, __may_alias__)); |
| 1678 | long long __u = ((struct __loadu_si64*)__a)->__v; |
| 1679 | return (__m128i){__u, 0L}; |
| 1680 | } |
| 1681 | |
Ekaterina Romanova | 2e041c9 | 2017-01-13 01:14:08 +0000 | [diff] [blame] | 1682 | /// \brief Loads a 64-bit double-precision value to the low element of a |
| 1683 | /// 128-bit integer vector and clears the upper element. |
| 1684 | /// |
| 1685 | /// \headerfile <x86intrin.h> |
| 1686 | /// |
| 1687 | /// This intrinsic corresponds to the <c> VMOVSD / MOVSD </c> instruction. |
| 1688 | /// |
| 1689 | /// \param __dp |
Ekaterina Romanova | cb3603a | 2017-06-06 22:58:01 +0000 | [diff] [blame] | 1690 | /// A pointer to a memory location containing a double-precision value. |
Ekaterina Romanova | 2e041c9 | 2017-01-13 01:14:08 +0000 | [diff] [blame] | 1691 | /// The address of the memory location does not have to be aligned. |
| 1692 | /// \returns A 128-bit vector of [2 x double] containing the loaded value. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1693 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1694 | _mm_load_sd(double const *__dp) |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1695 | { |
Eli Friedman | 9bb51ad | 2011-09-15 23:15:27 +0000 | [diff] [blame] | 1696 | struct __mm_load_sd_struct { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1697 | double __u; |
Eli Friedman | 9bb51ad | 2011-09-15 23:15:27 +0000 | [diff] [blame] | 1698 | } __attribute__((__packed__, __may_alias__)); |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1699 | double __u = ((struct __mm_load_sd_struct*)__dp)->__u; |
| 1700 | return (__m128d){ __u, 0 }; |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1701 | } |
| 1702 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1703 | /// \brief Loads a double-precision value into the high-order bits of a 128-bit |
| 1704 | /// vector of [2 x double]. The low-order bits are copied from the low-order |
| 1705 | /// bits of the first operand. |
| 1706 | /// |
| 1707 | /// \headerfile <x86intrin.h> |
| 1708 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1709 | /// This intrinsic corresponds to the <c> VMOVHPD / MOVHPD </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1710 | /// |
| 1711 | /// \param __a |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 1712 | /// A 128-bit vector of [2 x double]. \n |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1713 | /// Bits [63:0] are written to bits [63:0] of the result. |
| 1714 | /// \param __dp |
| 1715 | /// A pointer to a 64-bit memory location containing a double-precision |
| 1716 | /// floating-point value that is loaded. The loaded value is written to bits |
| 1717 | /// [127:64] of the result. The address of the memory location does not have |
| 1718 | /// to be aligned. |
| 1719 | /// \returns A 128-bit vector of [2 x double] containing the moved values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1720 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1721 | _mm_loadh_pd(__m128d __a, double const *__dp) |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1722 | { |
Eli Friedman | 9bb51ad | 2011-09-15 23:15:27 +0000 | [diff] [blame] | 1723 | struct __mm_loadh_pd_struct { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1724 | double __u; |
Eli Friedman | 9bb51ad | 2011-09-15 23:15:27 +0000 | [diff] [blame] | 1725 | } __attribute__((__packed__, __may_alias__)); |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1726 | double __u = ((struct __mm_loadh_pd_struct*)__dp)->__u; |
| 1727 | return (__m128d){ __a[0], __u }; |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1728 | } |
| 1729 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1730 | /// \brief Loads a double-precision value into the low-order bits of a 128-bit |
| 1731 | /// vector of [2 x double]. The high-order bits are copied from the |
| 1732 | /// high-order bits of the first operand. |
| 1733 | /// |
| 1734 | /// \headerfile <x86intrin.h> |
| 1735 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1736 | /// This intrinsic corresponds to the <c> VMOVLPD / MOVLPD </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1737 | /// |
| 1738 | /// \param __a |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 1739 | /// A 128-bit vector of [2 x double]. \n |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1740 | /// Bits [127:64] are written to bits [127:64] of the result. |
| 1741 | /// \param __dp |
| 1742 | /// A pointer to a 64-bit memory location containing a double-precision |
| 1743 | /// floating-point value that is loaded. The loaded value is written to bits |
| 1744 | /// [63:0] of the result. The address of the memory location does not have to |
| 1745 | /// be aligned. |
| 1746 | /// \returns A 128-bit vector of [2 x double] containing the moved values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1747 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1748 | _mm_loadl_pd(__m128d __a, double const *__dp) |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1749 | { |
Eli Friedman | 9bb51ad | 2011-09-15 23:15:27 +0000 | [diff] [blame] | 1750 | struct __mm_loadl_pd_struct { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1751 | double __u; |
Eli Friedman | 9bb51ad | 2011-09-15 23:15:27 +0000 | [diff] [blame] | 1752 | } __attribute__((__packed__, __may_alias__)); |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1753 | double __u = ((struct __mm_loadl_pd_struct*)__dp)->__u; |
| 1754 | return (__m128d){ __u, __a[1] }; |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1755 | } |
| 1756 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1757 | /// \brief Constructs a 128-bit floating-point vector of [2 x double] with |
| 1758 | /// unspecified content. This could be used as an argument to another |
| 1759 | /// intrinsic function where the argument is required but the value is not |
| 1760 | /// actually used. |
| 1761 | /// |
| 1762 | /// \headerfile <x86intrin.h> |
| 1763 | /// |
| 1764 | /// This intrinsic has no corresponding instruction. |
| 1765 | /// |
| 1766 | /// \returns A 128-bit floating-point vector of [2 x double] with unspecified |
| 1767 | /// content. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1768 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
Craig Topper | 3a0c726 | 2016-06-09 05:14:28 +0000 | [diff] [blame] | 1769 | _mm_undefined_pd(void) |
Simon Pilgrim | 5aba992 | 2015-08-26 21:17:12 +0000 | [diff] [blame] | 1770 | { |
| 1771 | return (__m128d)__builtin_ia32_undef128(); |
| 1772 | } |
| 1773 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1774 | /// \brief Constructs a 128-bit floating-point vector of [2 x double]. The lower |
| 1775 | /// 64 bits of the vector are initialized with the specified double-precision |
| 1776 | /// floating-point value. The upper 64 bits are set to zero. |
| 1777 | /// |
| 1778 | /// \headerfile <x86intrin.h> |
| 1779 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1780 | /// This intrinsic corresponds to the <c> VMOVQ / MOVQ </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1781 | /// |
| 1782 | /// \param __w |
| 1783 | /// A double-precision floating-point value used to initialize the lower 64 |
| 1784 | /// bits of the result. |
| 1785 | /// \returns An initialized 128-bit floating-point vector of [2 x double]. The |
| 1786 | /// lower 64 bits contain the value of the parameter. The upper 64 bits are |
| 1787 | /// set to zero. |
Simon Pilgrim | 5aba992 | 2015-08-26 21:17:12 +0000 | [diff] [blame] | 1788 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1789 | _mm_set_sd(double __w) |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1790 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1791 | return (__m128d){ __w, 0 }; |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1792 | } |
| 1793 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1794 | /// \brief Constructs a 128-bit floating-point vector of [2 x double], with each |
| 1795 | /// of the two double-precision floating-point vector elements set to the |
| 1796 | /// specified double-precision floating-point value. |
| 1797 | /// |
| 1798 | /// \headerfile <x86intrin.h> |
| 1799 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1800 | /// This intrinsic corresponds to the <c> VMOVDDUP / MOVLHPS </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1801 | /// |
| 1802 | /// \param __w |
| 1803 | /// A double-precision floating-point value used to initialize each vector |
| 1804 | /// element of the result. |
| 1805 | /// \returns An initialized 128-bit floating-point vector of [2 x double]. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1806 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1807 | _mm_set1_pd(double __w) |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1808 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1809 | return (__m128d){ __w, __w }; |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1810 | } |
| 1811 | |
Simon Pilgrim | 99ed270 | 2017-04-28 10:28:32 +0000 | [diff] [blame] | 1812 | /// \brief Constructs a 128-bit floating-point vector of [2 x double], with each |
| 1813 | /// of the two double-precision floating-point vector elements set to the |
| 1814 | /// specified double-precision floating-point value. |
| 1815 | /// |
| 1816 | /// \headerfile <x86intrin.h> |
| 1817 | /// |
| 1818 | /// This intrinsic corresponds to the <c> VMOVDDUP / MOVLHPS </c> instruction. |
| 1819 | /// |
| 1820 | /// \param __w |
| 1821 | /// A double-precision floating-point value used to initialize each vector |
| 1822 | /// element of the result. |
| 1823 | /// \returns An initialized 128-bit floating-point vector of [2 x double]. |
| 1824 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
| 1825 | _mm_set_pd1(double __w) |
| 1826 | { |
| 1827 | return _mm_set1_pd(__w); |
| 1828 | } |
| 1829 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1830 | /// \brief Constructs a 128-bit floating-point vector of [2 x double] |
| 1831 | /// initialized with the specified double-precision floating-point values. |
| 1832 | /// |
| 1833 | /// \headerfile <x86intrin.h> |
| 1834 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1835 | /// This intrinsic corresponds to the <c> VUNPCKLPD / UNPCKLPD </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1836 | /// |
| 1837 | /// \param __w |
| 1838 | /// A double-precision floating-point value used to initialize the upper 64 |
| 1839 | /// bits of the result. |
| 1840 | /// \param __x |
| 1841 | /// A double-precision floating-point value used to initialize the lower 64 |
| 1842 | /// bits of the result. |
| 1843 | /// \returns An initialized 128-bit floating-point vector of [2 x double]. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1844 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1845 | _mm_set_pd(double __w, double __x) |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1846 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1847 | return (__m128d){ __x, __w }; |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1848 | } |
| 1849 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1850 | /// \brief Constructs a 128-bit floating-point vector of [2 x double], |
| 1851 | /// initialized in reverse order with the specified double-precision |
| 1852 | /// floating-point values. |
| 1853 | /// |
| 1854 | /// \headerfile <x86intrin.h> |
| 1855 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1856 | /// This intrinsic corresponds to the <c> VUNPCKLPD / UNPCKLPD </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1857 | /// |
| 1858 | /// \param __w |
| 1859 | /// A double-precision floating-point value used to initialize the lower 64 |
| 1860 | /// bits of the result. |
| 1861 | /// \param __x |
| 1862 | /// A double-precision floating-point value used to initialize the upper 64 |
| 1863 | /// bits of the result. |
| 1864 | /// \returns An initialized 128-bit floating-point vector of [2 x double]. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1865 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1866 | _mm_setr_pd(double __w, double __x) |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1867 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1868 | return (__m128d){ __w, __x }; |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1869 | } |
| 1870 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1871 | /// \brief Constructs a 128-bit floating-point vector of [2 x double] |
| 1872 | /// initialized to zero. |
| 1873 | /// |
| 1874 | /// \headerfile <x86intrin.h> |
| 1875 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1876 | /// This intrinsic corresponds to the <c> VXORPS / XORPS </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1877 | /// |
| 1878 | /// \returns An initialized 128-bit floating-point vector of [2 x double] with |
| 1879 | /// all elements set to zero. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1880 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
Mike Stump | 5b31ed3 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 1881 | _mm_setzero_pd(void) |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1882 | { |
| 1883 | return (__m128d){ 0, 0 }; |
| 1884 | } |
| 1885 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1886 | /// \brief Constructs a 128-bit floating-point vector of [2 x double]. The lower |
| 1887 | /// 64 bits are set to the lower 64 bits of the second parameter. The upper |
| 1888 | /// 64 bits are set to the upper 64 bits of the first parameter. |
Ekaterina Romanova | 6a5702a | 2017-03-21 13:34:06 +0000 | [diff] [blame] | 1889 | /// |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1890 | /// \headerfile <x86intrin.h> |
| 1891 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1892 | /// This intrinsic corresponds to the <c> VBLENDPD / BLENDPD </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1893 | /// |
| 1894 | /// \param __a |
| 1895 | /// A 128-bit vector of [2 x double]. The upper 64 bits are written to the |
| 1896 | /// upper 64 bits of the result. |
| 1897 | /// \param __b |
| 1898 | /// A 128-bit vector of [2 x double]. The lower 64 bits are written to the |
| 1899 | /// lower 64 bits of the result. |
| 1900 | /// \returns A 128-bit vector of [2 x double] containing the moved values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1901 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1902 | _mm_move_sd(__m128d __a, __m128d __b) |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1903 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1904 | return (__m128d){ __b[0], __a[1] }; |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1905 | } |
| 1906 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1907 | /// \brief Stores the lower 64 bits of a 128-bit vector of [2 x double] to a |
| 1908 | /// memory location. |
| 1909 | /// |
| 1910 | /// \headerfile <x86intrin.h> |
| 1911 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1912 | /// This intrinsic corresponds to the <c> VMOVSD / MOVSD </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1913 | /// |
| 1914 | /// \param __dp |
| 1915 | /// A pointer to a 64-bit memory location. |
| 1916 | /// \param __a |
| 1917 | /// A 128-bit vector of [2 x double] containing the value to be stored. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1918 | static __inline__ void __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1919 | _mm_store_sd(double *__dp, __m128d __a) |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1920 | { |
Eli Friedman | 9bb51ad | 2011-09-15 23:15:27 +0000 | [diff] [blame] | 1921 | struct __mm_store_sd_struct { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1922 | double __u; |
Eli Friedman | 9bb51ad | 2011-09-15 23:15:27 +0000 | [diff] [blame] | 1923 | } __attribute__((__packed__, __may_alias__)); |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 1924 | ((struct __mm_store_sd_struct*)__dp)->__u = __a[0]; |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1925 | } |
| 1926 | |
Ekaterina Romanova | cb3603a | 2017-06-06 22:58:01 +0000 | [diff] [blame] | 1927 | /// \brief Moves packed double-precision values from a 128-bit vector of |
| 1928 | /// [2 x double] to a memory location. |
| 1929 | /// |
| 1930 | /// \headerfile <x86intrin.h> |
| 1931 | /// |
| 1932 | /// This intrinsic corresponds to the <c>VMOVAPD / MOVAPS</c> instruction. |
| 1933 | /// |
| 1934 | /// \param __dp |
| 1935 | /// A pointer to an aligned memory location that can store two |
| 1936 | /// double-precision values. |
| 1937 | /// \param __a |
| 1938 | /// A packed 128-bit vector of [2 x double] containing the values to be |
| 1939 | /// moved. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1940 | static __inline__ void __DEFAULT_FN_ATTRS |
Simon Pilgrim | 645e1ad | 2016-05-30 17:55:25 +0000 | [diff] [blame] | 1941 | _mm_store_pd(double *__dp, __m128d __a) |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1942 | { |
Simon Pilgrim | 645e1ad | 2016-05-30 17:55:25 +0000 | [diff] [blame] | 1943 | *(__m128d*)__dp = __a; |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1944 | } |
| 1945 | |
Ekaterina Romanova | cb3603a | 2017-06-06 22:58:01 +0000 | [diff] [blame] | 1946 | /// \brief Moves the lower 64 bits of a 128-bit vector of [2 x double] twice to |
| 1947 | /// the upper and lower 64 bits of a memory location. |
| 1948 | /// |
| 1949 | /// \headerfile <x86intrin.h> |
| 1950 | /// |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 1951 | /// This intrinsic corresponds to the |
| 1952 | /// <c> VMOVDDUP + VMOVAPD / MOVLHPS + MOVAPS </c> instruction. |
Ekaterina Romanova | cb3603a | 2017-06-06 22:58:01 +0000 | [diff] [blame] | 1953 | /// |
| 1954 | /// \param __dp |
| 1955 | /// A pointer to a memory location that can store two double-precision |
| 1956 | /// values. |
| 1957 | /// \param __a |
| 1958 | /// A 128-bit vector of [2 x double] whose lower 64 bits are copied to each |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 1959 | /// of the values in \a __dp. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1960 | static __inline__ void __DEFAULT_FN_ATTRS |
Simon Pilgrim | 645e1ad | 2016-05-30 17:55:25 +0000 | [diff] [blame] | 1961 | _mm_store1_pd(double *__dp, __m128d __a) |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1962 | { |
Simon Pilgrim | 645e1ad | 2016-05-30 17:55:25 +0000 | [diff] [blame] | 1963 | __a = __builtin_shufflevector((__v2df)__a, (__v2df)__a, 0, 0); |
| 1964 | _mm_store_pd(__dp, __a); |
| 1965 | } |
| 1966 | |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 1967 | /// \brief Moves the lower 64 bits of a 128-bit vector of [2 x double] twice to |
| 1968 | /// the upper and lower 64 bits of a memory location. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1969 | /// |
| 1970 | /// \headerfile <x86intrin.h> |
| 1971 | /// |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 1972 | /// This intrinsic corresponds to the |
| 1973 | /// <c> VMOVDDUP + VMOVAPD / MOVLHPS + MOVAPS </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1974 | /// |
| 1975 | /// \param __dp |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 1976 | /// A pointer to a memory location that can store two double-precision |
| 1977 | /// values. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1978 | /// \param __a |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 1979 | /// A 128-bit vector of [2 x double] whose lower 64 bits are copied to each |
| 1980 | /// of the values in \a __dp. |
Simon Pilgrim | 645e1ad | 2016-05-30 17:55:25 +0000 | [diff] [blame] | 1981 | static __inline__ void __DEFAULT_FN_ATTRS |
| 1982 | _mm_store_pd1(double *__dp, __m128d __a) |
| 1983 | { |
| 1984 | return _mm_store1_pd(__dp, __a); |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 1985 | } |
| 1986 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1987 | /// \brief Stores a 128-bit vector of [2 x double] into an unaligned memory |
| 1988 | /// location. |
| 1989 | /// |
| 1990 | /// \headerfile <x86intrin.h> |
| 1991 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 1992 | /// This intrinsic corresponds to the <c> VMOVUPD / MOVUPD </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 1993 | /// |
| 1994 | /// \param __dp |
| 1995 | /// A pointer to a 128-bit memory location. The address of the memory |
| 1996 | /// location does not have to be aligned. |
| 1997 | /// \param __a |
| 1998 | /// A 128-bit vector of [2 x double] containing the values to be stored. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 1999 | static __inline__ void __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2000 | _mm_storeu_pd(double *__dp, __m128d __a) |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 2001 | { |
Craig Topper | 09175da | 2016-05-30 17:10:30 +0000 | [diff] [blame] | 2002 | struct __storeu_pd { |
| 2003 | __m128d __v; |
| 2004 | } __attribute__((__packed__, __may_alias__)); |
| 2005 | ((struct __storeu_pd*)__dp)->__v = __a; |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 2006 | } |
| 2007 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2008 | /// \brief Stores two double-precision values, in reverse order, from a 128-bit |
| 2009 | /// vector of [2 x double] to a 16-byte aligned memory location. |
| 2010 | /// |
| 2011 | /// \headerfile <x86intrin.h> |
| 2012 | /// |
| 2013 | /// This intrinsic corresponds to a shuffling instruction followed by a |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2014 | /// <c> VMOVAPD / MOVAPD </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2015 | /// |
| 2016 | /// \param __dp |
| 2017 | /// A pointer to a 16-byte aligned memory location that can store two |
| 2018 | /// double-precision values. |
| 2019 | /// \param __a |
| 2020 | /// A 128-bit vector of [2 x double] containing the values to be reversed and |
| 2021 | /// stored. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2022 | static __inline__ void __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2023 | _mm_storer_pd(double *__dp, __m128d __a) |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 2024 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 2025 | __a = __builtin_shufflevector((__v2df)__a, (__v2df)__a, 1, 0); |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2026 | *(__m128d *)__dp = __a; |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 2027 | } |
| 2028 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2029 | /// \brief Stores the upper 64 bits of a 128-bit vector of [2 x double] to a |
| 2030 | /// memory location. |
| 2031 | /// |
| 2032 | /// \headerfile <x86intrin.h> |
| 2033 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2034 | /// This intrinsic corresponds to the <c> VMOVHPD / MOVHPD </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2035 | /// |
| 2036 | /// \param __dp |
| 2037 | /// A pointer to a 64-bit memory location. |
| 2038 | /// \param __a |
| 2039 | /// A 128-bit vector of [2 x double] containing the value to be stored. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2040 | static __inline__ void __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2041 | _mm_storeh_pd(double *__dp, __m128d __a) |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 2042 | { |
Eli Friedman | 9bb51ad | 2011-09-15 23:15:27 +0000 | [diff] [blame] | 2043 | struct __mm_storeh_pd_struct { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2044 | double __u; |
Eli Friedman | 9bb51ad | 2011-09-15 23:15:27 +0000 | [diff] [blame] | 2045 | } __attribute__((__packed__, __may_alias__)); |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2046 | ((struct __mm_storeh_pd_struct*)__dp)->__u = __a[1]; |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 2047 | } |
| 2048 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2049 | /// \brief Stores the lower 64 bits of a 128-bit vector of [2 x double] to a |
| 2050 | /// memory location. |
| 2051 | /// |
| 2052 | /// \headerfile <x86intrin.h> |
| 2053 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2054 | /// This intrinsic corresponds to the <c> VMOVLPD / MOVLPD </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2055 | /// |
| 2056 | /// \param __dp |
| 2057 | /// A pointer to a 64-bit memory location. |
| 2058 | /// \param __a |
| 2059 | /// A 128-bit vector of [2 x double] containing the value to be stored. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2060 | static __inline__ void __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2061 | _mm_storel_pd(double *__dp, __m128d __a) |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 2062 | { |
Eli Friedman | 9bb51ad | 2011-09-15 23:15:27 +0000 | [diff] [blame] | 2063 | struct __mm_storeh_pd_struct { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2064 | double __u; |
Eli Friedman | 9bb51ad | 2011-09-15 23:15:27 +0000 | [diff] [blame] | 2065 | } __attribute__((__packed__, __may_alias__)); |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2066 | ((struct __mm_storeh_pd_struct*)__dp)->__u = __a[0]; |
Anders Carlsson | b08ac0b | 2008-12-24 02:11:54 +0000 | [diff] [blame] | 2067 | } |
| 2068 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2069 | /// \brief Adds the corresponding elements of two 128-bit vectors of [16 x i8], |
| 2070 | /// saving the lower 8 bits of each sum in the corresponding element of a |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 2071 | /// 128-bit result vector of [16 x i8]. |
| 2072 | /// |
| 2073 | /// The integer elements of both parameters can be either signed or unsigned. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2074 | /// |
| 2075 | /// \headerfile <x86intrin.h> |
| 2076 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2077 | /// This intrinsic corresponds to the <c> VPADDB / PADDB </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2078 | /// |
| 2079 | /// \param __a |
| 2080 | /// A 128-bit vector of [16 x i8]. |
| 2081 | /// \param __b |
| 2082 | /// A 128-bit vector of [16 x i8]. |
| 2083 | /// \returns A 128-bit vector of [16 x i8] containing the sums of both |
| 2084 | /// parameters. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2085 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2086 | _mm_add_epi8(__m128i __a, __m128i __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2087 | { |
Craig Topper | 6a77b62 | 2016-06-04 05:43:41 +0000 | [diff] [blame] | 2088 | return (__m128i)((__v16qu)__a + (__v16qu)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2089 | } |
| 2090 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2091 | /// \brief Adds the corresponding elements of two 128-bit vectors of [8 x i16], |
| 2092 | /// saving the lower 16 bits of each sum in the corresponding element of a |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 2093 | /// 128-bit result vector of [8 x i16]. |
| 2094 | /// |
| 2095 | /// The integer elements of both parameters can be either signed or unsigned. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2096 | /// |
| 2097 | /// \headerfile <x86intrin.h> |
| 2098 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2099 | /// This intrinsic corresponds to the <c> VPADDW / PADDW </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2100 | /// |
| 2101 | /// \param __a |
| 2102 | /// A 128-bit vector of [8 x i16]. |
| 2103 | /// \param __b |
| 2104 | /// A 128-bit vector of [8 x i16]. |
| 2105 | /// \returns A 128-bit vector of [8 x i16] containing the sums of both |
| 2106 | /// parameters. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2107 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2108 | _mm_add_epi16(__m128i __a, __m128i __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2109 | { |
Craig Topper | 6a77b62 | 2016-06-04 05:43:41 +0000 | [diff] [blame] | 2110 | return (__m128i)((__v8hu)__a + (__v8hu)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2111 | } |
| 2112 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2113 | /// \brief Adds the corresponding elements of two 128-bit vectors of [4 x i32], |
| 2114 | /// saving the lower 32 bits of each sum in the corresponding element of a |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 2115 | /// 128-bit result vector of [4 x i32]. |
| 2116 | /// |
| 2117 | /// The integer elements of both parameters can be either signed or unsigned. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2118 | /// |
| 2119 | /// \headerfile <x86intrin.h> |
| 2120 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2121 | /// This intrinsic corresponds to the <c> VPADDD / PADDD </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2122 | /// |
| 2123 | /// \param __a |
| 2124 | /// A 128-bit vector of [4 x i32]. |
| 2125 | /// \param __b |
| 2126 | /// A 128-bit vector of [4 x i32]. |
| 2127 | /// \returns A 128-bit vector of [4 x i32] containing the sums of both |
| 2128 | /// parameters. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2129 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2130 | _mm_add_epi32(__m128i __a, __m128i __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2131 | { |
Craig Topper | 6a77b62 | 2016-06-04 05:43:41 +0000 | [diff] [blame] | 2132 | return (__m128i)((__v4su)__a + (__v4su)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2133 | } |
| 2134 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2135 | /// \brief Adds two signed or unsigned 64-bit integer values, returning the |
| 2136 | /// lower 64 bits of the sum. |
| 2137 | /// |
| 2138 | /// \headerfile <x86intrin.h> |
| 2139 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2140 | /// This intrinsic corresponds to the <c> PADDQ </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2141 | /// |
| 2142 | /// \param __a |
| 2143 | /// A 64-bit integer. |
| 2144 | /// \param __b |
| 2145 | /// A 64-bit integer. |
| 2146 | /// \returns A 64-bit integer containing the sum of both parameters. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2147 | static __inline__ __m64 __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2148 | _mm_add_si64(__m64 __a, __m64 __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2149 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 2150 | return (__m64)__builtin_ia32_paddq((__v1di)__a, (__v1di)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2151 | } |
| 2152 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2153 | /// \brief Adds the corresponding elements of two 128-bit vectors of [2 x i64], |
| 2154 | /// saving the lower 64 bits of each sum in the corresponding element of a |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 2155 | /// 128-bit result vector of [2 x i64]. |
| 2156 | /// |
| 2157 | /// The integer elements of both parameters can be either signed or unsigned. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2158 | /// |
| 2159 | /// \headerfile <x86intrin.h> |
| 2160 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2161 | /// This intrinsic corresponds to the <c> VPADDQ / PADDQ </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2162 | /// |
| 2163 | /// \param __a |
| 2164 | /// A 128-bit vector of [2 x i64]. |
| 2165 | /// \param __b |
| 2166 | /// A 128-bit vector of [2 x i64]. |
| 2167 | /// \returns A 128-bit vector of [2 x i64] containing the sums of both |
| 2168 | /// parameters. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2169 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2170 | _mm_add_epi64(__m128i __a, __m128i __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2171 | { |
Craig Topper | 6a77b62 | 2016-06-04 05:43:41 +0000 | [diff] [blame] | 2172 | return (__m128i)((__v2du)__a + (__v2du)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2173 | } |
| 2174 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2175 | /// \brief Adds, with saturation, the corresponding elements of two 128-bit |
| 2176 | /// signed [16 x i8] vectors, saving each sum in the corresponding element of |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 2177 | /// a 128-bit result vector of [16 x i8]. Positive sums greater than 0x7F are |
| 2178 | /// saturated to 0x7F. Negative sums less than 0x80 are saturated to 0x80. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2179 | /// |
| 2180 | /// \headerfile <x86intrin.h> |
| 2181 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2182 | /// This intrinsic corresponds to the <c> VPADDSB / PADDSB </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2183 | /// |
| 2184 | /// \param __a |
| 2185 | /// A 128-bit signed [16 x i8] vector. |
| 2186 | /// \param __b |
| 2187 | /// A 128-bit signed [16 x i8] vector. |
| 2188 | /// \returns A 128-bit signed [16 x i8] vector containing the saturated sums of |
| 2189 | /// both parameters. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2190 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2191 | _mm_adds_epi8(__m128i __a, __m128i __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2192 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2193 | return (__m128i)__builtin_ia32_paddsb128((__v16qi)__a, (__v16qi)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2194 | } |
| 2195 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2196 | /// \brief Adds, with saturation, the corresponding elements of two 128-bit |
| 2197 | /// signed [8 x i16] vectors, saving each sum in the corresponding element of |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 2198 | /// a 128-bit result vector of [8 x i16]. Positive sums greater than 0x7FFF |
| 2199 | /// are saturated to 0x7FFF. Negative sums less than 0x8000 are saturated to |
| 2200 | /// 0x8000. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2201 | /// |
| 2202 | /// \headerfile <x86intrin.h> |
| 2203 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2204 | /// This intrinsic corresponds to the <c> VPADDSW / PADDSW </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2205 | /// |
| 2206 | /// \param __a |
| 2207 | /// A 128-bit signed [8 x i16] vector. |
| 2208 | /// \param __b |
| 2209 | /// A 128-bit signed [8 x i16] vector. |
| 2210 | /// \returns A 128-bit signed [8 x i16] vector containing the saturated sums of |
| 2211 | /// both parameters. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2212 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2213 | _mm_adds_epi16(__m128i __a, __m128i __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2214 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2215 | return (__m128i)__builtin_ia32_paddsw128((__v8hi)__a, (__v8hi)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2216 | } |
| 2217 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2218 | /// \brief Adds, with saturation, the corresponding elements of two 128-bit |
| 2219 | /// unsigned [16 x i8] vectors, saving each sum in the corresponding element |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 2220 | /// of a 128-bit result vector of [16 x i8]. Positive sums greater than 0xFF |
| 2221 | /// are saturated to 0xFF. Negative sums are saturated to 0x00. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2222 | /// |
| 2223 | /// \headerfile <x86intrin.h> |
| 2224 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2225 | /// This intrinsic corresponds to the <c> VPADDUSB / PADDUSB </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2226 | /// |
| 2227 | /// \param __a |
| 2228 | /// A 128-bit unsigned [16 x i8] vector. |
| 2229 | /// \param __b |
| 2230 | /// A 128-bit unsigned [16 x i8] vector. |
| 2231 | /// \returns A 128-bit unsigned [16 x i8] vector containing the saturated sums |
| 2232 | /// of both parameters. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2233 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2234 | _mm_adds_epu8(__m128i __a, __m128i __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2235 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2236 | return (__m128i)__builtin_ia32_paddusb128((__v16qi)__a, (__v16qi)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2237 | } |
| 2238 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2239 | /// \brief Adds, with saturation, the corresponding elements of two 128-bit |
| 2240 | /// unsigned [8 x i16] vectors, saving each sum in the corresponding element |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 2241 | /// of a 128-bit result vector of [8 x i16]. Positive sums greater than |
| 2242 | /// 0xFFFF are saturated to 0xFFFF. Negative sums are saturated to 0x0000. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2243 | /// |
| 2244 | /// \headerfile <x86intrin.h> |
| 2245 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2246 | /// This intrinsic corresponds to the <c> VPADDUSB / PADDUSB </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2247 | /// |
| 2248 | /// \param __a |
| 2249 | /// A 128-bit unsigned [8 x i16] vector. |
| 2250 | /// \param __b |
| 2251 | /// A 128-bit unsigned [8 x i16] vector. |
| 2252 | /// \returns A 128-bit unsigned [8 x i16] vector containing the saturated sums |
| 2253 | /// of both parameters. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2254 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2255 | _mm_adds_epu16(__m128i __a, __m128i __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2256 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2257 | return (__m128i)__builtin_ia32_paddusw128((__v8hi)__a, (__v8hi)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2258 | } |
| 2259 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2260 | /// \brief Computes the rounded avarages of corresponding elements of two |
| 2261 | /// 128-bit unsigned [16 x i8] vectors, saving each result in the |
| 2262 | /// corresponding element of a 128-bit result vector of [16 x i8]. |
| 2263 | /// |
| 2264 | /// \headerfile <x86intrin.h> |
| 2265 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2266 | /// This intrinsic corresponds to the <c> VPAVGB / PAVGB </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2267 | /// |
| 2268 | /// \param __a |
| 2269 | /// A 128-bit unsigned [16 x i8] vector. |
| 2270 | /// \param __b |
| 2271 | /// A 128-bit unsigned [16 x i8] vector. |
| 2272 | /// \returns A 128-bit unsigned [16 x i8] vector containing the rounded |
| 2273 | /// averages of both parameters. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2274 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2275 | _mm_avg_epu8(__m128i __a, __m128i __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2276 | { |
Yael Tsafrir | 23e7733 | 2017-09-12 07:46:32 +0000 | [diff] [blame] | 2277 | typedef unsigned short __v16hu __attribute__ ((__vector_size__ (32))); |
| 2278 | return (__m128i)__builtin_convertvector( |
| 2279 | ((__builtin_convertvector((__v16qu)__a, __v16hu) + |
| 2280 | __builtin_convertvector((__v16qu)__b, __v16hu)) + 1) |
| 2281 | >> 1, __v16qu); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2282 | } |
| 2283 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2284 | /// \brief Computes the rounded avarages of corresponding elements of two |
| 2285 | /// 128-bit unsigned [8 x i16] vectors, saving each result in the |
| 2286 | /// corresponding element of a 128-bit result vector of [8 x i16]. |
| 2287 | /// |
| 2288 | /// \headerfile <x86intrin.h> |
| 2289 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2290 | /// This intrinsic corresponds to the <c> VPAVGW / PAVGW </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2291 | /// |
| 2292 | /// \param __a |
| 2293 | /// A 128-bit unsigned [8 x i16] vector. |
| 2294 | /// \param __b |
| 2295 | /// A 128-bit unsigned [8 x i16] vector. |
| 2296 | /// \returns A 128-bit unsigned [8 x i16] vector containing the rounded |
| 2297 | /// averages of both parameters. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2298 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2299 | _mm_avg_epu16(__m128i __a, __m128i __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2300 | { |
Yael Tsafrir | 23e7733 | 2017-09-12 07:46:32 +0000 | [diff] [blame] | 2301 | typedef unsigned int __v8su __attribute__ ((__vector_size__ (32))); |
| 2302 | return (__m128i)__builtin_convertvector( |
| 2303 | ((__builtin_convertvector((__v8hu)__a, __v8su) + |
| 2304 | __builtin_convertvector((__v8hu)__b, __v8su)) + 1) |
| 2305 | >> 1, __v8hu); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2306 | } |
| 2307 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2308 | /// \brief Multiplies the corresponding elements of two 128-bit signed [8 x i16] |
| 2309 | /// vectors, producing eight intermediate 32-bit signed integer products, and |
| 2310 | /// adds the consecutive pairs of 32-bit products to form a 128-bit signed |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 2311 | /// [4 x i32] vector. |
| 2312 | /// |
| 2313 | /// For example, bits [15:0] of both parameters are multiplied producing a |
| 2314 | /// 32-bit product, bits [31:16] of both parameters are multiplied producing |
| 2315 | /// a 32-bit product, and the sum of those two products becomes bits [31:0] |
| 2316 | /// of the result. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2317 | /// |
| 2318 | /// \headerfile <x86intrin.h> |
| 2319 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2320 | /// This intrinsic corresponds to the <c> VPMADDWD / PMADDWD </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2321 | /// |
| 2322 | /// \param __a |
| 2323 | /// A 128-bit signed [8 x i16] vector. |
| 2324 | /// \param __b |
| 2325 | /// A 128-bit signed [8 x i16] vector. |
| 2326 | /// \returns A 128-bit signed [4 x i32] vector containing the sums of products |
| 2327 | /// of both parameters. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2328 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2329 | _mm_madd_epi16(__m128i __a, __m128i __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2330 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2331 | return (__m128i)__builtin_ia32_pmaddwd128((__v8hi)__a, (__v8hi)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2332 | } |
| 2333 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2334 | /// \brief Compares corresponding elements of two 128-bit signed [8 x i16] |
| 2335 | /// vectors, saving the greater value from each comparison in the |
| 2336 | /// corresponding element of a 128-bit result vector of [8 x i16]. |
| 2337 | /// |
| 2338 | /// \headerfile <x86intrin.h> |
| 2339 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2340 | /// This intrinsic corresponds to the <c> VPMAXSW / PMAXSW </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2341 | /// |
| 2342 | /// \param __a |
| 2343 | /// A 128-bit signed [8 x i16] vector. |
| 2344 | /// \param __b |
| 2345 | /// A 128-bit signed [8 x i16] vector. |
| 2346 | /// \returns A 128-bit signed [8 x i16] vector containing the greater value of |
| 2347 | /// each comparison. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2348 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2349 | _mm_max_epi16(__m128i __a, __m128i __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2350 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2351 | return (__m128i)__builtin_ia32_pmaxsw128((__v8hi)__a, (__v8hi)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2352 | } |
| 2353 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2354 | /// \brief Compares corresponding elements of two 128-bit unsigned [16 x i8] |
| 2355 | /// vectors, saving the greater value from each comparison in the |
| 2356 | /// corresponding element of a 128-bit result vector of [16 x i8]. |
| 2357 | /// |
| 2358 | /// \headerfile <x86intrin.h> |
| 2359 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2360 | /// This intrinsic corresponds to the <c> VPMAXUB / PMAXUB </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2361 | /// |
| 2362 | /// \param __a |
| 2363 | /// A 128-bit unsigned [16 x i8] vector. |
| 2364 | /// \param __b |
| 2365 | /// A 128-bit unsigned [16 x i8] vector. |
| 2366 | /// \returns A 128-bit unsigned [16 x i8] vector containing the greater value of |
| 2367 | /// each comparison. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2368 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2369 | _mm_max_epu8(__m128i __a, __m128i __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2370 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2371 | return (__m128i)__builtin_ia32_pmaxub128((__v16qi)__a, (__v16qi)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2372 | } |
| 2373 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2374 | /// \brief Compares corresponding elements of two 128-bit signed [8 x i16] |
| 2375 | /// vectors, saving the smaller value from each comparison in the |
| 2376 | /// corresponding element of a 128-bit result vector of [8 x i16]. |
| 2377 | /// |
| 2378 | /// \headerfile <x86intrin.h> |
| 2379 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2380 | /// This intrinsic corresponds to the <c> VPMINSW / PMINSW </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2381 | /// |
| 2382 | /// \param __a |
| 2383 | /// A 128-bit signed [8 x i16] vector. |
| 2384 | /// \param __b |
| 2385 | /// A 128-bit signed [8 x i16] vector. |
| 2386 | /// \returns A 128-bit signed [8 x i16] vector containing the smaller value of |
| 2387 | /// each comparison. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2388 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2389 | _mm_min_epi16(__m128i __a, __m128i __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2390 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2391 | return (__m128i)__builtin_ia32_pminsw128((__v8hi)__a, (__v8hi)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2392 | } |
| 2393 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2394 | /// \brief Compares corresponding elements of two 128-bit unsigned [16 x i8] |
| 2395 | /// vectors, saving the smaller value from each comparison in the |
| 2396 | /// corresponding element of a 128-bit result vector of [16 x i8]. |
| 2397 | /// |
| 2398 | /// \headerfile <x86intrin.h> |
| 2399 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2400 | /// This intrinsic corresponds to the <c> VPMINUB / PMINUB </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2401 | /// |
| 2402 | /// \param __a |
| 2403 | /// A 128-bit unsigned [16 x i8] vector. |
| 2404 | /// \param __b |
| 2405 | /// A 128-bit unsigned [16 x i8] vector. |
| 2406 | /// \returns A 128-bit unsigned [16 x i8] vector containing the smaller value of |
| 2407 | /// each comparison. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2408 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2409 | _mm_min_epu8(__m128i __a, __m128i __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2410 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2411 | return (__m128i)__builtin_ia32_pminub128((__v16qi)__a, (__v16qi)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2412 | } |
| 2413 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2414 | /// \brief Multiplies the corresponding elements of two signed [8 x i16] |
| 2415 | /// vectors, saving the upper 16 bits of each 32-bit product in the |
| 2416 | /// corresponding element of a 128-bit signed [8 x i16] result vector. |
| 2417 | /// |
| 2418 | /// \headerfile <x86intrin.h> |
| 2419 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2420 | /// This intrinsic corresponds to the <c> VPMULHW / PMULHW </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2421 | /// |
| 2422 | /// \param __a |
| 2423 | /// A 128-bit signed [8 x i16] vector. |
| 2424 | /// \param __b |
| 2425 | /// A 128-bit signed [8 x i16] vector. |
| 2426 | /// \returns A 128-bit signed [8 x i16] vector containing the upper 16 bits of |
| 2427 | /// each of the eight 32-bit products. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2428 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2429 | _mm_mulhi_epi16(__m128i __a, __m128i __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2430 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2431 | return (__m128i)__builtin_ia32_pmulhw128((__v8hi)__a, (__v8hi)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2432 | } |
| 2433 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2434 | /// \brief Multiplies the corresponding elements of two unsigned [8 x i16] |
| 2435 | /// vectors, saving the upper 16 bits of each 32-bit product in the |
| 2436 | /// corresponding element of a 128-bit unsigned [8 x i16] result vector. |
| 2437 | /// |
| 2438 | /// \headerfile <x86intrin.h> |
| 2439 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2440 | /// This intrinsic corresponds to the <c> VPMULHUW / PMULHUW </c> instruction. |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2441 | /// |
| 2442 | /// \param __a |
| 2443 | /// A 128-bit unsigned [8 x i16] vector. |
| 2444 | /// \param __b |
| 2445 | /// A 128-bit unsigned [8 x i16] vector. |
| 2446 | /// \returns A 128-bit unsigned [8 x i16] vector containing the upper 16 bits |
| 2447 | /// of each of the eight 32-bit products. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2448 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2449 | _mm_mulhi_epu16(__m128i __a, __m128i __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2450 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2451 | return (__m128i)__builtin_ia32_pmulhuw128((__v8hi)__a, (__v8hi)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2452 | } |
| 2453 | |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2454 | /// \brief Multiplies the corresponding elements of two signed [8 x i16] |
| 2455 | /// vectors, saving the lower 16 bits of each 32-bit product in the |
| 2456 | /// corresponding element of a 128-bit signed [8 x i16] result vector. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2457 | /// |
| 2458 | /// \headerfile <x86intrin.h> |
| 2459 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2460 | /// This intrinsic corresponds to the <c> VPMULLW / PMULLW </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2461 | /// |
| 2462 | /// \param __a |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2463 | /// A 128-bit signed [8 x i16] vector. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2464 | /// \param __b |
Ekaterina Romanova | 06477bf | 2016-10-23 07:30:50 +0000 | [diff] [blame] | 2465 | /// A 128-bit signed [8 x i16] vector. |
| 2466 | /// \returns A 128-bit signed [8 x i16] vector containing the lower 16 bits of |
| 2467 | /// each of the eight 32-bit products. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2468 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2469 | _mm_mullo_epi16(__m128i __a, __m128i __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2470 | { |
Craig Topper | 6a77b62 | 2016-06-04 05:43:41 +0000 | [diff] [blame] | 2471 | return (__m128i)((__v8hu)__a * (__v8hu)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2472 | } |
| 2473 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2474 | /// \brief Multiplies 32-bit unsigned integer values contained in the lower bits |
| 2475 | /// of the two 64-bit integer vectors and returns the 64-bit unsigned |
| 2476 | /// product. |
| 2477 | /// |
| 2478 | /// \headerfile <x86intrin.h> |
| 2479 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2480 | /// This intrinsic corresponds to the <c> PMULUDQ </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2481 | /// |
| 2482 | /// \param __a |
| 2483 | /// A 64-bit integer containing one of the source operands. |
| 2484 | /// \param __b |
| 2485 | /// A 64-bit integer containing one of the source operands. |
| 2486 | /// \returns A 64-bit integer vector containing the product of both operands. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2487 | static __inline__ __m64 __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2488 | _mm_mul_su32(__m64 __a, __m64 __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2489 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2490 | return __builtin_ia32_pmuludq((__v2si)__a, (__v2si)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2491 | } |
| 2492 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2493 | /// \brief Multiplies 32-bit unsigned integer values contained in the lower |
| 2494 | /// bits of the corresponding elements of two [2 x i64] vectors, and returns |
| 2495 | /// the 64-bit products in the corresponding elements of a [2 x i64] vector. |
| 2496 | /// |
| 2497 | /// \headerfile <x86intrin.h> |
| 2498 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2499 | /// This intrinsic corresponds to the <c> VPMULUDQ / PMULUDQ </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2500 | /// |
| 2501 | /// \param __a |
| 2502 | /// A [2 x i64] vector containing one of the source operands. |
| 2503 | /// \param __b |
| 2504 | /// A [2 x i64] vector containing one of the source operands. |
| 2505 | /// \returns A [2 x i64] vector containing the product of both operands. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2506 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2507 | _mm_mul_epu32(__m128i __a, __m128i __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2508 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2509 | return __builtin_ia32_pmuludq128((__v4si)__a, (__v4si)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2510 | } |
| 2511 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2512 | /// \brief Computes the absolute differences of corresponding 8-bit integer |
| 2513 | /// values in two 128-bit vectors. Sums the first 8 absolute differences, and |
Ekaterina Romanova | ff266f5 | 2017-02-17 02:49:50 +0000 | [diff] [blame] | 2514 | /// separately sums the second 8 absolute differences. Packs these two |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2515 | /// unsigned 16-bit integer sums into the upper and lower elements of a |
| 2516 | /// [2 x i64] vector. |
| 2517 | /// |
| 2518 | /// \headerfile <x86intrin.h> |
| 2519 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2520 | /// This intrinsic corresponds to the <c> VPSADBW / PSADBW </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2521 | /// |
| 2522 | /// \param __a |
| 2523 | /// A 128-bit integer vector containing one of the source operands. |
| 2524 | /// \param __b |
| 2525 | /// A 128-bit integer vector containing one of the source operands. |
| 2526 | /// \returns A [2 x i64] vector containing the sums of the sets of absolute |
| 2527 | /// differences between both operands. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2528 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2529 | _mm_sad_epu8(__m128i __a, __m128i __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2530 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2531 | return __builtin_ia32_psadbw128((__v16qi)__a, (__v16qi)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2532 | } |
| 2533 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2534 | /// \brief Subtracts the corresponding 8-bit integer values in the operands. |
| 2535 | /// |
| 2536 | /// \headerfile <x86intrin.h> |
| 2537 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2538 | /// This intrinsic corresponds to the <c> VPSUBB / PSUBB </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2539 | /// |
| 2540 | /// \param __a |
| 2541 | /// A 128-bit integer vector containing the minuends. |
| 2542 | /// \param __b |
| 2543 | /// A 128-bit integer vector containing the subtrahends. |
| 2544 | /// \returns A 128-bit integer vector containing the differences of the values |
| 2545 | /// in the operands. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2546 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2547 | _mm_sub_epi8(__m128i __a, __m128i __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2548 | { |
Craig Topper | 6a77b62 | 2016-06-04 05:43:41 +0000 | [diff] [blame] | 2549 | return (__m128i)((__v16qu)__a - (__v16qu)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2550 | } |
| 2551 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2552 | /// \brief Subtracts the corresponding 16-bit integer values in the operands. |
| 2553 | /// |
| 2554 | /// \headerfile <x86intrin.h> |
| 2555 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2556 | /// This intrinsic corresponds to the <c> VPSUBW / PSUBW </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2557 | /// |
| 2558 | /// \param __a |
| 2559 | /// A 128-bit integer vector containing the minuends. |
| 2560 | /// \param __b |
| 2561 | /// A 128-bit integer vector containing the subtrahends. |
| 2562 | /// \returns A 128-bit integer vector containing the differences of the values |
| 2563 | /// in the operands. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2564 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2565 | _mm_sub_epi16(__m128i __a, __m128i __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2566 | { |
Craig Topper | 6a77b62 | 2016-06-04 05:43:41 +0000 | [diff] [blame] | 2567 | return (__m128i)((__v8hu)__a - (__v8hu)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2568 | } |
| 2569 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2570 | /// \brief Subtracts the corresponding 32-bit integer values in the operands. |
| 2571 | /// |
| 2572 | /// \headerfile <x86intrin.h> |
| 2573 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2574 | /// This intrinsic corresponds to the <c> VPSUBD / PSUBD </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2575 | /// |
| 2576 | /// \param __a |
| 2577 | /// A 128-bit integer vector containing the minuends. |
| 2578 | /// \param __b |
| 2579 | /// A 128-bit integer vector containing the subtrahends. |
| 2580 | /// \returns A 128-bit integer vector containing the differences of the values |
| 2581 | /// in the operands. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2582 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2583 | _mm_sub_epi32(__m128i __a, __m128i __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2584 | { |
Craig Topper | 6a77b62 | 2016-06-04 05:43:41 +0000 | [diff] [blame] | 2585 | return (__m128i)((__v4su)__a - (__v4su)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2586 | } |
| 2587 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2588 | /// \brief Subtracts signed or unsigned 64-bit integer values and writes the |
| 2589 | /// difference to the corresponding bits in the destination. |
| 2590 | /// |
| 2591 | /// \headerfile <x86intrin.h> |
| 2592 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2593 | /// This intrinsic corresponds to the <c> PSUBQ </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2594 | /// |
| 2595 | /// \param __a |
| 2596 | /// A 64-bit integer vector containing the minuend. |
| 2597 | /// \param __b |
| 2598 | /// A 64-bit integer vector containing the subtrahend. |
| 2599 | /// \returns A 64-bit integer vector containing the difference of the values in |
| 2600 | /// the operands. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2601 | static __inline__ __m64 __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2602 | _mm_sub_si64(__m64 __a, __m64 __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2603 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 2604 | return (__m64)__builtin_ia32_psubq((__v1di)__a, (__v1di)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2605 | } |
| 2606 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2607 | /// \brief Subtracts the corresponding elements of two [2 x i64] vectors. |
| 2608 | /// |
| 2609 | /// \headerfile <x86intrin.h> |
| 2610 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2611 | /// This intrinsic corresponds to the <c> VPSUBQ / PSUBQ </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2612 | /// |
| 2613 | /// \param __a |
| 2614 | /// A 128-bit integer vector containing the minuends. |
| 2615 | /// \param __b |
| 2616 | /// A 128-bit integer vector containing the subtrahends. |
| 2617 | /// \returns A 128-bit integer vector containing the differences of the values |
| 2618 | /// in the operands. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2619 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2620 | _mm_sub_epi64(__m128i __a, __m128i __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2621 | { |
Craig Topper | 6a77b62 | 2016-06-04 05:43:41 +0000 | [diff] [blame] | 2622 | return (__m128i)((__v2du)__a - (__v2du)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2623 | } |
| 2624 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2625 | /// \brief Subtracts corresponding 8-bit signed integer values in the input and |
| 2626 | /// returns the differences in the corresponding bytes in the destination. |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 2627 | /// Differences greater than 0x7F are saturated to 0x7F, and differences less |
| 2628 | /// than 0x80 are saturated to 0x80. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2629 | /// |
| 2630 | /// \headerfile <x86intrin.h> |
| 2631 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2632 | /// This intrinsic corresponds to the <c> VPSUBSB / PSUBSB </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2633 | /// |
| 2634 | /// \param __a |
| 2635 | /// A 128-bit integer vector containing the minuends. |
| 2636 | /// \param __b |
| 2637 | /// A 128-bit integer vector containing the subtrahends. |
| 2638 | /// \returns A 128-bit integer vector containing the differences of the values |
| 2639 | /// in the operands. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2640 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2641 | _mm_subs_epi8(__m128i __a, __m128i __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2642 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2643 | return (__m128i)__builtin_ia32_psubsb128((__v16qi)__a, (__v16qi)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2644 | } |
| 2645 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2646 | /// \brief Subtracts corresponding 16-bit signed integer values in the input and |
| 2647 | /// returns the differences in the corresponding bytes in the destination. |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 2648 | /// Differences greater than 0x7FFF are saturated to 0x7FFF, and values less |
| 2649 | /// than 0x8000 are saturated to 0x8000. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2650 | /// |
| 2651 | /// \headerfile <x86intrin.h> |
| 2652 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2653 | /// This intrinsic corresponds to the <c> VPSUBSW / PSUBSW </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2654 | /// |
| 2655 | /// \param __a |
| 2656 | /// A 128-bit integer vector containing the minuends. |
| 2657 | /// \param __b |
| 2658 | /// A 128-bit integer vector containing the subtrahends. |
| 2659 | /// \returns A 128-bit integer vector containing the differences of the values |
| 2660 | /// in the operands. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2661 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2662 | _mm_subs_epi16(__m128i __a, __m128i __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2663 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2664 | return (__m128i)__builtin_ia32_psubsw128((__v8hi)__a, (__v8hi)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2665 | } |
| 2666 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2667 | /// \brief Subtracts corresponding 8-bit unsigned integer values in the input |
| 2668 | /// and returns the differences in the corresponding bytes in the |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 2669 | /// destination. Differences less than 0x00 are saturated to 0x00. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2670 | /// |
| 2671 | /// \headerfile <x86intrin.h> |
| 2672 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2673 | /// This intrinsic corresponds to the <c> VPSUBUSB / PSUBUSB </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2674 | /// |
| 2675 | /// \param __a |
| 2676 | /// A 128-bit integer vector containing the minuends. |
| 2677 | /// \param __b |
| 2678 | /// A 128-bit integer vector containing the subtrahends. |
| 2679 | /// \returns A 128-bit integer vector containing the unsigned integer |
| 2680 | /// differences of the values in the operands. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2681 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2682 | _mm_subs_epu8(__m128i __a, __m128i __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2683 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2684 | return (__m128i)__builtin_ia32_psubusb128((__v16qi)__a, (__v16qi)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2685 | } |
| 2686 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2687 | /// \brief Subtracts corresponding 16-bit unsigned integer values in the input |
| 2688 | /// and returns the differences in the corresponding bytes in the |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 2689 | /// destination. Differences less than 0x0000 are saturated to 0x0000. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2690 | /// |
| 2691 | /// \headerfile <x86intrin.h> |
| 2692 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2693 | /// This intrinsic corresponds to the <c> VPSUBUSW / PSUBUSW </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2694 | /// |
| 2695 | /// \param __a |
| 2696 | /// A 128-bit integer vector containing the minuends. |
| 2697 | /// \param __b |
| 2698 | /// A 128-bit integer vector containing the subtrahends. |
| 2699 | /// \returns A 128-bit integer vector containing the unsigned integer |
| 2700 | /// differences of the values in the operands. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2701 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2702 | _mm_subs_epu16(__m128i __a, __m128i __b) |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2703 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2704 | return (__m128i)__builtin_ia32_psubusw128((__v8hi)__a, (__v8hi)__b); |
Anders Carlsson | a283f91 | 2008-12-24 02:41:00 +0000 | [diff] [blame] | 2705 | } |
| 2706 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2707 | /// \brief Performs a bitwise AND of two 128-bit integer vectors. |
| 2708 | /// |
| 2709 | /// \headerfile <x86intrin.h> |
| 2710 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2711 | /// This intrinsic corresponds to the <c> VPAND / PAND </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2712 | /// |
| 2713 | /// \param __a |
| 2714 | /// A 128-bit integer vector containing one of the source operands. |
| 2715 | /// \param __b |
| 2716 | /// A 128-bit integer vector containing one of the source operands. |
| 2717 | /// \returns A 128-bit integer vector containing the bitwise AND of the values |
| 2718 | /// in both operands. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2719 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2720 | _mm_and_si128(__m128i __a, __m128i __b) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 2721 | { |
Craig Topper | 6a77b62 | 2016-06-04 05:43:41 +0000 | [diff] [blame] | 2722 | return (__m128i)((__v2du)__a & (__v2du)__b); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 2723 | } |
| 2724 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2725 | /// \brief Performs a bitwise AND of two 128-bit integer vectors, using the |
| 2726 | /// one's complement of the values contained in the first source operand. |
| 2727 | /// |
| 2728 | /// \headerfile <x86intrin.h> |
| 2729 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2730 | /// This intrinsic corresponds to the <c> VPANDN / PANDN </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2731 | /// |
| 2732 | /// \param __a |
| 2733 | /// A 128-bit vector containing the left source operand. The one's complement |
| 2734 | /// of this value is used in the bitwise AND. |
| 2735 | /// \param __b |
| 2736 | /// A 128-bit vector containing the right source operand. |
| 2737 | /// \returns A 128-bit integer vector containing the bitwise AND of the one's |
| 2738 | /// complement of the first operand and the values in the second operand. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2739 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2740 | _mm_andnot_si128(__m128i __a, __m128i __b) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 2741 | { |
Craig Topper | 6a77b62 | 2016-06-04 05:43:41 +0000 | [diff] [blame] | 2742 | return (__m128i)(~(__v2du)__a & (__v2du)__b); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 2743 | } |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2744 | /// \brief Performs a bitwise OR of two 128-bit integer vectors. |
| 2745 | /// |
| 2746 | /// \headerfile <x86intrin.h> |
| 2747 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2748 | /// This intrinsic corresponds to the <c> VPOR / POR </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2749 | /// |
| 2750 | /// \param __a |
| 2751 | /// A 128-bit integer vector containing one of the source operands. |
| 2752 | /// \param __b |
| 2753 | /// A 128-bit integer vector containing one of the source operands. |
| 2754 | /// \returns A 128-bit integer vector containing the bitwise OR of the values |
| 2755 | /// in both operands. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2756 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2757 | _mm_or_si128(__m128i __a, __m128i __b) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 2758 | { |
Craig Topper | 6a77b62 | 2016-06-04 05:43:41 +0000 | [diff] [blame] | 2759 | return (__m128i)((__v2du)__a | (__v2du)__b); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 2760 | } |
| 2761 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2762 | /// \brief Performs a bitwise exclusive OR of two 128-bit integer vectors. |
| 2763 | /// |
| 2764 | /// \headerfile <x86intrin.h> |
| 2765 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2766 | /// This intrinsic corresponds to the <c> VPXOR / PXOR </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2767 | /// |
| 2768 | /// \param __a |
| 2769 | /// A 128-bit integer vector containing one of the source operands. |
| 2770 | /// \param __b |
| 2771 | /// A 128-bit integer vector containing one of the source operands. |
| 2772 | /// \returns A 128-bit integer vector containing the bitwise exclusive OR of the |
| 2773 | /// values in both operands. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2774 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2775 | _mm_xor_si128(__m128i __a, __m128i __b) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 2776 | { |
Craig Topper | 6a77b62 | 2016-06-04 05:43:41 +0000 | [diff] [blame] | 2777 | return (__m128i)((__v2du)__a ^ (__v2du)__b); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 2778 | } |
| 2779 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2780 | /// \brief Left-shifts the 128-bit integer vector operand by the specified |
| 2781 | /// number of bytes. Low-order bits are cleared. |
| 2782 | /// |
| 2783 | /// \headerfile <x86intrin.h> |
| 2784 | /// |
| 2785 | /// \code |
| 2786 | /// __m128i _mm_slli_si128(__m128i a, const int imm); |
| 2787 | /// \endcode |
| 2788 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2789 | /// This intrinsic corresponds to the <c> VPSLLDQ / PSLLDQ </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2790 | /// |
| 2791 | /// \param a |
| 2792 | /// A 128-bit integer vector containing the source operand. |
| 2793 | /// \param imm |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 2794 | /// An immediate value specifying the number of bytes to left-shift operand |
| 2795 | /// \a a. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2796 | /// \returns A 128-bit integer vector containing the left-shifted value. |
Craig Topper | 50e3dfe | 2016-06-25 07:31:14 +0000 | [diff] [blame] | 2797 | #define _mm_slli_si128(a, imm) __extension__ ({ \ |
| 2798 | (__m128i)__builtin_shufflevector( \ |
| 2799 | (__v16qi)_mm_setzero_si128(), \ |
| 2800 | (__v16qi)(__m128i)(a), \ |
| 2801 | ((char)(imm)&0xF0) ? 0 : 16 - (char)(imm), \ |
| 2802 | ((char)(imm)&0xF0) ? 1 : 17 - (char)(imm), \ |
| 2803 | ((char)(imm)&0xF0) ? 2 : 18 - (char)(imm), \ |
| 2804 | ((char)(imm)&0xF0) ? 3 : 19 - (char)(imm), \ |
| 2805 | ((char)(imm)&0xF0) ? 4 : 20 - (char)(imm), \ |
| 2806 | ((char)(imm)&0xF0) ? 5 : 21 - (char)(imm), \ |
| 2807 | ((char)(imm)&0xF0) ? 6 : 22 - (char)(imm), \ |
| 2808 | ((char)(imm)&0xF0) ? 7 : 23 - (char)(imm), \ |
| 2809 | ((char)(imm)&0xF0) ? 8 : 24 - (char)(imm), \ |
| 2810 | ((char)(imm)&0xF0) ? 9 : 25 - (char)(imm), \ |
| 2811 | ((char)(imm)&0xF0) ? 10 : 26 - (char)(imm), \ |
| 2812 | ((char)(imm)&0xF0) ? 11 : 27 - (char)(imm), \ |
| 2813 | ((char)(imm)&0xF0) ? 12 : 28 - (char)(imm), \ |
| 2814 | ((char)(imm)&0xF0) ? 13 : 29 - (char)(imm), \ |
| 2815 | ((char)(imm)&0xF0) ? 14 : 30 - (char)(imm), \ |
| 2816 | ((char)(imm)&0xF0) ? 15 : 31 - (char)(imm)); }) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 2817 | |
Craig Topper | a462482 | 2015-02-13 06:04:45 +0000 | [diff] [blame] | 2818 | #define _mm_bslli_si128(a, imm) \ |
| 2819 | _mm_slli_si128((a), (imm)) |
| 2820 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2821 | /// \brief Left-shifts each 16-bit value in the 128-bit integer vector operand |
| 2822 | /// by the specified number of bits. Low-order bits are cleared. |
| 2823 | /// |
| 2824 | /// \headerfile <x86intrin.h> |
| 2825 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2826 | /// This intrinsic corresponds to the <c> VPSLLW / PSLLW </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2827 | /// |
| 2828 | /// \param __a |
| 2829 | /// A 128-bit integer vector containing the source operand. |
| 2830 | /// \param __count |
| 2831 | /// An integer value specifying the number of bits to left-shift each value |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 2832 | /// in operand \a __a. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2833 | /// \returns A 128-bit integer vector containing the left-shifted values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2834 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2835 | _mm_slli_epi16(__m128i __a, int __count) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 2836 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2837 | return (__m128i)__builtin_ia32_psllwi128((__v8hi)__a, __count); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 2838 | } |
| 2839 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2840 | /// \brief Left-shifts each 16-bit value in the 128-bit integer vector operand |
| 2841 | /// by the specified number of bits. Low-order bits are cleared. |
| 2842 | /// |
| 2843 | /// \headerfile <x86intrin.h> |
| 2844 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2845 | /// This intrinsic corresponds to the <c> VPSLLW / PSLLW </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2846 | /// |
| 2847 | /// \param __a |
| 2848 | /// A 128-bit integer vector containing the source operand. |
| 2849 | /// \param __count |
| 2850 | /// A 128-bit integer vector in which bits [63:0] specify the number of bits |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 2851 | /// to left-shift each value in operand \a __a. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2852 | /// \returns A 128-bit integer vector containing the left-shifted values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2853 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2854 | _mm_sll_epi16(__m128i __a, __m128i __count) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 2855 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2856 | return (__m128i)__builtin_ia32_psllw128((__v8hi)__a, (__v8hi)__count); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 2857 | } |
| 2858 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2859 | /// \brief Left-shifts each 32-bit value in the 128-bit integer vector operand |
| 2860 | /// by the specified number of bits. Low-order bits are cleared. |
| 2861 | /// |
| 2862 | /// \headerfile <x86intrin.h> |
| 2863 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2864 | /// This intrinsic corresponds to the <c> VPSLLD / PSLLD </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2865 | /// |
| 2866 | /// \param __a |
| 2867 | /// A 128-bit integer vector containing the source operand. |
| 2868 | /// \param __count |
| 2869 | /// An integer value specifying the number of bits to left-shift each value |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 2870 | /// in operand \a __a. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2871 | /// \returns A 128-bit integer vector containing the left-shifted values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2872 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2873 | _mm_slli_epi32(__m128i __a, int __count) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 2874 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2875 | return (__m128i)__builtin_ia32_pslldi128((__v4si)__a, __count); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 2876 | } |
| 2877 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2878 | /// \brief Left-shifts each 32-bit value in the 128-bit integer vector operand |
| 2879 | /// by the specified number of bits. Low-order bits are cleared. |
| 2880 | /// |
| 2881 | /// \headerfile <x86intrin.h> |
| 2882 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2883 | /// This intrinsic corresponds to the <c> VPSLLD / PSLLD </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2884 | /// |
| 2885 | /// \param __a |
| 2886 | /// A 128-bit integer vector containing the source operand. |
| 2887 | /// \param __count |
| 2888 | /// A 128-bit integer vector in which bits [63:0] specify the number of bits |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 2889 | /// to left-shift each value in operand \a __a. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2890 | /// \returns A 128-bit integer vector containing the left-shifted values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2891 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2892 | _mm_sll_epi32(__m128i __a, __m128i __count) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 2893 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2894 | return (__m128i)__builtin_ia32_pslld128((__v4si)__a, (__v4si)__count); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 2895 | } |
| 2896 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2897 | /// \brief Left-shifts each 64-bit value in the 128-bit integer vector operand |
| 2898 | /// by the specified number of bits. Low-order bits are cleared. |
| 2899 | /// |
| 2900 | /// \headerfile <x86intrin.h> |
| 2901 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2902 | /// This intrinsic corresponds to the <c> VPSLLQ / PSLLQ </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2903 | /// |
| 2904 | /// \param __a |
| 2905 | /// A 128-bit integer vector containing the source operand. |
| 2906 | /// \param __count |
| 2907 | /// An integer value specifying the number of bits to left-shift each value |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 2908 | /// in operand \a __a. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2909 | /// \returns A 128-bit integer vector containing the left-shifted values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2910 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2911 | _mm_slli_epi64(__m128i __a, int __count) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 2912 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 2913 | return __builtin_ia32_psllqi128((__v2di)__a, __count); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 2914 | } |
| 2915 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2916 | /// \brief Left-shifts each 64-bit value in the 128-bit integer vector operand |
| 2917 | /// by the specified number of bits. Low-order bits are cleared. |
| 2918 | /// |
| 2919 | /// \headerfile <x86intrin.h> |
| 2920 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2921 | /// This intrinsic corresponds to the <c> VPSLLQ / PSLLQ </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2922 | /// |
| 2923 | /// \param __a |
| 2924 | /// A 128-bit integer vector containing the source operand. |
| 2925 | /// \param __count |
| 2926 | /// A 128-bit integer vector in which bits [63:0] specify the number of bits |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 2927 | /// to left-shift each value in operand \a __a. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2928 | /// \returns A 128-bit integer vector containing the left-shifted values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2929 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2930 | _mm_sll_epi64(__m128i __a, __m128i __count) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 2931 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 2932 | return __builtin_ia32_psllq128((__v2di)__a, (__v2di)__count); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 2933 | } |
| 2934 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2935 | /// \brief Right-shifts each 16-bit value in the 128-bit integer vector operand |
| 2936 | /// by the specified number of bits. High-order bits are filled with the sign |
| 2937 | /// bit of the initial value. |
| 2938 | /// |
| 2939 | /// \headerfile <x86intrin.h> |
| 2940 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2941 | /// This intrinsic corresponds to the <c> VPSRAW / PSRAW </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2942 | /// |
| 2943 | /// \param __a |
| 2944 | /// A 128-bit integer vector containing the source operand. |
| 2945 | /// \param __count |
| 2946 | /// An integer value specifying the number of bits to right-shift each value |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 2947 | /// in operand \a __a. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2948 | /// \returns A 128-bit integer vector containing the right-shifted values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2949 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2950 | _mm_srai_epi16(__m128i __a, int __count) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 2951 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2952 | return (__m128i)__builtin_ia32_psrawi128((__v8hi)__a, __count); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 2953 | } |
| 2954 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2955 | /// \brief Right-shifts each 16-bit value in the 128-bit integer vector operand |
| 2956 | /// by the specified number of bits. High-order bits are filled with the sign |
| 2957 | /// bit of the initial value. |
| 2958 | /// |
| 2959 | /// \headerfile <x86intrin.h> |
| 2960 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2961 | /// This intrinsic corresponds to the <c> VPSRAW / PSRAW </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2962 | /// |
| 2963 | /// \param __a |
| 2964 | /// A 128-bit integer vector containing the source operand. |
| 2965 | /// \param __count |
| 2966 | /// A 128-bit integer vector in which bits [63:0] specify the number of bits |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 2967 | /// to right-shift each value in operand \a __a. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2968 | /// \returns A 128-bit integer vector containing the right-shifted values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2969 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2970 | _mm_sra_epi16(__m128i __a, __m128i __count) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 2971 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2972 | return (__m128i)__builtin_ia32_psraw128((__v8hi)__a, (__v8hi)__count); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 2973 | } |
| 2974 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2975 | /// \brief Right-shifts each 32-bit value in the 128-bit integer vector operand |
| 2976 | /// by the specified number of bits. High-order bits are filled with the sign |
| 2977 | /// bit of the initial value. |
| 2978 | /// |
| 2979 | /// \headerfile <x86intrin.h> |
| 2980 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 2981 | /// This intrinsic corresponds to the <c> VPSRAD / PSRAD </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2982 | /// |
| 2983 | /// \param __a |
| 2984 | /// A 128-bit integer vector containing the source operand. |
| 2985 | /// \param __count |
| 2986 | /// An integer value specifying the number of bits to right-shift each value |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 2987 | /// in operand \a __a. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2988 | /// \returns A 128-bit integer vector containing the right-shifted values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 2989 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2990 | _mm_srai_epi32(__m128i __a, int __count) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 2991 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 2992 | return (__m128i)__builtin_ia32_psradi128((__v4si)__a, __count); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 2993 | } |
| 2994 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 2995 | /// \brief Right-shifts each 32-bit value in the 128-bit integer vector operand |
| 2996 | /// by the specified number of bits. High-order bits are filled with the sign |
| 2997 | /// bit of the initial value. |
| 2998 | /// |
| 2999 | /// \headerfile <x86intrin.h> |
| 3000 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3001 | /// This intrinsic corresponds to the <c> VPSRAD / PSRAD </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3002 | /// |
| 3003 | /// \param __a |
| 3004 | /// A 128-bit integer vector containing the source operand. |
| 3005 | /// \param __count |
| 3006 | /// A 128-bit integer vector in which bits [63:0] specify the number of bits |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 3007 | /// to right-shift each value in operand \a __a. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3008 | /// \returns A 128-bit integer vector containing the right-shifted values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3009 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3010 | _mm_sra_epi32(__m128i __a, __m128i __count) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3011 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3012 | return (__m128i)__builtin_ia32_psrad128((__v4si)__a, (__v4si)__count); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3013 | } |
| 3014 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3015 | /// \brief Right-shifts the 128-bit integer vector operand by the specified |
| 3016 | /// number of bytes. High-order bits are cleared. |
| 3017 | /// |
| 3018 | /// \headerfile <x86intrin.h> |
| 3019 | /// |
| 3020 | /// \code |
| 3021 | /// __m128i _mm_srli_si128(__m128i a, const int imm); |
| 3022 | /// \endcode |
| 3023 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3024 | /// This intrinsic corresponds to the <c> VPSRLDQ / PSRLDQ </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3025 | /// |
| 3026 | /// \param a |
| 3027 | /// A 128-bit integer vector containing the source operand. |
| 3028 | /// \param imm |
| 3029 | /// An immediate value specifying the number of bytes to right-shift operand |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 3030 | /// \a a. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3031 | /// \returns A 128-bit integer vector containing the right-shifted value. |
Craig Topper | 50e3dfe | 2016-06-25 07:31:14 +0000 | [diff] [blame] | 3032 | #define _mm_srli_si128(a, imm) __extension__ ({ \ |
| 3033 | (__m128i)__builtin_shufflevector( \ |
| 3034 | (__v16qi)(__m128i)(a), \ |
| 3035 | (__v16qi)_mm_setzero_si128(), \ |
| 3036 | ((char)(imm)&0xF0) ? 16 : (char)(imm) + 0, \ |
| 3037 | ((char)(imm)&0xF0) ? 17 : (char)(imm) + 1, \ |
| 3038 | ((char)(imm)&0xF0) ? 18 : (char)(imm) + 2, \ |
| 3039 | ((char)(imm)&0xF0) ? 19 : (char)(imm) + 3, \ |
| 3040 | ((char)(imm)&0xF0) ? 20 : (char)(imm) + 4, \ |
| 3041 | ((char)(imm)&0xF0) ? 21 : (char)(imm) + 5, \ |
| 3042 | ((char)(imm)&0xF0) ? 22 : (char)(imm) + 6, \ |
| 3043 | ((char)(imm)&0xF0) ? 23 : (char)(imm) + 7, \ |
| 3044 | ((char)(imm)&0xF0) ? 24 : (char)(imm) + 8, \ |
| 3045 | ((char)(imm)&0xF0) ? 25 : (char)(imm) + 9, \ |
| 3046 | ((char)(imm)&0xF0) ? 26 : (char)(imm) + 10, \ |
| 3047 | ((char)(imm)&0xF0) ? 27 : (char)(imm) + 11, \ |
| 3048 | ((char)(imm)&0xF0) ? 28 : (char)(imm) + 12, \ |
| 3049 | ((char)(imm)&0xF0) ? 29 : (char)(imm) + 13, \ |
| 3050 | ((char)(imm)&0xF0) ? 30 : (char)(imm) + 14, \ |
| 3051 | ((char)(imm)&0xF0) ? 31 : (char)(imm) + 15); }) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3052 | |
Craig Topper | a462482 | 2015-02-13 06:04:45 +0000 | [diff] [blame] | 3053 | #define _mm_bsrli_si128(a, imm) \ |
| 3054 | _mm_srli_si128((a), (imm)) |
| 3055 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3056 | /// \brief Right-shifts each of 16-bit values in the 128-bit integer vector |
| 3057 | /// operand by the specified number of bits. High-order bits are cleared. |
| 3058 | /// |
| 3059 | /// \headerfile <x86intrin.h> |
| 3060 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3061 | /// This intrinsic corresponds to the <c> VPSRLW / PSRLW </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3062 | /// |
| 3063 | /// \param __a |
| 3064 | /// A 128-bit integer vector containing the source operand. |
| 3065 | /// \param __count |
| 3066 | /// An integer value specifying the number of bits to right-shift each value |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 3067 | /// in operand \a __a. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3068 | /// \returns A 128-bit integer vector containing the right-shifted values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3069 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3070 | _mm_srli_epi16(__m128i __a, int __count) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3071 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3072 | return (__m128i)__builtin_ia32_psrlwi128((__v8hi)__a, __count); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3073 | } |
| 3074 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3075 | /// \brief Right-shifts each of 16-bit values in the 128-bit integer vector |
| 3076 | /// operand by the specified number of bits. High-order bits are cleared. |
| 3077 | /// |
| 3078 | /// \headerfile <x86intrin.h> |
| 3079 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3080 | /// This intrinsic corresponds to the <c> VPSRLW / PSRLW </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3081 | /// |
| 3082 | /// \param __a |
| 3083 | /// A 128-bit integer vector containing the source operand. |
| 3084 | /// \param __count |
| 3085 | /// A 128-bit integer vector in which bits [63:0] specify the number of bits |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 3086 | /// to right-shift each value in operand \a __a. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3087 | /// \returns A 128-bit integer vector containing the right-shifted values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3088 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3089 | _mm_srl_epi16(__m128i __a, __m128i __count) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3090 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3091 | return (__m128i)__builtin_ia32_psrlw128((__v8hi)__a, (__v8hi)__count); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3092 | } |
| 3093 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3094 | /// \brief Right-shifts each of 32-bit values in the 128-bit integer vector |
| 3095 | /// operand by the specified number of bits. High-order bits are cleared. |
| 3096 | /// |
| 3097 | /// \headerfile <x86intrin.h> |
| 3098 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3099 | /// This intrinsic corresponds to the <c> VPSRLD / PSRLD </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3100 | /// |
| 3101 | /// \param __a |
| 3102 | /// A 128-bit integer vector containing the source operand. |
| 3103 | /// \param __count |
| 3104 | /// An integer value specifying the number of bits to right-shift each value |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 3105 | /// in operand \a __a. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3106 | /// \returns A 128-bit integer vector containing the right-shifted values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3107 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3108 | _mm_srli_epi32(__m128i __a, int __count) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3109 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3110 | return (__m128i)__builtin_ia32_psrldi128((__v4si)__a, __count); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3111 | } |
| 3112 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3113 | /// \brief Right-shifts each of 32-bit values in the 128-bit integer vector |
| 3114 | /// operand by the specified number of bits. High-order bits are cleared. |
| 3115 | /// |
| 3116 | /// \headerfile <x86intrin.h> |
| 3117 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3118 | /// This intrinsic corresponds to the <c> VPSRLD / PSRLD </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3119 | /// |
| 3120 | /// \param __a |
| 3121 | /// A 128-bit integer vector containing the source operand. |
| 3122 | /// \param __count |
| 3123 | /// A 128-bit integer vector in which bits [63:0] specify the number of bits |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 3124 | /// to right-shift each value in operand \a __a. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3125 | /// \returns A 128-bit integer vector containing the right-shifted values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3126 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3127 | _mm_srl_epi32(__m128i __a, __m128i __count) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3128 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3129 | return (__m128i)__builtin_ia32_psrld128((__v4si)__a, (__v4si)__count); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3130 | } |
| 3131 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3132 | /// \brief Right-shifts each of 64-bit values in the 128-bit integer vector |
| 3133 | /// operand by the specified number of bits. High-order bits are cleared. |
| 3134 | /// |
| 3135 | /// \headerfile <x86intrin.h> |
| 3136 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3137 | /// This intrinsic corresponds to the <c> VPSRLQ / PSRLQ </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3138 | /// |
| 3139 | /// \param __a |
| 3140 | /// A 128-bit integer vector containing the source operand. |
| 3141 | /// \param __count |
| 3142 | /// An integer value specifying the number of bits to right-shift each value |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 3143 | /// in operand \a __a. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3144 | /// \returns A 128-bit integer vector containing the right-shifted values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3145 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3146 | _mm_srli_epi64(__m128i __a, int __count) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3147 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 3148 | return __builtin_ia32_psrlqi128((__v2di)__a, __count); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3149 | } |
| 3150 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3151 | /// \brief Right-shifts each of 64-bit values in the 128-bit integer vector |
| 3152 | /// operand by the specified number of bits. High-order bits are cleared. |
| 3153 | /// |
| 3154 | /// \headerfile <x86intrin.h> |
| 3155 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3156 | /// This intrinsic corresponds to the <c> VPSRLQ / PSRLQ </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3157 | /// |
| 3158 | /// \param __a |
| 3159 | /// A 128-bit integer vector containing the source operand. |
| 3160 | /// \param __count |
| 3161 | /// A 128-bit integer vector in which bits [63:0] specify the number of bits |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 3162 | /// to right-shift each value in operand \a __a. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3163 | /// \returns A 128-bit integer vector containing the right-shifted values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3164 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3165 | _mm_srl_epi64(__m128i __a, __m128i __count) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3166 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 3167 | return __builtin_ia32_psrlq128((__v2di)__a, (__v2di)__count); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3168 | } |
| 3169 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3170 | /// \brief Compares each of the corresponding 8-bit values of the 128-bit |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 3171 | /// integer vectors for equality. Each comparison yields 0x0 for false, 0xFF |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3172 | /// for true. |
| 3173 | /// |
| 3174 | /// \headerfile <x86intrin.h> |
| 3175 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3176 | /// This intrinsic corresponds to the <c> VPCMPEQB / PCMPEQB </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3177 | /// |
| 3178 | /// \param __a |
| 3179 | /// A 128-bit integer vector. |
| 3180 | /// \param __b |
| 3181 | /// A 128-bit integer vector. |
| 3182 | /// \returns A 128-bit integer vector containing the comparison results. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3183 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3184 | _mm_cmpeq_epi8(__m128i __a, __m128i __b) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3185 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3186 | return (__m128i)((__v16qi)__a == (__v16qi)__b); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3187 | } |
| 3188 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3189 | /// \brief Compares each of the corresponding 16-bit values of the 128-bit |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 3190 | /// integer vectors for equality. Each comparison yields 0x0 for false, |
| 3191 | /// 0xFFFF for true. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3192 | /// |
| 3193 | /// \headerfile <x86intrin.h> |
| 3194 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3195 | /// This intrinsic corresponds to the <c> VPCMPEQW / PCMPEQW </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3196 | /// |
| 3197 | /// \param __a |
| 3198 | /// A 128-bit integer vector. |
| 3199 | /// \param __b |
| 3200 | /// A 128-bit integer vector. |
| 3201 | /// \returns A 128-bit integer vector containing the comparison results. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3202 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3203 | _mm_cmpeq_epi16(__m128i __a, __m128i __b) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3204 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3205 | return (__m128i)((__v8hi)__a == (__v8hi)__b); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3206 | } |
| 3207 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3208 | /// \brief Compares each of the corresponding 32-bit values of the 128-bit |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 3209 | /// integer vectors for equality. Each comparison yields 0x0 for false, |
| 3210 | /// 0xFFFFFFFF for true. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3211 | /// |
| 3212 | /// \headerfile <x86intrin.h> |
| 3213 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3214 | /// This intrinsic corresponds to the <c> VPCMPEQD / PCMPEQD </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3215 | /// |
| 3216 | /// \param __a |
| 3217 | /// A 128-bit integer vector. |
| 3218 | /// \param __b |
| 3219 | /// A 128-bit integer vector. |
| 3220 | /// \returns A 128-bit integer vector containing the comparison results. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3221 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3222 | _mm_cmpeq_epi32(__m128i __a, __m128i __b) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3223 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3224 | return (__m128i)((__v4si)__a == (__v4si)__b); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3225 | } |
| 3226 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3227 | /// \brief Compares each of the corresponding signed 8-bit values of the 128-bit |
| 3228 | /// integer vectors to determine if the values in the first operand are |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 3229 | /// greater than those in the second operand. Each comparison yields 0x0 for |
| 3230 | /// false, 0xFF for true. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3231 | /// |
| 3232 | /// \headerfile <x86intrin.h> |
| 3233 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3234 | /// This intrinsic corresponds to the <c> VPCMPGTB / PCMPGTB </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3235 | /// |
| 3236 | /// \param __a |
| 3237 | /// A 128-bit integer vector. |
| 3238 | /// \param __b |
| 3239 | /// A 128-bit integer vector. |
| 3240 | /// \returns A 128-bit integer vector containing the comparison results. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3241 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3242 | _mm_cmpgt_epi8(__m128i __a, __m128i __b) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3243 | { |
Nick Lewycky | d0ba379 | 2012-02-04 02:16:48 +0000 | [diff] [blame] | 3244 | /* This function always performs a signed comparison, but __v16qi is a char |
Chandler Carruth | cbe6411 | 2015-10-01 23:40:12 +0000 | [diff] [blame] | 3245 | which may be signed or unsigned, so use __v16qs. */ |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3246 | return (__m128i)((__v16qs)__a > (__v16qs)__b); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3247 | } |
| 3248 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3249 | /// \brief Compares each of the corresponding signed 16-bit values of the |
| 3250 | /// 128-bit integer vectors to determine if the values in the first operand |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 3251 | /// are greater than those in the second operand. |
| 3252 | /// |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 3253 | /// Each comparison yields 0x0 for false, 0xFFFF for true. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3254 | /// |
| 3255 | /// \headerfile <x86intrin.h> |
| 3256 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3257 | /// This intrinsic corresponds to the <c> VPCMPGTW / PCMPGTW </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3258 | /// |
| 3259 | /// \param __a |
| 3260 | /// A 128-bit integer vector. |
| 3261 | /// \param __b |
| 3262 | /// A 128-bit integer vector. |
| 3263 | /// \returns A 128-bit integer vector containing the comparison results. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3264 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3265 | _mm_cmpgt_epi16(__m128i __a, __m128i __b) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3266 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3267 | return (__m128i)((__v8hi)__a > (__v8hi)__b); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3268 | } |
| 3269 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3270 | /// \brief Compares each of the corresponding signed 32-bit values of the |
| 3271 | /// 128-bit integer vectors to determine if the values in the first operand |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 3272 | /// are greater than those in the second operand. |
| 3273 | /// |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 3274 | /// Each comparison yields 0x0 for false, 0xFFFFFFFF for true. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3275 | /// |
| 3276 | /// \headerfile <x86intrin.h> |
| 3277 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3278 | /// This intrinsic corresponds to the <c> VPCMPGTD / PCMPGTD </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3279 | /// |
| 3280 | /// \param __a |
| 3281 | /// A 128-bit integer vector. |
| 3282 | /// \param __b |
| 3283 | /// A 128-bit integer vector. |
| 3284 | /// \returns A 128-bit integer vector containing the comparison results. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3285 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3286 | _mm_cmpgt_epi32(__m128i __a, __m128i __b) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3287 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3288 | return (__m128i)((__v4si)__a > (__v4si)__b); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3289 | } |
| 3290 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3291 | /// \brief Compares each of the corresponding signed 8-bit values of the 128-bit |
| 3292 | /// integer vectors to determine if the values in the first operand are less |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 3293 | /// than those in the second operand. |
| 3294 | /// |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 3295 | /// Each comparison yields 0x0 for false, 0xFF for true. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3296 | /// |
| 3297 | /// \headerfile <x86intrin.h> |
| 3298 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3299 | /// This intrinsic corresponds to the <c> VPCMPGTB / PCMPGTB </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3300 | /// |
| 3301 | /// \param __a |
| 3302 | /// A 128-bit integer vector. |
| 3303 | /// \param __b |
| 3304 | /// A 128-bit integer vector. |
| 3305 | /// \returns A 128-bit integer vector containing the comparison results. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3306 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3307 | _mm_cmplt_epi8(__m128i __a, __m128i __b) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3308 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3309 | return _mm_cmpgt_epi8(__b, __a); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3310 | } |
| 3311 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3312 | /// \brief Compares each of the corresponding signed 16-bit values of the |
| 3313 | /// 128-bit integer vectors to determine if the values in the first operand |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 3314 | /// are less than those in the second operand. |
| 3315 | /// |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 3316 | /// Each comparison yields 0x0 for false, 0xFFFF for true. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3317 | /// |
| 3318 | /// \headerfile <x86intrin.h> |
| 3319 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3320 | /// This intrinsic corresponds to the <c> VPCMPGTW / PCMPGTW </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3321 | /// |
| 3322 | /// \param __a |
| 3323 | /// A 128-bit integer vector. |
| 3324 | /// \param __b |
| 3325 | /// A 128-bit integer vector. |
| 3326 | /// \returns A 128-bit integer vector containing the comparison results. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3327 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3328 | _mm_cmplt_epi16(__m128i __a, __m128i __b) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3329 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3330 | return _mm_cmpgt_epi16(__b, __a); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3331 | } |
| 3332 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3333 | /// \brief Compares each of the corresponding signed 32-bit values of the |
| 3334 | /// 128-bit integer vectors to determine if the values in the first operand |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 3335 | /// are less than those in the second operand. |
| 3336 | /// |
Ekaterina Romanova | f287518 | 2018-02-16 03:11:35 +0000 | [diff] [blame] | 3337 | /// Each comparison yields 0x0 for false, 0xFFFFFFFF for true. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3338 | /// |
| 3339 | /// \headerfile <x86intrin.h> |
| 3340 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3341 | /// This intrinsic corresponds to the <c> VPCMPGTD / PCMPGTD </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3342 | /// |
| 3343 | /// \param __a |
| 3344 | /// A 128-bit integer vector. |
| 3345 | /// \param __b |
| 3346 | /// A 128-bit integer vector. |
| 3347 | /// \returns A 128-bit integer vector containing the comparison results. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3348 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3349 | _mm_cmplt_epi32(__m128i __a, __m128i __b) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3350 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3351 | return _mm_cmpgt_epi32(__b, __a); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3352 | } |
| 3353 | |
| 3354 | #ifdef __x86_64__ |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3355 | /// \brief Converts a 64-bit signed integer value from the second operand into a |
| 3356 | /// double-precision value and returns it in the lower element of a [2 x |
| 3357 | /// double] vector; the upper element of the returned vector is copied from |
| 3358 | /// the upper element of the first operand. |
| 3359 | /// |
| 3360 | /// \headerfile <x86intrin.h> |
| 3361 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3362 | /// This intrinsic corresponds to the <c> VCVTSI2SD / CVTSI2SD </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3363 | /// |
| 3364 | /// \param __a |
| 3365 | /// A 128-bit vector of [2 x double]. The upper 64 bits of this operand are |
| 3366 | /// copied to the upper 64 bits of the destination. |
| 3367 | /// \param __b |
| 3368 | /// A 64-bit signed integer operand containing the value to be converted. |
| 3369 | /// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the |
| 3370 | /// converted value of the second operand. The upper 64 bits are copied from |
| 3371 | /// the upper 64 bits of the first operand. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3372 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3373 | _mm_cvtsi64_sd(__m128d __a, long long __b) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3374 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3375 | __a[0] = __b; |
| 3376 | return __a; |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3377 | } |
| 3378 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3379 | /// \brief Converts the first (lower) element of a vector of [2 x double] into a |
| 3380 | /// 64-bit signed integer value, according to the current rounding mode. |
| 3381 | /// |
| 3382 | /// \headerfile <x86intrin.h> |
| 3383 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3384 | /// This intrinsic corresponds to the <c> VCVTSD2SI / CVTSD2SI </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3385 | /// |
| 3386 | /// \param __a |
| 3387 | /// A 128-bit vector of [2 x double]. The lower 64 bits are used in the |
| 3388 | /// conversion. |
| 3389 | /// \returns A 64-bit signed integer containing the converted value. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3390 | static __inline__ long long __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3391 | _mm_cvtsd_si64(__m128d __a) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3392 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 3393 | return __builtin_ia32_cvtsd2si64((__v2df)__a); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3394 | } |
| 3395 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3396 | /// \brief Converts the first (lower) element of a vector of [2 x double] into a |
| 3397 | /// 64-bit signed integer value, truncating the result when it is inexact. |
| 3398 | /// |
| 3399 | /// \headerfile <x86intrin.h> |
| 3400 | /// |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 3401 | /// This intrinsic corresponds to the <c> VCVTTSD2SI / CVTTSD2SI </c> |
| 3402 | /// instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3403 | /// |
| 3404 | /// \param __a |
| 3405 | /// A 128-bit vector of [2 x double]. The lower 64 bits are used in the |
| 3406 | /// conversion. |
| 3407 | /// \returns A 64-bit signed integer containing the converted value. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3408 | static __inline__ long long __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3409 | _mm_cvttsd_si64(__m128d __a) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3410 | { |
Simon Pilgrim | e3b9ee0 | 2016-07-20 10:18:01 +0000 | [diff] [blame] | 3411 | return __builtin_ia32_cvttsd2si64((__v2df)__a); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3412 | } |
| 3413 | #endif |
| 3414 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3415 | /// \brief Converts a vector of [4 x i32] into a vector of [4 x float]. |
| 3416 | /// |
| 3417 | /// \headerfile <x86intrin.h> |
| 3418 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3419 | /// This intrinsic corresponds to the <c> VCVTDQ2PS / CVTDQ2PS </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3420 | /// |
| 3421 | /// \param __a |
| 3422 | /// A 128-bit integer vector. |
| 3423 | /// \returns A 128-bit vector of [4 x float] containing the converted values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3424 | static __inline__ __m128 __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3425 | _mm_cvtepi32_ps(__m128i __a) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3426 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3427 | return __builtin_ia32_cvtdq2ps((__v4si)__a); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3428 | } |
| 3429 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3430 | /// \brief Converts a vector of [4 x float] into a vector of [4 x i32]. |
| 3431 | /// |
| 3432 | /// \headerfile <x86intrin.h> |
| 3433 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3434 | /// This intrinsic corresponds to the <c> VCVTPS2DQ / CVTPS2DQ </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3435 | /// |
| 3436 | /// \param __a |
| 3437 | /// A 128-bit vector of [4 x float]. |
| 3438 | /// \returns A 128-bit integer vector of [4 x i32] containing the converted |
| 3439 | /// values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3440 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3441 | _mm_cvtps_epi32(__m128 __a) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3442 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 3443 | return (__m128i)__builtin_ia32_cvtps2dq((__v4sf)__a); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3444 | } |
| 3445 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3446 | /// \brief Converts a vector of [4 x float] into a vector of [4 x i32], |
| 3447 | /// truncating the result when it is inexact. |
| 3448 | /// |
| 3449 | /// \headerfile <x86intrin.h> |
| 3450 | /// |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 3451 | /// This intrinsic corresponds to the <c> VCVTTPS2DQ / CVTTPS2DQ </c> |
| 3452 | /// instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3453 | /// |
| 3454 | /// \param __a |
| 3455 | /// A 128-bit vector of [4 x float]. |
| 3456 | /// \returns A 128-bit vector of [4 x i32] containing the converted values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3457 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3458 | _mm_cvttps_epi32(__m128 __a) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3459 | { |
Simon Pilgrim | e3b9ee0 | 2016-07-20 10:18:01 +0000 | [diff] [blame] | 3460 | return (__m128i)__builtin_ia32_cvttps2dq((__v4sf)__a); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3461 | } |
| 3462 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3463 | /// \brief Returns a vector of [4 x i32] where the lowest element is the input |
| 3464 | /// operand and the remaining elements are zero. |
| 3465 | /// |
| 3466 | /// \headerfile <x86intrin.h> |
| 3467 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3468 | /// This intrinsic corresponds to the <c> VMOVD / MOVD </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3469 | /// |
| 3470 | /// \param __a |
| 3471 | /// A 32-bit signed integer operand. |
| 3472 | /// \returns A 128-bit vector of [4 x i32]. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3473 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3474 | _mm_cvtsi32_si128(int __a) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3475 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3476 | return (__m128i)(__v4si){ __a, 0, 0, 0 }; |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3477 | } |
| 3478 | |
| 3479 | #ifdef __x86_64__ |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3480 | /// \brief Returns a vector of [2 x i64] where the lower element is the input |
| 3481 | /// operand and the upper element is zero. |
| 3482 | /// |
| 3483 | /// \headerfile <x86intrin.h> |
| 3484 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3485 | /// This intrinsic corresponds to the <c> VMOVQ / MOVQ </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3486 | /// |
| 3487 | /// \param __a |
| 3488 | /// A 64-bit signed integer operand containing the value to be converted. |
| 3489 | /// \returns A 128-bit vector of [2 x i64] containing the converted value. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3490 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3491 | _mm_cvtsi64_si128(long long __a) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3492 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3493 | return (__m128i){ __a, 0 }; |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3494 | } |
| 3495 | #endif |
| 3496 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3497 | /// \brief Moves the least significant 32 bits of a vector of [4 x i32] to a |
| 3498 | /// 32-bit signed integer value. |
| 3499 | /// |
| 3500 | /// \headerfile <x86intrin.h> |
| 3501 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3502 | /// This intrinsic corresponds to the <c> VMOVD / MOVD </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3503 | /// |
| 3504 | /// \param __a |
| 3505 | /// A vector of [4 x i32]. The least significant 32 bits are moved to the |
| 3506 | /// destination. |
| 3507 | /// \returns A 32-bit signed integer containing the moved value. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3508 | static __inline__ int __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3509 | _mm_cvtsi128_si32(__m128i __a) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3510 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3511 | __v4si __b = (__v4si)__a; |
| 3512 | return __b[0]; |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3513 | } |
| 3514 | |
| 3515 | #ifdef __x86_64__ |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3516 | /// \brief Moves the least significant 64 bits of a vector of [2 x i64] to a |
| 3517 | /// 64-bit signed integer value. |
| 3518 | /// |
| 3519 | /// \headerfile <x86intrin.h> |
| 3520 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3521 | /// This intrinsic corresponds to the <c> VMOVQ / MOVQ </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3522 | /// |
| 3523 | /// \param __a |
| 3524 | /// A vector of [2 x i64]. The least significant 64 bits are moved to the |
| 3525 | /// destination. |
| 3526 | /// \returns A 64-bit signed integer containing the moved value. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3527 | static __inline__ long long __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3528 | _mm_cvtsi128_si64(__m128i __a) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3529 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3530 | return __a[0]; |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3531 | } |
| 3532 | #endif |
| 3533 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3534 | /// \brief Moves packed integer values from an aligned 128-bit memory location |
| 3535 | /// to elements in a 128-bit integer vector. |
| 3536 | /// |
| 3537 | /// \headerfile <x86intrin.h> |
| 3538 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3539 | /// This intrinsic corresponds to the <c> VMOVDQA / MOVDQA </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3540 | /// |
| 3541 | /// \param __p |
| 3542 | /// An aligned pointer to a memory location containing integer values. |
| 3543 | /// \returns A 128-bit integer vector containing the moved values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3544 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3545 | _mm_load_si128(__m128i const *__p) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3546 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3547 | return *__p; |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3548 | } |
| 3549 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3550 | /// \brief Moves packed integer values from an unaligned 128-bit memory location |
| 3551 | /// to elements in a 128-bit integer vector. |
| 3552 | /// |
| 3553 | /// \headerfile <x86intrin.h> |
| 3554 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3555 | /// This intrinsic corresponds to the <c> VMOVDQU / MOVDQU </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3556 | /// |
| 3557 | /// \param __p |
| 3558 | /// A pointer to a memory location containing integer values. |
| 3559 | /// \returns A 128-bit integer vector containing the moved values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3560 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3561 | _mm_loadu_si128(__m128i const *__p) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3562 | { |
Bill Wendling | 502931f | 2011-05-13 00:11:39 +0000 | [diff] [blame] | 3563 | struct __loadu_si128 { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3564 | __m128i __v; |
David Majnemer | 1cf22e6 | 2015-02-04 00:26:10 +0000 | [diff] [blame] | 3565 | } __attribute__((__packed__, __may_alias__)); |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3566 | return ((struct __loadu_si128*)__p)->__v; |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3567 | } |
| 3568 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3569 | /// \brief Returns a vector of [2 x i64] where the lower element is taken from |
| 3570 | /// the lower element of the operand, and the upper element is zero. |
| 3571 | /// |
| 3572 | /// \headerfile <x86intrin.h> |
| 3573 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3574 | /// This intrinsic corresponds to the <c> VMOVQ / MOVQ </c> instruction. |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3575 | /// |
| 3576 | /// \param __p |
| 3577 | /// A 128-bit vector of [2 x i64]. Bits [63:0] are written to bits [63:0] of |
| 3578 | /// the destination. |
| 3579 | /// \returns A 128-bit vector of [2 x i64]. The lower order bits contain the |
| 3580 | /// moved value. The higher order bits are cleared. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3581 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3582 | _mm_loadl_epi64(__m128i const *__p) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3583 | { |
Eli Friedman | 9bb51ad | 2011-09-15 23:15:27 +0000 | [diff] [blame] | 3584 | struct __mm_loadl_epi64_struct { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3585 | long long __u; |
Eli Friedman | 9bb51ad | 2011-09-15 23:15:27 +0000 | [diff] [blame] | 3586 | } __attribute__((__packed__, __may_alias__)); |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3587 | return (__m128i) { ((struct __mm_loadl_epi64_struct*)__p)->__u, 0}; |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3588 | } |
| 3589 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3590 | /// \brief Generates a 128-bit vector of [4 x i32] with unspecified content. |
| 3591 | /// This could be used as an argument to another intrinsic function where the |
| 3592 | /// argument is required but the value is not actually used. |
| 3593 | /// |
| 3594 | /// \headerfile <x86intrin.h> |
| 3595 | /// |
| 3596 | /// This intrinsic has no corresponding instruction. |
| 3597 | /// |
| 3598 | /// \returns A 128-bit vector of [4 x i32] with unspecified content. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3599 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
Craig Topper | 3a0c726 | 2016-06-09 05:14:28 +0000 | [diff] [blame] | 3600 | _mm_undefined_si128(void) |
Simon Pilgrim | 5aba992 | 2015-08-26 21:17:12 +0000 | [diff] [blame] | 3601 | { |
| 3602 | return (__m128i)__builtin_ia32_undef128(); |
| 3603 | } |
| 3604 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3605 | /// \brief Initializes both 64-bit values in a 128-bit vector of [2 x i64] with |
| 3606 | /// the specified 64-bit integer values. |
| 3607 | /// |
| 3608 | /// \headerfile <x86intrin.h> |
| 3609 | /// |
| 3610 | /// This intrinsic is a utility function and does not correspond to a specific |
| 3611 | /// instruction. |
| 3612 | /// |
| 3613 | /// \param __q1 |
| 3614 | /// A 64-bit integer value used to initialize the upper 64 bits of the |
| 3615 | /// destination vector of [2 x i64]. |
| 3616 | /// \param __q0 |
| 3617 | /// A 64-bit integer value used to initialize the lower 64 bits of the |
| 3618 | /// destination vector of [2 x i64]. |
| 3619 | /// \returns An initialized 128-bit vector of [2 x i64] containing the values |
| 3620 | /// provided in the operands. |
Simon Pilgrim | 5aba992 | 2015-08-26 21:17:12 +0000 | [diff] [blame] | 3621 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
Michael Kuperstein | 5c2cb0e | 2015-09-21 11:45:27 +0000 | [diff] [blame] | 3622 | _mm_set_epi64x(long long __q1, long long __q0) |
Anders Carlsson | dfa3117 | 2009-09-18 17:03:55 +0000 | [diff] [blame] | 3623 | { |
Michael Kuperstein | 5c2cb0e | 2015-09-21 11:45:27 +0000 | [diff] [blame] | 3624 | return (__m128i){ __q0, __q1 }; |
Anders Carlsson | dfa3117 | 2009-09-18 17:03:55 +0000 | [diff] [blame] | 3625 | } |
| 3626 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3627 | /// \brief Initializes both 64-bit values in a 128-bit vector of [2 x i64] with |
| 3628 | /// the specified 64-bit integer values. |
| 3629 | /// |
| 3630 | /// \headerfile <x86intrin.h> |
| 3631 | /// |
| 3632 | /// This intrinsic is a utility function and does not correspond to a specific |
| 3633 | /// instruction. |
| 3634 | /// |
| 3635 | /// \param __q1 |
| 3636 | /// A 64-bit integer value used to initialize the upper 64 bits of the |
| 3637 | /// destination vector of [2 x i64]. |
| 3638 | /// \param __q0 |
| 3639 | /// A 64-bit integer value used to initialize the lower 64 bits of the |
| 3640 | /// destination vector of [2 x i64]. |
| 3641 | /// \returns An initialized 128-bit vector of [2 x i64] containing the values |
| 3642 | /// provided in the operands. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3643 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
Michael Kuperstein | 5c2cb0e | 2015-09-21 11:45:27 +0000 | [diff] [blame] | 3644 | _mm_set_epi64(__m64 __q1, __m64 __q0) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3645 | { |
Michael Kuperstein | 5c2cb0e | 2015-09-21 11:45:27 +0000 | [diff] [blame] | 3646 | return (__m128i){ (long long)__q0, (long long)__q1 }; |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3647 | } |
| 3648 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3649 | /// \brief Initializes the 32-bit values in a 128-bit vector of [4 x i32] with |
| 3650 | /// the specified 32-bit integer values. |
| 3651 | /// |
| 3652 | /// \headerfile <x86intrin.h> |
| 3653 | /// |
| 3654 | /// This intrinsic is a utility function and does not correspond to a specific |
| 3655 | /// instruction. |
| 3656 | /// |
| 3657 | /// \param __i3 |
| 3658 | /// A 32-bit integer value used to initialize bits [127:96] of the |
| 3659 | /// destination vector. |
| 3660 | /// \param __i2 |
| 3661 | /// A 32-bit integer value used to initialize bits [95:64] of the destination |
| 3662 | /// vector. |
| 3663 | /// \param __i1 |
| 3664 | /// A 32-bit integer value used to initialize bits [63:32] of the destination |
| 3665 | /// vector. |
| 3666 | /// \param __i0 |
| 3667 | /// A 32-bit integer value used to initialize bits [31:0] of the destination |
| 3668 | /// vector. |
| 3669 | /// \returns An initialized 128-bit vector of [4 x i32] containing the values |
| 3670 | /// provided in the operands. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3671 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
Michael Kuperstein | 5c2cb0e | 2015-09-21 11:45:27 +0000 | [diff] [blame] | 3672 | _mm_set_epi32(int __i3, int __i2, int __i1, int __i0) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3673 | { |
Michael Kuperstein | 5c2cb0e | 2015-09-21 11:45:27 +0000 | [diff] [blame] | 3674 | return (__m128i)(__v4si){ __i0, __i1, __i2, __i3}; |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3675 | } |
| 3676 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3677 | /// \brief Initializes the 16-bit values in a 128-bit vector of [8 x i16] with |
| 3678 | /// the specified 16-bit integer values. |
| 3679 | /// |
| 3680 | /// \headerfile <x86intrin.h> |
| 3681 | /// |
| 3682 | /// This intrinsic is a utility function and does not correspond to a specific |
| 3683 | /// instruction. |
| 3684 | /// |
| 3685 | /// \param __w7 |
| 3686 | /// A 16-bit integer value used to initialize bits [127:112] of the |
| 3687 | /// destination vector. |
| 3688 | /// \param __w6 |
| 3689 | /// A 16-bit integer value used to initialize bits [111:96] of the |
| 3690 | /// destination vector. |
| 3691 | /// \param __w5 |
| 3692 | /// A 16-bit integer value used to initialize bits [95:80] of the destination |
| 3693 | /// vector. |
| 3694 | /// \param __w4 |
| 3695 | /// A 16-bit integer value used to initialize bits [79:64] of the destination |
| 3696 | /// vector. |
| 3697 | /// \param __w3 |
| 3698 | /// A 16-bit integer value used to initialize bits [63:48] of the destination |
| 3699 | /// vector. |
| 3700 | /// \param __w2 |
| 3701 | /// A 16-bit integer value used to initialize bits [47:32] of the destination |
| 3702 | /// vector. |
| 3703 | /// \param __w1 |
| 3704 | /// A 16-bit integer value used to initialize bits [31:16] of the destination |
| 3705 | /// vector. |
| 3706 | /// \param __w0 |
| 3707 | /// A 16-bit integer value used to initialize bits [15:0] of the destination |
| 3708 | /// vector. |
| 3709 | /// \returns An initialized 128-bit vector of [8 x i16] containing the values |
| 3710 | /// provided in the operands. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3711 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
Michael Kuperstein | 5c2cb0e | 2015-09-21 11:45:27 +0000 | [diff] [blame] | 3712 | _mm_set_epi16(short __w7, short __w6, short __w5, short __w4, short __w3, short __w2, short __w1, short __w0) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3713 | { |
Michael Kuperstein | 5c2cb0e | 2015-09-21 11:45:27 +0000 | [diff] [blame] | 3714 | return (__m128i)(__v8hi){ __w0, __w1, __w2, __w3, __w4, __w5, __w6, __w7 }; |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3715 | } |
| 3716 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3717 | /// \brief Initializes the 8-bit values in a 128-bit vector of [16 x i8] with |
| 3718 | /// the specified 8-bit integer values. |
| 3719 | /// |
| 3720 | /// \headerfile <x86intrin.h> |
| 3721 | /// |
| 3722 | /// This intrinsic is a utility function and does not correspond to a specific |
| 3723 | /// instruction. |
| 3724 | /// |
| 3725 | /// \param __b15 |
| 3726 | /// Initializes bits [127:120] of the destination vector. |
| 3727 | /// \param __b14 |
| 3728 | /// Initializes bits [119:112] of the destination vector. |
| 3729 | /// \param __b13 |
| 3730 | /// Initializes bits [111:104] of the destination vector. |
| 3731 | /// \param __b12 |
| 3732 | /// Initializes bits [103:96] of the destination vector. |
| 3733 | /// \param __b11 |
| 3734 | /// Initializes bits [95:88] of the destination vector. |
| 3735 | /// \param __b10 |
| 3736 | /// Initializes bits [87:80] of the destination vector. |
| 3737 | /// \param __b9 |
| 3738 | /// Initializes bits [79:72] of the destination vector. |
| 3739 | /// \param __b8 |
| 3740 | /// Initializes bits [71:64] of the destination vector. |
| 3741 | /// \param __b7 |
| 3742 | /// Initializes bits [63:56] of the destination vector. |
| 3743 | /// \param __b6 |
| 3744 | /// Initializes bits [55:48] of the destination vector. |
| 3745 | /// \param __b5 |
| 3746 | /// Initializes bits [47:40] of the destination vector. |
| 3747 | /// \param __b4 |
| 3748 | /// Initializes bits [39:32] of the destination vector. |
| 3749 | /// \param __b3 |
| 3750 | /// Initializes bits [31:24] of the destination vector. |
| 3751 | /// \param __b2 |
| 3752 | /// Initializes bits [23:16] of the destination vector. |
| 3753 | /// \param __b1 |
| 3754 | /// Initializes bits [15:8] of the destination vector. |
| 3755 | /// \param __b0 |
| 3756 | /// Initializes bits [7:0] of the destination vector. |
| 3757 | /// \returns An initialized 128-bit vector of [16 x i8] containing the values |
| 3758 | /// provided in the operands. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3759 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
Michael Kuperstein | 5c2cb0e | 2015-09-21 11:45:27 +0000 | [diff] [blame] | 3760 | _mm_set_epi8(char __b15, char __b14, char __b13, char __b12, char __b11, char __b10, char __b9, char __b8, char __b7, char __b6, char __b5, char __b4, char __b3, char __b2, char __b1, char __b0) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3761 | { |
Michael Kuperstein | 5c2cb0e | 2015-09-21 11:45:27 +0000 | [diff] [blame] | 3762 | return (__m128i)(__v16qi){ __b0, __b1, __b2, __b3, __b4, __b5, __b6, __b7, __b8, __b9, __b10, __b11, __b12, __b13, __b14, __b15 }; |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3763 | } |
| 3764 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3765 | /// \brief Initializes both values in a 128-bit integer vector with the |
| 3766 | /// specified 64-bit integer value. |
| 3767 | /// |
| 3768 | /// \headerfile <x86intrin.h> |
| 3769 | /// |
| 3770 | /// This intrinsic is a utility function and does not correspond to a specific |
| 3771 | /// instruction. |
| 3772 | /// |
| 3773 | /// \param __q |
| 3774 | /// Integer value used to initialize the elements of the destination integer |
| 3775 | /// vector. |
| 3776 | /// \returns An initialized 128-bit integer vector of [2 x i64] with both |
| 3777 | /// elements containing the value provided in the operand. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3778 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3779 | _mm_set1_epi64x(long long __q) |
Anders Carlsson | dfa3117 | 2009-09-18 17:03:55 +0000 | [diff] [blame] | 3780 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3781 | return (__m128i){ __q, __q }; |
Anders Carlsson | dfa3117 | 2009-09-18 17:03:55 +0000 | [diff] [blame] | 3782 | } |
| 3783 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3784 | /// \brief Initializes both values in a 128-bit vector of [2 x i64] with the |
| 3785 | /// specified 64-bit value. |
| 3786 | /// |
| 3787 | /// \headerfile <x86intrin.h> |
| 3788 | /// |
| 3789 | /// This intrinsic is a utility function and does not correspond to a specific |
| 3790 | /// instruction. |
| 3791 | /// |
| 3792 | /// \param __q |
| 3793 | /// A 64-bit value used to initialize the elements of the destination integer |
| 3794 | /// vector. |
| 3795 | /// \returns An initialized 128-bit vector of [2 x i64] with all elements |
| 3796 | /// containing the value provided in the operand. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3797 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3798 | _mm_set1_epi64(__m64 __q) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3799 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3800 | return (__m128i){ (long long)__q, (long long)__q }; |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3801 | } |
| 3802 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3803 | /// \brief Initializes all values in a 128-bit vector of [4 x i32] with the |
| 3804 | /// specified 32-bit value. |
| 3805 | /// |
| 3806 | /// \headerfile <x86intrin.h> |
| 3807 | /// |
| 3808 | /// This intrinsic is a utility function and does not correspond to a specific |
| 3809 | /// instruction. |
| 3810 | /// |
| 3811 | /// \param __i |
| 3812 | /// A 32-bit value used to initialize the elements of the destination integer |
| 3813 | /// vector. |
| 3814 | /// \returns An initialized 128-bit vector of [4 x i32] with all elements |
| 3815 | /// containing the value provided in the operand. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3816 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3817 | _mm_set1_epi32(int __i) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3818 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3819 | return (__m128i)(__v4si){ __i, __i, __i, __i }; |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3820 | } |
| 3821 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3822 | /// \brief Initializes all values in a 128-bit vector of [8 x i16] with the |
| 3823 | /// specified 16-bit value. |
| 3824 | /// |
| 3825 | /// \headerfile <x86intrin.h> |
| 3826 | /// |
| 3827 | /// This intrinsic is a utility function and does not correspond to a specific |
| 3828 | /// instruction. |
| 3829 | /// |
| 3830 | /// \param __w |
| 3831 | /// A 16-bit value used to initialize the elements of the destination integer |
| 3832 | /// vector. |
| 3833 | /// \returns An initialized 128-bit vector of [8 x i16] with all elements |
| 3834 | /// containing the value provided in the operand. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3835 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3836 | _mm_set1_epi16(short __w) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3837 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3838 | return (__m128i)(__v8hi){ __w, __w, __w, __w, __w, __w, __w, __w }; |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3839 | } |
| 3840 | |
Ekaterina Romanova | f2ed620 | 2016-04-08 20:45:48 +0000 | [diff] [blame] | 3841 | /// \brief Initializes all values in a 128-bit vector of [16 x i8] with the |
| 3842 | /// specified 8-bit value. |
| 3843 | /// |
| 3844 | /// \headerfile <x86intrin.h> |
| 3845 | /// |
| 3846 | /// This intrinsic is a utility function and does not correspond to a specific |
| 3847 | /// instruction. |
| 3848 | /// |
| 3849 | /// \param __b |
| 3850 | /// An 8-bit value used to initialize the elements of the destination integer |
| 3851 | /// vector. |
| 3852 | /// \returns An initialized 128-bit vector of [16 x i8] with all elements |
| 3853 | /// containing the value provided in the operand. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3854 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3855 | _mm_set1_epi8(char __b) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3856 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 3857 | return (__m128i)(__v16qi){ __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b }; |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3858 | } |
| 3859 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 3860 | /// \brief Constructs a 128-bit integer vector, initialized in reverse order |
| 3861 | /// with the specified 64-bit integral values. |
| 3862 | /// |
| 3863 | /// \headerfile <x86intrin.h> |
| 3864 | /// |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 3865 | /// This intrinsic does not correspond to a specific instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 3866 | /// |
| 3867 | /// \param __q0 |
| 3868 | /// A 64-bit integral value used to initialize the lower 64 bits of the |
| 3869 | /// result. |
| 3870 | /// \param __q1 |
| 3871 | /// A 64-bit integral value used to initialize the upper 64 bits of the |
| 3872 | /// result. |
| 3873 | /// \returns An initialized 128-bit integer vector. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3874 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
Michael Kuperstein | 5c2cb0e | 2015-09-21 11:45:27 +0000 | [diff] [blame] | 3875 | _mm_setr_epi64(__m64 __q0, __m64 __q1) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3876 | { |
Michael Kuperstein | 5c2cb0e | 2015-09-21 11:45:27 +0000 | [diff] [blame] | 3877 | return (__m128i){ (long long)__q0, (long long)__q1 }; |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3878 | } |
| 3879 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 3880 | /// \brief Constructs a 128-bit integer vector, initialized in reverse order |
| 3881 | /// with the specified 32-bit integral values. |
| 3882 | /// |
| 3883 | /// \headerfile <x86intrin.h> |
| 3884 | /// |
| 3885 | /// This intrinsic is a utility function and does not correspond to a specific |
| 3886 | /// instruction. |
| 3887 | /// |
| 3888 | /// \param __i0 |
| 3889 | /// A 32-bit integral value used to initialize bits [31:0] of the result. |
| 3890 | /// \param __i1 |
| 3891 | /// A 32-bit integral value used to initialize bits [63:32] of the result. |
| 3892 | /// \param __i2 |
| 3893 | /// A 32-bit integral value used to initialize bits [95:64] of the result. |
| 3894 | /// \param __i3 |
| 3895 | /// A 32-bit integral value used to initialize bits [127:96] of the result. |
| 3896 | /// \returns An initialized 128-bit integer vector. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3897 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
Michael Kuperstein | 5c2cb0e | 2015-09-21 11:45:27 +0000 | [diff] [blame] | 3898 | _mm_setr_epi32(int __i0, int __i1, int __i2, int __i3) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3899 | { |
Michael Kuperstein | 5c2cb0e | 2015-09-21 11:45:27 +0000 | [diff] [blame] | 3900 | return (__m128i)(__v4si){ __i0, __i1, __i2, __i3}; |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3901 | } |
| 3902 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 3903 | /// \brief Constructs a 128-bit integer vector, initialized in reverse order |
| 3904 | /// with the specified 16-bit integral values. |
| 3905 | /// |
| 3906 | /// \headerfile <x86intrin.h> |
| 3907 | /// |
| 3908 | /// This intrinsic is a utility function and does not correspond to a specific |
| 3909 | /// instruction. |
| 3910 | /// |
| 3911 | /// \param __w0 |
| 3912 | /// A 16-bit integral value used to initialize bits [15:0] of the result. |
| 3913 | /// \param __w1 |
| 3914 | /// A 16-bit integral value used to initialize bits [31:16] of the result. |
| 3915 | /// \param __w2 |
| 3916 | /// A 16-bit integral value used to initialize bits [47:32] of the result. |
| 3917 | /// \param __w3 |
| 3918 | /// A 16-bit integral value used to initialize bits [63:48] of the result. |
| 3919 | /// \param __w4 |
| 3920 | /// A 16-bit integral value used to initialize bits [79:64] of the result. |
| 3921 | /// \param __w5 |
| 3922 | /// A 16-bit integral value used to initialize bits [95:80] of the result. |
| 3923 | /// \param __w6 |
| 3924 | /// A 16-bit integral value used to initialize bits [111:96] of the result. |
| 3925 | /// \param __w7 |
| 3926 | /// A 16-bit integral value used to initialize bits [127:112] of the result. |
| 3927 | /// \returns An initialized 128-bit integer vector. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3928 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
Michael Kuperstein | 5c2cb0e | 2015-09-21 11:45:27 +0000 | [diff] [blame] | 3929 | _mm_setr_epi16(short __w0, short __w1, short __w2, short __w3, short __w4, short __w5, short __w6, short __w7) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3930 | { |
Michael Kuperstein | 5c2cb0e | 2015-09-21 11:45:27 +0000 | [diff] [blame] | 3931 | return (__m128i)(__v8hi){ __w0, __w1, __w2, __w3, __w4, __w5, __w6, __w7 }; |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3932 | } |
| 3933 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 3934 | /// \brief Constructs a 128-bit integer vector, initialized in reverse order |
| 3935 | /// with the specified 8-bit integral values. |
| 3936 | /// |
| 3937 | /// \headerfile <x86intrin.h> |
| 3938 | /// |
| 3939 | /// This intrinsic is a utility function and does not correspond to a specific |
| 3940 | /// instruction. |
| 3941 | /// |
| 3942 | /// \param __b0 |
| 3943 | /// An 8-bit integral value used to initialize bits [7:0] of the result. |
| 3944 | /// \param __b1 |
| 3945 | /// An 8-bit integral value used to initialize bits [15:8] of the result. |
| 3946 | /// \param __b2 |
| 3947 | /// An 8-bit integral value used to initialize bits [23:16] of the result. |
| 3948 | /// \param __b3 |
| 3949 | /// An 8-bit integral value used to initialize bits [31:24] of the result. |
| 3950 | /// \param __b4 |
| 3951 | /// An 8-bit integral value used to initialize bits [39:32] of the result. |
| 3952 | /// \param __b5 |
| 3953 | /// An 8-bit integral value used to initialize bits [47:40] of the result. |
| 3954 | /// \param __b6 |
| 3955 | /// An 8-bit integral value used to initialize bits [55:48] of the result. |
| 3956 | /// \param __b7 |
| 3957 | /// An 8-bit integral value used to initialize bits [63:56] of the result. |
| 3958 | /// \param __b8 |
| 3959 | /// An 8-bit integral value used to initialize bits [71:64] of the result. |
| 3960 | /// \param __b9 |
| 3961 | /// An 8-bit integral value used to initialize bits [79:72] of the result. |
| 3962 | /// \param __b10 |
| 3963 | /// An 8-bit integral value used to initialize bits [87:80] of the result. |
| 3964 | /// \param __b11 |
| 3965 | /// An 8-bit integral value used to initialize bits [95:88] of the result. |
| 3966 | /// \param __b12 |
| 3967 | /// An 8-bit integral value used to initialize bits [103:96] of the result. |
| 3968 | /// \param __b13 |
| 3969 | /// An 8-bit integral value used to initialize bits [111:104] of the result. |
| 3970 | /// \param __b14 |
| 3971 | /// An 8-bit integral value used to initialize bits [119:112] of the result. |
| 3972 | /// \param __b15 |
| 3973 | /// An 8-bit integral value used to initialize bits [127:120] of the result. |
| 3974 | /// \returns An initialized 128-bit integer vector. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3975 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
Michael Kuperstein | 5c2cb0e | 2015-09-21 11:45:27 +0000 | [diff] [blame] | 3976 | _mm_setr_epi8(char __b0, char __b1, char __b2, char __b3, char __b4, char __b5, char __b6, char __b7, char __b8, char __b9, char __b10, char __b11, char __b12, char __b13, char __b14, char __b15) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3977 | { |
Michael Kuperstein | 5c2cb0e | 2015-09-21 11:45:27 +0000 | [diff] [blame] | 3978 | return (__m128i)(__v16qi){ __b0, __b1, __b2, __b3, __b4, __b5, __b6, __b7, __b8, __b9, __b10, __b11, __b12, __b13, __b14, __b15 }; |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3979 | } |
| 3980 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 3981 | /// \brief Creates a 128-bit integer vector initialized to zero. |
| 3982 | /// |
| 3983 | /// \headerfile <x86intrin.h> |
| 3984 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 3985 | /// This intrinsic corresponds to the <c> VXORPS / XORPS </c> instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 3986 | /// |
| 3987 | /// \returns An initialized 128-bit integer vector with all elements set to |
| 3988 | /// zero. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 3989 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
Mike Stump | 5b31ed3 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 3990 | _mm_setzero_si128(void) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 3991 | { |
| 3992 | return (__m128i){ 0LL, 0LL }; |
| 3993 | } |
| 3994 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 3995 | /// \brief Stores a 128-bit integer vector to a memory location aligned on a |
| 3996 | /// 128-bit boundary. |
| 3997 | /// |
| 3998 | /// \headerfile <x86intrin.h> |
| 3999 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 4000 | /// This intrinsic corresponds to the <c> VMOVAPS / MOVAPS </c> instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4001 | /// |
| 4002 | /// \param __p |
| 4003 | /// A pointer to an aligned memory location that will receive the integer |
| 4004 | /// values. |
| 4005 | /// \param __b |
| 4006 | /// A 128-bit integer vector containing the values to be moved. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4007 | static __inline__ void __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4008 | _mm_store_si128(__m128i *__p, __m128i __b) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 4009 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4010 | *__p = __b; |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 4011 | } |
| 4012 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4013 | /// \brief Stores a 128-bit integer vector to an unaligned memory location. |
| 4014 | /// |
| 4015 | /// \headerfile <x86intrin.h> |
| 4016 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 4017 | /// This intrinsic corresponds to the <c> VMOVUPS / MOVUPS </c> instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4018 | /// |
| 4019 | /// \param __p |
| 4020 | /// A pointer to a memory location that will receive the integer values. |
| 4021 | /// \param __b |
| 4022 | /// A 128-bit integer vector containing the values to be moved. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4023 | static __inline__ void __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4024 | _mm_storeu_si128(__m128i *__p, __m128i __b) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 4025 | { |
Craig Topper | 09175da | 2016-05-30 17:10:30 +0000 | [diff] [blame] | 4026 | struct __storeu_si128 { |
| 4027 | __m128i __v; |
| 4028 | } __attribute__((__packed__, __may_alias__)); |
| 4029 | ((struct __storeu_si128*)__p)->__v = __b; |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 4030 | } |
| 4031 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4032 | /// \brief Moves bytes selected by the mask from the first operand to the |
| 4033 | /// specified unaligned memory location. When a mask bit is 1, the |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 4034 | /// corresponding byte is written, otherwise it is not written. |
| 4035 | /// |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 4036 | /// To minimize caching, the data is flagged as non-temporal (unlikely to be |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 4037 | /// used again soon). Exception and trap behavior for elements not selected |
| 4038 | /// for storage to memory are implementation dependent. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4039 | /// |
| 4040 | /// \headerfile <x86intrin.h> |
| 4041 | /// |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4042 | /// This intrinsic corresponds to the <c> VMASKMOVDQU / MASKMOVDQU </c> |
| 4043 | /// instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4044 | /// |
| 4045 | /// \param __d |
| 4046 | /// A 128-bit integer vector containing the values to be moved. |
| 4047 | /// \param __n |
| 4048 | /// A 128-bit integer vector containing the mask. The most significant bit of |
| 4049 | /// each byte represents the mask bits. |
| 4050 | /// \param __p |
| 4051 | /// A pointer to an unaligned 128-bit memory location where the specified |
| 4052 | /// values are moved. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4053 | static __inline__ void __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4054 | _mm_maskmoveu_si128(__m128i __d, __m128i __n, char *__p) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 4055 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4056 | __builtin_ia32_maskmovdqu((__v16qi)__d, (__v16qi)__n, __p); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 4057 | } |
| 4058 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4059 | /// \brief Stores the lower 64 bits of a 128-bit integer vector of [2 x i64] to |
| 4060 | /// a memory location. |
| 4061 | /// |
| 4062 | /// \headerfile <x86intrin.h> |
| 4063 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 4064 | /// This intrinsic corresponds to the <c> VMOVLPS / MOVLPS </c> instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4065 | /// |
| 4066 | /// \param __p |
| 4067 | /// A pointer to a 64-bit memory location that will receive the lower 64 bits |
| 4068 | /// of the integer vector parameter. |
| 4069 | /// \param __a |
| 4070 | /// A 128-bit integer vector of [2 x i64]. The lower 64 bits contain the |
| 4071 | /// value to be stored. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4072 | static __inline__ void __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4073 | _mm_storel_epi64(__m128i *__p, __m128i __a) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 4074 | { |
Chad Rosier | 87622b8 | 2012-05-01 18:11:51 +0000 | [diff] [blame] | 4075 | struct __mm_storel_epi64_struct { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4076 | long long __u; |
Chad Rosier | 87622b8 | 2012-05-01 18:11:51 +0000 | [diff] [blame] | 4077 | } __attribute__((__packed__, __may_alias__)); |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4078 | ((struct __mm_storel_epi64_struct*)__p)->__u = __a[0]; |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 4079 | } |
| 4080 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4081 | /// \brief Stores a 128-bit floating point vector of [2 x double] to a 128-bit |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 4082 | /// aligned memory location. |
| 4083 | /// |
| 4084 | /// To minimize caching, the data is flagged as non-temporal (unlikely to be |
| 4085 | /// used again soon). |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4086 | /// |
| 4087 | /// \headerfile <x86intrin.h> |
| 4088 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 4089 | /// This intrinsic corresponds to the <c> VMOVNTPS / MOVNTPS </c> instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4090 | /// |
| 4091 | /// \param __p |
| 4092 | /// A pointer to the 128-bit aligned memory location used to store the value. |
| 4093 | /// \param __a |
| 4094 | /// A vector of [2 x double] containing the 64-bit values to be stored. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4095 | static __inline__ void __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4096 | _mm_stream_pd(double *__p, __m128d __a) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 4097 | { |
Simon Pilgrim | beca5f2 | 2016-06-13 09:57:52 +0000 | [diff] [blame] | 4098 | __builtin_nontemporal_store((__v2df)__a, (__v2df*)__p); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 4099 | } |
| 4100 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4101 | /// \brief Stores a 128-bit integer vector to a 128-bit aligned memory location. |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 4102 | /// |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4103 | /// To minimize caching, the data is flagged as non-temporal (unlikely to be |
| 4104 | /// used again soon). |
| 4105 | /// |
| 4106 | /// \headerfile <x86intrin.h> |
| 4107 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 4108 | /// This intrinsic corresponds to the <c> VMOVNTPS / MOVNTPS </c> instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4109 | /// |
| 4110 | /// \param __p |
| 4111 | /// A pointer to the 128-bit aligned memory location used to store the value. |
| 4112 | /// \param __a |
| 4113 | /// A 128-bit integer vector containing the values to be stored. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4114 | static __inline__ void __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4115 | _mm_stream_si128(__m128i *__p, __m128i __a) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 4116 | { |
Simon Pilgrim | beca5f2 | 2016-06-13 09:57:52 +0000 | [diff] [blame] | 4117 | __builtin_nontemporal_store((__v2di)__a, (__v2di*)__p); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 4118 | } |
| 4119 | |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 4120 | /// \brief Stores a 32-bit integer value in the specified memory location. |
| 4121 | /// |
| 4122 | /// To minimize caching, the data is flagged as non-temporal (unlikely to be |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4123 | /// used again soon). |
| 4124 | /// |
| 4125 | /// \headerfile <x86intrin.h> |
| 4126 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 4127 | /// This intrinsic corresponds to the <c> MOVNTI </c> instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4128 | /// |
| 4129 | /// \param __p |
| 4130 | /// A pointer to the 32-bit memory location used to store the value. |
| 4131 | /// \param __a |
| 4132 | /// A 32-bit integer containing the value to be stored. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4133 | static __inline__ void __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4134 | _mm_stream_si32(int *__p, int __a) |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 4135 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4136 | __builtin_ia32_movnti(__p, __a); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 4137 | } |
| 4138 | |
Eli Friedman | f9d8c6c | 2013-09-23 23:38:39 +0000 | [diff] [blame] | 4139 | #ifdef __x86_64__ |
Ekaterina Romanova | 1d4a0f2 | 2017-05-15 03:25:04 +0000 | [diff] [blame] | 4140 | /// \brief Stores a 64-bit integer value in the specified memory location. |
| 4141 | /// |
| 4142 | /// To minimize caching, the data is flagged as non-temporal (unlikely to be |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4143 | /// used again soon). |
| 4144 | /// |
| 4145 | /// \headerfile <x86intrin.h> |
| 4146 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 4147 | /// This intrinsic corresponds to the <c> MOVNTIQ </c> instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4148 | /// |
| 4149 | /// \param __p |
| 4150 | /// A pointer to the 64-bit memory location used to store the value. |
| 4151 | /// \param __a |
| 4152 | /// A 64-bit integer containing the value to be stored. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4153 | static __inline__ void __DEFAULT_FN_ATTRS |
Eli Friedman | f9d8c6c | 2013-09-23 23:38:39 +0000 | [diff] [blame] | 4154 | _mm_stream_si64(long long *__p, long long __a) |
| 4155 | { |
| 4156 | __builtin_ia32_movnti64(__p, __a); |
| 4157 | } |
| 4158 | #endif |
| 4159 | |
Albert Gutowski | 727ab8a | 2016-09-14 21:19:43 +0000 | [diff] [blame] | 4160 | #if defined(__cplusplus) |
| 4161 | extern "C" { |
| 4162 | #endif |
| 4163 | |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 4164 | /// \brief The cache line containing \a __p is flushed and invalidated from all |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4165 | /// caches in the coherency domain. |
| 4166 | /// |
| 4167 | /// \headerfile <x86intrin.h> |
| 4168 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 4169 | /// This intrinsic corresponds to the <c> CLFLUSH </c> instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4170 | /// |
| 4171 | /// \param __p |
| 4172 | /// A pointer to the memory location used to identify the cache line to be |
| 4173 | /// flushed. |
Ekaterina Romanova | 2e041c9 | 2017-01-13 01:14:08 +0000 | [diff] [blame] | 4174 | void _mm_clflush(void const * __p); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 4175 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4176 | /// \brief Forces strong memory ordering (serialization) between load |
| 4177 | /// instructions preceding this instruction and load instructions following |
| 4178 | /// this instruction, ensuring the system completes all previous loads before |
| 4179 | /// executing subsequent loads. |
| 4180 | /// |
| 4181 | /// \headerfile <x86intrin.h> |
| 4182 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 4183 | /// This intrinsic corresponds to the <c> LFENCE </c> instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4184 | /// |
Albert Gutowski | 727ab8a | 2016-09-14 21:19:43 +0000 | [diff] [blame] | 4185 | void _mm_lfence(void); |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 4186 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4187 | /// \brief Forces strong memory ordering (serialization) between load and store |
| 4188 | /// instructions preceding this instruction and load and store instructions |
| 4189 | /// following this instruction, ensuring that the system completes all |
| 4190 | /// previous memory accesses before executing subsequent memory accesses. |
| 4191 | /// |
| 4192 | /// \headerfile <x86intrin.h> |
| 4193 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 4194 | /// This intrinsic corresponds to the <c> MFENCE </c> instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4195 | /// |
Albert Gutowski | 727ab8a | 2016-09-14 21:19:43 +0000 | [diff] [blame] | 4196 | void _mm_mfence(void); |
| 4197 | |
| 4198 | #if defined(__cplusplus) |
| 4199 | } // extern "C" |
| 4200 | #endif |
Anders Carlsson | a0d5ca2 | 2008-12-25 23:48:58 +0000 | [diff] [blame] | 4201 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4202 | /// \brief Converts 16-bit signed integers from both 128-bit integer vector |
| 4203 | /// operands into 8-bit signed integers, and packs the results into the |
| 4204 | /// destination. Positive values greater than 0x7F are saturated to 0x7F. |
| 4205 | /// Negative values less than 0x80 are saturated to 0x80. |
| 4206 | /// |
| 4207 | /// \headerfile <x86intrin.h> |
| 4208 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 4209 | /// This intrinsic corresponds to the <c> VPACKSSWB / PACKSSWB </c> instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4210 | /// |
| 4211 | /// \param __a |
| 4212 | /// A 128-bit integer vector of [8 x i16]. Each 16-bit element is treated as |
| 4213 | /// a signed integer and is converted to a 8-bit signed integer with |
| 4214 | /// saturation. Values greater than 0x7F are saturated to 0x7F. Values less |
| 4215 | /// than 0x80 are saturated to 0x80. The converted [8 x i8] values are |
| 4216 | /// written to the lower 64 bits of the result. |
| 4217 | /// \param __b |
| 4218 | /// A 128-bit integer vector of [8 x i16]. Each 16-bit element is treated as |
| 4219 | /// a signed integer and is converted to a 8-bit signed integer with |
| 4220 | /// saturation. Values greater than 0x7F are saturated to 0x7F. Values less |
| 4221 | /// than 0x80 are saturated to 0x80. The converted [8 x i8] values are |
| 4222 | /// written to the higher 64 bits of the result. |
| 4223 | /// \returns A 128-bit vector of [16 x i8] containing the converted values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4224 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4225 | _mm_packs_epi16(__m128i __a, __m128i __b) |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4226 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4227 | return (__m128i)__builtin_ia32_packsswb128((__v8hi)__a, (__v8hi)__b); |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4228 | } |
| 4229 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4230 | /// \brief Converts 32-bit signed integers from both 128-bit integer vector |
| 4231 | /// operands into 16-bit signed integers, and packs the results into the |
| 4232 | /// destination. Positive values greater than 0x7FFF are saturated to 0x7FFF. |
| 4233 | /// Negative values less than 0x8000 are saturated to 0x8000. |
| 4234 | /// |
| 4235 | /// \headerfile <x86intrin.h> |
| 4236 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 4237 | /// This intrinsic corresponds to the <c> VPACKSSDW / PACKSSDW </c> instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4238 | /// |
| 4239 | /// \param __a |
| 4240 | /// A 128-bit integer vector of [4 x i32]. Each 32-bit element is treated as |
| 4241 | /// a signed integer and is converted to a 16-bit signed integer with |
| 4242 | /// saturation. Values greater than 0x7FFF are saturated to 0x7FFF. Values |
| 4243 | /// less than 0x8000 are saturated to 0x8000. The converted [4 x i16] values |
| 4244 | /// are written to the lower 64 bits of the result. |
| 4245 | /// \param __b |
| 4246 | /// A 128-bit integer vector of [4 x i32]. Each 32-bit element is treated as |
| 4247 | /// a signed integer and is converted to a 16-bit signed integer with |
| 4248 | /// saturation. Values greater than 0x7FFF are saturated to 0x7FFF. Values |
| 4249 | /// less than 0x8000 are saturated to 0x8000. The converted [4 x i16] values |
| 4250 | /// are written to the higher 64 bits of the result. |
| 4251 | /// \returns A 128-bit vector of [8 x i16] containing the converted values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4252 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4253 | _mm_packs_epi32(__m128i __a, __m128i __b) |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4254 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4255 | return (__m128i)__builtin_ia32_packssdw128((__v4si)__a, (__v4si)__b); |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4256 | } |
| 4257 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4258 | /// \brief Converts 16-bit signed integers from both 128-bit integer vector |
| 4259 | /// operands into 8-bit unsigned integers, and packs the results into the |
| 4260 | /// destination. Values greater than 0xFF are saturated to 0xFF. Values less |
| 4261 | /// than 0x00 are saturated to 0x00. |
| 4262 | /// |
| 4263 | /// \headerfile <x86intrin.h> |
| 4264 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 4265 | /// This intrinsic corresponds to the <c> VPACKUSWB / PACKUSWB </c> instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4266 | /// |
| 4267 | /// \param __a |
| 4268 | /// A 128-bit integer vector of [8 x i16]. Each 16-bit element is treated as |
| 4269 | /// a signed integer and is converted to an 8-bit unsigned integer with |
| 4270 | /// saturation. Values greater than 0xFF are saturated to 0xFF. Values less |
| 4271 | /// than 0x00 are saturated to 0x00. The converted [8 x i8] values are |
| 4272 | /// written to the lower 64 bits of the result. |
| 4273 | /// \param __b |
| 4274 | /// A 128-bit integer vector of [8 x i16]. Each 16-bit element is treated as |
| 4275 | /// a signed integer and is converted to an 8-bit unsigned integer with |
| 4276 | /// saturation. Values greater than 0xFF are saturated to 0xFF. Values less |
| 4277 | /// than 0x00 are saturated to 0x00. The converted [8 x i8] values are |
| 4278 | /// written to the higher 64 bits of the result. |
| 4279 | /// \returns A 128-bit vector of [16 x i8] containing the converted values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4280 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4281 | _mm_packus_epi16(__m128i __a, __m128i __b) |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4282 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4283 | return (__m128i)__builtin_ia32_packuswb128((__v8hi)__a, (__v8hi)__b); |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4284 | } |
| 4285 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4286 | /// \brief Extracts 16 bits from a 128-bit integer vector of [8 x i16], using |
| 4287 | /// the immediate-value parameter as a selector. |
| 4288 | /// |
| 4289 | /// \headerfile <x86intrin.h> |
| 4290 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 4291 | /// This intrinsic corresponds to the <c> VPEXTRW / PEXTRW </c> instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4292 | /// |
| 4293 | /// \param __a |
| 4294 | /// A 128-bit integer vector. |
| 4295 | /// \param __imm |
Ekaterina Romanova | 2e041c9 | 2017-01-13 01:14:08 +0000 | [diff] [blame] | 4296 | /// An immediate value. Bits [2:0] selects values from \a __a to be assigned |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4297 | /// to bits[15:0] of the result. \n |
| 4298 | /// 000: assign values from bits [15:0] of \a __a. \n |
| 4299 | /// 001: assign values from bits [31:16] of \a __a. \n |
| 4300 | /// 010: assign values from bits [47:32] of \a __a. \n |
| 4301 | /// 011: assign values from bits [63:48] of \a __a. \n |
| 4302 | /// 100: assign values from bits [79:64] of \a __a. \n |
| 4303 | /// 101: assign values from bits [95:80] of \a __a. \n |
| 4304 | /// 110: assign values from bits [111:96] of \a __a. \n |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 4305 | /// 111: assign values from bits [127:112] of \a __a. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4306 | /// \returns An integer, whose lower 16 bits are selected from the 128-bit |
| 4307 | /// integer vector parameter and the remaining bits are assigned zeros. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4308 | static __inline__ int __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4309 | _mm_extract_epi16(__m128i __a, int __imm) |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4310 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4311 | __v8hi __b = (__v8hi)__a; |
Manman Ren | be38b9e | 2013-10-22 19:24:42 +0000 | [diff] [blame] | 4312 | return (unsigned short)__b[__imm & 7]; |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4313 | } |
| 4314 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4315 | /// \brief Constructs a 128-bit integer vector by first making a copy of the |
| 4316 | /// 128-bit integer vector parameter, and then inserting the lower 16 bits |
| 4317 | /// of an integer parameter into an offset specified by the immediate-value |
| 4318 | /// parameter. |
| 4319 | /// |
| 4320 | /// \headerfile <x86intrin.h> |
| 4321 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 4322 | /// This intrinsic corresponds to the <c> VPINSRW / PINSRW </c> instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4323 | /// |
| 4324 | /// \param __a |
| 4325 | /// A 128-bit integer vector of [8 x i16]. This vector is copied to the |
| 4326 | /// result and then one of the eight elements in the result is replaced by |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 4327 | /// the lower 16 bits of \a __b. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4328 | /// \param __b |
| 4329 | /// An integer. The lower 16 bits of this parameter are written to the |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 4330 | /// result beginning at an offset specified by \a __imm. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4331 | /// \param __imm |
| 4332 | /// An immediate value specifying the bit offset in the result at which the |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 4333 | /// lower 16 bits of \a __b are written. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4334 | /// \returns A 128-bit integer vector containing the constructed values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4335 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4336 | _mm_insert_epi16(__m128i __a, int __b, int __imm) |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4337 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4338 | __v8hi __c = (__v8hi)__a; |
| 4339 | __c[__imm & 7] = __b; |
| 4340 | return (__m128i)__c; |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4341 | } |
| 4342 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4343 | /// \brief Copies the values of the most significant bits from each 8-bit |
| 4344 | /// element in a 128-bit integer vector of [16 x i8] to create a 16-bit mask |
| 4345 | /// value, zero-extends the value, and writes it to the destination. |
| 4346 | /// |
| 4347 | /// \headerfile <x86intrin.h> |
| 4348 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 4349 | /// This intrinsic corresponds to the <c> VPMOVMSKB / PMOVMSKB </c> instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4350 | /// |
| 4351 | /// \param __a |
| 4352 | /// A 128-bit integer vector containing the values with bits to be extracted. |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 4353 | /// \returns The most significant bits from each 8-bit element in \a __a, |
| 4354 | /// written to bits [15:0]. The other bits are assigned zeros. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4355 | static __inline__ int __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4356 | _mm_movemask_epi8(__m128i __a) |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4357 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4358 | return __builtin_ia32_pmovmskb128((__v16qi)__a); |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4359 | } |
| 4360 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4361 | /// \brief Constructs a 128-bit integer vector by shuffling four 32-bit |
| 4362 | /// elements of a 128-bit integer vector parameter, using the immediate-value |
| 4363 | /// parameter as a specifier. |
| 4364 | /// |
| 4365 | /// \headerfile <x86intrin.h> |
| 4366 | /// |
| 4367 | /// \code |
| 4368 | /// __m128i _mm_shuffle_epi32(__m128i a, const int imm); |
| 4369 | /// \endcode |
| 4370 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 4371 | /// This intrinsic corresponds to the <c> VPSHUFD / PSHUFD </c> instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4372 | /// |
| 4373 | /// \param a |
| 4374 | /// A 128-bit integer vector containing the values to be copied. |
| 4375 | /// \param imm |
| 4376 | /// An immediate value containing an 8-bit value specifying which elements to |
| 4377 | /// copy from a. The destinations within the 128-bit destination are assigned |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4378 | /// values as follows: \n |
| 4379 | /// Bits [1:0] are used to assign values to bits [31:0] of the result. \n |
| 4380 | /// Bits [3:2] are used to assign values to bits [63:32] of the result. \n |
| 4381 | /// Bits [5:4] are used to assign values to bits [95:64] of the result. \n |
| 4382 | /// Bits [7:6] are used to assign values to bits [127:96] of the result. \n |
| 4383 | /// Bit value assignments: \n |
| 4384 | /// 00: assign values from bits [31:0] of \a a. \n |
| 4385 | /// 01: assign values from bits [63:32] of \a a. \n |
| 4386 | /// 10: assign values from bits [95:64] of \a a. \n |
| 4387 | /// 11: assign values from bits [127:96] of \a a. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4388 | /// \returns A 128-bit integer vector containing the shuffled values. |
Bob Wilson | c9b97cc | 2011-11-05 06:08:06 +0000 | [diff] [blame] | 4389 | #define _mm_shuffle_epi32(a, imm) __extension__ ({ \ |
Craig Topper | 51e4741 | 2015-02-13 06:04:43 +0000 | [diff] [blame] | 4390 | (__m128i)__builtin_shufflevector((__v4si)(__m128i)(a), \ |
Craig Topper | 2a383c9 | 2016-07-04 22:18:01 +0000 | [diff] [blame] | 4391 | (__v4si)_mm_undefined_si128(), \ |
| 4392 | ((imm) >> 0) & 0x3, ((imm) >> 2) & 0x3, \ |
| 4393 | ((imm) >> 4) & 0x3, ((imm) >> 6) & 0x3); }) |
Chris Lattner | f03406f | 2011-04-25 20:42:40 +0000 | [diff] [blame] | 4394 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4395 | /// \brief Constructs a 128-bit integer vector by shuffling four lower 16-bit |
| 4396 | /// elements of a 128-bit integer vector of [8 x i16], using the immediate |
| 4397 | /// value parameter as a specifier. |
| 4398 | /// |
| 4399 | /// \headerfile <x86intrin.h> |
| 4400 | /// |
| 4401 | /// \code |
| 4402 | /// __m128i _mm_shufflelo_epi16(__m128i a, const int imm); |
| 4403 | /// \endcode |
| 4404 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 4405 | /// This intrinsic corresponds to the <c> VPSHUFLW / PSHUFLW </c> instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4406 | /// |
| 4407 | /// \param a |
| 4408 | /// A 128-bit integer vector of [8 x i16]. Bits [127:64] are copied to bits |
| 4409 | /// [127:64] of the result. |
| 4410 | /// \param imm |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4411 | /// An 8-bit immediate value specifying which elements to copy from \a a. \n |
| 4412 | /// Bits[1:0] are used to assign values to bits [15:0] of the result. \n |
| 4413 | /// Bits[3:2] are used to assign values to bits [31:16] of the result. \n |
| 4414 | /// Bits[5:4] are used to assign values to bits [47:32] of the result. \n |
| 4415 | /// Bits[7:6] are used to assign values to bits [63:48] of the result. \n |
| 4416 | /// Bit value assignments: \n |
| 4417 | /// 00: assign values from bits [15:0] of \a a. \n |
| 4418 | /// 01: assign values from bits [31:16] of \a a. \n |
| 4419 | /// 10: assign values from bits [47:32] of \a a. \n |
| 4420 | /// 11: assign values from bits [63:48] of \a a. \n |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4421 | /// \returns A 128-bit integer vector containing the shuffled values. |
Bob Wilson | c9b97cc | 2011-11-05 06:08:06 +0000 | [diff] [blame] | 4422 | #define _mm_shufflelo_epi16(a, imm) __extension__ ({ \ |
Craig Topper | 51e4741 | 2015-02-13 06:04:43 +0000 | [diff] [blame] | 4423 | (__m128i)__builtin_shufflevector((__v8hi)(__m128i)(a), \ |
Craig Topper | 2a383c9 | 2016-07-04 22:18:01 +0000 | [diff] [blame] | 4424 | (__v8hi)_mm_undefined_si128(), \ |
| 4425 | ((imm) >> 0) & 0x3, ((imm) >> 2) & 0x3, \ |
| 4426 | ((imm) >> 4) & 0x3, ((imm) >> 6) & 0x3, \ |
Bob Wilson | c9b97cc | 2011-11-05 06:08:06 +0000 | [diff] [blame] | 4427 | 4, 5, 6, 7); }) |
Chris Lattner | f03406f | 2011-04-25 20:42:40 +0000 | [diff] [blame] | 4428 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4429 | /// \brief Constructs a 128-bit integer vector by shuffling four upper 16-bit |
| 4430 | /// elements of a 128-bit integer vector of [8 x i16], using the immediate |
| 4431 | /// value parameter as a specifier. |
| 4432 | /// |
| 4433 | /// \headerfile <x86intrin.h> |
| 4434 | /// |
| 4435 | /// \code |
| 4436 | /// __m128i _mm_shufflehi_epi16(__m128i a, const int imm); |
| 4437 | /// \endcode |
| 4438 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 4439 | /// This intrinsic corresponds to the <c> VPSHUFHW / PSHUFHW </c> instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4440 | /// |
| 4441 | /// \param a |
| 4442 | /// A 128-bit integer vector of [8 x i16]. Bits [63:0] are copied to bits |
| 4443 | /// [63:0] of the result. |
| 4444 | /// \param imm |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4445 | /// An 8-bit immediate value specifying which elements to copy from \a a. \n |
| 4446 | /// Bits[1:0] are used to assign values to bits [79:64] of the result. \n |
| 4447 | /// Bits[3:2] are used to assign values to bits [95:80] of the result. \n |
| 4448 | /// Bits[5:4] are used to assign values to bits [111:96] of the result. \n |
| 4449 | /// Bits[7:6] are used to assign values to bits [127:112] of the result. \n |
| 4450 | /// Bit value assignments: \n |
| 4451 | /// 00: assign values from bits [79:64] of \a a. \n |
| 4452 | /// 01: assign values from bits [95:80] of \a a. \n |
| 4453 | /// 10: assign values from bits [111:96] of \a a. \n |
| 4454 | /// 11: assign values from bits [127:112] of \a a. \n |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4455 | /// \returns A 128-bit integer vector containing the shuffled values. |
Bob Wilson | c9b97cc | 2011-11-05 06:08:06 +0000 | [diff] [blame] | 4456 | #define _mm_shufflehi_epi16(a, imm) __extension__ ({ \ |
Craig Topper | 51e4741 | 2015-02-13 06:04:43 +0000 | [diff] [blame] | 4457 | (__m128i)__builtin_shufflevector((__v8hi)(__m128i)(a), \ |
Craig Topper | 2a383c9 | 2016-07-04 22:18:01 +0000 | [diff] [blame] | 4458 | (__v8hi)_mm_undefined_si128(), \ |
Bob Wilson | c9b97cc | 2011-11-05 06:08:06 +0000 | [diff] [blame] | 4459 | 0, 1, 2, 3, \ |
Craig Topper | 2a383c9 | 2016-07-04 22:18:01 +0000 | [diff] [blame] | 4460 | 4 + (((imm) >> 0) & 0x3), \ |
| 4461 | 4 + (((imm) >> 2) & 0x3), \ |
| 4462 | 4 + (((imm) >> 4) & 0x3), \ |
| 4463 | 4 + (((imm) >> 6) & 0x3)); }) |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4464 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4465 | /// \brief Unpacks the high-order (index 8-15) values from two 128-bit vectors |
| 4466 | /// of [16 x i8] and interleaves them into a 128-bit vector of [16 x i8]. |
| 4467 | /// |
| 4468 | /// \headerfile <x86intrin.h> |
| 4469 | /// |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4470 | /// This intrinsic corresponds to the <c> VPUNPCKHBW / PUNPCKHBW </c> |
| 4471 | /// instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4472 | /// |
| 4473 | /// \param __a |
| 4474 | /// A 128-bit vector of [16 x i8]. |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4475 | /// Bits [71:64] are written to bits [7:0] of the result. \n |
| 4476 | /// Bits [79:72] are written to bits [23:16] of the result. \n |
| 4477 | /// Bits [87:80] are written to bits [39:32] of the result. \n |
| 4478 | /// Bits [95:88] are written to bits [55:48] of the result. \n |
| 4479 | /// Bits [103:96] are written to bits [71:64] of the result. \n |
| 4480 | /// Bits [111:104] are written to bits [87:80] of the result. \n |
| 4481 | /// Bits [119:112] are written to bits [103:96] of the result. \n |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4482 | /// Bits [127:120] are written to bits [119:112] of the result. |
| 4483 | /// \param __b |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4484 | /// A 128-bit vector of [16 x i8]. \n |
| 4485 | /// Bits [71:64] are written to bits [15:8] of the result. \n |
| 4486 | /// Bits [79:72] are written to bits [31:24] of the result. \n |
| 4487 | /// Bits [87:80] are written to bits [47:40] of the result. \n |
| 4488 | /// Bits [95:88] are written to bits [63:56] of the result. \n |
| 4489 | /// Bits [103:96] are written to bits [79:72] of the result. \n |
| 4490 | /// Bits [111:104] are written to bits [95:88] of the result. \n |
| 4491 | /// Bits [119:112] are written to bits [111:104] of the result. \n |
| 4492 | /// Bits [127:120] are written to bits [127:120] of the result. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4493 | /// \returns A 128-bit vector of [16 x i8] containing the interleaved values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4494 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4495 | _mm_unpackhi_epi8(__m128i __a, __m128i __b) |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4496 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4497 | return (__m128i)__builtin_shufflevector((__v16qi)__a, (__v16qi)__b, 8, 16+8, 9, 16+9, 10, 16+10, 11, 16+11, 12, 16+12, 13, 16+13, 14, 16+14, 15, 16+15); |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4498 | } |
| 4499 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4500 | /// \brief Unpacks the high-order (index 4-7) values from two 128-bit vectors of |
| 4501 | /// [8 x i16] and interleaves them into a 128-bit vector of [8 x i16]. |
| 4502 | /// |
| 4503 | /// \headerfile <x86intrin.h> |
| 4504 | /// |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4505 | /// This intrinsic corresponds to the <c> VPUNPCKHWD / PUNPCKHWD </c> |
| 4506 | /// instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4507 | /// |
| 4508 | /// \param __a |
| 4509 | /// A 128-bit vector of [8 x i16]. |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4510 | /// Bits [79:64] are written to bits [15:0] of the result. \n |
| 4511 | /// Bits [95:80] are written to bits [47:32] of the result. \n |
| 4512 | /// Bits [111:96] are written to bits [79:64] of the result. \n |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4513 | /// Bits [127:112] are written to bits [111:96] of the result. |
| 4514 | /// \param __b |
| 4515 | /// A 128-bit vector of [8 x i16]. |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4516 | /// Bits [79:64] are written to bits [31:16] of the result. \n |
| 4517 | /// Bits [95:80] are written to bits [63:48] of the result. \n |
| 4518 | /// Bits [111:96] are written to bits [95:80] of the result. \n |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4519 | /// Bits [127:112] are written to bits [127:112] of the result. |
| 4520 | /// \returns A 128-bit vector of [8 x i16] containing the interleaved values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4521 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4522 | _mm_unpackhi_epi16(__m128i __a, __m128i __b) |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4523 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4524 | return (__m128i)__builtin_shufflevector((__v8hi)__a, (__v8hi)__b, 4, 8+4, 5, 8+5, 6, 8+6, 7, 8+7); |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4525 | } |
| 4526 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4527 | /// \brief Unpacks the high-order (index 2,3) values from two 128-bit vectors of |
| 4528 | /// [4 x i32] and interleaves them into a 128-bit vector of [4 x i32]. |
| 4529 | /// |
| 4530 | /// \headerfile <x86intrin.h> |
| 4531 | /// |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4532 | /// This intrinsic corresponds to the <c> VPUNPCKHDQ / PUNPCKHDQ </c> |
| 4533 | /// instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4534 | /// |
| 4535 | /// \param __a |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4536 | /// A 128-bit vector of [4 x i32]. \n |
| 4537 | /// Bits [95:64] are written to bits [31:0] of the destination. \n |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4538 | /// Bits [127:96] are written to bits [95:64] of the destination. |
| 4539 | /// \param __b |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4540 | /// A 128-bit vector of [4 x i32]. \n |
| 4541 | /// Bits [95:64] are written to bits [64:32] of the destination. \n |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4542 | /// Bits [127:96] are written to bits [127:96] of the destination. |
| 4543 | /// \returns A 128-bit vector of [4 x i32] containing the interleaved values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4544 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4545 | _mm_unpackhi_epi32(__m128i __a, __m128i __b) |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4546 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4547 | return (__m128i)__builtin_shufflevector((__v4si)__a, (__v4si)__b, 2, 4+2, 3, 4+3); |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4548 | } |
| 4549 | |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 4550 | /// \brief Unpacks the high-order 64-bit elements from two 128-bit vectors of |
| 4551 | /// [2 x i64] and interleaves them into a 128-bit vector of [2 x i64]. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4552 | /// |
| 4553 | /// \headerfile <x86intrin.h> |
| 4554 | /// |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4555 | /// This intrinsic corresponds to the <c> VPUNPCKHQDQ / PUNPCKHQDQ </c> |
| 4556 | /// instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4557 | /// |
| 4558 | /// \param __a |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4559 | /// A 128-bit vector of [2 x i64]. \n |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4560 | /// Bits [127:64] are written to bits [63:0] of the destination. |
| 4561 | /// \param __b |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4562 | /// A 128-bit vector of [2 x i64]. \n |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4563 | /// Bits [127:64] are written to bits [127:64] of the destination. |
| 4564 | /// \returns A 128-bit vector of [2 x i64] containing the interleaved values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4565 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4566 | _mm_unpackhi_epi64(__m128i __a, __m128i __b) |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4567 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 4568 | return (__m128i)__builtin_shufflevector((__v2di)__a, (__v2di)__b, 1, 2+1); |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4569 | } |
| 4570 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4571 | /// \brief Unpacks the low-order (index 0-7) values from two 128-bit vectors of |
| 4572 | /// [16 x i8] and interleaves them into a 128-bit vector of [16 x i8]. |
| 4573 | /// |
| 4574 | /// \headerfile <x86intrin.h> |
| 4575 | /// |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4576 | /// This intrinsic corresponds to the <c> VPUNPCKLBW / PUNPCKLBW </c> |
| 4577 | /// instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4578 | /// |
| 4579 | /// \param __a |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4580 | /// A 128-bit vector of [16 x i8]. \n |
| 4581 | /// Bits [7:0] are written to bits [7:0] of the result. \n |
| 4582 | /// Bits [15:8] are written to bits [23:16] of the result. \n |
| 4583 | /// Bits [23:16] are written to bits [39:32] of the result. \n |
| 4584 | /// Bits [31:24] are written to bits [55:48] of the result. \n |
| 4585 | /// Bits [39:32] are written to bits [71:64] of the result. \n |
| 4586 | /// Bits [47:40] are written to bits [87:80] of the result. \n |
| 4587 | /// Bits [55:48] are written to bits [103:96] of the result. \n |
| 4588 | /// Bits [63:56] are written to bits [119:112] of the result. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4589 | /// \param __b |
| 4590 | /// A 128-bit vector of [16 x i8]. |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4591 | /// Bits [7:0] are written to bits [15:8] of the result. \n |
| 4592 | /// Bits [15:8] are written to bits [31:24] of the result. \n |
| 4593 | /// Bits [23:16] are written to bits [47:40] of the result. \n |
| 4594 | /// Bits [31:24] are written to bits [63:56] of the result. \n |
| 4595 | /// Bits [39:32] are written to bits [79:72] of the result. \n |
| 4596 | /// Bits [47:40] are written to bits [95:88] of the result. \n |
| 4597 | /// Bits [55:48] are written to bits [111:104] of the result. \n |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4598 | /// Bits [63:56] are written to bits [127:120] of the result. |
| 4599 | /// \returns A 128-bit vector of [16 x i8] containing the interleaved values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4600 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4601 | _mm_unpacklo_epi8(__m128i __a, __m128i __b) |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4602 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4603 | return (__m128i)__builtin_shufflevector((__v16qi)__a, (__v16qi)__b, 0, 16+0, 1, 16+1, 2, 16+2, 3, 16+3, 4, 16+4, 5, 16+5, 6, 16+6, 7, 16+7); |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4604 | } |
| 4605 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4606 | /// \brief Unpacks the low-order (index 0-3) values from each of the two 128-bit |
| 4607 | /// vectors of [8 x i16] and interleaves them into a 128-bit vector of |
| 4608 | /// [8 x i16]. |
| 4609 | /// |
| 4610 | /// \headerfile <x86intrin.h> |
| 4611 | /// |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4612 | /// This intrinsic corresponds to the <c> VPUNPCKLWD / PUNPCKLWD </c> |
| 4613 | /// instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4614 | /// |
| 4615 | /// \param __a |
| 4616 | /// A 128-bit vector of [8 x i16]. |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4617 | /// Bits [15:0] are written to bits [15:0] of the result. \n |
| 4618 | /// Bits [31:16] are written to bits [47:32] of the result. \n |
| 4619 | /// Bits [47:32] are written to bits [79:64] of the result. \n |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4620 | /// Bits [63:48] are written to bits [111:96] of the result. |
| 4621 | /// \param __b |
| 4622 | /// A 128-bit vector of [8 x i16]. |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4623 | /// Bits [15:0] are written to bits [31:16] of the result. \n |
| 4624 | /// Bits [31:16] are written to bits [63:48] of the result. \n |
| 4625 | /// Bits [47:32] are written to bits [95:80] of the result. \n |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4626 | /// Bits [63:48] are written to bits [127:112] of the result. |
| 4627 | /// \returns A 128-bit vector of [8 x i16] containing the interleaved values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4628 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4629 | _mm_unpacklo_epi16(__m128i __a, __m128i __b) |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4630 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4631 | return (__m128i)__builtin_shufflevector((__v8hi)__a, (__v8hi)__b, 0, 8+0, 1, 8+1, 2, 8+2, 3, 8+3); |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4632 | } |
| 4633 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4634 | /// \brief Unpacks the low-order (index 0,1) values from two 128-bit vectors of |
| 4635 | /// [4 x i32] and interleaves them into a 128-bit vector of [4 x i32]. |
| 4636 | /// |
| 4637 | /// \headerfile <x86intrin.h> |
| 4638 | /// |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4639 | /// This intrinsic corresponds to the <c> VPUNPCKLDQ / PUNPCKLDQ </c> |
| 4640 | /// instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4641 | /// |
| 4642 | /// \param __a |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4643 | /// A 128-bit vector of [4 x i32]. \n |
| 4644 | /// Bits [31:0] are written to bits [31:0] of the destination. \n |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4645 | /// Bits [63:32] are written to bits [95:64] of the destination. |
| 4646 | /// \param __b |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4647 | /// A 128-bit vector of [4 x i32]. \n |
| 4648 | /// Bits [31:0] are written to bits [64:32] of the destination. \n |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4649 | /// Bits [63:32] are written to bits [127:96] of the destination. |
| 4650 | /// \returns A 128-bit vector of [4 x i32] containing the interleaved values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4651 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4652 | _mm_unpacklo_epi32(__m128i __a, __m128i __b) |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4653 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4654 | return (__m128i)__builtin_shufflevector((__v4si)__a, (__v4si)__b, 0, 4+0, 1, 4+1); |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4655 | } |
| 4656 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4657 | /// \brief Unpacks the low-order 64-bit elements from two 128-bit vectors of |
| 4658 | /// [2 x i64] and interleaves them into a 128-bit vector of [2 x i64]. |
| 4659 | /// |
| 4660 | /// \headerfile <x86intrin.h> |
| 4661 | /// |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4662 | /// This intrinsic corresponds to the <c> VPUNPCKLQDQ / PUNPCKLQDQ </c> |
| 4663 | /// instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4664 | /// |
| 4665 | /// \param __a |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4666 | /// A 128-bit vector of [2 x i64]. \n |
| 4667 | /// Bits [63:0] are written to bits [63:0] of the destination. \n |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4668 | /// \param __b |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4669 | /// A 128-bit vector of [2 x i64]. \n |
| 4670 | /// Bits [63:0] are written to bits [127:64] of the destination. \n |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4671 | /// \returns A 128-bit vector of [2 x i64] containing the interleaved values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4672 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4673 | _mm_unpacklo_epi64(__m128i __a, __m128i __b) |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4674 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 4675 | return (__m128i)__builtin_shufflevector((__v2di)__a, (__v2di)__b, 0, 2+0); |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4676 | } |
| 4677 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4678 | /// \brief Returns the lower 64 bits of a 128-bit integer vector as a 64-bit |
Ekaterina Romanova | 493091f | 2016-10-20 17:59:15 +0000 | [diff] [blame] | 4679 | /// integer. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4680 | /// |
| 4681 | /// \headerfile <x86intrin.h> |
| 4682 | /// |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 4683 | /// This intrinsic corresponds to the <c> MOVDQ2Q </c> instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4684 | /// |
| 4685 | /// \param __a |
| 4686 | /// A 128-bit integer vector operand. The lower 64 bits are moved to the |
| 4687 | /// destination. |
| 4688 | /// \returns A 64-bit integer containing the lower 64 bits of the parameter. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4689 | static __inline__ __m64 __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4690 | _mm_movepi64_pi64(__m128i __a) |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4691 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4692 | return (__m64)__a[0]; |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4693 | } |
| 4694 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4695 | /// \brief Moves the 64-bit operand to a 128-bit integer vector, zeroing the |
| 4696 | /// upper bits. |
| 4697 | /// |
| 4698 | /// \headerfile <x86intrin.h> |
| 4699 | /// |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 4700 | /// This intrinsic corresponds to the <c> MOVD+VMOVQ </c> instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4701 | /// |
| 4702 | /// \param __a |
| 4703 | /// A 64-bit value. |
| 4704 | /// \returns A 128-bit integer vector. The lower 64 bits contain the value from |
| 4705 | /// the operand. The upper 64 bits are assigned zeros. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4706 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
Alp Toker | d480b1b | 2013-11-23 22:11:57 +0000 | [diff] [blame] | 4707 | _mm_movpi64_epi64(__m64 __a) |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4708 | { |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4709 | return (__m128i){ (long long)__a, 0 }; |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4710 | } |
| 4711 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4712 | /// \brief Moves the lower 64 bits of a 128-bit integer vector to a 128-bit |
| 4713 | /// integer vector, zeroing the upper bits. |
| 4714 | /// |
| 4715 | /// \headerfile <x86intrin.h> |
| 4716 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 4717 | /// This intrinsic corresponds to the <c> VMOVQ / MOVQ </c> instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4718 | /// |
| 4719 | /// \param __a |
| 4720 | /// A 128-bit integer vector operand. The lower 64 bits are moved to the |
| 4721 | /// destination. |
| 4722 | /// \returns A 128-bit integer vector. The lower 64 bits contain the value from |
| 4723 | /// the operand. The upper 64 bits are assigned zeros. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4724 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4725 | _mm_move_epi64(__m128i __a) |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4726 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 4727 | return __builtin_shufflevector((__v2di)__a, (__m128i){ 0 }, 0, 2); |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4728 | } |
| 4729 | |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 4730 | /// \brief Unpacks the high-order 64-bit elements from two 128-bit vectors of |
| 4731 | /// [2 x double] and interleaves them into a 128-bit vector of [2 x |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4732 | /// double]. |
| 4733 | /// |
| 4734 | /// \headerfile <x86intrin.h> |
| 4735 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 4736 | /// This intrinsic corresponds to the <c> VUNPCKHPD / UNPCKHPD </c> instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4737 | /// |
| 4738 | /// \param __a |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4739 | /// A 128-bit vector of [2 x double]. \n |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4740 | /// Bits [127:64] are written to bits [63:0] of the destination. |
| 4741 | /// \param __b |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4742 | /// A 128-bit vector of [2 x double]. \n |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4743 | /// Bits [127:64] are written to bits [127:64] of the destination. |
| 4744 | /// \returns A 128-bit vector of [2 x double] containing the interleaved values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4745 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4746 | _mm_unpackhi_pd(__m128d __a, __m128d __b) |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4747 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 4748 | return __builtin_shufflevector((__v2df)__a, (__v2df)__b, 1, 2+1); |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4749 | } |
| 4750 | |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 4751 | /// \brief Unpacks the low-order 64-bit elements from two 128-bit vectors |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4752 | /// of [2 x double] and interleaves them into a 128-bit vector of [2 x |
| 4753 | /// double]. |
| 4754 | /// |
| 4755 | /// \headerfile <x86intrin.h> |
| 4756 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 4757 | /// This intrinsic corresponds to the <c> VUNPCKLPD / UNPCKLPD </c> instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4758 | /// |
| 4759 | /// \param __a |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4760 | /// A 128-bit vector of [2 x double]. \n |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4761 | /// Bits [63:0] are written to bits [63:0] of the destination. |
| 4762 | /// \param __b |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4763 | /// A 128-bit vector of [2 x double]. \n |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4764 | /// Bits [63:0] are written to bits [127:64] of the destination. |
| 4765 | /// \returns A 128-bit vector of [2 x double] containing the interleaved values. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4766 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4767 | _mm_unpacklo_pd(__m128d __a, __m128d __b) |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4768 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 4769 | return __builtin_shufflevector((__v2df)__a, (__v2df)__b, 0, 2+0); |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4770 | } |
| 4771 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4772 | /// \brief Extracts the sign bits of the double-precision values in the 128-bit |
| 4773 | /// vector of [2 x double], zero-extends the value, and writes it to the |
| 4774 | /// low-order bits of the destination. |
| 4775 | /// |
| 4776 | /// \headerfile <x86intrin.h> |
| 4777 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 4778 | /// This intrinsic corresponds to the <c> VMOVMSKPD / MOVMSKPD </c> instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4779 | /// |
| 4780 | /// \param __a |
| 4781 | /// A 128-bit vector of [2 x double] containing the values with sign bits to |
| 4782 | /// be extracted. |
Ekaterina Romanova | 797b0eb | 2016-12-08 22:10:51 +0000 | [diff] [blame] | 4783 | /// \returns The sign bits from each of the double-precision elements in \a __a, |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4784 | /// written to bits [1:0]. The remaining bits are assigned values of zero. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4785 | static __inline__ int __DEFAULT_FN_ATTRS |
David Blaikie | 3302f2b | 2013-01-16 23:08:36 +0000 | [diff] [blame] | 4786 | _mm_movemask_pd(__m128d __a) |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4787 | { |
Craig Topper | 1aa231e | 2016-05-16 06:38:42 +0000 | [diff] [blame] | 4788 | return __builtin_ia32_movmskpd((__v2df)__a); |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4789 | } |
| 4790 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4791 | |
| 4792 | /// \brief Constructs a 128-bit floating-point vector of [2 x double] from two |
| 4793 | /// 128-bit vector parameters of [2 x double], using the immediate-value |
| 4794 | /// parameter as a specifier. |
| 4795 | /// |
| 4796 | /// \headerfile <x86intrin.h> |
| 4797 | /// |
| 4798 | /// \code |
| 4799 | /// __m128d _mm_shuffle_pd(__m128d a, __m128d b, const int i); |
| 4800 | /// \endcode |
| 4801 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 4802 | /// This intrinsic corresponds to the <c> VSHUFPD / SHUFPD </c> instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4803 | /// |
| 4804 | /// \param a |
| 4805 | /// A 128-bit vector of [2 x double]. |
| 4806 | /// \param b |
| 4807 | /// A 128-bit vector of [2 x double]. |
| 4808 | /// \param i |
| 4809 | /// An 8-bit immediate value. The least significant two bits specify which |
Douglas Yung | 0686df10 | 2018-01-02 20:39:29 +0000 | [diff] [blame] | 4810 | /// elements to copy from \a a and \a b: \n |
| 4811 | /// Bit[0] = 0: lower element of \a a copied to lower element of result. \n |
| 4812 | /// Bit[0] = 1: upper element of \a a copied to lower element of result. \n |
Ekaterina Romanova | dffe45b | 2016-12-27 00:49:38 +0000 | [diff] [blame] | 4813 | /// Bit[1] = 0: lower element of \a b copied to upper element of result. \n |
| 4814 | /// Bit[1] = 1: upper element of \a b copied to upper element of result. \n |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4815 | /// \returns A 128-bit vector of [2 x double] containing the shuffled values. |
Bob Wilson | c9b97cc | 2011-11-05 06:08:06 +0000 | [diff] [blame] | 4816 | #define _mm_shuffle_pd(a, b, i) __extension__ ({ \ |
Craig Topper | d619eaaa | 2015-11-11 03:47:10 +0000 | [diff] [blame] | 4817 | (__m128d)__builtin_shufflevector((__v2df)(__m128d)(a), (__v2df)(__m128d)(b), \ |
Craig Topper | 2a383c9 | 2016-07-04 22:18:01 +0000 | [diff] [blame] | 4818 | 0 + (((i) >> 0) & 0x1), \ |
| 4819 | 2 + (((i) >> 1) & 0x1)); }) |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4820 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4821 | /// \brief Casts a 128-bit floating-point vector of [2 x double] into a 128-bit |
| 4822 | /// floating-point vector of [4 x float]. |
| 4823 | /// |
| 4824 | /// \headerfile <x86intrin.h> |
| 4825 | /// |
| 4826 | /// This intrinsic has no corresponding instruction. |
| 4827 | /// |
| 4828 | /// \param __a |
| 4829 | /// A 128-bit floating-point vector of [2 x double]. |
| 4830 | /// \returns A 128-bit floating-point vector of [4 x float] containing the same |
| 4831 | /// bitwise pattern as the parameter. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4832 | static __inline__ __m128 __DEFAULT_FN_ATTRS |
Reid Kleckner | 7ab75b3 | 2013-04-19 17:00:14 +0000 | [diff] [blame] | 4833 | _mm_castpd_ps(__m128d __a) |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4834 | { |
Reid Kleckner | 7ab75b3 | 2013-04-19 17:00:14 +0000 | [diff] [blame] | 4835 | return (__m128)__a; |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4836 | } |
| 4837 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4838 | /// \brief Casts a 128-bit floating-point vector of [2 x double] into a 128-bit |
| 4839 | /// integer vector. |
| 4840 | /// |
| 4841 | /// \headerfile <x86intrin.h> |
| 4842 | /// |
| 4843 | /// This intrinsic has no corresponding instruction. |
| 4844 | /// |
| 4845 | /// \param __a |
| 4846 | /// A 128-bit floating-point vector of [2 x double]. |
| 4847 | /// \returns A 128-bit integer vector containing the same bitwise pattern as the |
| 4848 | /// parameter. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4849 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
Reid Kleckner | 7ab75b3 | 2013-04-19 17:00:14 +0000 | [diff] [blame] | 4850 | _mm_castpd_si128(__m128d __a) |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4851 | { |
Reid Kleckner | 7ab75b3 | 2013-04-19 17:00:14 +0000 | [diff] [blame] | 4852 | return (__m128i)__a; |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4853 | } |
| 4854 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4855 | /// \brief Casts a 128-bit floating-point vector of [4 x float] into a 128-bit |
| 4856 | /// floating-point vector of [2 x double]. |
| 4857 | /// |
| 4858 | /// \headerfile <x86intrin.h> |
| 4859 | /// |
| 4860 | /// This intrinsic has no corresponding instruction. |
| 4861 | /// |
| 4862 | /// \param __a |
| 4863 | /// A 128-bit floating-point vector of [4 x float]. |
| 4864 | /// \returns A 128-bit floating-point vector of [2 x double] containing the same |
| 4865 | /// bitwise pattern as the parameter. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4866 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
Reid Kleckner | 7ab75b3 | 2013-04-19 17:00:14 +0000 | [diff] [blame] | 4867 | _mm_castps_pd(__m128 __a) |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4868 | { |
Reid Kleckner | 7ab75b3 | 2013-04-19 17:00:14 +0000 | [diff] [blame] | 4869 | return (__m128d)__a; |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4870 | } |
| 4871 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4872 | /// \brief Casts a 128-bit floating-point vector of [4 x float] into a 128-bit |
| 4873 | /// integer vector. |
| 4874 | /// |
| 4875 | /// \headerfile <x86intrin.h> |
| 4876 | /// |
| 4877 | /// This intrinsic has no corresponding instruction. |
| 4878 | /// |
| 4879 | /// \param __a |
| 4880 | /// A 128-bit floating-point vector of [4 x float]. |
| 4881 | /// \returns A 128-bit integer vector containing the same bitwise pattern as the |
| 4882 | /// parameter. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4883 | static __inline__ __m128i __DEFAULT_FN_ATTRS |
Reid Kleckner | 7ab75b3 | 2013-04-19 17:00:14 +0000 | [diff] [blame] | 4884 | _mm_castps_si128(__m128 __a) |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4885 | { |
Reid Kleckner | 7ab75b3 | 2013-04-19 17:00:14 +0000 | [diff] [blame] | 4886 | return (__m128i)__a; |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4887 | } |
| 4888 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4889 | /// \brief Casts a 128-bit integer vector into a 128-bit floating-point vector |
| 4890 | /// of [4 x float]. |
| 4891 | /// |
| 4892 | /// \headerfile <x86intrin.h> |
| 4893 | /// |
| 4894 | /// This intrinsic has no corresponding instruction. |
| 4895 | /// |
| 4896 | /// \param __a |
| 4897 | /// A 128-bit integer vector. |
| 4898 | /// \returns A 128-bit floating-point vector of [4 x float] containing the same |
| 4899 | /// bitwise pattern as the parameter. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4900 | static __inline__ __m128 __DEFAULT_FN_ATTRS |
Reid Kleckner | 7ab75b3 | 2013-04-19 17:00:14 +0000 | [diff] [blame] | 4901 | _mm_castsi128_ps(__m128i __a) |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4902 | { |
Reid Kleckner | 7ab75b3 | 2013-04-19 17:00:14 +0000 | [diff] [blame] | 4903 | return (__m128)__a; |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4904 | } |
| 4905 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4906 | /// \brief Casts a 128-bit integer vector into a 128-bit floating-point vector |
| 4907 | /// of [2 x double]. |
| 4908 | /// |
| 4909 | /// \headerfile <x86intrin.h> |
| 4910 | /// |
| 4911 | /// This intrinsic has no corresponding instruction. |
| 4912 | /// |
| 4913 | /// \param __a |
| 4914 | /// A 128-bit integer vector. |
| 4915 | /// \returns A 128-bit floating-point vector of [2 x double] containing the same |
| 4916 | /// bitwise pattern as the parameter. |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4917 | static __inline__ __m128d __DEFAULT_FN_ATTRS |
Reid Kleckner | 7ab75b3 | 2013-04-19 17:00:14 +0000 | [diff] [blame] | 4918 | _mm_castsi128_pd(__m128i __a) |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4919 | { |
Reid Kleckner | 7ab75b3 | 2013-04-19 17:00:14 +0000 | [diff] [blame] | 4920 | return (__m128d)__a; |
Anders Carlsson | 85eb124 | 2008-12-26 00:45:50 +0000 | [diff] [blame] | 4921 | } |
| 4922 | |
Ekaterina Romanova | 2174b6f | 2016-11-17 23:02:00 +0000 | [diff] [blame] | 4923 | #if defined(__cplusplus) |
| 4924 | extern "C" { |
| 4925 | #endif |
| 4926 | |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4927 | /// \brief Indicates that a spin loop is being executed for the purposes of |
| 4928 | /// optimizing power consumption during the loop. |
| 4929 | /// |
| 4930 | /// \headerfile <x86intrin.h> |
| 4931 | /// |
Ekaterina Romanova | 0c1c3bb | 2016-12-09 18:35:50 +0000 | [diff] [blame] | 4932 | /// This intrinsic corresponds to the <c> PAUSE </c> instruction. |
Ekaterina Romanova | a84c24f | 2016-07-22 23:49:37 +0000 | [diff] [blame] | 4933 | /// |
Albert Gutowski | 727ab8a | 2016-09-14 21:19:43 +0000 | [diff] [blame] | 4934 | void _mm_pause(void); |
Anders Carlsson | 37c2371 | 2008-12-26 00:49:43 +0000 | [diff] [blame] | 4935 | |
Ekaterina Romanova | 2174b6f | 2016-11-17 23:02:00 +0000 | [diff] [blame] | 4936 | #if defined(__cplusplus) |
| 4937 | } // extern "C" |
| 4938 | #endif |
Michael Kuperstein | e45af54 | 2015-06-30 13:36:19 +0000 | [diff] [blame] | 4939 | #undef __DEFAULT_FN_ATTRS |
Eric Christopher | 4d185168 | 2015-06-17 07:09:20 +0000 | [diff] [blame] | 4940 | |
Anders Carlsson | 43c2bab | 2009-01-21 01:49:39 +0000 | [diff] [blame] | 4941 | #define _MM_SHUFFLE2(x, y) (((x) << 1) | (y)) |
Anders Carlsson | 37c2371 | 2008-12-26 00:49:43 +0000 | [diff] [blame] | 4942 | |
Oren Ben Simhon | 259b091 | 2017-02-26 11:58:15 +0000 | [diff] [blame] | 4943 | #define _MM_DENORMALS_ZERO_ON (0x0040) |
| 4944 | #define _MM_DENORMALS_ZERO_OFF (0x0000) |
| 4945 | |
| 4946 | #define _MM_DENORMALS_ZERO_MASK (0x0040) |
| 4947 | |
| 4948 | #define _MM_GET_DENORMALS_ZERO_MODE() (_mm_getcsr() & _MM_DENORMALS_ZERO_MASK) |
| 4949 | #define _MM_SET_DENORMALS_ZERO_MODE(x) (_mm_setcsr((_mm_getcsr() & ~_MM_DENORMALS_ZERO_MASK) | (x))) |
| 4950 | |
Anders Carlsson | f15e71d | 2008-12-24 01:45:22 +0000 | [diff] [blame] | 4951 | #endif /* __EMMINTRIN_H */ |