clang API Documentation
00001 /*===---- smmintrin.h - SSE4 intrinsics ------------------------------------=== 00002 * 00003 * Permission is hereby granted, free of charge, to any person obtaining a copy 00004 * of this software and associated documentation files (the "Software"), to deal 00005 * in the Software without restriction, including without limitation the rights 00006 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 00007 * copies of the Software, and to permit persons to whom the Software is 00008 * furnished to do so, subject to the following conditions: 00009 * 00010 * The above copyright notice and this permission notice shall be included in 00011 * all copies or substantial portions of the Software. 00012 * 00013 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00014 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00015 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 00016 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00017 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 00018 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 00019 * THE SOFTWARE. 00020 * 00021 *===-----------------------------------------------------------------------=== 00022 */ 00023 00024 #ifndef _SMMINTRIN_H 00025 #define _SMMINTRIN_H 00026 00027 #ifndef __SSE4_1__ 00028 #error "SSE4.1 instruction set not enabled" 00029 #else 00030 00031 #include <tmmintrin.h> 00032 00033 /* SSE4 Rounding macros. */ 00034 #define _MM_FROUND_TO_NEAREST_INT 0x00 00035 #define _MM_FROUND_TO_NEG_INF 0x01 00036 #define _MM_FROUND_TO_POS_INF 0x02 00037 #define _MM_FROUND_TO_ZERO 0x03 00038 #define _MM_FROUND_CUR_DIRECTION 0x04 00039 00040 #define _MM_FROUND_RAISE_EXC 0x00 00041 #define _MM_FROUND_NO_EXC 0x08 00042 00043 #define _MM_FROUND_NINT (_MM_FROUND_RAISE_EXC | _MM_FROUND_TO_NEAREST_INT) 00044 #define _MM_FROUND_FLOOR (_MM_FROUND_RAISE_EXC | _MM_FROUND_TO_NEG_INF) 00045 #define _MM_FROUND_CEIL (_MM_FROUND_RAISE_EXC | _MM_FROUND_TO_POS_INF) 00046 #define _MM_FROUND_TRUNC (_MM_FROUND_RAISE_EXC | _MM_FROUND_TO_ZERO) 00047 #define _MM_FROUND_RINT (_MM_FROUND_RAISE_EXC | _MM_FROUND_CUR_DIRECTION) 00048 #define _MM_FROUND_NEARBYINT (_MM_FROUND_NO_EXC | _MM_FROUND_CUR_DIRECTION) 00049 00050 #define _mm_ceil_ps(X) _mm_round_ps((X), _MM_FROUND_CEIL) 00051 #define _mm_ceil_pd(X) _mm_round_pd((X), _MM_FROUND_CEIL) 00052 #define _mm_ceil_ss(X, Y) _mm_round_ss((X), (Y), _MM_FROUND_CEIL) 00053 #define _mm_ceil_sd(X, Y) _mm_round_sd((X), (Y), _MM_FROUND_CEIL) 00054 00055 #define _mm_floor_ps(X) _mm_round_ps((X), _MM_FROUND_FLOOR) 00056 #define _mm_floor_pd(X) _mm_round_pd((X), _MM_FROUND_FLOOR) 00057 #define _mm_floor_ss(X, Y) _mm_round_ss((X), (Y), _MM_FROUND_FLOOR) 00058 #define _mm_floor_sd(X, Y) _mm_round_sd((X), (Y), _MM_FROUND_FLOOR) 00059 00060 #define _mm_round_ps(X, M) __extension__ ({ \ 00061 __m128 __X = (X); \ 00062 (__m128) __builtin_ia32_roundps((__v4sf)__X, (M)); }) 00063 00064 #define _mm_round_ss(X, Y, M) __extension__ ({ \ 00065 __m128 __X = (X); \ 00066 __m128 __Y = (Y); \ 00067 (__m128) __builtin_ia32_roundss((__v4sf)__X, (__v4sf)__Y, (M)); }) 00068 00069 #define _mm_round_pd(X, M) __extension__ ({ \ 00070 __m128d __X = (X); \ 00071 (__m128d) __builtin_ia32_roundpd((__v2df)__X, (M)); }) 00072 00073 #define _mm_round_sd(X, Y, M) __extension__ ({ \ 00074 __m128d __X = (X); \ 00075 __m128d __Y = (Y); \ 00076 (__m128d) __builtin_ia32_roundsd((__v2df)__X, (__v2df)__Y, (M)); }) 00077 00078 /* SSE4 Packed Blending Intrinsics. */ 00079 #define _mm_blend_pd(V1, V2, M) __extension__ ({ \ 00080 __m128d __V1 = (V1); \ 00081 __m128d __V2 = (V2); \ 00082 (__m128d) __builtin_ia32_blendpd ((__v2df)__V1, (__v2df)__V2, (M)); }) 00083 00084 #define _mm_blend_ps(V1, V2, M) __extension__ ({ \ 00085 __m128 __V1 = (V1); \ 00086 __m128 __V2 = (V2); \ 00087 (__m128) __builtin_ia32_blendps ((__v4sf)__V1, (__v4sf)__V2, (M)); }) 00088 00089 static __inline__ __m128d __attribute__((__always_inline__, __nodebug__)) 00090 _mm_blendv_pd (__m128d __V1, __m128d __V2, __m128d __M) 00091 { 00092 return (__m128d) __builtin_ia32_blendvpd ((__v2df)__V1, (__v2df)__V2, 00093 (__v2df)__M); 00094 } 00095 00096 static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) 00097 _mm_blendv_ps (__m128 __V1, __m128 __V2, __m128 __M) 00098 { 00099 return (__m128) __builtin_ia32_blendvps ((__v4sf)__V1, (__v4sf)__V2, 00100 (__v4sf)__M); 00101 } 00102 00103 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) 00104 _mm_blendv_epi8 (__m128i __V1, __m128i __V2, __m128i __M) 00105 { 00106 return (__m128i) __builtin_ia32_pblendvb128 ((__v16qi)__V1, (__v16qi)__V2, 00107 (__v16qi)__M); 00108 } 00109 00110 #define _mm_blend_epi16(V1, V2, M) __extension__ ({ \ 00111 __m128i __V1 = (V1); \ 00112 __m128i __V2 = (V2); \ 00113 (__m128i) __builtin_ia32_pblendw128 ((__v8hi)__V1, (__v8hi)__V2, (M)); }) 00114 00115 /* SSE4 Dword Multiply Instructions. */ 00116 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) 00117 _mm_mullo_epi32 (__m128i __V1, __m128i __V2) 00118 { 00119 return (__m128i) ((__v4si)__V1 * (__v4si)__V2); 00120 } 00121 00122 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) 00123 _mm_mul_epi32 (__m128i __V1, __m128i __V2) 00124 { 00125 return (__m128i) __builtin_ia32_pmuldq128 ((__v4si)__V1, (__v4si)__V2); 00126 } 00127 00128 /* SSE4 Floating Point Dot Product Instructions. */ 00129 #define _mm_dp_ps(X, Y, M) __extension__ ({ \ 00130 __m128 __X = (X); \ 00131 __m128 __Y = (Y); \ 00132 (__m128) __builtin_ia32_dpps((__v4sf)__X, (__v4sf)__Y, (M)); }) 00133 00134 #define _mm_dp_pd(X, Y, M) __extension__ ({\ 00135 __m128d __X = (X); \ 00136 __m128d __Y = (Y); \ 00137 (__m128d) __builtin_ia32_dppd((__v2df)__X, (__v2df)__Y, (M)); }) 00138 00139 /* SSE4 Streaming Load Hint Instruction. */ 00140 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) 00141 _mm_stream_load_si128 (__m128i *__V) 00142 { 00143 return (__m128i) __builtin_ia32_movntdqa ((__v2di *) __V); 00144 } 00145 00146 /* SSE4 Packed Integer Min/Max Instructions. */ 00147 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) 00148 _mm_min_epi8 (__m128i __V1, __m128i __V2) 00149 { 00150 return (__m128i) __builtin_ia32_pminsb128 ((__v16qi) __V1, (__v16qi) __V2); 00151 } 00152 00153 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) 00154 _mm_max_epi8 (__m128i __V1, __m128i __V2) 00155 { 00156 return (__m128i) __builtin_ia32_pmaxsb128 ((__v16qi) __V1, (__v16qi) __V2); 00157 } 00158 00159 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) 00160 _mm_min_epu16 (__m128i __V1, __m128i __V2) 00161 { 00162 return (__m128i) __builtin_ia32_pminuw128 ((__v8hi) __V1, (__v8hi) __V2); 00163 } 00164 00165 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) 00166 _mm_max_epu16 (__m128i __V1, __m128i __V2) 00167 { 00168 return (__m128i) __builtin_ia32_pmaxuw128 ((__v8hi) __V1, (__v8hi) __V2); 00169 } 00170 00171 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) 00172 _mm_min_epi32 (__m128i __V1, __m128i __V2) 00173 { 00174 return (__m128i) __builtin_ia32_pminsd128 ((__v4si) __V1, (__v4si) __V2); 00175 } 00176 00177 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) 00178 _mm_max_epi32 (__m128i __V1, __m128i __V2) 00179 { 00180 return (__m128i) __builtin_ia32_pmaxsd128 ((__v4si) __V1, (__v4si) __V2); 00181 } 00182 00183 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) 00184 _mm_min_epu32 (__m128i __V1, __m128i __V2) 00185 { 00186 return (__m128i) __builtin_ia32_pminud128((__v4si) __V1, (__v4si) __V2); 00187 } 00188 00189 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) 00190 _mm_max_epu32 (__m128i __V1, __m128i __V2) 00191 { 00192 return (__m128i) __builtin_ia32_pmaxud128((__v4si) __V1, (__v4si) __V2); 00193 } 00194 00195 /* SSE4 Insertion and Extraction from XMM Register Instructions. */ 00196 #define _mm_insert_ps(X, Y, N) __builtin_ia32_insertps128((X), (Y), (N)) 00197 #define _mm_extract_ps(X, N) (__extension__ \ 00198 ({ union { int i; float f; } __t; \ 00199 __v4sf __a = (__v4sf)(X); \ 00200 __t.f = __a[N]; \ 00201 __t.i;})) 00202 00203 /* Miscellaneous insert and extract macros. */ 00204 /* Extract a single-precision float from X at index N into D. */ 00205 #define _MM_EXTRACT_FLOAT(D, X, N) (__extension__ ({ __v4sf __a = (__v4sf)(X); \ 00206 (D) = __a[N]; })) 00207 00208 /* Or together 2 sets of indexes (X and Y) with the zeroing bits (Z) to create 00209 an index suitable for _mm_insert_ps. */ 00210 #define _MM_MK_INSERTPS_NDX(X, Y, Z) (((X) << 6) | ((Y) << 4) | (Z)) 00211 00212 /* Extract a float from X at index N into the first index of the return. */ 00213 #define _MM_PICK_OUT_PS(X, N) _mm_insert_ps (_mm_setzero_ps(), (X), \ 00214 _MM_MK_INSERTPS_NDX((N), 0, 0x0e)) 00215 00216 /* Insert int into packed integer array at index. */ 00217 #define _mm_insert_epi8(X, I, N) (__extension__ ({ __v16qi __a = (__v16qi)(X); \ 00218 __a[(N)] = (I); \ 00219 __a;})) 00220 #define _mm_insert_epi32(X, I, N) (__extension__ ({ __v4si __a = (__v4si)(X); \ 00221 __a[(N)] = (I); \ 00222 __a;})) 00223 #ifdef __x86_64__ 00224 #define _mm_insert_epi64(X, I, N) (__extension__ ({ __v2di __a = (__v2di)(X); \ 00225 __a[(N)] = (I); \ 00226 __a;})) 00227 #endif /* __x86_64__ */ 00228 00229 /* Extract int from packed integer array at index. This returns the element 00230 * as a zero extended value, so it is unsigned. 00231 */ 00232 #define _mm_extract_epi8(X, N) (__extension__ ({ __v16qi __a = (__v16qi)(X); \ 00233 (unsigned char)__a[(N)];})) 00234 #define _mm_extract_epi32(X, N) (__extension__ ({ __v4si __a = (__v4si)(X); \ 00235 (unsigned)__a[(N)];})) 00236 #ifdef __x86_64__ 00237 #define _mm_extract_epi64(X, N) (__extension__ ({ __v2di __a = (__v2di)(X); \ 00238 __a[(N)];})) 00239 #endif /* __x86_64 */ 00240 00241 /* SSE4 128-bit Packed Integer Comparisons. */ 00242 static __inline__ int __attribute__((__always_inline__, __nodebug__)) 00243 _mm_testz_si128(__m128i __M, __m128i __V) 00244 { 00245 return __builtin_ia32_ptestz128((__v2di)__M, (__v2di)__V); 00246 } 00247 00248 static __inline__ int __attribute__((__always_inline__, __nodebug__)) 00249 _mm_testc_si128(__m128i __M, __m128i __V) 00250 { 00251 return __builtin_ia32_ptestc128((__v2di)__M, (__v2di)__V); 00252 } 00253 00254 static __inline__ int __attribute__((__always_inline__, __nodebug__)) 00255 _mm_testnzc_si128(__m128i __M, __m128i __V) 00256 { 00257 return __builtin_ia32_ptestnzc128((__v2di)__M, (__v2di)__V); 00258 } 00259 00260 #define _mm_test_all_ones(V) _mm_testc_si128((V), _mm_cmpeq_epi32((V), (V))) 00261 #define _mm_test_mix_ones_zeros(M, V) _mm_testnzc_si128((M), (V)) 00262 #define _mm_test_all_zeros(M, V) _mm_testz_si128 ((M), (V)) 00263 00264 /* SSE4 64-bit Packed Integer Comparisons. */ 00265 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) 00266 _mm_cmpeq_epi64(__m128i __V1, __m128i __V2) 00267 { 00268 return (__m128i)((__v2di)__V1 == (__v2di)__V2); 00269 } 00270 00271 /* SSE4 Packed Integer Sign-Extension. */ 00272 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) 00273 _mm_cvtepi8_epi16(__m128i __V) 00274 { 00275 return (__m128i) __builtin_ia32_pmovsxbw128((__v16qi) __V); 00276 } 00277 00278 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) 00279 _mm_cvtepi8_epi32(__m128i __V) 00280 { 00281 return (__m128i) __builtin_ia32_pmovsxbd128((__v16qi) __V); 00282 } 00283 00284 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) 00285 _mm_cvtepi8_epi64(__m128i __V) 00286 { 00287 return (__m128i) __builtin_ia32_pmovsxbq128((__v16qi) __V); 00288 } 00289 00290 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) 00291 _mm_cvtepi16_epi32(__m128i __V) 00292 { 00293 return (__m128i) __builtin_ia32_pmovsxwd128((__v8hi) __V); 00294 } 00295 00296 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) 00297 _mm_cvtepi16_epi64(__m128i __V) 00298 { 00299 return (__m128i) __builtin_ia32_pmovsxwq128((__v8hi)__V); 00300 } 00301 00302 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) 00303 _mm_cvtepi32_epi64(__m128i __V) 00304 { 00305 return (__m128i) __builtin_ia32_pmovsxdq128((__v4si)__V); 00306 } 00307 00308 /* SSE4 Packed Integer Zero-Extension. */ 00309 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) 00310 _mm_cvtepu8_epi16(__m128i __V) 00311 { 00312 return (__m128i) __builtin_ia32_pmovzxbw128((__v16qi) __V); 00313 } 00314 00315 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) 00316 _mm_cvtepu8_epi32(__m128i __V) 00317 { 00318 return (__m128i) __builtin_ia32_pmovzxbd128((__v16qi)__V); 00319 } 00320 00321 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) 00322 _mm_cvtepu8_epi64(__m128i __V) 00323 { 00324 return (__m128i) __builtin_ia32_pmovzxbq128((__v16qi)__V); 00325 } 00326 00327 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) 00328 _mm_cvtepu16_epi32(__m128i __V) 00329 { 00330 return (__m128i) __builtin_ia32_pmovzxwd128((__v8hi)__V); 00331 } 00332 00333 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) 00334 _mm_cvtepu16_epi64(__m128i __V) 00335 { 00336 return (__m128i) __builtin_ia32_pmovzxwq128((__v8hi)__V); 00337 } 00338 00339 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) 00340 _mm_cvtepu32_epi64(__m128i __V) 00341 { 00342 return (__m128i) __builtin_ia32_pmovzxdq128((__v4si)__V); 00343 } 00344 00345 /* SSE4 Pack with Unsigned Saturation. */ 00346 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) 00347 _mm_packus_epi32(__m128i __V1, __m128i __V2) 00348 { 00349 return (__m128i) __builtin_ia32_packusdw128((__v4si)__V1, (__v4si)__V2); 00350 } 00351 00352 /* SSE4 Multiple Packed Sums of Absolute Difference. */ 00353 #define _mm_mpsadbw_epu8(X, Y, M) __extension__ ({ \ 00354 __m128i __X = (X); \ 00355 __m128i __Y = (Y); \ 00356 (__m128i) __builtin_ia32_mpsadbw128((__v16qi)__X, (__v16qi)__Y, (M)); }) 00357 00358 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) 00359 _mm_minpos_epu16(__m128i __V) 00360 { 00361 return (__m128i) __builtin_ia32_phminposuw128((__v8hi)__V); 00362 } 00363 00364 /* These definitions are normally in nmmintrin.h, but gcc puts them in here 00365 so we'll do the same. */ 00366 #ifdef __SSE4_2__ 00367 00368 /* These specify the type of data that we're comparing. */ 00369 #define _SIDD_UBYTE_OPS 0x00 00370 #define _SIDD_UWORD_OPS 0x01 00371 #define _SIDD_SBYTE_OPS 0x02 00372 #define _SIDD_SWORD_OPS 0x03 00373 00374 /* These specify the type of comparison operation. */ 00375 #define _SIDD_CMP_EQUAL_ANY 0x00 00376 #define _SIDD_CMP_RANGES 0x04 00377 #define _SIDD_CMP_EQUAL_EACH 0x08 00378 #define _SIDD_CMP_EQUAL_ORDERED 0x0c 00379 00380 /* These macros specify the polarity of the operation. */ 00381 #define _SIDD_POSITIVE_POLARITY 0x00 00382 #define _SIDD_NEGATIVE_POLARITY 0x10 00383 #define _SIDD_MASKED_POSITIVE_POLARITY 0x20 00384 #define _SIDD_MASKED_NEGATIVE_POLARITY 0x30 00385 00386 /* These macros are used in _mm_cmpXstri() to specify the return. */ 00387 #define _SIDD_LEAST_SIGNIFICANT 0x00 00388 #define _SIDD_MOST_SIGNIFICANT 0x40 00389 00390 /* These macros are used in _mm_cmpXstri() to specify the return. */ 00391 #define _SIDD_BIT_MASK 0x00 00392 #define _SIDD_UNIT_MASK 0x40 00393 00394 /* SSE4.2 Packed Comparison Intrinsics. */ 00395 #define _mm_cmpistrm(A, B, M) __builtin_ia32_pcmpistrm128((A), (B), (M)) 00396 #define _mm_cmpistri(A, B, M) __builtin_ia32_pcmpistri128((A), (B), (M)) 00397 00398 #define _mm_cmpestrm(A, LA, B, LB, M) \ 00399 __builtin_ia32_pcmpestrm128((A), (LA), (B), (LB), (M)) 00400 #define _mm_cmpestri(A, LA, B, LB, M) \ 00401 __builtin_ia32_pcmpestri128((A), (LA), (B), (LB), (M)) 00402 00403 /* SSE4.2 Packed Comparison Intrinsics and EFlag Reading. */ 00404 #define _mm_cmpistra(A, B, M) \ 00405 __builtin_ia32_pcmpistria128((A), (B), (M)) 00406 #define _mm_cmpistrc(A, B, M) \ 00407 __builtin_ia32_pcmpistric128((A), (B), (M)) 00408 #define _mm_cmpistro(A, B, M) \ 00409 __builtin_ia32_pcmpistrio128((A), (B), (M)) 00410 #define _mm_cmpistrs(A, B, M) \ 00411 __builtin_ia32_pcmpistris128((A), (B), (M)) 00412 #define _mm_cmpistrz(A, B, M) \ 00413 __builtin_ia32_pcmpistriz128((A), (B), (M)) 00414 00415 #define _mm_cmpestra(A, LA, B, LB, M) \ 00416 __builtin_ia32_pcmpestria128((A), (LA), (B), (LB), (M)) 00417 #define _mm_cmpestrc(A, LA, B, LB, M) \ 00418 __builtin_ia32_pcmpestric128((A), (LA), (B), (LB), (M)) 00419 #define _mm_cmpestro(A, LA, B, LB, M) \ 00420 __builtin_ia32_pcmpestrio128((A), (LA), (B), (LB), (M)) 00421 #define _mm_cmpestrs(A, LA, B, LB, M) \ 00422 __builtin_ia32_pcmpestris128((A), (LA), (B), (LB), (M)) 00423 #define _mm_cmpestrz(A, LA, B, LB, M) \ 00424 __builtin_ia32_pcmpestriz128((A), (LA), (B), (LB), (M)) 00425 00426 /* SSE4.2 Compare Packed Data -- Greater Than. */ 00427 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) 00428 _mm_cmpgt_epi64(__m128i __V1, __m128i __V2) 00429 { 00430 return (__m128i)((__v2di)__V1 > (__v2di)__V2); 00431 } 00432 00433 /* SSE4.2 Accumulate CRC32. */ 00434 static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__)) 00435 _mm_crc32_u8(unsigned int __C, unsigned char __D) 00436 { 00437 return __builtin_ia32_crc32qi(__C, __D); 00438 } 00439 00440 static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__)) 00441 _mm_crc32_u16(unsigned int __C, unsigned short __D) 00442 { 00443 return __builtin_ia32_crc32hi(__C, __D); 00444 } 00445 00446 static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__)) 00447 _mm_crc32_u32(unsigned int __C, unsigned int __D) 00448 { 00449 return __builtin_ia32_crc32si(__C, __D); 00450 } 00451 00452 #ifdef __x86_64__ 00453 static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__)) 00454 _mm_crc32_u64(unsigned long long __C, unsigned long long __D) 00455 { 00456 return __builtin_ia32_crc32di(__C, __D); 00457 } 00458 #endif /* __x86_64__ */ 00459 00460 #ifdef __POPCNT__ 00461 #include <popcntintrin.h> 00462 #endif 00463 00464 #endif /* __SSE4_2__ */ 00465 #endif /* __SSE4_1__ */ 00466 00467 #endif /* _SMMINTRIN_H */