llvm-runtime-resources-darwin 0.0.0 → 22.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (350) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +33 -0
  3. package/include/__clang_cuda_builtin_vars.h +121 -0
  4. package/include/__clang_cuda_cmath.h +512 -0
  5. package/include/__clang_cuda_complex_builtins.h +229 -0
  6. package/include/__clang_cuda_device_functions.h +1572 -0
  7. package/include/__clang_cuda_intrinsics.h +994 -0
  8. package/include/__clang_cuda_libdevice_declares.h +468 -0
  9. package/include/__clang_cuda_math.h +353 -0
  10. package/include/__clang_cuda_math_forward_declares.h +284 -0
  11. package/include/__clang_cuda_runtime_wrapper.h +522 -0
  12. package/include/__clang_cuda_texture_intrinsics.h +1177 -0
  13. package/include/__clang_hip_cmath.h +848 -0
  14. package/include/__clang_hip_libdevice_declares.h +340 -0
  15. package/include/__clang_hip_math.h +1405 -0
  16. package/include/__clang_hip_runtime_wrapper.h +165 -0
  17. package/include/__clang_hip_stdlib.h +43 -0
  18. package/include/__clang_spirv_builtins.h +217 -0
  19. package/include/__float_float.h +176 -0
  20. package/include/__float_header_macro.h +12 -0
  21. package/include/__float_infinity_nan.h +20 -0
  22. package/include/__stdarg___gnuc_va_list.h +13 -0
  23. package/include/__stdarg___va_copy.h +12 -0
  24. package/include/__stdarg_header_macro.h +12 -0
  25. package/include/__stdarg_va_arg.h +22 -0
  26. package/include/__stdarg_va_copy.h +12 -0
  27. package/include/__stdarg_va_list.h +13 -0
  28. package/include/__stddef_header_macro.h +12 -0
  29. package/include/__stddef_max_align_t.h +27 -0
  30. package/include/__stddef_null.h +29 -0
  31. package/include/__stddef_nullptr_t.h +29 -0
  32. package/include/__stddef_offsetof.h +17 -0
  33. package/include/__stddef_ptrdiff_t.h +20 -0
  34. package/include/__stddef_rsize_t.h +20 -0
  35. package/include/__stddef_size_t.h +20 -0
  36. package/include/__stddef_unreachable.h +21 -0
  37. package/include/__stddef_wchar_t.h +28 -0
  38. package/include/__stddef_wint_t.h +15 -0
  39. package/include/__wmmintrin_aes.h +140 -0
  40. package/include/__wmmintrin_pclmul.h +48 -0
  41. package/include/adcintrin.h +165 -0
  42. package/include/adxintrin.h +107 -0
  43. package/include/altivec.h +19364 -0
  44. package/include/amdgpuintrin.h +191 -0
  45. package/include/ammintrin.h +183 -0
  46. package/include/amo.h +131 -0
  47. package/include/amxavx512intrin.h +596 -0
  48. package/include/amxcomplexintrin.h +167 -0
  49. package/include/amxfp16intrin.h +93 -0
  50. package/include/amxfp8intrin.h +230 -0
  51. package/include/amxintrin.h +492 -0
  52. package/include/amxmovrsintrin.h +48 -0
  53. package/include/amxtf32intrin.h +108 -0
  54. package/include/andes_vector.h +16 -0
  55. package/include/arm64intr.h +35 -0
  56. package/include/arm_acle.h +865 -0
  57. package/include/arm_bf16.h +20 -0
  58. package/include/arm_cde.h +410 -0
  59. package/include/arm_cmse.h +217 -0
  60. package/include/arm_fp16.h +596 -0
  61. package/include/arm_mve.h +19187 -0
  62. package/include/arm_neon.h +74183 -0
  63. package/include/arm_neon_sve_bridge.h +182 -0
  64. package/include/arm_sme.h +3741 -0
  65. package/include/arm_sve.h +32278 -0
  66. package/include/arm_vector_types.h +432 -0
  67. package/include/armintr.h +31 -0
  68. package/include/avx10_2_512bf16intrin.h +568 -0
  69. package/include/avx10_2_512convertintrin.h +322 -0
  70. package/include/avx10_2_512minmaxintrin.h +127 -0
  71. package/include/avx10_2_512niintrin.h +314 -0
  72. package/include/avx10_2_512satcvtdsintrin.h +307 -0
  73. package/include/avx10_2_512satcvtintrin.h +301 -0
  74. package/include/avx10_2bf16intrin.h +1094 -0
  75. package/include/avx10_2convertintrin.h +3257 -0
  76. package/include/avx10_2copyintrin.h +66 -0
  77. package/include/avx10_2minmaxintrin.h +232 -0
  78. package/include/avx10_2niintrin.h +409 -0
  79. package/include/avx10_2satcvtdsintrin.h +376 -0
  80. package/include/avx10_2satcvtintrin.h +312 -0
  81. package/include/avx2intrin.h +5191 -0
  82. package/include/avx512bf16intrin.h +292 -0
  83. package/include/avx512bitalgintrin.h +75 -0
  84. package/include/avx512bwintrin.h +1895 -0
  85. package/include/avx512cdintrin.h +112 -0
  86. package/include/avx512dqintrin.h +1350 -0
  87. package/include/avx512fintrin.h +9378 -0
  88. package/include/avx512fp16intrin.h +3355 -0
  89. package/include/avx512ifmaintrin.h +68 -0
  90. package/include/avx512ifmavlintrin.h +138 -0
  91. package/include/avx512vbmi2intrin.h +368 -0
  92. package/include/avx512vbmiintrin.h +98 -0
  93. package/include/avx512vbmivlintrin.h +179 -0
  94. package/include/avx512vlbf16intrin.h +527 -0
  95. package/include/avx512vlbitalgintrin.h +135 -0
  96. package/include/avx512vlbwintrin.h +3064 -0
  97. package/include/avx512vlcdintrin.h +202 -0
  98. package/include/avx512vldqintrin.h +1156 -0
  99. package/include/avx512vlfp16intrin.h +2090 -0
  100. package/include/avx512vlintrin.h +8083 -0
  101. package/include/avx512vlvbmi2intrin.h +710 -0
  102. package/include/avx512vlvnniintrin.h +313 -0
  103. package/include/avx512vlvp2intersectintrin.h +123 -0
  104. package/include/avx512vnniintrin.h +116 -0
  105. package/include/avx512vp2intersectintrin.h +77 -0
  106. package/include/avx512vpopcntdqintrin.h +62 -0
  107. package/include/avx512vpopcntdqvlintrin.h +105 -0
  108. package/include/avxifmaintrin.h +193 -0
  109. package/include/avxintrin.h +5064 -0
  110. package/include/avxneconvertintrin.h +484 -0
  111. package/include/avxvnniint16intrin.h +451 -0
  112. package/include/avxvnniint8intrin.h +454 -0
  113. package/include/avxvnniintrin.h +233 -0
  114. package/include/bmi2intrin.h +253 -0
  115. package/include/bmiintrin.h +604 -0
  116. package/include/builtins.h +19 -0
  117. package/include/cet.h +66 -0
  118. package/include/cetintrin.h +115 -0
  119. package/include/cldemoteintrin.h +36 -0
  120. package/include/clflushoptintrin.h +36 -0
  121. package/include/clwbintrin.h +38 -0
  122. package/include/clzerointrin.h +38 -0
  123. package/include/cmpccxaddintrin.h +70 -0
  124. package/include/cpuid.h +451 -0
  125. package/include/crc32intrin.h +100 -0
  126. package/include/cuda_wrappers/__utility/declval.h +28 -0
  127. package/include/cuda_wrappers/algorithm +116 -0
  128. package/include/cuda_wrappers/bits/basic_string.h +9 -0
  129. package/include/cuda_wrappers/bits/basic_string.tcc +9 -0
  130. package/include/cuda_wrappers/bits/c++config.h +61 -0
  131. package/include/cuda_wrappers/bits/shared_ptr_base.h +9 -0
  132. package/include/cuda_wrappers/cmath +44 -0
  133. package/include/cuda_wrappers/complex +90 -0
  134. package/include/cuda_wrappers/new +108 -0
  135. package/include/emmintrin.h +4940 -0
  136. package/include/enqcmdintrin.h +63 -0
  137. package/include/f16cintrin.h +176 -0
  138. package/include/float.h +48 -0
  139. package/include/fma4intrin.h +220 -0
  140. package/include/fmaintrin.h +826 -0
  141. package/include/fuzzer/FuzzedDataProvider.h +397 -0
  142. package/include/fxsrintrin.h +91 -0
  143. package/include/gfniintrin.h +238 -0
  144. package/include/gpuintrin.h +330 -0
  145. package/include/hexagon_circ_brev_intrinsics.h +298 -0
  146. package/include/hexagon_protos.h +8439 -0
  147. package/include/hexagon_types.h +2628 -0
  148. package/include/hresetintrin.h +49 -0
  149. package/include/htmintrin.h +212 -0
  150. package/include/htmxlintrin.h +345 -0
  151. package/include/hvx_hexagon_protos.h +5399 -0
  152. package/include/ia32intrin.h +863 -0
  153. package/include/immintrin.h +595 -0
  154. package/include/intrin.h +491 -0
  155. package/include/intrin0.h +256 -0
  156. package/include/inttypes.h +101 -0
  157. package/include/invpcidintrin.h +23 -0
  158. package/include/iso646.h +31 -0
  159. package/include/keylockerintrin.h +518 -0
  160. package/include/larchintrin.h +260 -0
  161. package/include/lasxintrin.h +3999 -0
  162. package/include/limits.h +133 -0
  163. package/include/llvm_libc_wrappers/assert.h +32 -0
  164. package/include/llvm_libc_wrappers/ctype.h +28 -0
  165. package/include/llvm_libc_wrappers/inttypes.h +32 -0
  166. package/include/llvm_libc_wrappers/stdio.h +52 -0
  167. package/include/llvm_libc_wrappers/stdlib.h +32 -0
  168. package/include/llvm_libc_wrappers/string.h +28 -0
  169. package/include/llvm_libc_wrappers/time.h +28 -0
  170. package/include/llvm_offload_wrappers/__llvm_offload.h +31 -0
  171. package/include/llvm_offload_wrappers/__llvm_offload_device.h +10 -0
  172. package/include/llvm_offload_wrappers/__llvm_offload_host.h +15 -0
  173. package/include/lsxintrin.h +3752 -0
  174. package/include/lwpintrin.h +136 -0
  175. package/include/lzcntintrin.h +109 -0
  176. package/include/mm3dnow.h +22 -0
  177. package/include/mm_malloc.h +67 -0
  178. package/include/mmintrin.h +1541 -0
  179. package/include/module.modulemap +360 -0
  180. package/include/movdirintrin.h +49 -0
  181. package/include/movrs_avx10_2_512intrin.h +98 -0
  182. package/include/movrs_avx10_2intrin.h +174 -0
  183. package/include/movrsintrin.h +59 -0
  184. package/include/msa.h +573 -0
  185. package/include/mwaitxintrin.h +62 -0
  186. package/include/nmmintrin.h +20 -0
  187. package/include/nvptxintrin.h +219 -0
  188. package/include/opencl-c-base.h +758 -0
  189. package/include/opencl-c.h +18676 -0
  190. package/include/openmp_wrappers/__clang_openmp_device_functions.h +104 -0
  191. package/include/openmp_wrappers/cmath +132 -0
  192. package/include/openmp_wrappers/complex +55 -0
  193. package/include/openmp_wrappers/complex.h +35 -0
  194. package/include/openmp_wrappers/complex_cmath.h +393 -0
  195. package/include/openmp_wrappers/math.h +61 -0
  196. package/include/openmp_wrappers/new +48 -0
  197. package/include/pconfigintrin.h +40 -0
  198. package/include/pkuintrin.h +34 -0
  199. package/include/pmmintrin.h +302 -0
  200. package/include/popcntintrin.h +59 -0
  201. package/include/ppc_wrappers/bmi2intrin.h +134 -0
  202. package/include/ppc_wrappers/bmiintrin.h +165 -0
  203. package/include/ppc_wrappers/emmintrin.h +2269 -0
  204. package/include/ppc_wrappers/immintrin.h +27 -0
  205. package/include/ppc_wrappers/mm_malloc.h +45 -0
  206. package/include/ppc_wrappers/mmintrin.h +1453 -0
  207. package/include/ppc_wrappers/nmmintrin.h +26 -0
  208. package/include/ppc_wrappers/pmmintrin.h +145 -0
  209. package/include/ppc_wrappers/smmintrin.h +683 -0
  210. package/include/ppc_wrappers/tmmintrin.h +453 -0
  211. package/include/ppc_wrappers/x86gprintrin.h +17 -0
  212. package/include/ppc_wrappers/x86intrin.h +28 -0
  213. package/include/ppc_wrappers/xmmintrin.h +1827 -0
  214. package/include/prfchiintrin.h +61 -0
  215. package/include/prfchwintrin.h +57 -0
  216. package/include/profile/InstrProfData.inc +1001 -0
  217. package/include/profile/instr_prof_interface.h +88 -0
  218. package/include/ptrauth.h +407 -0
  219. package/include/ptwriteintrin.h +37 -0
  220. package/include/raointintrin.h +203 -0
  221. package/include/rdpruintrin.h +57 -0
  222. package/include/rdseedintrin.h +105 -0
  223. package/include/riscv_bitmanip.h +195 -0
  224. package/include/riscv_corev_alu.h +128 -0
  225. package/include/riscv_crypto.h +170 -0
  226. package/include/riscv_mips.h +34 -0
  227. package/include/riscv_nds.h +89 -0
  228. package/include/riscv_ntlh.h +26 -0
  229. package/include/riscv_vector.h +422 -0
  230. package/include/rtmintrin.h +45 -0
  231. package/include/s390intrin.h +25 -0
  232. package/include/sanitizer/allocator_interface.h +106 -0
  233. package/include/sanitizer/asan_interface.h +348 -0
  234. package/include/sanitizer/common_interface_defs.h +544 -0
  235. package/include/sanitizer/coverage_interface.h +36 -0
  236. package/include/sanitizer/dfsan_interface.h +220 -0
  237. package/include/sanitizer/hwasan_interface.h +109 -0
  238. package/include/sanitizer/linux_syscall_hooks.h +3112 -0
  239. package/include/sanitizer/lsan_interface.h +89 -0
  240. package/include/sanitizer/msan_interface.h +135 -0
  241. package/include/sanitizer/netbsd_syscall_hooks.h +5005 -0
  242. package/include/sanitizer/rtsan_interface.h +75 -0
  243. package/include/sanitizer/scudo_interface.h +38 -0
  244. package/include/sanitizer/tsan_interface.h +316 -0
  245. package/include/sanitizer/tsan_interface_atomic.h +223 -0
  246. package/include/sanitizer/ubsan_interface.h +34 -0
  247. package/include/serializeintrin.h +30 -0
  248. package/include/sgxintrin.h +60 -0
  249. package/include/sha512intrin.h +200 -0
  250. package/include/shaintrin.h +190 -0
  251. package/include/sifive_vector.h +174 -0
  252. package/include/sm3intrin.h +238 -0
  253. package/include/sm4evexintrin.h +32 -0
  254. package/include/sm4intrin.h +269 -0
  255. package/include/smmintrin.h +2352 -0
  256. package/include/spirvintrin.h +194 -0
  257. package/include/stdalign.h +24 -0
  258. package/include/stdarg.h +75 -0
  259. package/include/stdatomic.h +204 -0
  260. package/include/stdbool.h +39 -0
  261. package/include/stdckdint.h +42 -0
  262. package/include/stdcountof.h +15 -0
  263. package/include/stddef.h +139 -0
  264. package/include/stddefer.h +19 -0
  265. package/include/stdint.h +844 -0
  266. package/include/stdnoreturn.h +35 -0
  267. package/include/tbmintrin.h +128 -0
  268. package/include/tgmath.h +1368 -0
  269. package/include/tmmintrin.h +779 -0
  270. package/include/tsxldtrkintrin.h +56 -0
  271. package/include/uintrintrin.h +157 -0
  272. package/include/unwind.h +332 -0
  273. package/include/usermsrintrin.h +51 -0
  274. package/include/vadefs.h +51 -0
  275. package/include/vaesintrin.h +86 -0
  276. package/include/varargs.h +16 -0
  277. package/include/vecintrin.h +12868 -0
  278. package/include/velintrin.h +71 -0
  279. package/include/velintrin_approx.h +120 -0
  280. package/include/velintrin_gen.h +1257 -0
  281. package/include/vpclmulqdqintrin.h +30 -0
  282. package/include/waitpkgintrin.h +42 -0
  283. package/include/wasm_simd128.h +2143 -0
  284. package/include/wbnoinvdintrin.h +24 -0
  285. package/include/wmmintrin.h +23 -0
  286. package/include/x86gprintrin.h +49 -0
  287. package/include/x86intrin.h +35 -0
  288. package/include/xmmintrin.h +3175 -0
  289. package/include/xopintrin.h +780 -0
  290. package/include/xsavecintrin.h +84 -0
  291. package/include/xsaveintrin.h +63 -0
  292. package/include/xsaveoptintrin.h +34 -0
  293. package/include/xsavesintrin.h +44 -0
  294. package/include/xtestintrin.h +27 -0
  295. package/include/yvals_core.h +25 -0
  296. package/include/zos_wrappers/builtins.h +18 -0
  297. package/index.js +5 -0
  298. package/lib/darwin/libclang_rt.asan_abi_ios.a +0 -0
  299. package/lib/darwin/libclang_rt.asan_abi_iossim.a +0 -0
  300. package/lib/darwin/libclang_rt.asan_abi_osx.a +0 -0
  301. package/lib/darwin/libclang_rt.asan_ios_dynamic.dylib +0 -0
  302. package/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib +0 -0
  303. package/lib/darwin/libclang_rt.asan_osx_dynamic.dylib +0 -0
  304. package/lib/darwin/libclang_rt.cc_kext.a +0 -0
  305. package/lib/darwin/libclang_rt.cc_kext_ios.a +0 -0
  306. package/lib/darwin/libclang_rt.fuzzer_interceptors_ios.a +0 -0
  307. package/lib/darwin/libclang_rt.fuzzer_interceptors_iossim.a +0 -0
  308. package/lib/darwin/libclang_rt.fuzzer_interceptors_osx.a +0 -0
  309. package/lib/darwin/libclang_rt.fuzzer_ios.a +0 -0
  310. package/lib/darwin/libclang_rt.fuzzer_iossim.a +0 -0
  311. package/lib/darwin/libclang_rt.fuzzer_no_main_ios.a +0 -0
  312. package/lib/darwin/libclang_rt.fuzzer_no_main_iossim.a +0 -0
  313. package/lib/darwin/libclang_rt.fuzzer_no_main_osx.a +0 -0
  314. package/lib/darwin/libclang_rt.fuzzer_osx.a +0 -0
  315. package/lib/darwin/libclang_rt.ios.a +0 -0
  316. package/lib/darwin/libclang_rt.iossim.a +0 -0
  317. package/lib/darwin/libclang_rt.lsan_ios_dynamic.dylib +0 -0
  318. package/lib/darwin/libclang_rt.lsan_iossim_dynamic.dylib +0 -0
  319. package/lib/darwin/libclang_rt.lsan_osx_dynamic.dylib +0 -0
  320. package/lib/darwin/libclang_rt.osx.a +0 -0
  321. package/lib/darwin/libclang_rt.profile_ios.a +0 -0
  322. package/lib/darwin/libclang_rt.profile_iossim.a +0 -0
  323. package/lib/darwin/libclang_rt.profile_osx.a +0 -0
  324. package/lib/darwin/libclang_rt.rtsan_ios_dynamic.dylib +0 -0
  325. package/lib/darwin/libclang_rt.rtsan_iossim_dynamic.dylib +0 -0
  326. package/lib/darwin/libclang_rt.rtsan_osx_dynamic.dylib +0 -0
  327. package/lib/darwin/libclang_rt.stats_client_ios.a +0 -0
  328. package/lib/darwin/libclang_rt.stats_client_iossim.a +0 -0
  329. package/lib/darwin/libclang_rt.stats_client_osx.a +0 -0
  330. package/lib/darwin/libclang_rt.stats_ios_dynamic.dylib +0 -0
  331. package/lib/darwin/libclang_rt.stats_iossim_dynamic.dylib +0 -0
  332. package/lib/darwin/libclang_rt.stats_osx_dynamic.dylib +0 -0
  333. package/lib/darwin/libclang_rt.tsan_ios_dynamic.dylib +0 -0
  334. package/lib/darwin/libclang_rt.tsan_iossim_dynamic.dylib +0 -0
  335. package/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib +0 -0
  336. package/lib/darwin/libclang_rt.tysan_ios_dynamic.dylib +0 -0
  337. package/lib/darwin/libclang_rt.tysan_iossim_dynamic.dylib +0 -0
  338. package/lib/darwin/libclang_rt.tysan_osx_dynamic.dylib +0 -0
  339. package/lib/darwin/libclang_rt.ubsan_ios_dynamic.dylib +0 -0
  340. package/lib/darwin/libclang_rt.ubsan_iossim_dynamic.dylib +0 -0
  341. package/lib/darwin/libclang_rt.ubsan_minimal_ios.a +0 -0
  342. package/lib/darwin/libclang_rt.ubsan_minimal_ios_dynamic.dylib +0 -0
  343. package/lib/darwin/libclang_rt.ubsan_minimal_iossim.a +0 -0
  344. package/lib/darwin/libclang_rt.ubsan_minimal_iossim_dynamic.dylib +0 -0
  345. package/lib/darwin/libclang_rt.ubsan_minimal_osx.a +0 -0
  346. package/lib/darwin/libclang_rt.ubsan_minimal_osx_dynamic.dylib +0 -0
  347. package/lib/darwin/libclang_rt.ubsan_osx_dynamic.dylib +0 -0
  348. package/package.json +40 -1
  349. package/share/asan_ignorelist.txt +14 -0
  350. package/share/cfi_ignorelist.txt +17 -0
@@ -0,0 +1,2352 @@
1
+ /*===---- smmintrin.h - SSE4 intrinsics ------------------------------------===
2
+ *
3
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ * See https://llvm.org/LICENSE.txt for license information.
5
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ *
7
+ *===-----------------------------------------------------------------------===
8
+ */
9
+
10
+ #ifndef __SMMINTRIN_H
11
+ #define __SMMINTRIN_H
12
+
13
+ #if !defined(__i386__) && !defined(__x86_64__)
14
+ #error "This header is only meant to be used on x86 and x64 architecture"
15
+ #endif
16
+
17
+ #include <tmmintrin.h>
18
+
19
+ /* Define the default attributes for the functions in this file. */
20
+ #define __DEFAULT_FN_ATTRS \
21
+ __attribute__((__always_inline__, __nodebug__, __target__("sse4.1"), \
22
+ __min_vector_width__(128)))
23
+
24
+ #if defined(__cplusplus) && (__cplusplus >= 201103L)
25
+ #define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr
26
+ #else
27
+ #define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS
28
+ #endif
29
+
30
+ /* SSE4 Rounding macros. */
31
+ #define _MM_FROUND_TO_NEAREST_INT 0x00
32
+ #define _MM_FROUND_TO_NEG_INF 0x01
33
+ #define _MM_FROUND_TO_POS_INF 0x02
34
+ #define _MM_FROUND_TO_ZERO 0x03
35
+ #define _MM_FROUND_CUR_DIRECTION 0x04
36
+
37
+ #define _MM_FROUND_RAISE_EXC 0x00
38
+ #define _MM_FROUND_NO_EXC 0x08
39
+
40
+ #define _MM_FROUND_NINT (_MM_FROUND_RAISE_EXC | _MM_FROUND_TO_NEAREST_INT)
41
+ #define _MM_FROUND_FLOOR (_MM_FROUND_RAISE_EXC | _MM_FROUND_TO_NEG_INF)
42
+ #define _MM_FROUND_CEIL (_MM_FROUND_RAISE_EXC | _MM_FROUND_TO_POS_INF)
43
+ #define _MM_FROUND_TRUNC (_MM_FROUND_RAISE_EXC | _MM_FROUND_TO_ZERO)
44
+ #define _MM_FROUND_RINT (_MM_FROUND_RAISE_EXC | _MM_FROUND_CUR_DIRECTION)
45
+ #define _MM_FROUND_NEARBYINT (_MM_FROUND_NO_EXC | _MM_FROUND_CUR_DIRECTION)
46
+
47
+ /// Rounds up each element of the 128-bit vector of [4 x float] to an
48
+ /// integer and returns the rounded values in a 128-bit vector of
49
+ /// [4 x float].
50
+ ///
51
+ /// \headerfile <x86intrin.h>
52
+ ///
53
+ /// \code
54
+ /// __m128 _mm_ceil_ps(__m128 X);
55
+ /// \endcode
56
+ ///
57
+ /// This intrinsic corresponds to the <c> VROUNDPS / ROUNDPS </c> instruction.
58
+ ///
59
+ /// \param X
60
+ /// A 128-bit vector of [4 x float] values to be rounded up.
61
+ /// \returns A 128-bit vector of [4 x float] containing the rounded values.
62
+ #define _mm_ceil_ps(X) _mm_round_ps((X), _MM_FROUND_CEIL)
63
+
64
+ /// Rounds up each element of the 128-bit vector of [2 x double] to an
65
+ /// integer and returns the rounded values in a 128-bit vector of
66
+ /// [2 x double].
67
+ ///
68
+ /// \headerfile <x86intrin.h>
69
+ ///
70
+ /// \code
71
+ /// __m128d _mm_ceil_pd(__m128d X);
72
+ /// \endcode
73
+ ///
74
+ /// This intrinsic corresponds to the <c> VROUNDPD / ROUNDPD </c> instruction.
75
+ ///
76
+ /// \param X
77
+ /// A 128-bit vector of [2 x double] values to be rounded up.
78
+ /// \returns A 128-bit vector of [2 x double] containing the rounded values.
79
+ #define _mm_ceil_pd(X) _mm_round_pd((X), _MM_FROUND_CEIL)
80
+
81
+ /// Copies three upper elements of the first 128-bit vector operand to
82
+ /// the corresponding three upper elements of the 128-bit result vector of
83
+ /// [4 x float]. Rounds up the lowest element of the second 128-bit vector
84
+ /// operand to an integer and copies it to the lowest element of the 128-bit
85
+ /// result vector of [4 x float].
86
+ ///
87
+ /// \headerfile <x86intrin.h>
88
+ ///
89
+ /// \code
90
+ /// __m128 _mm_ceil_ss(__m128 X, __m128 Y);
91
+ /// \endcode
92
+ ///
93
+ /// This intrinsic corresponds to the <c> VROUNDSS / ROUNDSS </c> instruction.
94
+ ///
95
+ /// \param X
96
+ /// A 128-bit vector of [4 x float]. The values stored in bits [127:32] are
97
+ /// copied to the corresponding bits of the result.
98
+ /// \param Y
99
+ /// A 128-bit vector of [4 x float]. The value stored in bits [31:0] is
100
+ /// rounded up to the nearest integer and copied to the corresponding bits
101
+ /// of the result.
102
+ /// \returns A 128-bit vector of [4 x float] containing the copied and rounded
103
+ /// values.
104
+ #define _mm_ceil_ss(X, Y) _mm_round_ss((X), (Y), _MM_FROUND_CEIL)
105
+
106
+ /// Copies the upper element of the first 128-bit vector operand to the
107
+ /// corresponding upper element of the 128-bit result vector of [2 x double].
108
+ /// Rounds up the lower element of the second 128-bit vector operand to an
109
+ /// integer and copies it to the lower element of the 128-bit result vector
110
+ /// of [2 x double].
111
+ ///
112
+ /// \headerfile <x86intrin.h>
113
+ ///
114
+ /// \code
115
+ /// __m128d _mm_ceil_sd(__m128d X, __m128d Y);
116
+ /// \endcode
117
+ ///
118
+ /// This intrinsic corresponds to the <c> VROUNDSD / ROUNDSD </c> instruction.
119
+ ///
120
+ /// \param X
121
+ /// A 128-bit vector of [2 x double]. The value stored in bits [127:64] is
122
+ /// copied to the corresponding bits of the result.
123
+ /// \param Y
124
+ /// A 128-bit vector of [2 x double]. The value stored in bits [63:0] is
125
+ /// rounded up to the nearest integer and copied to the corresponding bits
126
+ /// of the result.
127
+ /// \returns A 128-bit vector of [2 x double] containing the copied and rounded
128
+ /// values.
129
+ #define _mm_ceil_sd(X, Y) _mm_round_sd((X), (Y), _MM_FROUND_CEIL)
130
+
131
+ /// Rounds down each element of the 128-bit vector of [4 x float] to an
132
+ /// an integer and returns the rounded values in a 128-bit vector of
133
+ /// [4 x float].
134
+ ///
135
+ /// \headerfile <x86intrin.h>
136
+ ///
137
+ /// \code
138
+ /// __m128 _mm_floor_ps(__m128 X);
139
+ /// \endcode
140
+ ///
141
+ /// This intrinsic corresponds to the <c> VROUNDPS / ROUNDPS </c> instruction.
142
+ ///
143
+ /// \param X
144
+ /// A 128-bit vector of [4 x float] values to be rounded down.
145
+ /// \returns A 128-bit vector of [4 x float] containing the rounded values.
146
+ #define _mm_floor_ps(X) _mm_round_ps((X), _MM_FROUND_FLOOR)
147
+
148
+ /// Rounds down each element of the 128-bit vector of [2 x double] to an
149
+ /// integer and returns the rounded values in a 128-bit vector of
150
+ /// [2 x double].
151
+ ///
152
+ /// \headerfile <x86intrin.h>
153
+ ///
154
+ /// \code
155
+ /// __m128d _mm_floor_pd(__m128d X);
156
+ /// \endcode
157
+ ///
158
+ /// This intrinsic corresponds to the <c> VROUNDPD / ROUNDPD </c> instruction.
159
+ ///
160
+ /// \param X
161
+ /// A 128-bit vector of [2 x double].
162
+ /// \returns A 128-bit vector of [2 x double] containing the rounded values.
163
+ #define _mm_floor_pd(X) _mm_round_pd((X), _MM_FROUND_FLOOR)
164
+
165
+ /// Copies three upper elements of the first 128-bit vector operand to
166
+ /// the corresponding three upper elements of the 128-bit result vector of
167
+ /// [4 x float]. Rounds down the lowest element of the second 128-bit vector
168
+ /// operand to an integer and copies it to the lowest element of the 128-bit
169
+ /// result vector of [4 x float].
170
+ ///
171
+ /// \headerfile <x86intrin.h>
172
+ ///
173
+ /// \code
174
+ /// __m128 _mm_floor_ss(__m128 X, __m128 Y);
175
+ /// \endcode
176
+ ///
177
+ /// This intrinsic corresponds to the <c> VROUNDSS / ROUNDSS </c> instruction.
178
+ ///
179
+ /// \param X
180
+ /// A 128-bit vector of [4 x float]. The values stored in bits [127:32] are
181
+ /// copied to the corresponding bits of the result.
182
+ /// \param Y
183
+ /// A 128-bit vector of [4 x float]. The value stored in bits [31:0] is
184
+ /// rounded down to the nearest integer and copied to the corresponding bits
185
+ /// of the result.
186
+ /// \returns A 128-bit vector of [4 x float] containing the copied and rounded
187
+ /// values.
188
+ #define _mm_floor_ss(X, Y) _mm_round_ss((X), (Y), _MM_FROUND_FLOOR)
189
+
190
+ /// Copies the upper element of the first 128-bit vector operand to the
191
+ /// corresponding upper element of the 128-bit result vector of [2 x double].
192
+ /// Rounds down the lower element of the second 128-bit vector operand to an
193
+ /// integer and copies it to the lower element of the 128-bit result vector
194
+ /// of [2 x double].
195
+ ///
196
+ /// \headerfile <x86intrin.h>
197
+ ///
198
+ /// \code
199
+ /// __m128d _mm_floor_sd(__m128d X, __m128d Y);
200
+ /// \endcode
201
+ ///
202
+ /// This intrinsic corresponds to the <c> VROUNDSD / ROUNDSD </c> instruction.
203
+ ///
204
+ /// \param X
205
+ /// A 128-bit vector of [2 x double]. The value stored in bits [127:64] is
206
+ /// copied to the corresponding bits of the result.
207
+ /// \param Y
208
+ /// A 128-bit vector of [2 x double]. The value stored in bits [63:0] is
209
+ /// rounded down to the nearest integer and copied to the corresponding bits
210
+ /// of the result.
211
+ /// \returns A 128-bit vector of [2 x double] containing the copied and rounded
212
+ /// values.
213
+ #define _mm_floor_sd(X, Y) _mm_round_sd((X), (Y), _MM_FROUND_FLOOR)
214
+
215
+ /// Rounds each element of the 128-bit vector of [4 x float] to an
216
+ /// integer value according to the rounding control specified by the second
217
+ /// argument and returns the rounded values in a 128-bit vector of
218
+ /// [4 x float].
219
+ ///
220
+ /// \headerfile <x86intrin.h>
221
+ ///
222
+ /// \code
223
+ /// __m128 _mm_round_ps(__m128 X, const int M);
224
+ /// \endcode
225
+ ///
226
+ /// This intrinsic corresponds to the <c> VROUNDPS / ROUNDPS </c> instruction.
227
+ ///
228
+ /// \param X
229
+ /// A 128-bit vector of [4 x float].
230
+ /// \param M
231
+ /// An integer value that specifies the rounding operation. \n
232
+ /// Bits [7:4] are reserved. \n
233
+ /// Bit [3] is a precision exception value: \n
234
+ /// 0: A normal PE exception is used \n
235
+ /// 1: The PE field is not updated \n
236
+ /// Bit [2] is the rounding control source: \n
237
+ /// 0: Use bits [1:0] of \a M \n
238
+ /// 1: Use the current MXCSR setting \n
239
+ /// Bits [1:0] contain the rounding control definition: \n
240
+ /// 00: Nearest \n
241
+ /// 01: Downward (toward negative infinity) \n
242
+ /// 10: Upward (toward positive infinity) \n
243
+ /// 11: Truncated
244
+ /// \returns A 128-bit vector of [4 x float] containing the rounded values.
245
+ #define _mm_round_ps(X, M) \
246
+ ((__m128)__builtin_ia32_roundps((__v4sf)(__m128)(X), (M)))
247
+
248
+ /// Copies three upper elements of the first 128-bit vector operand to
249
+ /// the corresponding three upper elements of the 128-bit result vector of
250
+ /// [4 x float]. Rounds the lowest element of the second 128-bit vector
251
+ /// operand to an integer value according to the rounding control specified
252
+ /// by the third argument and copies it to the lowest element of the 128-bit
253
+ /// result vector of [4 x float].
254
+ ///
255
+ /// \headerfile <x86intrin.h>
256
+ ///
257
+ /// \code
258
+ /// __m128 _mm_round_ss(__m128 X, __m128 Y, const int M);
259
+ /// \endcode
260
+ ///
261
+ /// This intrinsic corresponds to the <c> VROUNDSS / ROUNDSS </c> instruction.
262
+ ///
263
+ /// \param X
264
+ /// A 128-bit vector of [4 x float]. The values stored in bits [127:32] are
265
+ /// copied to the corresponding bits of the result.
266
+ /// \param Y
267
+ /// A 128-bit vector of [4 x float]. The value stored in bits [31:0] is
268
+ /// rounded to the nearest integer using the specified rounding control and
269
+ /// copied to the corresponding bits of the result.
270
+ /// \param M
271
+ /// An integer value that specifies the rounding operation. \n
272
+ /// Bits [7:4] are reserved. \n
273
+ /// Bit [3] is a precision exception value: \n
274
+ /// 0: A normal PE exception is used \n
275
+ /// 1: The PE field is not updated \n
276
+ /// Bit [2] is the rounding control source: \n
277
+ /// 0: Use bits [1:0] of \a M \n
278
+ /// 1: Use the current MXCSR setting \n
279
+ /// Bits [1:0] contain the rounding control definition: \n
280
+ /// 00: Nearest \n
281
+ /// 01: Downward (toward negative infinity) \n
282
+ /// 10: Upward (toward positive infinity) \n
283
+ /// 11: Truncated
284
+ /// \returns A 128-bit vector of [4 x float] containing the copied and rounded
285
+ /// values.
286
+ #define _mm_round_ss(X, Y, M) \
287
+ ((__m128)__builtin_ia32_roundss((__v4sf)(__m128)(X), (__v4sf)(__m128)(Y), \
288
+ (M)))
289
+
290
+ /// Rounds each element of the 128-bit vector of [2 x double] to an
291
+ /// integer value according to the rounding control specified by the second
292
+ /// argument and returns the rounded values in a 128-bit vector of
293
+ /// [2 x double].
294
+ ///
295
+ /// \headerfile <x86intrin.h>
296
+ ///
297
+ /// \code
298
+ /// __m128d _mm_round_pd(__m128d X, const int M);
299
+ /// \endcode
300
+ ///
301
+ /// This intrinsic corresponds to the <c> VROUNDPD / ROUNDPD </c> instruction.
302
+ ///
303
+ /// \param X
304
+ /// A 128-bit vector of [2 x double].
305
+ /// \param M
306
+ /// An integer value that specifies the rounding operation. \n
307
+ /// Bits [7:4] are reserved. \n
308
+ /// Bit [3] is a precision exception value: \n
309
+ /// 0: A normal PE exception is used \n
310
+ /// 1: The PE field is not updated \n
311
+ /// Bit [2] is the rounding control source: \n
312
+ /// 0: Use bits [1:0] of \a M \n
313
+ /// 1: Use the current MXCSR setting \n
314
+ /// Bits [1:0] contain the rounding control definition: \n
315
+ /// 00: Nearest \n
316
+ /// 01: Downward (toward negative infinity) \n
317
+ /// 10: Upward (toward positive infinity) \n
318
+ /// 11: Truncated
319
+ /// \returns A 128-bit vector of [2 x double] containing the rounded values.
320
+ #define _mm_round_pd(X, M) \
321
+ ((__m128d)__builtin_ia32_roundpd((__v2df)(__m128d)(X), (M)))
322
+
323
+ /// Copies the upper element of the first 128-bit vector operand to the
324
+ /// corresponding upper element of the 128-bit result vector of [2 x double].
325
+ /// Rounds the lower element of the second 128-bit vector operand to an
326
+ /// integer value according to the rounding control specified by the third
327
+ /// argument and copies it to the lower element of the 128-bit result vector
328
+ /// of [2 x double].
329
+ ///
330
+ /// \headerfile <x86intrin.h>
331
+ ///
332
+ /// \code
333
+ /// __m128d _mm_round_sd(__m128d X, __m128d Y, const int M);
334
+ /// \endcode
335
+ ///
336
+ /// This intrinsic corresponds to the <c> VROUNDSD / ROUNDSD </c> instruction.
337
+ ///
338
+ /// \param X
339
+ /// A 128-bit vector of [2 x double]. The value stored in bits [127:64] is
340
+ /// copied to the corresponding bits of the result.
341
+ /// \param Y
342
+ /// A 128-bit vector of [2 x double]. The value stored in bits [63:0] is
343
+ /// rounded to the nearest integer using the specified rounding control and
344
+ /// copied to the corresponding bits of the result.
345
+ /// \param M
346
+ /// An integer value that specifies the rounding operation. \n
347
+ /// Bits [7:4] are reserved. \n
348
+ /// Bit [3] is a precision exception value: \n
349
+ /// 0: A normal PE exception is used \n
350
+ /// 1: The PE field is not updated \n
351
+ /// Bit [2] is the rounding control source: \n
352
+ /// 0: Use bits [1:0] of \a M \n
353
+ /// 1: Use the current MXCSR setting \n
354
+ /// Bits [1:0] contain the rounding control definition: \n
355
+ /// 00: Nearest \n
356
+ /// 01: Downward (toward negative infinity) \n
357
+ /// 10: Upward (toward positive infinity) \n
358
+ /// 11: Truncated
359
+ /// \returns A 128-bit vector of [2 x double] containing the copied and rounded
360
+ /// values.
361
+ #define _mm_round_sd(X, Y, M) \
362
+ ((__m128d)__builtin_ia32_roundsd((__v2df)(__m128d)(X), (__v2df)(__m128d)(Y), \
363
+ (M)))
364
+
365
+ /* SSE4 Packed Blending Intrinsics. */
366
+ /// Returns a 128-bit vector of [2 x double] where the values are
367
+ /// selected from either the first or second operand as specified by the
368
+ /// third operand, the control mask.
369
+ ///
370
+ /// \headerfile <x86intrin.h>
371
+ ///
372
+ /// \code
373
+ /// __m128d _mm_blend_pd(__m128d V1, __m128d V2, const int M);
374
+ /// \endcode
375
+ ///
376
+ /// This intrinsic corresponds to the <c> VBLENDPD / BLENDPD </c> instruction.
377
+ ///
378
+ /// \param V1
379
+ /// A 128-bit vector of [2 x double].
380
+ /// \param V2
381
+ /// A 128-bit vector of [2 x double].
382
+ /// \param M
383
+ /// An immediate integer operand, with mask bits [1:0] specifying how the
384
+ /// values are to be copied. The position of the mask bit corresponds to the
385
+ /// index of a copied value. When a mask bit is 0, the corresponding 64-bit
386
+ /// element in operand \a V1 is copied to the same position in the result.
387
+ /// When a mask bit is 1, the corresponding 64-bit element in operand \a V2
388
+ /// is copied to the same position in the result.
389
+ /// \returns A 128-bit vector of [2 x double] containing the copied values.
390
+ #define _mm_blend_pd(V1, V2, M) \
391
+ ((__m128d)__builtin_ia32_blendpd((__v2df)(__m128d)(V1), \
392
+ (__v2df)(__m128d)(V2), (int)(M)))
393
+
394
+ /// Returns a 128-bit vector of [4 x float] where the values are selected
395
+ /// from either the first or second operand as specified by the third
396
+ /// operand, the control mask.
397
+ ///
398
+ /// \headerfile <x86intrin.h>
399
+ ///
400
+ /// \code
401
+ /// __m128 _mm_blend_ps(__m128 V1, __m128 V2, const int M);
402
+ /// \endcode
403
+ ///
404
+ /// This intrinsic corresponds to the <c> VBLENDPS / BLENDPS </c> instruction.
405
+ ///
406
+ /// \param V1
407
+ /// A 128-bit vector of [4 x float].
408
+ /// \param V2
409
+ /// A 128-bit vector of [4 x float].
410
+ /// \param M
411
+ /// An immediate integer operand, with mask bits [3:0] specifying how the
412
+ /// values are to be copied. The position of the mask bit corresponds to the
413
+ /// index of a copied value. When a mask bit is 0, the corresponding 32-bit
414
+ /// element in operand \a V1 is copied to the same position in the result.
415
+ /// When a mask bit is 1, the corresponding 32-bit element in operand \a V2
416
+ /// is copied to the same position in the result.
417
+ /// \returns A 128-bit vector of [4 x float] containing the copied values.
418
+ #define _mm_blend_ps(V1, V2, M) \
419
+ ((__m128)__builtin_ia32_blendps((__v4sf)(__m128)(V1), (__v4sf)(__m128)(V2), \
420
+ (int)(M)))
421
+
422
+ /// Returns a 128-bit vector of [2 x double] where the values are
423
+ /// selected from either the first or second operand as specified by the
424
+ /// third operand, the control mask.
425
+ ///
426
+ /// \headerfile <x86intrin.h>
427
+ ///
428
+ /// This intrinsic corresponds to the <c> VBLENDVPD / BLENDVPD </c> instruction.
429
+ ///
430
+ /// \param __V1
431
+ /// A 128-bit vector of [2 x double].
432
+ /// \param __V2
433
+ /// A 128-bit vector of [2 x double].
434
+ /// \param __M
435
+ /// A 128-bit vector operand, with mask bits 127 and 63 specifying how the
436
+ /// values are to be copied. The position of the mask bit corresponds to the
437
+ /// most significant bit of a copied value. When a mask bit is 0, the
438
+ /// corresponding 64-bit element in operand \a __V1 is copied to the same
439
+ /// position in the result. When a mask bit is 1, the corresponding 64-bit
440
+ /// element in operand \a __V2 is copied to the same position in the result.
441
+ /// \returns A 128-bit vector of [2 x double] containing the copied values.
442
+ static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR
443
+ _mm_blendv_pd(__m128d __V1, __m128d __V2, __m128d __M) {
444
+ return (__m128d)__builtin_ia32_blendvpd((__v2df)__V1, (__v2df)__V2,
445
+ (__v2df)__M);
446
+ }
447
+
448
+ /// Returns a 128-bit vector of [4 x float] where the values are
449
+ /// selected from either the first or second operand as specified by the
450
+ /// third operand, the control mask.
451
+ ///
452
+ /// \headerfile <x86intrin.h>
453
+ ///
454
+ /// This intrinsic corresponds to the <c> VBLENDVPS / BLENDVPS </c> instruction.
455
+ ///
456
+ /// \param __V1
457
+ /// A 128-bit vector of [4 x float].
458
+ /// \param __V2
459
+ /// A 128-bit vector of [4 x float].
460
+ /// \param __M
461
+ /// A 128-bit vector operand, with mask bits 127, 95, 63, and 31 specifying
462
+ /// how the values are to be copied. The position of the mask bit corresponds
463
+ /// to the most significant bit of a copied value. When a mask bit is 0, the
464
+ /// corresponding 32-bit element in operand \a __V1 is copied to the same
465
+ /// position in the result. When a mask bit is 1, the corresponding 32-bit
466
+ /// element in operand \a __V2 is copied to the same position in the result.
467
+ /// \returns A 128-bit vector of [4 x float] containing the copied values.
468
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
469
+ _mm_blendv_ps(__m128 __V1, __m128 __V2, __m128 __M) {
470
+ return (__m128)__builtin_ia32_blendvps((__v4sf)__V1, (__v4sf)__V2,
471
+ (__v4sf)__M);
472
+ }
473
+
474
+ /// Returns a 128-bit vector of [16 x i8] where the values are selected
475
+ /// from either of the first or second operand as specified by the third
476
+ /// operand, the control mask.
477
+ ///
478
+ /// \headerfile <x86intrin.h>
479
+ ///
480
+ /// This intrinsic corresponds to the <c> VPBLENDVB / PBLENDVB </c> instruction.
481
+ ///
482
+ /// \param __V1
483
+ /// A 128-bit vector of [16 x i8].
484
+ /// \param __V2
485
+ /// A 128-bit vector of [16 x i8].
486
+ /// \param __M
487
+ /// A 128-bit vector operand, with mask bits 127, 119, 111...7 specifying
488
+ /// how the values are to be copied. The position of the mask bit corresponds
489
+ /// to the most significant bit of a copied value. When a mask bit is 0, the
490
+ /// corresponding 8-bit element in operand \a __V1 is copied to the same
491
+ /// position in the result. When a mask bit is 1, the corresponding 8-bit
492
+ /// element in operand \a __V2 is copied to the same position in the result.
493
+ /// \returns A 128-bit vector of [16 x i8] containing the copied values.
494
+ static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
495
+ _mm_blendv_epi8(__m128i __V1, __m128i __V2, __m128i __M) {
496
+ return (__m128i)__builtin_ia32_pblendvb128((__v16qi)__V1, (__v16qi)__V2,
497
+ (__v16qi)__M);
498
+ }
499
+
500
+ /// Returns a 128-bit vector of [8 x i16] where the values are selected
501
+ /// from either of the first or second operand as specified by the third
502
+ /// operand, the control mask.
503
+ ///
504
+ /// \headerfile <x86intrin.h>
505
+ ///
506
+ /// \code
507
+ /// __m128i _mm_blend_epi16(__m128i V1, __m128i V2, const int M);
508
+ /// \endcode
509
+ ///
510
+ /// This intrinsic corresponds to the <c> VPBLENDW / PBLENDW </c> instruction.
511
+ ///
512
+ /// \param V1
513
+ /// A 128-bit vector of [8 x i16].
514
+ /// \param V2
515
+ /// A 128-bit vector of [8 x i16].
516
+ /// \param M
517
+ /// An immediate integer operand, with mask bits [7:0] specifying how the
518
+ /// values are to be copied. The position of the mask bit corresponds to the
519
+ /// index of a copied value. When a mask bit is 0, the corresponding 16-bit
520
+ /// element in operand \a V1 is copied to the same position in the result.
521
+ /// When a mask bit is 1, the corresponding 16-bit element in operand \a V2
522
+ /// is copied to the same position in the result.
523
+ /// \returns A 128-bit vector of [8 x i16] containing the copied values.
524
+ #define _mm_blend_epi16(V1, V2, M) \
525
+ ((__m128i)__builtin_ia32_pblendw128((__v8hi)(__m128i)(V1), \
526
+ (__v8hi)(__m128i)(V2), (int)(M)))
527
+
528
+ /* SSE4 Dword Multiply Instructions. */
529
+ /// Multiples corresponding elements of two 128-bit vectors of [4 x i32]
530
+ /// and returns the lower 32 bits of the each product in a 128-bit vector of
531
+ /// [4 x i32].
532
+ ///
533
+ /// \headerfile <x86intrin.h>
534
+ ///
535
+ /// This intrinsic corresponds to the <c> VPMULLD / PMULLD </c> instruction.
536
+ ///
537
+ /// \param __V1
538
+ /// A 128-bit integer vector.
539
+ /// \param __V2
540
+ /// A 128-bit integer vector.
541
+ /// \returns A 128-bit integer vector containing the products of both operands.
542
+ static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
543
+ _mm_mullo_epi32(__m128i __V1, __m128i __V2) {
544
+ return (__m128i)((__v4su)__V1 * (__v4su)__V2);
545
+ }
546
+
547
+ /// Multiplies corresponding even-indexed elements of two 128-bit
548
+ /// vectors of [4 x i32] and returns a 128-bit vector of [2 x i64]
549
+ /// containing the products.
550
+ ///
551
+ /// \headerfile <x86intrin.h>
552
+ ///
553
+ /// This intrinsic corresponds to the <c> VPMULDQ / PMULDQ </c> instruction.
554
+ ///
555
+ /// \param __V1
556
+ /// A 128-bit vector of [4 x i32].
557
+ /// \param __V2
558
+ /// A 128-bit vector of [4 x i32].
559
+ /// \returns A 128-bit vector of [2 x i64] containing the products of both
560
+ /// operands.
561
+ static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
562
+ _mm_mul_epi32(__m128i __V1, __m128i __V2) {
563
+ return (__m128i)__builtin_ia32_pmuldq128((__v4si)__V1, (__v4si)__V2);
564
+ }
565
+
566
+ /* SSE4 Floating Point Dot Product Instructions. */
567
+ /// Computes the dot product of the two 128-bit vectors of [4 x float]
568
+ /// and returns it in the elements of the 128-bit result vector of
569
+ /// [4 x float].
570
+ ///
571
+ /// The immediate integer operand controls which input elements
572
+ /// will contribute to the dot product, and where the final results are
573
+ /// returned.
574
+ ///
575
+ /// \headerfile <x86intrin.h>
576
+ ///
577
+ /// \code
578
+ /// __m128 _mm_dp_ps(__m128 X, __m128 Y, const int M);
579
+ /// \endcode
580
+ ///
581
+ /// This intrinsic corresponds to the <c> VDPPS / DPPS </c> instruction.
582
+ ///
583
+ /// \param X
584
+ /// A 128-bit vector of [4 x float].
585
+ /// \param Y
586
+ /// A 128-bit vector of [4 x float].
587
+ /// \param M
588
+ /// An immediate integer operand. Mask bits [7:4] determine which elements
589
+ /// of the input vectors are used, with bit [4] corresponding to the lowest
590
+ /// element and bit [7] corresponding to the highest element of each [4 x
591
+ /// float] vector. If a bit is set, the corresponding elements from the two
592
+ /// input vectors are used as an input for dot product; otherwise that input
593
+ /// is treated as zero. Bits [3:0] determine which elements of the result
594
+ /// will receive a copy of the final dot product, with bit [0] corresponding
595
+ /// to the lowest element and bit [3] corresponding to the highest element of
596
+ /// each [4 x float] subvector. If a bit is set, the dot product is returned
597
+ /// in the corresponding element; otherwise that element is set to zero.
598
+ /// \returns A 128-bit vector of [4 x float] containing the dot product.
599
+ #define _mm_dp_ps(X, Y, M) \
600
+ ((__m128)__builtin_ia32_dpps((__v4sf)(__m128)(X), (__v4sf)(__m128)(Y), (M)))
601
+
602
+ /// Computes the dot product of the two 128-bit vectors of [2 x double]
603
+ /// and returns it in the elements of the 128-bit result vector of
604
+ /// [2 x double].
605
+ ///
606
+ /// The immediate integer operand controls which input
607
+ /// elements will contribute to the dot product, and where the final results
608
+ /// are returned.
609
+ ///
610
+ /// \headerfile <x86intrin.h>
611
+ ///
612
+ /// \code
613
+ /// __m128d _mm_dp_pd(__m128d X, __m128d Y, const int M);
614
+ /// \endcode
615
+ ///
616
+ /// This intrinsic corresponds to the <c> VDPPD / DPPD </c> instruction.
617
+ ///
618
+ /// \param X
619
+ /// A 128-bit vector of [2 x double].
620
+ /// \param Y
621
+ /// A 128-bit vector of [2 x double].
622
+ /// \param M
623
+ /// An immediate integer operand. Mask bits [5:4] determine which elements
624
+ /// of the input vectors are used, with bit [4] corresponding to the lowest
625
+ /// element and bit [5] corresponding to the highest element of each of [2 x
626
+ /// double] vector. If a bit is set, the corresponding elements from the two
627
+ /// input vectors are used as an input for dot product; otherwise that input
628
+ /// is treated as zero. Bits [1:0] determine which elements of the result
629
+ /// will receive a copy of the final dot product, with bit [0] corresponding
630
+ /// to the lowest element and bit [1] corresponding to the highest element of
631
+ /// each [2 x double] vector. If a bit is set, the dot product is returned in
632
+ /// the corresponding element; otherwise that element is set to zero.
633
+ #define _mm_dp_pd(X, Y, M) \
634
+ ((__m128d)__builtin_ia32_dppd((__v2df)(__m128d)(X), (__v2df)(__m128d)(Y), \
635
+ (M)))
636
+
637
+ /* SSE4 Streaming Load Hint Instruction. */
638
+ /// Loads integer values from a 128-bit aligned memory location to a
639
+ /// 128-bit integer vector.
640
+ ///
641
+ /// \headerfile <x86intrin.h>
642
+ ///
643
+ /// This intrinsic corresponds to the <c> VMOVNTDQA / MOVNTDQA </c> instruction.
644
+ ///
645
+ /// \param __V
646
+ /// A pointer to a 128-bit aligned memory location that contains the integer
647
+ /// values.
648
+ /// \returns A 128-bit integer vector containing the data stored at the
649
+ /// specified memory location.
650
+ static __inline__ __m128i __DEFAULT_FN_ATTRS
651
+ _mm_stream_load_si128(const void *__V) {
652
+ return (__m128i)__builtin_nontemporal_load((const __v2di *)__V);
653
+ }
654
+
655
+ /* SSE4 Packed Integer Min/Max Instructions. */
656
+ /// Compares the corresponding elements of two 128-bit vectors of
657
+ /// [16 x i8] and returns a 128-bit vector of [16 x i8] containing the lesser
658
+ /// of the two values.
659
+ ///
660
+ /// \headerfile <x86intrin.h>
661
+ ///
662
+ /// This intrinsic corresponds to the <c> VPMINSB / PMINSB </c> instruction.
663
+ ///
664
+ /// \param __V1
665
+ /// A 128-bit vector of [16 x i8].
666
+ /// \param __V2
667
+ /// A 128-bit vector of [16 x i8]
668
+ /// \returns A 128-bit vector of [16 x i8] containing the lesser values.
669
+ static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
670
+ _mm_min_epi8(__m128i __V1, __m128i __V2) {
671
+ return (__m128i)__builtin_elementwise_min((__v16qs)__V1, (__v16qs)__V2);
672
+ }
673
+
674
+ /// Compares the corresponding elements of two 128-bit vectors of
675
+ /// [16 x i8] and returns a 128-bit vector of [16 x i8] containing the
676
+ /// greater value of the two.
677
+ ///
678
+ /// \headerfile <x86intrin.h>
679
+ ///
680
+ /// This intrinsic corresponds to the <c> VPMAXSB / PMAXSB </c> instruction.
681
+ ///
682
+ /// \param __V1
683
+ /// A 128-bit vector of [16 x i8].
684
+ /// \param __V2
685
+ /// A 128-bit vector of [16 x i8].
686
+ /// \returns A 128-bit vector of [16 x i8] containing the greater values.
687
+ static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
688
+ _mm_max_epi8(__m128i __V1, __m128i __V2) {
689
+ return (__m128i)__builtin_elementwise_max((__v16qs)__V1, (__v16qs)__V2);
690
+ }
691
+
692
+ /// Compares the corresponding elements of two 128-bit vectors of
693
+ /// [8 x u16] and returns a 128-bit vector of [8 x u16] containing the lesser
694
+ /// value of the two.
695
+ ///
696
+ /// \headerfile <x86intrin.h>
697
+ ///
698
+ /// This intrinsic corresponds to the <c> VPMINUW / PMINUW </c> instruction.
699
+ ///
700
+ /// \param __V1
701
+ /// A 128-bit vector of [8 x u16].
702
+ /// \param __V2
703
+ /// A 128-bit vector of [8 x u16].
704
+ /// \returns A 128-bit vector of [8 x u16] containing the lesser values.
705
+ static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
706
+ _mm_min_epu16(__m128i __V1, __m128i __V2) {
707
+ return (__m128i)__builtin_elementwise_min((__v8hu)__V1, (__v8hu)__V2);
708
+ }
709
+
710
+ /// Compares the corresponding elements of two 128-bit vectors of
711
+ /// [8 x u16] and returns a 128-bit vector of [8 x u16] containing the
712
+ /// greater value of the two.
713
+ ///
714
+ /// \headerfile <x86intrin.h>
715
+ ///
716
+ /// This intrinsic corresponds to the <c> VPMAXUW / PMAXUW </c> instruction.
717
+ ///
718
+ /// \param __V1
719
+ /// A 128-bit vector of [8 x u16].
720
+ /// \param __V2
721
+ /// A 128-bit vector of [8 x u16].
722
+ /// \returns A 128-bit vector of [8 x u16] containing the greater values.
723
+ static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
724
+ _mm_max_epu16(__m128i __V1, __m128i __V2) {
725
+ return (__m128i)__builtin_elementwise_max((__v8hu)__V1, (__v8hu)__V2);
726
+ }
727
+
728
+ /// Compares the corresponding elements of two 128-bit vectors of
729
+ /// [4 x i32] and returns a 128-bit vector of [4 x i32] containing the lesser
730
+ /// value of the two.
731
+ ///
732
+ /// \headerfile <x86intrin.h>
733
+ ///
734
+ /// This intrinsic corresponds to the <c> VPMINSD / PMINSD </c> instruction.
735
+ ///
736
+ /// \param __V1
737
+ /// A 128-bit vector of [4 x i32].
738
+ /// \param __V2
739
+ /// A 128-bit vector of [4 x i32].
740
+ /// \returns A 128-bit vector of [4 x i32] containing the lesser values.
741
+ static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
742
+ _mm_min_epi32(__m128i __V1, __m128i __V2) {
743
+ return (__m128i)__builtin_elementwise_min((__v4si)__V1, (__v4si)__V2);
744
+ }
745
+
746
+ /// Compares the corresponding elements of two 128-bit vectors of
747
+ /// [4 x i32] and returns a 128-bit vector of [4 x i32] containing the
748
+ /// greater value of the two.
749
+ ///
750
+ /// \headerfile <x86intrin.h>
751
+ ///
752
+ /// This intrinsic corresponds to the <c> VPMAXSD / PMAXSD </c> instruction.
753
+ ///
754
+ /// \param __V1
755
+ /// A 128-bit vector of [4 x i32].
756
+ /// \param __V2
757
+ /// A 128-bit vector of [4 x i32].
758
+ /// \returns A 128-bit vector of [4 x i32] containing the greater values.
759
+ static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
760
+ _mm_max_epi32(__m128i __V1, __m128i __V2) {
761
+ return (__m128i)__builtin_elementwise_max((__v4si)__V1, (__v4si)__V2);
762
+ }
763
+
764
+ /// Compares the corresponding elements of two 128-bit vectors of
765
+ /// [4 x u32] and returns a 128-bit vector of [4 x u32] containing the lesser
766
+ /// value of the two.
767
+ ///
768
+ /// \headerfile <x86intrin.h>
769
+ ///
770
+ /// This intrinsic corresponds to the <c> VPMINUD / PMINUD </c> instruction.
771
+ ///
772
+ /// \param __V1
773
+ /// A 128-bit vector of [4 x u32].
774
+ /// \param __V2
775
+ /// A 128-bit vector of [4 x u32].
776
+ /// \returns A 128-bit vector of [4 x u32] containing the lesser values.
777
+ static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
778
+ _mm_min_epu32(__m128i __V1, __m128i __V2) {
779
+ return (__m128i)__builtin_elementwise_min((__v4su)__V1, (__v4su)__V2);
780
+ }
781
+
782
+ /// Compares the corresponding elements of two 128-bit vectors of
783
+ /// [4 x u32] and returns a 128-bit vector of [4 x u32] containing the
784
+ /// greater value of the two.
785
+ ///
786
+ /// \headerfile <x86intrin.h>
787
+ ///
788
+ /// This intrinsic corresponds to the <c> VPMAXUD / PMAXUD </c> instruction.
789
+ ///
790
+ /// \param __V1
791
+ /// A 128-bit vector of [4 x u32].
792
+ /// \param __V2
793
+ /// A 128-bit vector of [4 x u32].
794
+ /// \returns A 128-bit vector of [4 x u32] containing the greater values.
795
+ static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
796
+ _mm_max_epu32(__m128i __V1, __m128i __V2) {
797
+ return (__m128i)__builtin_elementwise_max((__v4su)__V1, (__v4su)__V2);
798
+ }
799
+
800
+ /* SSE4 Insertion and Extraction from XMM Register Instructions. */
801
+ /// Takes the first argument \a X and inserts an element from the second
802
+ /// argument \a Y as selected by the third argument \a N. That result then
803
+ /// has elements zeroed out also as selected by the third argument \a N. The
804
+ /// resulting 128-bit vector of [4 x float] is then returned.
805
+ ///
806
+ /// \headerfile <x86intrin.h>
807
+ ///
808
+ /// \code
809
+ /// __m128 _mm_insert_ps(__m128 X, __m128 Y, const int N);
810
+ /// \endcode
811
+ ///
812
+ /// This intrinsic corresponds to the <c> VINSERTPS </c> instruction.
813
+ ///
814
+ /// \param X
815
+ /// A 128-bit vector source operand of [4 x float]. With the exception of
816
+ /// those bits in the result copied from parameter \a Y and zeroed by bits
817
+ /// [3:0] of \a N, all bits from this parameter are copied to the result.
818
+ /// \param Y
819
+ /// A 128-bit vector source operand of [4 x float]. One single-precision
820
+ /// floating-point element from this source, as determined by the immediate
821
+ /// parameter, is copied to the result.
822
+ /// \param N
823
+ /// Specifies which bits from operand \a Y will be copied, which bits in the
824
+ /// result they will be copied to, and which bits in the result will be
825
+ /// cleared. The following assignments are made: \n
826
+ /// Bits [7:6] specify the bits to copy from operand \a Y: \n
827
+ /// 00: Selects bits [31:0] from operand \a Y. \n
828
+ /// 01: Selects bits [63:32] from operand \a Y. \n
829
+ /// 10: Selects bits [95:64] from operand \a Y. \n
830
+ /// 11: Selects bits [127:96] from operand \a Y. \n
831
+ /// Bits [5:4] specify the bits in the result to which the selected bits
832
+ /// from operand \a Y are copied: \n
833
+ /// 00: Copies the selected bits from \a Y to result bits [31:0]. \n
834
+ /// 01: Copies the selected bits from \a Y to result bits [63:32]. \n
835
+ /// 10: Copies the selected bits from \a Y to result bits [95:64]. \n
836
+ /// 11: Copies the selected bits from \a Y to result bits [127:96]. \n
837
+ /// Bits[3:0]: If any of these bits are set, the corresponding result
838
+ /// element is cleared.
839
+ /// \returns A 128-bit vector of [4 x float] containing the copied
840
+ /// single-precision floating point elements from the operands.
841
+ #define _mm_insert_ps(X, Y, N) __builtin_ia32_insertps128((X), (Y), (N))
842
+
843
+ /// Extracts a 32-bit integer from a 128-bit vector of [4 x float] and
844
+ /// returns it, using the immediate value parameter \a N as a selector.
845
+ ///
846
+ /// \headerfile <x86intrin.h>
847
+ ///
848
+ /// \code
849
+ /// int _mm_extract_ps(__m128 X, const int N);
850
+ /// \endcode
851
+ ///
852
+ /// This intrinsic corresponds to the <c> VEXTRACTPS / EXTRACTPS </c>
853
+ /// instruction.
854
+ ///
855
+ /// \param X
856
+ /// A 128-bit vector of [4 x float].
857
+ /// \param N
858
+ /// An immediate value. Bits [1:0] determines which bits from the argument
859
+ /// \a X are extracted and returned: \n
860
+ /// 00: Bits [31:0] of parameter \a X are returned. \n
861
+ /// 01: Bits [63:32] of parameter \a X are returned. \n
862
+ /// 10: Bits [95:64] of parameter \a X are returned. \n
863
+ /// 11: Bits [127:96] of parameter \a X are returned.
864
+ /// \returns A 32-bit integer containing the extracted 32 bits of float data.
865
+ #define _mm_extract_ps(X, N) \
866
+ __builtin_bit_cast( \
867
+ int, __builtin_ia32_vec_ext_v4sf((__v4sf)(__m128)(X), (int)(N)))
868
+
869
+ /* Miscellaneous insert and extract macros. */
870
+ /* Extract a single-precision float from X at index N into D. */
871
+ #define _MM_EXTRACT_FLOAT(D, X, N) \
872
+ do { \
873
+ (D) = __builtin_ia32_vec_ext_v4sf((__v4sf)(__m128)(X), (int)(N)); \
874
+ } while (0)
875
+
876
+ /* Or together 2 sets of indexes (X and Y) with the zeroing bits (Z) to create
877
+ an index suitable for _mm_insert_ps. */
878
+ #define _MM_MK_INSERTPS_NDX(X, Y, Z) (((X) << 6) | ((Y) << 4) | (Z))
879
+
880
+ /* Extract a float from X at index N into the first index of the return. */
881
+ #define _MM_PICK_OUT_PS(X, N) \
882
+ _mm_insert_ps(_mm_setzero_ps(), (X), _MM_MK_INSERTPS_NDX((N), 0, 0x0e))
883
+
884
+ /* Insert int into packed integer array at index. */
885
+ /// Constructs a 128-bit vector of [16 x i8] by first making a copy of
886
+ /// the 128-bit integer vector parameter, and then inserting the lower 8 bits
887
+ /// of an integer parameter \a I into an offset specified by the immediate
888
+ /// value parameter \a N.
889
+ ///
890
+ /// \headerfile <x86intrin.h>
891
+ ///
892
+ /// \code
893
+ /// __m128i _mm_insert_epi8(__m128i X, int I, const int N);
894
+ /// \endcode
895
+ ///
896
+ /// This intrinsic corresponds to the <c> VPINSRB / PINSRB </c> instruction.
897
+ ///
898
+ /// \param X
899
+ /// A 128-bit integer vector of [16 x i8]. This vector is copied to the
900
+ /// result and then one of the sixteen elements in the result vector is
901
+ /// replaced by the lower 8 bits of \a I.
902
+ /// \param I
903
+ /// An integer. The lower 8 bits of this operand are written to the result
904
+ /// beginning at the offset specified by \a N.
905
+ /// \param N
906
+ /// An immediate value. Bits [3:0] specify the bit offset in the result at
907
+ /// which the lower 8 bits of \a I are written. \n
908
+ /// 0000: Bits [7:0] of the result are used for insertion. \n
909
+ /// 0001: Bits [15:8] of the result are used for insertion. \n
910
+ /// 0010: Bits [23:16] of the result are used for insertion. \n
911
+ /// 0011: Bits [31:24] of the result are used for insertion. \n
912
+ /// 0100: Bits [39:32] of the result are used for insertion. \n
913
+ /// 0101: Bits [47:40] of the result are used for insertion. \n
914
+ /// 0110: Bits [55:48] of the result are used for insertion. \n
915
+ /// 0111: Bits [63:56] of the result are used for insertion. \n
916
+ /// 1000: Bits [71:64] of the result are used for insertion. \n
917
+ /// 1001: Bits [79:72] of the result are used for insertion. \n
918
+ /// 1010: Bits [87:80] of the result are used for insertion. \n
919
+ /// 1011: Bits [95:88] of the result are used for insertion. \n
920
+ /// 1100: Bits [103:96] of the result are used for insertion. \n
921
+ /// 1101: Bits [111:104] of the result are used for insertion. \n
922
+ /// 1110: Bits [119:112] of the result are used for insertion. \n
923
+ /// 1111: Bits [127:120] of the result are used for insertion.
924
+ /// \returns A 128-bit integer vector containing the constructed values.
925
+ #define _mm_insert_epi8(X, I, N) \
926
+ ((__m128i)__builtin_ia32_vec_set_v16qi((__v16qi)(__m128i)(X), (int)(I), \
927
+ (int)(N)))
928
+
929
+ /// Constructs a 128-bit vector of [4 x i32] by first making a copy of
930
+ /// the 128-bit integer vector parameter, and then inserting the 32-bit
931
+ /// integer parameter \a I at the offset specified by the immediate value
932
+ /// parameter \a N.
933
+ ///
934
+ /// \headerfile <x86intrin.h>
935
+ ///
936
+ /// \code
937
+ /// __m128i _mm_insert_epi32(__m128i X, int I, const int N);
938
+ /// \endcode
939
+ ///
940
+ /// This intrinsic corresponds to the <c> VPINSRD / PINSRD </c> instruction.
941
+ ///
942
+ /// \param X
943
+ /// A 128-bit integer vector of [4 x i32]. This vector is copied to the
944
+ /// result and then one of the four elements in the result vector is
945
+ /// replaced by \a I.
946
+ /// \param I
947
+ /// A 32-bit integer that is written to the result beginning at the offset
948
+ /// specified by \a N.
949
+ /// \param N
950
+ /// An immediate value. Bits [1:0] specify the bit offset in the result at
951
+ /// which the integer \a I is written. \n
952
+ /// 00: Bits [31:0] of the result are used for insertion. \n
953
+ /// 01: Bits [63:32] of the result are used for insertion. \n
954
+ /// 10: Bits [95:64] of the result are used for insertion. \n
955
+ /// 11: Bits [127:96] of the result are used for insertion.
956
+ /// \returns A 128-bit integer vector containing the constructed values.
957
+ #define _mm_insert_epi32(X, I, N) \
958
+ ((__m128i)__builtin_ia32_vec_set_v4si((__v4si)(__m128i)(X), (int)(I), \
959
+ (int)(N)))
960
+
961
+ #ifdef __x86_64__
962
+ /// Constructs a 128-bit vector of [2 x i64] by first making a copy of
963
+ /// the 128-bit integer vector parameter, and then inserting the 64-bit
964
+ /// integer parameter \a I, using the immediate value parameter \a N as an
965
+ /// insertion location selector.
966
+ ///
967
+ /// \headerfile <x86intrin.h>
968
+ ///
969
+ /// \code
970
+ /// __m128i _mm_insert_epi64(__m128i X, long long I, const int N);
971
+ /// \endcode
972
+ ///
973
+ /// This intrinsic corresponds to the <c> VPINSRQ / PINSRQ </c> instruction.
974
+ ///
975
+ /// \param X
976
+ /// A 128-bit integer vector of [2 x i64]. This vector is copied to the
977
+ /// result and then one of the two elements in the result vector is replaced
978
+ /// by \a I.
979
+ /// \param I
980
+ /// A 64-bit integer that is written to the result beginning at the offset
981
+ /// specified by \a N.
982
+ /// \param N
983
+ /// An immediate value. Bit [0] specifies the bit offset in the result at
984
+ /// which the integer \a I is written. \n
985
+ /// 0: Bits [63:0] of the result are used for insertion. \n
986
+ /// 1: Bits [127:64] of the result are used for insertion. \n
987
+ /// \returns A 128-bit integer vector containing the constructed values.
988
+ #define _mm_insert_epi64(X, I, N) \
989
+ ((__m128i)__builtin_ia32_vec_set_v2di((__v2di)(__m128i)(X), (long long)(I), \
990
+ (int)(N)))
991
+ #endif /* __x86_64__ */
992
+
993
+ /* Extract int from packed integer array at index. This returns the element
994
+ * as a zero extended value, so it is unsigned.
995
+ */
996
+ /// Extracts an 8-bit element from the 128-bit integer vector of
997
+ /// [16 x i8], using the immediate value parameter \a N as a selector.
998
+ ///
999
+ /// \headerfile <x86intrin.h>
1000
+ ///
1001
+ /// \code
1002
+ /// int _mm_extract_epi8(__m128i X, const int N);
1003
+ /// \endcode
1004
+ ///
1005
+ /// This intrinsic corresponds to the <c> VPEXTRB / PEXTRB </c> instruction.
1006
+ ///
1007
+ /// \param X
1008
+ /// A 128-bit integer vector.
1009
+ /// \param N
1010
+ /// An immediate value. Bits [3:0] specify which 8-bit vector element from
1011
+ /// the argument \a X to extract and copy to the result. \n
1012
+ /// 0000: Bits [7:0] of parameter \a X are extracted. \n
1013
+ /// 0001: Bits [15:8] of the parameter \a X are extracted. \n
1014
+ /// 0010: Bits [23:16] of the parameter \a X are extracted. \n
1015
+ /// 0011: Bits [31:24] of the parameter \a X are extracted. \n
1016
+ /// 0100: Bits [39:32] of the parameter \a X are extracted. \n
1017
+ /// 0101: Bits [47:40] of the parameter \a X are extracted. \n
1018
+ /// 0110: Bits [55:48] of the parameter \a X are extracted. \n
1019
+ /// 0111: Bits [63:56] of the parameter \a X are extracted. \n
1020
+ /// 1000: Bits [71:64] of the parameter \a X are extracted. \n
1021
+ /// 1001: Bits [79:72] of the parameter \a X are extracted. \n
1022
+ /// 1010: Bits [87:80] of the parameter \a X are extracted. \n
1023
+ /// 1011: Bits [95:88] of the parameter \a X are extracted. \n
1024
+ /// 1100: Bits [103:96] of the parameter \a X are extracted. \n
1025
+ /// 1101: Bits [111:104] of the parameter \a X are extracted. \n
1026
+ /// 1110: Bits [119:112] of the parameter \a X are extracted. \n
1027
+ /// 1111: Bits [127:120] of the parameter \a X are extracted.
1028
+ /// \returns An unsigned integer, whose lower 8 bits are selected from the
1029
+ /// 128-bit integer vector parameter and the remaining bits are assigned
1030
+ /// zeros.
1031
+ #define _mm_extract_epi8(X, N) \
1032
+ ((int)(unsigned char)__builtin_ia32_vec_ext_v16qi((__v16qi)(__m128i)(X), \
1033
+ (int)(N)))
1034
+
1035
+ /// Extracts a 32-bit element from the 128-bit integer vector of
1036
+ /// [4 x i32], using the immediate value parameter \a N as a selector.
1037
+ ///
1038
+ /// \headerfile <x86intrin.h>
1039
+ ///
1040
+ /// \code
1041
+ /// int _mm_extract_epi32(__m128i X, const int N);
1042
+ /// \endcode
1043
+ ///
1044
+ /// This intrinsic corresponds to the <c> VPEXTRD / PEXTRD </c> instruction.
1045
+ ///
1046
+ /// \param X
1047
+ /// A 128-bit integer vector.
1048
+ /// \param N
1049
+ /// An immediate value. Bits [1:0] specify which 32-bit vector element from
1050
+ /// the argument \a X to extract and copy to the result. \n
1051
+ /// 00: Bits [31:0] of the parameter \a X are extracted. \n
1052
+ /// 01: Bits [63:32] of the parameter \a X are extracted. \n
1053
+ /// 10: Bits [95:64] of the parameter \a X are extracted. \n
1054
+ /// 11: Bits [127:96] of the parameter \a X are exracted.
1055
+ /// \returns An integer, whose lower 32 bits are selected from the 128-bit
1056
+ /// integer vector parameter and the remaining bits are assigned zeros.
1057
+ #define _mm_extract_epi32(X, N) \
1058
+ ((int)__builtin_ia32_vec_ext_v4si((__v4si)(__m128i)(X), (int)(N)))
1059
+
1060
+ /// Extracts a 64-bit element from the 128-bit integer vector of
1061
+ /// [2 x i64], using the immediate value parameter \a N as a selector.
1062
+ ///
1063
+ /// \headerfile <x86intrin.h>
1064
+ ///
1065
+ /// \code
1066
+ /// long long _mm_extract_epi64(__m128i X, const int N);
1067
+ /// \endcode
1068
+ ///
1069
+ /// This intrinsic corresponds to the <c> VPEXTRQ / PEXTRQ </c> instruction
1070
+ /// in 64-bit mode.
1071
+ ///
1072
+ /// \param X
1073
+ /// A 128-bit integer vector.
1074
+ /// \param N
1075
+ /// An immediate value. Bit [0] specifies which 64-bit vector element from
1076
+ /// the argument \a X to return. \n
1077
+ /// 0: Bits [63:0] are returned. \n
1078
+ /// 1: Bits [127:64] are returned. \n
1079
+ /// \returns A 64-bit integer.
1080
+ #define _mm_extract_epi64(X, N) \
1081
+ ((long long)__builtin_ia32_vec_ext_v2di((__v2di)(__m128i)(X), (int)(N)))
1082
+
1083
+ /* SSE4 128-bit Packed Integer Comparisons. */
1084
+ /// Tests whether the specified bits in a 128-bit integer vector are all
1085
+ /// zeros.
1086
+ ///
1087
+ /// \headerfile <x86intrin.h>
1088
+ ///
1089
+ /// This intrinsic corresponds to the <c> VPTEST / PTEST </c> instruction.
1090
+ ///
1091
+ /// \param __M
1092
+ /// A 128-bit integer vector containing the bits to be tested.
1093
+ /// \param __V
1094
+ /// A 128-bit integer vector selecting which bits to test in operand \a __M.
1095
+ /// \returns TRUE if the specified bits are all zeros; FALSE otherwise.
1096
+ static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
1097
+ _mm_testz_si128(__m128i __M, __m128i __V) {
1098
+ return __builtin_ia32_ptestz128((__v2di)__M, (__v2di)__V);
1099
+ }
1100
+
1101
+ /// Tests whether the specified bits in a 128-bit integer vector are all
1102
+ /// ones.
1103
+ ///
1104
+ /// \headerfile <x86intrin.h>
1105
+ ///
1106
+ /// This intrinsic corresponds to the <c> VPTEST / PTEST </c> instruction.
1107
+ ///
1108
+ /// \param __M
1109
+ /// A 128-bit integer vector containing the bits to be tested.
1110
+ /// \param __V
1111
+ /// A 128-bit integer vector selecting which bits to test in operand \a __M.
1112
+ /// \returns TRUE if the specified bits are all ones; FALSE otherwise.
1113
+ static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
1114
+ _mm_testc_si128(__m128i __M, __m128i __V) {
1115
+ return __builtin_ia32_ptestc128((__v2di)__M, (__v2di)__V);
1116
+ }
1117
+
1118
+ /// Tests whether the specified bits in a 128-bit integer vector are
1119
+ /// neither all zeros nor all ones.
1120
+ ///
1121
+ /// \headerfile <x86intrin.h>
1122
+ ///
1123
+ /// This intrinsic corresponds to the <c> VPTEST / PTEST </c> instruction.
1124
+ ///
1125
+ /// \param __M
1126
+ /// A 128-bit integer vector containing the bits to be tested.
1127
+ /// \param __V
1128
+ /// A 128-bit integer vector selecting which bits to test in operand \a __M.
1129
+ /// \returns TRUE if the specified bits are neither all zeros nor all ones;
1130
+ /// FALSE otherwise.
1131
+ static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
1132
+ _mm_testnzc_si128(__m128i __M, __m128i __V) {
1133
+ return __builtin_ia32_ptestnzc128((__v2di)__M, (__v2di)__V);
1134
+ }
1135
+
1136
+ /// Tests whether the specified bits in a 128-bit integer vector are all
1137
+ /// ones.
1138
+ ///
1139
+ /// \headerfile <x86intrin.h>
1140
+ ///
1141
+ /// \code
1142
+ /// int _mm_test_all_ones(__m128i V);
1143
+ /// \endcode
1144
+ ///
1145
+ /// This intrinsic corresponds to the <c> VPTEST / PTEST </c> instruction.
1146
+ ///
1147
+ /// \param V
1148
+ /// A 128-bit integer vector containing the bits to be tested.
1149
+ /// \returns TRUE if the bits specified in the operand are all set to 1; FALSE
1150
+ /// otherwise.
1151
+ #define _mm_test_all_ones(V) _mm_testc_si128((V), _mm_set1_epi32(-1))
1152
+
1153
+ /// Tests whether the specified bits in a 128-bit integer vector are
1154
+ /// neither all zeros nor all ones.
1155
+ ///
1156
+ /// \headerfile <x86intrin.h>
1157
+ ///
1158
+ /// \code
1159
+ /// int _mm_test_mix_ones_zeros(__m128i M, __m128i V);
1160
+ /// \endcode
1161
+ ///
1162
+ /// This intrinsic corresponds to the <c> VPTEST / PTEST </c> instruction.
1163
+ ///
1164
+ /// \param M
1165
+ /// A 128-bit integer vector containing the bits to be tested.
1166
+ /// \param V
1167
+ /// A 128-bit integer vector selecting which bits to test in operand \a M.
1168
+ /// \returns TRUE if the specified bits are neither all zeros nor all ones;
1169
+ /// FALSE otherwise.
1170
+ #define _mm_test_mix_ones_zeros(M, V) _mm_testnzc_si128((M), (V))
1171
+
1172
+ /// Tests whether the specified bits in a 128-bit integer vector are all
1173
+ /// zeros.
1174
+ ///
1175
+ /// \headerfile <x86intrin.h>
1176
+ ///
1177
+ /// \code
1178
+ /// int _mm_test_all_zeros(__m128i M, __m128i V);
1179
+ /// \endcode
1180
+ ///
1181
+ /// This intrinsic corresponds to the <c> VPTEST / PTEST </c> instruction.
1182
+ ///
1183
+ /// \param M
1184
+ /// A 128-bit integer vector containing the bits to be tested.
1185
+ /// \param V
1186
+ /// A 128-bit integer vector selecting which bits to test in operand \a M.
1187
+ /// \returns TRUE if the specified bits are all zeros; FALSE otherwise.
1188
+ #define _mm_test_all_zeros(M, V) _mm_testz_si128((M), (V))
1189
+
1190
+ /* SSE4 64-bit Packed Integer Comparisons. */
1191
+ /// Compares each of the corresponding 64-bit values of the 128-bit
1192
+ /// integer vectors for equality.
1193
+ ///
1194
+ /// Each comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
1195
+ ///
1196
+ /// \headerfile <x86intrin.h>
1197
+ ///
1198
+ /// This intrinsic corresponds to the <c> VPCMPEQQ / PCMPEQQ </c> instruction.
1199
+ ///
1200
+ /// \param __V1
1201
+ /// A 128-bit integer vector.
1202
+ /// \param __V2
1203
+ /// A 128-bit integer vector.
1204
+ /// \returns A 128-bit integer vector containing the comparison results.
1205
+ static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1206
+ _mm_cmpeq_epi64(__m128i __V1, __m128i __V2) {
1207
+ return (__m128i)((__v2di)__V1 == (__v2di)__V2);
1208
+ }
1209
+
1210
+ /* SSE4 Packed Integer Sign-Extension. */
1211
+ /// Sign-extends each of the lower eight 8-bit integer elements of a
1212
+ /// 128-bit vector of [16 x i8] to 16-bit values and returns them in a
1213
+ /// 128-bit vector of [8 x i16]. The upper eight elements of the input vector
1214
+ /// are unused.
1215
+ ///
1216
+ /// \headerfile <x86intrin.h>
1217
+ ///
1218
+ /// This intrinsic corresponds to the <c> VPMOVSXBW / PMOVSXBW </c> instruction.
1219
+ ///
1220
+ /// \param __V
1221
+ /// A 128-bit vector of [16 x i8]. The lower eight 8-bit elements are
1222
+ /// sign-extended to 16-bit values.
1223
+ /// \returns A 128-bit vector of [8 x i16] containing the sign-extended values.
1224
+ static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1225
+ _mm_cvtepi8_epi16(__m128i __V) {
1226
+ /* This function always performs a signed extension, but __v16qi is a char
1227
+ which may be signed or unsigned, so use __v16qs. */
1228
+ return (__m128i) __builtin_convertvector(
1229
+ __builtin_shufflevector((__v16qs)__V, (__v16qs)__V, 0, 1, 2, 3, 4, 5, 6,
1230
+ 7),
1231
+ __v8hi);
1232
+ }
1233
+
1234
+ /// Sign-extends each of the lower four 8-bit integer elements of a
1235
+ /// 128-bit vector of [16 x i8] to 32-bit values and returns them in a
1236
+ /// 128-bit vector of [4 x i32]. The upper twelve elements of the input
1237
+ /// vector are unused.
1238
+ ///
1239
+ /// \headerfile <x86intrin.h>
1240
+ ///
1241
+ /// This intrinsic corresponds to the <c> VPMOVSXBD / PMOVSXBD </c> instruction.
1242
+ ///
1243
+ /// \param __V
1244
+ /// A 128-bit vector of [16 x i8]. The lower four 8-bit elements are
1245
+ /// sign-extended to 32-bit values.
1246
+ /// \returns A 128-bit vector of [4 x i32] containing the sign-extended values.
1247
+ static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1248
+ _mm_cvtepi8_epi32(__m128i __V) {
1249
+ /* This function always performs a signed extension, but __v16qi is a char
1250
+ which may be signed or unsigned, so use __v16qs. */
1251
+ return (__m128i) __builtin_convertvector(
1252
+ __builtin_shufflevector((__v16qs)__V, (__v16qs)__V, 0, 1, 2, 3), __v4si);
1253
+ }
1254
+
1255
+ /// Sign-extends each of the lower two 8-bit integer elements of a
1256
+ /// 128-bit integer vector of [16 x i8] to 64-bit values and returns them in
1257
+ /// a 128-bit vector of [2 x i64]. The upper fourteen elements of the input
1258
+ /// vector are unused.
1259
+ ///
1260
+ /// \headerfile <x86intrin.h>
1261
+ ///
1262
+ /// This intrinsic corresponds to the <c> VPMOVSXBQ / PMOVSXBQ </c> instruction.
1263
+ ///
1264
+ /// \param __V
1265
+ /// A 128-bit vector of [16 x i8]. The lower two 8-bit elements are
1266
+ /// sign-extended to 64-bit values.
1267
+ /// \returns A 128-bit vector of [2 x i64] containing the sign-extended values.
1268
+ static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1269
+ _mm_cvtepi8_epi64(__m128i __V) {
1270
+ /* This function always performs a signed extension, but __v16qi is a char
1271
+ which may be signed or unsigned, so use __v16qs. */
1272
+ return (__m128i) __builtin_convertvector(
1273
+ __builtin_shufflevector((__v16qs)__V, (__v16qs)__V, 0, 1), __v2di);
1274
+ }
1275
+
1276
+ /// Sign-extends each of the lower four 16-bit integer elements of a
1277
+ /// 128-bit integer vector of [8 x i16] to 32-bit values and returns them in
1278
+ /// a 128-bit vector of [4 x i32]. The upper four elements of the input
1279
+ /// vector are unused.
1280
+ ///
1281
+ /// \headerfile <x86intrin.h>
1282
+ ///
1283
+ /// This intrinsic corresponds to the <c> VPMOVSXWD / PMOVSXWD </c> instruction.
1284
+ ///
1285
+ /// \param __V
1286
+ /// A 128-bit vector of [8 x i16]. The lower four 16-bit elements are
1287
+ /// sign-extended to 32-bit values.
1288
+ /// \returns A 128-bit vector of [4 x i32] containing the sign-extended values.
1289
+ static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1290
+ _mm_cvtepi16_epi32(__m128i __V) {
1291
+ return (__m128i) __builtin_convertvector(
1292
+ __builtin_shufflevector((__v8hi)__V, (__v8hi)__V, 0, 1, 2, 3), __v4si);
1293
+ }
1294
+
1295
+ /// Sign-extends each of the lower two 16-bit integer elements of a
1296
+ /// 128-bit integer vector of [8 x i16] to 64-bit values and returns them in
1297
+ /// a 128-bit vector of [2 x i64]. The upper six elements of the input
1298
+ /// vector are unused.
1299
+ ///
1300
+ /// \headerfile <x86intrin.h>
1301
+ ///
1302
+ /// This intrinsic corresponds to the <c> VPMOVSXWQ / PMOVSXWQ </c> instruction.
1303
+ ///
1304
+ /// \param __V
1305
+ /// A 128-bit vector of [8 x i16]. The lower two 16-bit elements are
1306
+ /// sign-extended to 64-bit values.
1307
+ /// \returns A 128-bit vector of [2 x i64] containing the sign-extended values.
1308
+ static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1309
+ _mm_cvtepi16_epi64(__m128i __V) {
1310
+ return (__m128i) __builtin_convertvector(
1311
+ __builtin_shufflevector((__v8hi)__V, (__v8hi)__V, 0, 1), __v2di);
1312
+ }
1313
+
1314
+ /// Sign-extends each of the lower two 32-bit integer elements of a
1315
+ /// 128-bit integer vector of [4 x i32] to 64-bit values and returns them in
1316
+ /// a 128-bit vector of [2 x i64]. The upper two elements of the input vector
1317
+ /// are unused.
1318
+ ///
1319
+ /// \headerfile <x86intrin.h>
1320
+ ///
1321
+ /// This intrinsic corresponds to the <c> VPMOVSXDQ / PMOVSXDQ </c> instruction.
1322
+ ///
1323
+ /// \param __V
1324
+ /// A 128-bit vector of [4 x i32]. The lower two 32-bit elements are
1325
+ /// sign-extended to 64-bit values.
1326
+ /// \returns A 128-bit vector of [2 x i64] containing the sign-extended values.
1327
+ static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1328
+ _mm_cvtepi32_epi64(__m128i __V) {
1329
+ return (__m128i) __builtin_convertvector(
1330
+ __builtin_shufflevector((__v4si)__V, (__v4si)__V, 0, 1), __v2di);
1331
+ }
1332
+
1333
+ /* SSE4 Packed Integer Zero-Extension. */
1334
+ /// Zero-extends each of the lower eight 8-bit integer elements of a
1335
+ /// 128-bit vector of [16 x i8] to 16-bit values and returns them in a
1336
+ /// 128-bit vector of [8 x i16]. The upper eight elements of the input vector
1337
+ /// are unused.
1338
+ ///
1339
+ /// \headerfile <x86intrin.h>
1340
+ ///
1341
+ /// This intrinsic corresponds to the <c> VPMOVZXBW / PMOVZXBW </c> instruction.
1342
+ ///
1343
+ /// \param __V
1344
+ /// A 128-bit vector of [16 x i8]. The lower eight 8-bit elements are
1345
+ /// zero-extended to 16-bit values.
1346
+ /// \returns A 128-bit vector of [8 x i16] containing the zero-extended values.
1347
+ static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1348
+ _mm_cvtepu8_epi16(__m128i __V) {
1349
+ return (__m128i) __builtin_convertvector(
1350
+ __builtin_shufflevector((__v16qu)__V, (__v16qu)__V, 0, 1, 2, 3, 4, 5, 6,
1351
+ 7),
1352
+ __v8hi);
1353
+ }
1354
+
1355
+ /// Zero-extends each of the lower four 8-bit integer elements of a
1356
+ /// 128-bit vector of [16 x i8] to 32-bit values and returns them in a
1357
+ /// 128-bit vector of [4 x i32]. The upper twelve elements of the input
1358
+ /// vector are unused.
1359
+ ///
1360
+ /// \headerfile <x86intrin.h>
1361
+ ///
1362
+ /// This intrinsic corresponds to the <c> VPMOVZXBD / PMOVZXBD </c> instruction.
1363
+ ///
1364
+ /// \param __V
1365
+ /// A 128-bit vector of [16 x i8]. The lower four 8-bit elements are
1366
+ /// zero-extended to 32-bit values.
1367
+ /// \returns A 128-bit vector of [4 x i32] containing the zero-extended values.
1368
+ static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1369
+ _mm_cvtepu8_epi32(__m128i __V) {
1370
+ return (__m128i) __builtin_convertvector(
1371
+ __builtin_shufflevector((__v16qu)__V, (__v16qu)__V, 0, 1, 2, 3), __v4si);
1372
+ }
1373
+
1374
+ /// Zero-extends each of the lower two 8-bit integer elements of a
1375
+ /// 128-bit integer vector of [16 x i8] to 64-bit values and returns them in
1376
+ /// a 128-bit vector of [2 x i64]. The upper fourteen elements of the input
1377
+ /// vector are unused.
1378
+ ///
1379
+ /// \headerfile <x86intrin.h>
1380
+ ///
1381
+ /// This intrinsic corresponds to the <c> VPMOVZXBQ / PMOVZXBQ </c> instruction.
1382
+ ///
1383
+ /// \param __V
1384
+ /// A 128-bit vector of [16 x i8]. The lower two 8-bit elements are
1385
+ /// zero-extended to 64-bit values.
1386
+ /// \returns A 128-bit vector of [2 x i64] containing the zero-extended values.
1387
+ static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1388
+ _mm_cvtepu8_epi64(__m128i __V) {
1389
+ return (__m128i) __builtin_convertvector(
1390
+ __builtin_shufflevector((__v16qu)__V, (__v16qu)__V, 0, 1), __v2di);
1391
+ }
1392
+
1393
+ /// Zero-extends each of the lower four 16-bit integer elements of a
1394
+ /// 128-bit integer vector of [8 x i16] to 32-bit values and returns them in
1395
+ /// a 128-bit vector of [4 x i32]. The upper four elements of the input
1396
+ /// vector are unused.
1397
+ ///
1398
+ /// \headerfile <x86intrin.h>
1399
+ ///
1400
+ /// This intrinsic corresponds to the <c> VPMOVZXWD / PMOVZXWD </c> instruction.
1401
+ ///
1402
+ /// \param __V
1403
+ /// A 128-bit vector of [8 x i16]. The lower four 16-bit elements are
1404
+ /// zero-extended to 32-bit values.
1405
+ /// \returns A 128-bit vector of [4 x i32] containing the zero-extended values.
1406
+ static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1407
+ _mm_cvtepu16_epi32(__m128i __V) {
1408
+ return (__m128i) __builtin_convertvector(
1409
+ __builtin_shufflevector((__v8hu)__V, (__v8hu)__V, 0, 1, 2, 3), __v4si);
1410
+ }
1411
+
1412
+ /// Zero-extends each of the lower two 16-bit integer elements of a
1413
+ /// 128-bit integer vector of [8 x i16] to 64-bit values and returns them in
1414
+ /// a 128-bit vector of [2 x i64]. The upper six elements of the input vector
1415
+ /// are unused.
1416
+ ///
1417
+ /// \headerfile <x86intrin.h>
1418
+ ///
1419
+ /// This intrinsic corresponds to the <c> VPMOVZXWQ / PMOVZXWQ </c> instruction.
1420
+ ///
1421
+ /// \param __V
1422
+ /// A 128-bit vector of [8 x i16]. The lower two 16-bit elements are
1423
+ /// zero-extended to 64-bit values.
1424
+ /// \returns A 128-bit vector of [2 x i64] containing the zero-extended values.
1425
+ static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1426
+ _mm_cvtepu16_epi64(__m128i __V) {
1427
+ return (__m128i) __builtin_convertvector(
1428
+ __builtin_shufflevector((__v8hu)__V, (__v8hu)__V, 0, 1), __v2di);
1429
+ }
1430
+
1431
+ /// Zero-extends each of the lower two 32-bit integer elements of a
1432
+ /// 128-bit integer vector of [4 x i32] to 64-bit values and returns them in
1433
+ /// a 128-bit vector of [2 x i64]. The upper two elements of the input vector
1434
+ /// are unused.
1435
+ ///
1436
+ /// \headerfile <x86intrin.h>
1437
+ ///
1438
+ /// This intrinsic corresponds to the <c> VPMOVZXDQ / PMOVZXDQ </c> instruction.
1439
+ ///
1440
+ /// \param __V
1441
+ /// A 128-bit vector of [4 x i32]. The lower two 32-bit elements are
1442
+ /// zero-extended to 64-bit values.
1443
+ /// \returns A 128-bit vector of [2 x i64] containing the zero-extended values.
1444
+ static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1445
+ _mm_cvtepu32_epi64(__m128i __V) {
1446
+ return (__m128i) __builtin_convertvector(
1447
+ __builtin_shufflevector((__v4su)__V, (__v4su)__V, 0, 1), __v2di);
1448
+ }
1449
+
1450
+ /* SSE4 Pack with Unsigned Saturation. */
1451
+ /// Converts, with saturation, 32-bit signed integers from both 128-bit integer
1452
+ /// vector operands into 16-bit unsigned integers, and returns the packed
1453
+ /// result.
1454
+ ///
1455
+ /// Values greater than 0xFFFF are saturated to 0xFFFF. Values less than
1456
+ /// 0x0000 are saturated to 0x0000.
1457
+ ///
1458
+ /// \headerfile <x86intrin.h>
1459
+ ///
1460
+ /// This intrinsic corresponds to the <c> VPACKUSDW / PACKUSDW </c> instruction.
1461
+ ///
1462
+ /// \param __V1
1463
+ /// A 128-bit vector of [4 x i32]. The converted [4 x i16] values are
1464
+ /// written to the lower 64 bits of the result.
1465
+ /// \param __V2
1466
+ /// A 128-bit vector of [4 x i32]. The converted [4 x i16] values are
1467
+ /// written to the higher 64 bits of the result.
1468
+ /// \returns A 128-bit vector of [8 x i16] containing the converted values.
1469
+ static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1470
+ _mm_packus_epi32(__m128i __V1, __m128i __V2) {
1471
+ return (__m128i)__builtin_ia32_packusdw128((__v4si)__V1, (__v4si)__V2);
1472
+ }
1473
+
1474
+ /* SSE4 Multiple Packed Sums of Absolute Difference. */
1475
+ /// Subtracts 8-bit unsigned integer values and computes the absolute
1476
+ /// values of the differences to the corresponding bits in the destination.
1477
+ /// Then sums of the absolute differences are returned according to the bit
1478
+ /// fields in the immediate operand.
1479
+ ///
1480
+ /// \headerfile <x86intrin.h>
1481
+ ///
1482
+ /// \code
1483
+ /// __m128i _mm_mpsadbw_epu8(__m128i X, __m128i Y, const int M);
1484
+ /// \endcode
1485
+ ///
1486
+ /// This intrinsic corresponds to the <c> VMPSADBW / MPSADBW </c> instruction.
1487
+ ///
1488
+ /// \param X
1489
+ /// A 128-bit vector of [16 x i8].
1490
+ /// \param Y
1491
+ /// A 128-bit vector of [16 x i8].
1492
+ /// \param M
1493
+ /// An 8-bit immediate operand specifying how the absolute differences are to
1494
+ /// be calculated, according to the following algorithm:
1495
+ /// \code
1496
+ /// // M2 represents bit 2 of the immediate operand
1497
+ /// // M10 represents bits [1:0] of the immediate operand
1498
+ /// i = M2 * 4;
1499
+ /// j = M10 * 4;
1500
+ /// for (k = 0; k < 8; k = k + 1) {
1501
+ /// d0 = abs(X[i + k + 0] - Y[j + 0]);
1502
+ /// d1 = abs(X[i + k + 1] - Y[j + 1]);
1503
+ /// d2 = abs(X[i + k + 2] - Y[j + 2]);
1504
+ /// d3 = abs(X[i + k + 3] - Y[j + 3]);
1505
+ /// r[k] = d0 + d1 + d2 + d3;
1506
+ /// }
1507
+ /// \endcode
1508
+ /// \returns A 128-bit integer vector containing the sums of the sets of
1509
+ /// absolute differences between both operands.
1510
+ #define _mm_mpsadbw_epu8(X, Y, M) \
1511
+ ((__m128i)__builtin_ia32_mpsadbw128((__v16qi)(__m128i)(X), \
1512
+ (__v16qi)(__m128i)(Y), (M)))
1513
+
1514
+ /// Finds the minimum unsigned 16-bit element in the input 128-bit
1515
+ /// vector of [8 x u16] and returns it and along with its index.
1516
+ ///
1517
+ /// \headerfile <x86intrin.h>
1518
+ ///
1519
+ /// This intrinsic corresponds to the <c> VPHMINPOSUW / PHMINPOSUW </c>
1520
+ /// instruction.
1521
+ ///
1522
+ /// \param __V
1523
+ /// A 128-bit vector of [8 x u16].
1524
+ /// \returns A 128-bit value where bits [15:0] contain the minimum value found
1525
+ /// in parameter \a __V, bits [18:16] contain the index of the minimum value
1526
+ /// and the remaining bits are set to 0.
1527
+ static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
1528
+ _mm_minpos_epu16(__m128i __V) {
1529
+ return (__m128i)__builtin_ia32_phminposuw128((__v8hi)__V);
1530
+ }
1531
+
1532
+ /* Handle the sse4.2 definitions here. */
1533
+
1534
+ /* These definitions are normally in nmmintrin.h, but gcc puts them in here
1535
+ so we'll do the same. */
1536
+
1537
+ #undef __DEFAULT_FN_ATTRS
1538
+ #undef __DEFAULT_FN_ATTRS_CONSTEXPR
1539
+ #define __DEFAULT_FN_ATTRS \
1540
+ __attribute__((__always_inline__, __nodebug__, __target__("sse4.2")))
1541
+
1542
+ #if defined(__cplusplus) && (__cplusplus >= 201103L)
1543
+ #define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr
1544
+ #else
1545
+ #define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS
1546
+ #endif
1547
+
1548
+ /* These specify the type of data that we're comparing. */
1549
+ #define _SIDD_UBYTE_OPS 0x00
1550
+ #define _SIDD_UWORD_OPS 0x01
1551
+ #define _SIDD_SBYTE_OPS 0x02
1552
+ #define _SIDD_SWORD_OPS 0x03
1553
+
1554
+ /* These specify the type of comparison operation. */
1555
+ #define _SIDD_CMP_EQUAL_ANY 0x00
1556
+ #define _SIDD_CMP_RANGES 0x04
1557
+ #define _SIDD_CMP_EQUAL_EACH 0x08
1558
+ #define _SIDD_CMP_EQUAL_ORDERED 0x0c
1559
+
1560
+ /* These macros specify the polarity of the operation. */
1561
+ #define _SIDD_POSITIVE_POLARITY 0x00
1562
+ #define _SIDD_NEGATIVE_POLARITY 0x10
1563
+ #define _SIDD_MASKED_POSITIVE_POLARITY 0x20
1564
+ #define _SIDD_MASKED_NEGATIVE_POLARITY 0x30
1565
+
1566
+ /* These macros are used in _mm_cmpXstri() to specify the return. */
1567
+ #define _SIDD_LEAST_SIGNIFICANT 0x00
1568
+ #define _SIDD_MOST_SIGNIFICANT 0x40
1569
+
1570
+ /* These macros are used in _mm_cmpXstri() to specify the return. */
1571
+ #define _SIDD_BIT_MASK 0x00
1572
+ #define _SIDD_UNIT_MASK 0x40
1573
+
1574
+ /* SSE4.2 Packed Comparison Intrinsics. */
1575
+ /// Uses the immediate operand \a M to perform a comparison of string
1576
+ /// data with implicitly defined lengths that is contained in source operands
1577
+ /// \a A and \a B. Returns a 128-bit integer vector representing the result
1578
+ /// mask of the comparison.
1579
+ ///
1580
+ /// \headerfile <x86intrin.h>
1581
+ ///
1582
+ /// \code
1583
+ /// __m128i _mm_cmpistrm(__m128i A, __m128i B, const int M);
1584
+ /// \endcode
1585
+ ///
1586
+ /// This intrinsic corresponds to the <c> VPCMPISTRM / PCMPISTRM </c>
1587
+ /// instruction.
1588
+ ///
1589
+ /// \param A
1590
+ /// A 128-bit integer vector containing one of the source operands to be
1591
+ /// compared.
1592
+ /// \param B
1593
+ /// A 128-bit integer vector containing one of the source operands to be
1594
+ /// compared.
1595
+ /// \param M
1596
+ /// An 8-bit immediate operand specifying whether the characters are bytes or
1597
+ /// words, the type of comparison to perform, and the format of the return
1598
+ /// value. \n
1599
+ /// Bits [1:0]: Determine source data format. \n
1600
+ /// 00: 16 unsigned bytes \n
1601
+ /// 01: 8 unsigned words \n
1602
+ /// 10: 16 signed bytes \n
1603
+ /// 11: 8 signed words \n
1604
+ /// Bits [3:2]: Determine comparison type and aggregation method. \n
1605
+ /// 00: Subset: Each character in \a B is compared for equality with all
1606
+ /// the characters in \a A. \n
1607
+ /// 01: Ranges: Each character in \a B is compared to \a A. The comparison
1608
+ /// basis is greater than or equal for even-indexed elements in \a A,
1609
+ /// and less than or equal for odd-indexed elements in \a A. \n
1610
+ /// 10: Match: Compare each pair of corresponding characters in \a A and
1611
+ /// \a B for equality. \n
1612
+ /// 11: Substring: Search \a B for substring matches of \a A. \n
1613
+ /// Bits [5:4]: Determine whether to perform a one's complement on the bit
1614
+ /// mask of the comparison results. \n
1615
+ /// 00: No effect. \n
1616
+ /// 01: Negate the bit mask. \n
1617
+ /// 10: No effect. \n
1618
+ /// 11: Negate the bit mask only for bits with an index less than or equal
1619
+ /// to the size of \a A or \a B. \n
1620
+ /// Bit [6]: Determines whether the result is zero-extended or expanded to 16
1621
+ /// bytes. \n
1622
+ /// 0: The result is zero-extended to 16 bytes. \n
1623
+ /// 1: The result is expanded to 16 bytes (this expansion is performed by
1624
+ /// repeating each bit 8 or 16 times).
1625
+ /// \returns Returns a 128-bit integer vector representing the result mask of
1626
+ /// the comparison.
1627
+ #define _mm_cmpistrm(A, B, M) \
1628
+ ((__m128i)__builtin_ia32_pcmpistrm128((__v16qi)(__m128i)(A), \
1629
+ (__v16qi)(__m128i)(B), (int)(M)))
1630
+
1631
+ /// Uses the immediate operand \a M to perform a comparison of string
1632
+ /// data with implicitly defined lengths that is contained in source operands
1633
+ /// \a A and \a B. Returns an integer representing the result index of the
1634
+ /// comparison.
1635
+ ///
1636
+ /// \headerfile <x86intrin.h>
1637
+ ///
1638
+ /// \code
1639
+ /// int _mm_cmpistri(__m128i A, __m128i B, const int M);
1640
+ /// \endcode
1641
+ ///
1642
+ /// This intrinsic corresponds to the <c> VPCMPISTRI / PCMPISTRI </c>
1643
+ /// instruction.
1644
+ ///
1645
+ /// \param A
1646
+ /// A 128-bit integer vector containing one of the source operands to be
1647
+ /// compared.
1648
+ /// \param B
1649
+ /// A 128-bit integer vector containing one of the source operands to be
1650
+ /// compared.
1651
+ /// \param M
1652
+ /// An 8-bit immediate operand specifying whether the characters are bytes or
1653
+ /// words, the type of comparison to perform, and the format of the return
1654
+ /// value. \n
1655
+ /// Bits [1:0]: Determine source data format. \n
1656
+ /// 00: 16 unsigned bytes \n
1657
+ /// 01: 8 unsigned words \n
1658
+ /// 10: 16 signed bytes \n
1659
+ /// 11: 8 signed words \n
1660
+ /// Bits [3:2]: Determine comparison type and aggregation method. \n
1661
+ /// 00: Subset: Each character in \a B is compared for equality with all
1662
+ /// the characters in \a A. \n
1663
+ /// 01: Ranges: Each character in \a B is compared to \a A. The comparison
1664
+ /// basis is greater than or equal for even-indexed elements in \a A,
1665
+ /// and less than or equal for odd-indexed elements in \a A. \n
1666
+ /// 10: Match: Compare each pair of corresponding characters in \a A and
1667
+ /// \a B for equality. \n
1668
+ /// 11: Substring: Search B for substring matches of \a A. \n
1669
+ /// Bits [5:4]: Determine whether to perform a one's complement on the bit
1670
+ /// mask of the comparison results. \n
1671
+ /// 00: No effect. \n
1672
+ /// 01: Negate the bit mask. \n
1673
+ /// 10: No effect. \n
1674
+ /// 11: Negate the bit mask only for bits with an index less than or equal
1675
+ /// to the size of \a A or \a B. \n
1676
+ /// Bit [6]: Determines whether the index of the lowest set bit or the
1677
+ /// highest set bit is returned. \n
1678
+ /// 0: The index of the least significant set bit. \n
1679
+ /// 1: The index of the most significant set bit. \n
1680
+ /// \returns Returns an integer representing the result index of the comparison.
1681
+ #define _mm_cmpistri(A, B, M) \
1682
+ ((int)__builtin_ia32_pcmpistri128((__v16qi)(__m128i)(A), \
1683
+ (__v16qi)(__m128i)(B), (int)(M)))
1684
+
1685
+ /// Uses the immediate operand \a M to perform a comparison of string
1686
+ /// data with explicitly defined lengths that is contained in source operands
1687
+ /// \a A and \a B. Returns a 128-bit integer vector representing the result
1688
+ /// mask of the comparison.
1689
+ ///
1690
+ /// \headerfile <x86intrin.h>
1691
+ ///
1692
+ /// \code
1693
+ /// __m128i _mm_cmpestrm(__m128i A, int LA, __m128i B, int LB, const int M);
1694
+ /// \endcode
1695
+ ///
1696
+ /// This intrinsic corresponds to the <c> VPCMPESTRM / PCMPESTRM </c>
1697
+ /// instruction.
1698
+ ///
1699
+ /// \param A
1700
+ /// A 128-bit integer vector containing one of the source operands to be
1701
+ /// compared.
1702
+ /// \param LA
1703
+ /// An integer that specifies the length of the string in \a A.
1704
+ /// \param B
1705
+ /// A 128-bit integer vector containing one of the source operands to be
1706
+ /// compared.
1707
+ /// \param LB
1708
+ /// An integer that specifies the length of the string in \a B.
1709
+ /// \param M
1710
+ /// An 8-bit immediate operand specifying whether the characters are bytes or
1711
+ /// words, the type of comparison to perform, and the format of the return
1712
+ /// value. \n
1713
+ /// Bits [1:0]: Determine source data format. \n
1714
+ /// 00: 16 unsigned bytes \n
1715
+ /// 01: 8 unsigned words \n
1716
+ /// 10: 16 signed bytes \n
1717
+ /// 11: 8 signed words \n
1718
+ /// Bits [3:2]: Determine comparison type and aggregation method. \n
1719
+ /// 00: Subset: Each character in \a B is compared for equality with all
1720
+ /// the characters in \a A. \n
1721
+ /// 01: Ranges: Each character in \a B is compared to \a A. The comparison
1722
+ /// basis is greater than or equal for even-indexed elements in \a A,
1723
+ /// and less than or equal for odd-indexed elements in \a A. \n
1724
+ /// 10: Match: Compare each pair of corresponding characters in \a A and
1725
+ /// \a B for equality. \n
1726
+ /// 11: Substring: Search \a B for substring matches of \a A. \n
1727
+ /// Bits [5:4]: Determine whether to perform a one's complement on the bit
1728
+ /// mask of the comparison results. \n
1729
+ /// 00: No effect. \n
1730
+ /// 01: Negate the bit mask. \n
1731
+ /// 10: No effect. \n
1732
+ /// 11: Negate the bit mask only for bits with an index less than or equal
1733
+ /// to the size of \a A or \a B. \n
1734
+ /// Bit [6]: Determines whether the result is zero-extended or expanded to 16
1735
+ /// bytes. \n
1736
+ /// 0: The result is zero-extended to 16 bytes. \n
1737
+ /// 1: The result is expanded to 16 bytes (this expansion is performed by
1738
+ /// repeating each bit 8 or 16 times). \n
1739
+ /// \returns Returns a 128-bit integer vector representing the result mask of
1740
+ /// the comparison.
1741
+ #define _mm_cmpestrm(A, LA, B, LB, M) \
1742
+ ((__m128i)__builtin_ia32_pcmpestrm128((__v16qi)(__m128i)(A), (int)(LA), \
1743
+ (__v16qi)(__m128i)(B), (int)(LB), \
1744
+ (int)(M)))
1745
+
1746
+ /// Uses the immediate operand \a M to perform a comparison of string
1747
+ /// data with explicitly defined lengths that is contained in source operands
1748
+ /// \a A and \a B. Returns an integer representing the result index of the
1749
+ /// comparison.
1750
+ ///
1751
+ /// \headerfile <x86intrin.h>
1752
+ ///
1753
+ /// \code
1754
+ /// int _mm_cmpestri(__m128i A, int LA, __m128i B, int LB, const int M);
1755
+ /// \endcode
1756
+ ///
1757
+ /// This intrinsic corresponds to the <c> VPCMPESTRI / PCMPESTRI </c>
1758
+ /// instruction.
1759
+ ///
1760
+ /// \param A
1761
+ /// A 128-bit integer vector containing one of the source operands to be
1762
+ /// compared.
1763
+ /// \param LA
1764
+ /// An integer that specifies the length of the string in \a A.
1765
+ /// \param B
1766
+ /// A 128-bit integer vector containing one of the source operands to be
1767
+ /// compared.
1768
+ /// \param LB
1769
+ /// An integer that specifies the length of the string in \a B.
1770
+ /// \param M
1771
+ /// An 8-bit immediate operand specifying whether the characters are bytes or
1772
+ /// words, the type of comparison to perform, and the format of the return
1773
+ /// value. \n
1774
+ /// Bits [1:0]: Determine source data format. \n
1775
+ /// 00: 16 unsigned bytes \n
1776
+ /// 01: 8 unsigned words \n
1777
+ /// 10: 16 signed bytes \n
1778
+ /// 11: 8 signed words \n
1779
+ /// Bits [3:2]: Determine comparison type and aggregation method. \n
1780
+ /// 00: Subset: Each character in \a B is compared for equality with all
1781
+ /// the characters in \a A. \n
1782
+ /// 01: Ranges: Each character in \a B is compared to \a A. The comparison
1783
+ /// basis is greater than or equal for even-indexed elements in \a A,
1784
+ /// and less than or equal for odd-indexed elements in \a A. \n
1785
+ /// 10: Match: Compare each pair of corresponding characters in \a A and
1786
+ /// \a B for equality. \n
1787
+ /// 11: Substring: Search B for substring matches of \a A. \n
1788
+ /// Bits [5:4]: Determine whether to perform a one's complement on the bit
1789
+ /// mask of the comparison results. \n
1790
+ /// 00: No effect. \n
1791
+ /// 01: Negate the bit mask. \n
1792
+ /// 10: No effect. \n
1793
+ /// 11: Negate the bit mask only for bits with an index less than or equal
1794
+ /// to the size of \a A or \a B. \n
1795
+ /// Bit [6]: Determines whether the index of the lowest set bit or the
1796
+ /// highest set bit is returned. \n
1797
+ /// 0: The index of the least significant set bit. \n
1798
+ /// 1: The index of the most significant set bit. \n
1799
+ /// \returns Returns an integer representing the result index of the comparison.
1800
+ #define _mm_cmpestri(A, LA, B, LB, M) \
1801
+ ((int)__builtin_ia32_pcmpestri128((__v16qi)(__m128i)(A), (int)(LA), \
1802
+ (__v16qi)(__m128i)(B), (int)(LB), \
1803
+ (int)(M)))
1804
+
1805
+ /* SSE4.2 Packed Comparison Intrinsics and EFlag Reading. */
1806
+ /// Uses the immediate operand \a M to perform a comparison of string
1807
+ /// data with implicitly defined lengths that is contained in source operands
1808
+ /// \a A and \a B. Returns 1 if the bit mask is zero and the length of the
1809
+ /// string in \a B is the maximum, otherwise, returns 0.
1810
+ ///
1811
+ /// \headerfile <x86intrin.h>
1812
+ ///
1813
+ /// \code
1814
+ /// int _mm_cmpistra(__m128i A, __m128i B, const int M);
1815
+ /// \endcode
1816
+ ///
1817
+ /// This intrinsic corresponds to the <c> VPCMPISTRI / PCMPISTRI </c>
1818
+ /// instruction.
1819
+ ///
1820
+ /// \param A
1821
+ /// A 128-bit integer vector containing one of the source operands to be
1822
+ /// compared.
1823
+ /// \param B
1824
+ /// A 128-bit integer vector containing one of the source operands to be
1825
+ /// compared.
1826
+ /// \param M
1827
+ /// An 8-bit immediate operand specifying whether the characters are bytes or
1828
+ /// words and the type of comparison to perform. \n
1829
+ /// Bits [1:0]: Determine source data format. \n
1830
+ /// 00: 16 unsigned bytes \n
1831
+ /// 01: 8 unsigned words \n
1832
+ /// 10: 16 signed bytes \n
1833
+ /// 11: 8 signed words \n
1834
+ /// Bits [3:2]: Determine comparison type and aggregation method. \n
1835
+ /// 00: Subset: Each character in \a B is compared for equality with all
1836
+ /// the characters in \a A. \n
1837
+ /// 01: Ranges: Each character in \a B is compared to \a A. The comparison
1838
+ /// basis is greater than or equal for even-indexed elements in \a A,
1839
+ /// and less than or equal for odd-indexed elements in \a A. \n
1840
+ /// 10: Match: Compare each pair of corresponding characters in \a A and
1841
+ /// \a B for equality. \n
1842
+ /// 11: Substring: Search \a B for substring matches of \a A. \n
1843
+ /// Bits [5:4]: Determine whether to perform a one's complement on the bit
1844
+ /// mask of the comparison results. \n
1845
+ /// 00: No effect. \n
1846
+ /// 01: Negate the bit mask. \n
1847
+ /// 10: No effect. \n
1848
+ /// 11: Negate the bit mask only for bits with an index less than or equal
1849
+ /// to the size of \a A or \a B. \n
1850
+ /// \returns Returns 1 if the bit mask is zero and the length of the string in
1851
+ /// \a B is the maximum; otherwise, returns 0.
1852
+ #define _mm_cmpistra(A, B, M) \
1853
+ ((int)__builtin_ia32_pcmpistria128((__v16qi)(__m128i)(A), \
1854
+ (__v16qi)(__m128i)(B), (int)(M)))
1855
+
1856
+ /// Uses the immediate operand \a M to perform a comparison of string
1857
+ /// data with implicitly defined lengths that is contained in source operands
1858
+ /// \a A and \a B. Returns 1 if the bit mask is non-zero, otherwise, returns
1859
+ /// 0.
1860
+ ///
1861
+ /// \headerfile <x86intrin.h>
1862
+ ///
1863
+ /// \code
1864
+ /// int _mm_cmpistrc(__m128i A, __m128i B, const int M);
1865
+ /// \endcode
1866
+ ///
1867
+ /// This intrinsic corresponds to the <c> VPCMPISTRI / PCMPISTRI </c>
1868
+ /// instruction.
1869
+ ///
1870
+ /// \param A
1871
+ /// A 128-bit integer vector containing one of the source operands to be
1872
+ /// compared.
1873
+ /// \param B
1874
+ /// A 128-bit integer vector containing one of the source operands to be
1875
+ /// compared.
1876
+ /// \param M
1877
+ /// An 8-bit immediate operand specifying whether the characters are bytes or
1878
+ /// words and the type of comparison to perform. \n
1879
+ /// Bits [1:0]: Determine source data format. \n
1880
+ /// 00: 16 unsigned bytes \n
1881
+ /// 01: 8 unsigned words \n
1882
+ /// 10: 16 signed bytes \n
1883
+ /// 11: 8 signed words \n
1884
+ /// Bits [3:2]: Determine comparison type and aggregation method. \n
1885
+ /// 00: Subset: Each character in \a B is compared for equality with all
1886
+ /// the characters in \a A. \n
1887
+ /// 01: Ranges: Each character in \a B is compared to \a A. The comparison
1888
+ /// basis is greater than or equal for even-indexed elements in \a A,
1889
+ /// and less than or equal for odd-indexed elements in \a A. \n
1890
+ /// 10: Match: Compare each pair of corresponding characters in \a A and
1891
+ /// \a B for equality. \n
1892
+ /// 11: Substring: Search B for substring matches of \a A. \n
1893
+ /// Bits [5:4]: Determine whether to perform a one's complement on the bit
1894
+ /// mask of the comparison results. \n
1895
+ /// 00: No effect. \n
1896
+ /// 01: Negate the bit mask. \n
1897
+ /// 10: No effect. \n
1898
+ /// 11: Negate the bit mask only for bits with an index less than or equal
1899
+ /// to the size of \a A or \a B.
1900
+ /// \returns Returns 1 if the bit mask is non-zero, otherwise, returns 0.
1901
+ #define _mm_cmpistrc(A, B, M) \
1902
+ ((int)__builtin_ia32_pcmpistric128((__v16qi)(__m128i)(A), \
1903
+ (__v16qi)(__m128i)(B), (int)(M)))
1904
+
1905
+ /// Uses the immediate operand \a M to perform a comparison of string
1906
+ /// data with implicitly defined lengths that is contained in source operands
1907
+ /// \a A and \a B. Returns bit 0 of the resulting bit mask.
1908
+ ///
1909
+ /// \headerfile <x86intrin.h>
1910
+ ///
1911
+ /// \code
1912
+ /// int _mm_cmpistro(__m128i A, __m128i B, const int M);
1913
+ /// \endcode
1914
+ ///
1915
+ /// This intrinsic corresponds to the <c> VPCMPISTRI / PCMPISTRI </c>
1916
+ /// instruction.
1917
+ ///
1918
+ /// \param A
1919
+ /// A 128-bit integer vector containing one of the source operands to be
1920
+ /// compared.
1921
+ /// \param B
1922
+ /// A 128-bit integer vector containing one of the source operands to be
1923
+ /// compared.
1924
+ /// \param M
1925
+ /// An 8-bit immediate operand specifying whether the characters are bytes or
1926
+ /// words and the type of comparison to perform. \n
1927
+ /// Bits [1:0]: Determine source data format. \n
1928
+ /// 00: 16 unsigned bytes \n
1929
+ /// 01: 8 unsigned words \n
1930
+ /// 10: 16 signed bytes \n
1931
+ /// 11: 8 signed words \n
1932
+ /// Bits [3:2]: Determine comparison type and aggregation method. \n
1933
+ /// 00: Subset: Each character in \a B is compared for equality with all
1934
+ /// the characters in \a A. \n
1935
+ /// 01: Ranges: Each character in \a B is compared to \a A. The comparison
1936
+ /// basis is greater than or equal for even-indexed elements in \a A,
1937
+ /// and less than or equal for odd-indexed elements in \a A. \n
1938
+ /// 10: Match: Compare each pair of corresponding characters in \a A and
1939
+ /// \a B for equality. \n
1940
+ /// 11: Substring: Search B for substring matches of \a A. \n
1941
+ /// Bits [5:4]: Determine whether to perform a one's complement on the bit
1942
+ /// mask of the comparison results. \n
1943
+ /// 00: No effect. \n
1944
+ /// 01: Negate the bit mask. \n
1945
+ /// 10: No effect. \n
1946
+ /// 11: Negate the bit mask only for bits with an index less than or equal
1947
+ /// to the size of \a A or \a B. \n
1948
+ /// \returns Returns bit 0 of the resulting bit mask.
1949
+ #define _mm_cmpistro(A, B, M) \
1950
+ ((int)__builtin_ia32_pcmpistrio128((__v16qi)(__m128i)(A), \
1951
+ (__v16qi)(__m128i)(B), (int)(M)))
1952
+
1953
+ /// Uses the immediate operand \a M to perform a comparison of string
1954
+ /// data with implicitly defined lengths that is contained in source operands
1955
+ /// \a A and \a B. Returns 1 if the length of the string in \a A is less than
1956
+ /// the maximum, otherwise, returns 0.
1957
+ ///
1958
+ /// \headerfile <x86intrin.h>
1959
+ ///
1960
+ /// \code
1961
+ /// int _mm_cmpistrs(__m128i A, __m128i B, const int M);
1962
+ /// \endcode
1963
+ ///
1964
+ /// This intrinsic corresponds to the <c> VPCMPISTRI / PCMPISTRI </c>
1965
+ /// instruction.
1966
+ ///
1967
+ /// \param A
1968
+ /// A 128-bit integer vector containing one of the source operands to be
1969
+ /// compared.
1970
+ /// \param B
1971
+ /// A 128-bit integer vector containing one of the source operands to be
1972
+ /// compared.
1973
+ /// \param M
1974
+ /// An 8-bit immediate operand specifying whether the characters are bytes or
1975
+ /// words and the type of comparison to perform. \n
1976
+ /// Bits [1:0]: Determine source data format. \n
1977
+ /// 00: 16 unsigned bytes \n
1978
+ /// 01: 8 unsigned words \n
1979
+ /// 10: 16 signed bytes \n
1980
+ /// 11: 8 signed words \n
1981
+ /// Bits [3:2]: Determine comparison type and aggregation method. \n
1982
+ /// 00: Subset: Each character in \a B is compared for equality with all
1983
+ /// the characters in \a A. \n
1984
+ /// 01: Ranges: Each character in \a B is compared to \a A. The comparison
1985
+ /// basis is greater than or equal for even-indexed elements in \a A,
1986
+ /// and less than or equal for odd-indexed elements in \a A. \n
1987
+ /// 10: Match: Compare each pair of corresponding characters in \a A and
1988
+ /// \a B for equality. \n
1989
+ /// 11: Substring: Search \a B for substring matches of \a A. \n
1990
+ /// Bits [5:4]: Determine whether to perform a one's complement on the bit
1991
+ /// mask of the comparison results. \n
1992
+ /// 00: No effect. \n
1993
+ /// 01: Negate the bit mask. \n
1994
+ /// 10: No effect. \n
1995
+ /// 11: Negate the bit mask only for bits with an index less than or equal
1996
+ /// to the size of \a A or \a B. \n
1997
+ /// \returns Returns 1 if the length of the string in \a A is less than the
1998
+ /// maximum, otherwise, returns 0.
1999
+ #define _mm_cmpistrs(A, B, M) \
2000
+ ((int)__builtin_ia32_pcmpistris128((__v16qi)(__m128i)(A), \
2001
+ (__v16qi)(__m128i)(B), (int)(M)))
2002
+
2003
+ /// Uses the immediate operand \a M to perform a comparison of string
2004
+ /// data with implicitly defined lengths that is contained in source operands
2005
+ /// \a A and \a B. Returns 1 if the length of the string in \a B is less than
2006
+ /// the maximum, otherwise, returns 0.
2007
+ ///
2008
+ /// \headerfile <x86intrin.h>
2009
+ ///
2010
+ /// \code
2011
+ /// int _mm_cmpistrz(__m128i A, __m128i B, const int M);
2012
+ /// \endcode
2013
+ ///
2014
+ /// This intrinsic corresponds to the <c> VPCMPISTRI / PCMPISTRI </c>
2015
+ /// instruction.
2016
+ ///
2017
+ /// \param A
2018
+ /// A 128-bit integer vector containing one of the source operands to be
2019
+ /// compared.
2020
+ /// \param B
2021
+ /// A 128-bit integer vector containing one of the source operands to be
2022
+ /// compared.
2023
+ /// \param M
2024
+ /// An 8-bit immediate operand specifying whether the characters are bytes or
2025
+ /// words and the type of comparison to perform. \n
2026
+ /// Bits [1:0]: Determine source data format. \n
2027
+ /// 00: 16 unsigned bytes \n
2028
+ /// 01: 8 unsigned words \n
2029
+ /// 10: 16 signed bytes \n
2030
+ /// 11: 8 signed words \n
2031
+ /// Bits [3:2]: Determine comparison type and aggregation method. \n
2032
+ /// 00: Subset: Each character in \a B is compared for equality with all
2033
+ /// the characters in \a A. \n
2034
+ /// 01: Ranges: Each character in \a B is compared to \a A. The comparison
2035
+ /// basis is greater than or equal for even-indexed elements in \a A,
2036
+ /// and less than or equal for odd-indexed elements in \a A. \n
2037
+ /// 10: Match: Compare each pair of corresponding characters in \a A and
2038
+ /// \a B for equality. \n
2039
+ /// 11: Substring: Search \a B for substring matches of \a A. \n
2040
+ /// Bits [5:4]: Determine whether to perform a one's complement on the bit
2041
+ /// mask of the comparison results. \n
2042
+ /// 00: No effect. \n
2043
+ /// 01: Negate the bit mask. \n
2044
+ /// 10: No effect. \n
2045
+ /// 11: Negate the bit mask only for bits with an index less than or equal
2046
+ /// to the size of \a A or \a B.
2047
+ /// \returns Returns 1 if the length of the string in \a B is less than the
2048
+ /// maximum, otherwise, returns 0.
2049
+ #define _mm_cmpistrz(A, B, M) \
2050
+ ((int)__builtin_ia32_pcmpistriz128((__v16qi)(__m128i)(A), \
2051
+ (__v16qi)(__m128i)(B), (int)(M)))
2052
+
2053
+ /// Uses the immediate operand \a M to perform a comparison of string
2054
+ /// data with explicitly defined lengths that is contained in source operands
2055
+ /// \a A and \a B. Returns 1 if the bit mask is zero and the length of the
2056
+ /// string in \a B is the maximum, otherwise, returns 0.
2057
+ ///
2058
+ /// \headerfile <x86intrin.h>
2059
+ ///
2060
+ /// \code
2061
+ /// int _mm_cmpestra(__m128i A, int LA, __m128i B, int LB, const int M);
2062
+ /// \endcode
2063
+ ///
2064
+ /// This intrinsic corresponds to the <c> VPCMPESTRI / PCMPESTRI </c>
2065
+ /// instruction.
2066
+ ///
2067
+ /// \param A
2068
+ /// A 128-bit integer vector containing one of the source operands to be
2069
+ /// compared.
2070
+ /// \param LA
2071
+ /// An integer that specifies the length of the string in \a A.
2072
+ /// \param B
2073
+ /// A 128-bit integer vector containing one of the source operands to be
2074
+ /// compared.
2075
+ /// \param LB
2076
+ /// An integer that specifies the length of the string in \a B.
2077
+ /// \param M
2078
+ /// An 8-bit immediate operand specifying whether the characters are bytes or
2079
+ /// words and the type of comparison to perform. \n
2080
+ /// Bits [1:0]: Determine source data format. \n
2081
+ /// 00: 16 unsigned bytes \n
2082
+ /// 01: 8 unsigned words \n
2083
+ /// 10: 16 signed bytes \n
2084
+ /// 11: 8 signed words \n
2085
+ /// Bits [3:2]: Determine comparison type and aggregation method. \n
2086
+ /// 00: Subset: Each character in \a B is compared for equality with all
2087
+ /// the characters in \a A. \n
2088
+ /// 01: Ranges: Each character in \a B is compared to \a A. The comparison
2089
+ /// basis is greater than or equal for even-indexed elements in \a A,
2090
+ /// and less than or equal for odd-indexed elements in \a A. \n
2091
+ /// 10: Match: Compare each pair of corresponding characters in \a A and
2092
+ /// \a B for equality. \n
2093
+ /// 11: Substring: Search \a B for substring matches of \a A. \n
2094
+ /// Bits [5:4]: Determine whether to perform a one's complement on the bit
2095
+ /// mask of the comparison results. \n
2096
+ /// 00: No effect. \n
2097
+ /// 01: Negate the bit mask. \n
2098
+ /// 10: No effect. \n
2099
+ /// 11: Negate the bit mask only for bits with an index less than or equal
2100
+ /// to the size of \a A or \a B.
2101
+ /// \returns Returns 1 if the bit mask is zero and the length of the string in
2102
+ /// \a B is the maximum, otherwise, returns 0.
2103
+ #define _mm_cmpestra(A, LA, B, LB, M) \
2104
+ ((int)__builtin_ia32_pcmpestria128((__v16qi)(__m128i)(A), (int)(LA), \
2105
+ (__v16qi)(__m128i)(B), (int)(LB), \
2106
+ (int)(M)))
2107
+
2108
+ /// Uses the immediate operand \a M to perform a comparison of string
2109
+ /// data with explicitly defined lengths that is contained in source operands
2110
+ /// \a A and \a B. Returns 1 if the resulting mask is non-zero, otherwise,
2111
+ /// returns 0.
2112
+ ///
2113
+ /// \headerfile <x86intrin.h>
2114
+ ///
2115
+ /// \code
2116
+ /// int _mm_cmpestrc(__m128i A, int LA, __m128i B, int LB, const int M);
2117
+ /// \endcode
2118
+ ///
2119
+ /// This intrinsic corresponds to the <c> VPCMPESTRI / PCMPESTRI </c>
2120
+ /// instruction.
2121
+ ///
2122
+ /// \param A
2123
+ /// A 128-bit integer vector containing one of the source operands to be
2124
+ /// compared.
2125
+ /// \param LA
2126
+ /// An integer that specifies the length of the string in \a A.
2127
+ /// \param B
2128
+ /// A 128-bit integer vector containing one of the source operands to be
2129
+ /// compared.
2130
+ /// \param LB
2131
+ /// An integer that specifies the length of the string in \a B.
2132
+ /// \param M
2133
+ /// An 8-bit immediate operand specifying whether the characters are bytes or
2134
+ /// words and the type of comparison to perform. \n
2135
+ /// Bits [1:0]: Determine source data format. \n
2136
+ /// 00: 16 unsigned bytes \n
2137
+ /// 01: 8 unsigned words \n
2138
+ /// 10: 16 signed bytes \n
2139
+ /// 11: 8 signed words \n
2140
+ /// Bits [3:2]: Determine comparison type and aggregation method. \n
2141
+ /// 00: Subset: Each character in \a B is compared for equality with all
2142
+ /// the characters in \a A. \n
2143
+ /// 01: Ranges: Each character in \a B is compared to \a A. The comparison
2144
+ /// basis is greater than or equal for even-indexed elements in \a A,
2145
+ /// and less than or equal for odd-indexed elements in \a A. \n
2146
+ /// 10: Match: Compare each pair of corresponding characters in \a A and
2147
+ /// \a B for equality. \n
2148
+ /// 11: Substring: Search \a B for substring matches of \a A. \n
2149
+ /// Bits [5:4]: Determine whether to perform a one's complement on the bit
2150
+ /// mask of the comparison results. \n
2151
+ /// 00: No effect. \n
2152
+ /// 01: Negate the bit mask. \n
2153
+ /// 10: No effect. \n
2154
+ /// 11: Negate the bit mask only for bits with an index less than or equal
2155
+ /// to the size of \a A or \a B. \n
2156
+ /// \returns Returns 1 if the resulting mask is non-zero, otherwise, returns 0.
2157
+ #define _mm_cmpestrc(A, LA, B, LB, M) \
2158
+ ((int)__builtin_ia32_pcmpestric128((__v16qi)(__m128i)(A), (int)(LA), \
2159
+ (__v16qi)(__m128i)(B), (int)(LB), \
2160
+ (int)(M)))
2161
+
2162
+ /// Uses the immediate operand \a M to perform a comparison of string
2163
+ /// data with explicitly defined lengths that is contained in source operands
2164
+ /// \a A and \a B. Returns bit 0 of the resulting bit mask.
2165
+ ///
2166
+ /// \headerfile <x86intrin.h>
2167
+ ///
2168
+ /// \code
2169
+ /// int _mm_cmpestro(__m128i A, int LA, __m128i B, int LB, const int M);
2170
+ /// \endcode
2171
+ ///
2172
+ /// This intrinsic corresponds to the <c> VPCMPESTRI / PCMPESTRI </c>
2173
+ /// instruction.
2174
+ ///
2175
+ /// \param A
2176
+ /// A 128-bit integer vector containing one of the source operands to be
2177
+ /// compared.
2178
+ /// \param LA
2179
+ /// An integer that specifies the length of the string in \a A.
2180
+ /// \param B
2181
+ /// A 128-bit integer vector containing one of the source operands to be
2182
+ /// compared.
2183
+ /// \param LB
2184
+ /// An integer that specifies the length of the string in \a B.
2185
+ /// \param M
2186
+ /// An 8-bit immediate operand specifying whether the characters are bytes or
2187
+ /// words and the type of comparison to perform. \n
2188
+ /// Bits [1:0]: Determine source data format. \n
2189
+ /// 00: 16 unsigned bytes \n
2190
+ /// 01: 8 unsigned words \n
2191
+ /// 10: 16 signed bytes \n
2192
+ /// 11: 8 signed words \n
2193
+ /// Bits [3:2]: Determine comparison type and aggregation method. \n
2194
+ /// 00: Subset: Each character in \a B is compared for equality with all
2195
+ /// the characters in \a A. \n
2196
+ /// 01: Ranges: Each character in \a B is compared to \a A. The comparison
2197
+ /// basis is greater than or equal for even-indexed elements in \a A,
2198
+ /// and less than or equal for odd-indexed elements in \a A. \n
2199
+ /// 10: Match: Compare each pair of corresponding characters in \a A and
2200
+ /// \a B for equality. \n
2201
+ /// 11: Substring: Search \a B for substring matches of \a A. \n
2202
+ /// Bits [5:4]: Determine whether to perform a one's complement on the bit
2203
+ /// mask of the comparison results. \n
2204
+ /// 00: No effect. \n
2205
+ /// 01: Negate the bit mask. \n
2206
+ /// 10: No effect. \n
2207
+ /// 11: Negate the bit mask only for bits with an index less than or equal
2208
+ /// to the size of \a A or \a B.
2209
+ /// \returns Returns bit 0 of the resulting bit mask.
2210
+ #define _mm_cmpestro(A, LA, B, LB, M) \
2211
+ ((int)__builtin_ia32_pcmpestrio128((__v16qi)(__m128i)(A), (int)(LA), \
2212
+ (__v16qi)(__m128i)(B), (int)(LB), \
2213
+ (int)(M)))
2214
+
2215
+ /// Uses the immediate operand \a M to perform a comparison of string
2216
+ /// data with explicitly defined lengths that is contained in source operands
2217
+ /// \a A and \a B. Returns 1 if the length of the string in \a A is less than
2218
+ /// the maximum, otherwise, returns 0.
2219
+ ///
2220
+ /// \headerfile <x86intrin.h>
2221
+ ///
2222
+ /// \code
2223
+ /// int _mm_cmpestrs(__m128i A, int LA, __m128i B, int LB, const int M);
2224
+ /// \endcode
2225
+ ///
2226
+ /// This intrinsic corresponds to the <c> VPCMPESTRI / PCMPESTRI </c>
2227
+ /// instruction.
2228
+ ///
2229
+ /// \param A
2230
+ /// A 128-bit integer vector containing one of the source operands to be
2231
+ /// compared.
2232
+ /// \param LA
2233
+ /// An integer that specifies the length of the string in \a A.
2234
+ /// \param B
2235
+ /// A 128-bit integer vector containing one of the source operands to be
2236
+ /// compared.
2237
+ /// \param LB
2238
+ /// An integer that specifies the length of the string in \a B.
2239
+ /// \param M
2240
+ /// An 8-bit immediate operand specifying whether the characters are bytes or
2241
+ /// words and the type of comparison to perform. \n
2242
+ /// Bits [1:0]: Determine source data format. \n
2243
+ /// 00: 16 unsigned bytes \n
2244
+ /// 01: 8 unsigned words \n
2245
+ /// 10: 16 signed bytes \n
2246
+ /// 11: 8 signed words \n
2247
+ /// Bits [3:2]: Determine comparison type and aggregation method. \n
2248
+ /// 00: Subset: Each character in \a B is compared for equality with all
2249
+ /// the characters in \a A. \n
2250
+ /// 01: Ranges: Each character in \a B is compared to \a A. The comparison
2251
+ /// basis is greater than or equal for even-indexed elements in \a A,
2252
+ /// and less than or equal for odd-indexed elements in \a A. \n
2253
+ /// 10: Match: Compare each pair of corresponding characters in \a A and
2254
+ /// \a B for equality. \n
2255
+ /// 11: Substring: Search \a B for substring matches of \a A. \n
2256
+ /// Bits [5:4]: Determine whether to perform a one's complement in the bit
2257
+ /// mask of the comparison results. \n
2258
+ /// 00: No effect. \n
2259
+ /// 01: Negate the bit mask. \n
2260
+ /// 10: No effect. \n
2261
+ /// 11: Negate the bit mask only for bits with an index less than or equal
2262
+ /// to the size of \a A or \a B. \n
2263
+ /// \returns Returns 1 if the length of the string in \a A is less than the
2264
+ /// maximum, otherwise, returns 0.
2265
+ #define _mm_cmpestrs(A, LA, B, LB, M) \
2266
+ ((int)__builtin_ia32_pcmpestris128((__v16qi)(__m128i)(A), (int)(LA), \
2267
+ (__v16qi)(__m128i)(B), (int)(LB), \
2268
+ (int)(M)))
2269
+
2270
+ /// Uses the immediate operand \a M to perform a comparison of string
2271
+ /// data with explicitly defined lengths that is contained in source operands
2272
+ /// \a A and \a B. Returns 1 if the length of the string in \a B is less than
2273
+ /// the maximum, otherwise, returns 0.
2274
+ ///
2275
+ /// \headerfile <x86intrin.h>
2276
+ ///
2277
+ /// \code
2278
+ /// int _mm_cmpestrz(__m128i A, int LA, __m128i B, int LB, const int M);
2279
+ /// \endcode
2280
+ ///
2281
+ /// This intrinsic corresponds to the <c> VPCMPESTRI </c> instruction.
2282
+ ///
2283
+ /// \param A
2284
+ /// A 128-bit integer vector containing one of the source operands to be
2285
+ /// compared.
2286
+ /// \param LA
2287
+ /// An integer that specifies the length of the string in \a A.
2288
+ /// \param B
2289
+ /// A 128-bit integer vector containing one of the source operands to be
2290
+ /// compared.
2291
+ /// \param LB
2292
+ /// An integer that specifies the length of the string in \a B.
2293
+ /// \param M
2294
+ /// An 8-bit immediate operand specifying whether the characters are bytes or
2295
+ /// words and the type of comparison to perform. \n
2296
+ /// Bits [1:0]: Determine source data format. \n
2297
+ /// 00: 16 unsigned bytes \n
2298
+ /// 01: 8 unsigned words \n
2299
+ /// 10: 16 signed bytes \n
2300
+ /// 11: 8 signed words \n
2301
+ /// Bits [3:2]: Determine comparison type and aggregation method. \n
2302
+ /// 00: Subset: Each character in \a B is compared for equality with all
2303
+ /// the characters in \a A. \n
2304
+ /// 01: Ranges: Each character in \a B is compared to \a A. The comparison
2305
+ /// basis is greater than or equal for even-indexed elements in \a A,
2306
+ /// and less than or equal for odd-indexed elements in \a A. \n
2307
+ /// 10: Match: Compare each pair of corresponding characters in \a A and
2308
+ /// \a B for equality. \n
2309
+ /// 11: Substring: Search \a B for substring matches of \a A. \n
2310
+ /// Bits [5:4]: Determine whether to perform a one's complement on the bit
2311
+ /// mask of the comparison results. \n
2312
+ /// 00: No effect. \n
2313
+ /// 01: Negate the bit mask. \n
2314
+ /// 10: No effect. \n
2315
+ /// 11: Negate the bit mask only for bits with an index less than or equal
2316
+ /// to the size of \a A or \a B.
2317
+ /// \returns Returns 1 if the length of the string in \a B is less than the
2318
+ /// maximum, otherwise, returns 0.
2319
+ #define _mm_cmpestrz(A, LA, B, LB, M) \
2320
+ ((int)__builtin_ia32_pcmpestriz128((__v16qi)(__m128i)(A), (int)(LA), \
2321
+ (__v16qi)(__m128i)(B), (int)(LB), \
2322
+ (int)(M)))
2323
+
2324
+ /* SSE4.2 Compare Packed Data -- Greater Than. */
2325
+ /// Compares each of the corresponding 64-bit values of the 128-bit
2326
+ /// integer vectors to determine if the values in the first operand are
2327
+ /// greater than those in the second operand.
2328
+ ///
2329
+ /// Each comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
2330
+ ///
2331
+ /// \headerfile <x86intrin.h>
2332
+ ///
2333
+ /// This intrinsic corresponds to the <c> VPCMPGTQ / PCMPGTQ </c> instruction.
2334
+ ///
2335
+ /// \param __V1
2336
+ /// A 128-bit integer vector.
2337
+ /// \param __V2
2338
+ /// A 128-bit integer vector.
2339
+ /// \returns A 128-bit integer vector containing the comparison results.
2340
+ static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2341
+ _mm_cmpgt_epi64(__m128i __V1, __m128i __V2) {
2342
+ return (__m128i)((__v2di)__V1 > (__v2di)__V2);
2343
+ }
2344
+
2345
+ #undef __DEFAULT_FN_ATTRS
2346
+ #undef __DEFAULT_FN_ATTRS_CONSTEXPR
2347
+
2348
+ #include <popcntintrin.h>
2349
+
2350
+ #include <crc32intrin.h>
2351
+
2352
+ #endif /* __SMMINTRIN_H */