llvm-runtime-resources-darwin 0.0.0 → 23.1.0

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 (372) 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 +236 -0
  6. package/include/__clang_cuda_device_functions.h +1572 -0
  7. package/include/__clang_cuda_intrinsics.h +975 -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 +289 -0
  11. package/include/__clang_cuda_runtime_wrapper.h +526 -0
  12. package/include/__clang_cuda_texture_intrinsics.h +1177 -0
  13. package/include/__clang_gpu_builtin_vars.h +71 -0
  14. package/include/__clang_gpu_device_functions.h +411 -0
  15. package/include/__clang_gpu_intrinsics.h +242 -0
  16. package/include/__clang_hip_cmath.h +848 -0
  17. package/include/__clang_hip_libdevice_declares.h +238 -0
  18. package/include/__clang_hip_math.h +1405 -0
  19. package/include/__clang_hip_runtime_wrapper.h +170 -0
  20. package/include/__clang_hip_stdlib.h +43 -0
  21. package/include/__clang_spirv_builtins.h +217 -0
  22. package/include/__clang_spirv_libdevice_declares.h +170 -0
  23. package/include/__clang_spirv_math.h +719 -0
  24. package/include/__float_float.h +176 -0
  25. package/include/__float_header_macro.h +12 -0
  26. package/include/__float_infinity_nan.h +20 -0
  27. package/include/__stdarg___gnuc_va_list.h +13 -0
  28. package/include/__stdarg___va_copy.h +12 -0
  29. package/include/__stdarg_header_macro.h +12 -0
  30. package/include/__stdarg_va_arg.h +22 -0
  31. package/include/__stdarg_va_copy.h +12 -0
  32. package/include/__stdarg_va_list.h +13 -0
  33. package/include/__stddef_header_macro.h +12 -0
  34. package/include/__stddef_max_align_t.h +27 -0
  35. package/include/__stddef_null.h +29 -0
  36. package/include/__stddef_nullptr_t.h +29 -0
  37. package/include/__stddef_offsetof.h +17 -0
  38. package/include/__stddef_ptrdiff_t.h +20 -0
  39. package/include/__stddef_rsize_t.h +20 -0
  40. package/include/__stddef_size_t.h +20 -0
  41. package/include/__stddef_unreachable.h +21 -0
  42. package/include/__stddef_wchar_t.h +28 -0
  43. package/include/__stddef_wint_t.h +15 -0
  44. package/include/__wmmintrin_aes.h +140 -0
  45. package/include/__wmmintrin_pclmul.h +48 -0
  46. package/include/adcintrin.h +165 -0
  47. package/include/adxintrin.h +107 -0
  48. package/include/altivec.h +19434 -0
  49. package/include/amdgpuintrin.h +164 -0
  50. package/include/amdhsa_abi.h +83 -0
  51. package/include/ammintrin.h +183 -0
  52. package/include/amo.h +220 -0
  53. package/include/amxavx512intrin.h +596 -0
  54. package/include/amxcomplexintrin.h +167 -0
  55. package/include/amxfp16intrin.h +93 -0
  56. package/include/amxfp8intrin.h +230 -0
  57. package/include/amxintrin.h +492 -0
  58. package/include/amxmovrsintrin.h +48 -0
  59. package/include/andes_vector.h +21 -0
  60. package/include/arm64_neon.h +21 -0
  61. package/include/arm64intr.h +45 -0
  62. package/include/arm_acle.h +866 -0
  63. package/include/arm_bf16.h +20 -0
  64. package/include/arm_cde.h +410 -0
  65. package/include/arm_cmse.h +217 -0
  66. package/include/arm_fp16.h +596 -0
  67. package/include/arm_mve.h +19187 -0
  68. package/include/arm_neon.h +74351 -0
  69. package/include/arm_neon_sve_bridge.h +182 -0
  70. package/include/arm_sme.h +3753 -0
  71. package/include/arm_sve.h +32698 -0
  72. package/include/arm_vector_types.h +432 -0
  73. package/include/armintr.h +31 -0
  74. package/include/avx10_2_512bf16intrin.h +568 -0
  75. package/include/avx10_2_512convertintrin.h +322 -0
  76. package/include/avx10_2_512minmaxintrin.h +127 -0
  77. package/include/avx10_2_512niintrin.h +314 -0
  78. package/include/avx10_2_512satcvtdsintrin.h +307 -0
  79. package/include/avx10_2_512satcvtintrin.h +301 -0
  80. package/include/avx10_2bf16intrin.h +1094 -0
  81. package/include/avx10_2convertintrin.h +3257 -0
  82. package/include/avx10_2copyintrin.h +66 -0
  83. package/include/avx10_2minmaxintrin.h +232 -0
  84. package/include/avx10_2niintrin.h +409 -0
  85. package/include/avx10_2satcvtdsintrin.h +376 -0
  86. package/include/avx10_2satcvtintrin.h +312 -0
  87. package/include/avx2intrin.h +5190 -0
  88. package/include/avx512bf16intrin.h +292 -0
  89. package/include/avx512bitalgintrin.h +75 -0
  90. package/include/avx512bmmintrin.h +174 -0
  91. package/include/avx512bmmvlintrin.h +245 -0
  92. package/include/avx512bwintrin.h +1885 -0
  93. package/include/avx512cdintrin.h +112 -0
  94. package/include/avx512dqintrin.h +1350 -0
  95. package/include/avx512fintrin.h +9351 -0
  96. package/include/avx512fp16intrin.h +3349 -0
  97. package/include/avx512ifmaintrin.h +68 -0
  98. package/include/avx512ifmavlintrin.h +138 -0
  99. package/include/avx512vbmi2intrin.h +364 -0
  100. package/include/avx512vbmiintrin.h +98 -0
  101. package/include/avx512vbmivlintrin.h +179 -0
  102. package/include/avx512vlbf16intrin.h +527 -0
  103. package/include/avx512vlbitalgintrin.h +135 -0
  104. package/include/avx512vlbwintrin.h +3052 -0
  105. package/include/avx512vlcdintrin.h +202 -0
  106. package/include/avx512vldqintrin.h +1156 -0
  107. package/include/avx512vlfp16intrin.h +2090 -0
  108. package/include/avx512vlintrin.h +8067 -0
  109. package/include/avx512vlvbmi2intrin.h +702 -0
  110. package/include/avx512vlvnniintrin.h +308 -0
  111. package/include/avx512vlvp2intersectintrin.h +123 -0
  112. package/include/avx512vnniintrin.h +113 -0
  113. package/include/avx512vp2intersectintrin.h +77 -0
  114. package/include/avx512vpopcntdqintrin.h +62 -0
  115. package/include/avx512vpopcntdqvlintrin.h +105 -0
  116. package/include/avxifmaintrin.h +193 -0
  117. package/include/avxintrin.h +5064 -0
  118. package/include/avxneconvertintrin.h +484 -0
  119. package/include/avxvnniint16intrin.h +451 -0
  120. package/include/avxvnniint8intrin.h +454 -0
  121. package/include/avxvnniintrin.h +238 -0
  122. package/include/bmi2intrin.h +253 -0
  123. package/include/bmiintrin.h +604 -0
  124. package/include/builtins.h +19 -0
  125. package/include/cet.h +66 -0
  126. package/include/cetintrin.h +115 -0
  127. package/include/cldemoteintrin.h +36 -0
  128. package/include/clflushoptintrin.h +36 -0
  129. package/include/clwbintrin.h +38 -0
  130. package/include/clzerointrin.h +38 -0
  131. package/include/cmpccxaddintrin.h +70 -0
  132. package/include/cpuid.h +451 -0
  133. package/include/crc32intrin.h +102 -0
  134. package/include/cuda_wrappers/__utility/declval.h +28 -0
  135. package/include/cuda_wrappers/algorithm +116 -0
  136. package/include/cuda_wrappers/bits/basic_string.h +9 -0
  137. package/include/cuda_wrappers/bits/basic_string.tcc +9 -0
  138. package/include/cuda_wrappers/bits/c++config.h +61 -0
  139. package/include/cuda_wrappers/bits/shared_ptr_base.h +9 -0
  140. package/include/cuda_wrappers/cmath +44 -0
  141. package/include/cuda_wrappers/complex +90 -0
  142. package/include/cuda_wrappers/new +108 -0
  143. package/include/emmintrin.h +4940 -0
  144. package/include/endian.h +91 -0
  145. package/include/enqcmdintrin.h +63 -0
  146. package/include/f16cintrin.h +176 -0
  147. package/include/float.h +48 -0
  148. package/include/fma4intrin.h +220 -0
  149. package/include/fmaintrin.h +826 -0
  150. package/include/fuzzer/FuzzedDataProvider.h +397 -0
  151. package/include/fxsrintrin.h +91 -0
  152. package/include/gfniintrin.h +238 -0
  153. package/include/gpuintrin.h +348 -0
  154. package/include/hexagon_circ_brev_intrinsics.h +298 -0
  155. package/include/hexagon_protos.h +8439 -0
  156. package/include/hexagon_types.h +2628 -0
  157. package/include/hlsl_alias_intrinsics_gen.inc +3869 -0
  158. package/include/hlsl_inline_intrinsics_gen.inc +546 -0
  159. package/include/hresetintrin.h +49 -0
  160. package/include/htmintrin.h +212 -0
  161. package/include/htmxlintrin.h +345 -0
  162. package/include/hvx_hexagon_protos.h +5421 -0
  163. package/include/ia32intrin.h +863 -0
  164. package/include/immintrin.h +597 -0
  165. package/include/intrin.h +501 -0
  166. package/include/intrin0.h +256 -0
  167. package/include/inttypes.h +101 -0
  168. package/include/invpcidintrin.h +23 -0
  169. package/include/iso646.h +31 -0
  170. package/include/keylockerintrin.h +518 -0
  171. package/include/larchintrin.h +262 -0
  172. package/include/lasxintrin.h +3999 -0
  173. package/include/limits.h +133 -0
  174. package/include/llvm_libc_wrappers/assert.h +32 -0
  175. package/include/llvm_libc_wrappers/ctype.h +29 -0
  176. package/include/llvm_libc_wrappers/inttypes.h +32 -0
  177. package/include/llvm_libc_wrappers/stdio.h +52 -0
  178. package/include/llvm_libc_wrappers/stdlib.h +32 -0
  179. package/include/llvm_libc_wrappers/string.h +29 -0
  180. package/include/llvm_libc_wrappers/time.h +28 -0
  181. package/include/llvm_offload_wrappers/__llvm_offload.h +31 -0
  182. package/include/llvm_offload_wrappers/__llvm_offload_device.h +10 -0
  183. package/include/llvm_offload_wrappers/__llvm_offload_host.h +15 -0
  184. package/include/lsxintrin.h +3752 -0
  185. package/include/lwpintrin.h +136 -0
  186. package/include/lzcntintrin.h +109 -0
  187. package/include/mm3dnow.h +22 -0
  188. package/include/mm_malloc.h +67 -0
  189. package/include/mmintrin.h +1541 -0
  190. package/include/module.modulemap +375 -0
  191. package/include/movdirintrin.h +49 -0
  192. package/include/movrs_avx10_2_512intrin.h +98 -0
  193. package/include/movrs_avx10_2intrin.h +174 -0
  194. package/include/movrsintrin.h +59 -0
  195. package/include/msa.h +573 -0
  196. package/include/mwaitxintrin.h +62 -0
  197. package/include/nmmintrin.h +20 -0
  198. package/include/nvptxintrin.h +208 -0
  199. package/include/opencl-c-base.h +765 -0
  200. package/include/opencl-c.h +18737 -0
  201. package/include/openmp_wrappers/__clang_openmp_device_functions.h +118 -0
  202. package/include/openmp_wrappers/cmath +132 -0
  203. package/include/openmp_wrappers/complex +61 -0
  204. package/include/openmp_wrappers/complex.h +41 -0
  205. package/include/openmp_wrappers/complex_cmath.h +393 -0
  206. package/include/openmp_wrappers/math.h +71 -0
  207. package/include/openmp_wrappers/new +48 -0
  208. package/include/pconfigintrin.h +40 -0
  209. package/include/pkuintrin.h +34 -0
  210. package/include/pmmintrin.h +302 -0
  211. package/include/popcntintrin.h +59 -0
  212. package/include/ppc_wrappers/bmi2intrin.h +134 -0
  213. package/include/ppc_wrappers/bmiintrin.h +165 -0
  214. package/include/ppc_wrappers/emmintrin.h +2269 -0
  215. package/include/ppc_wrappers/immintrin.h +27 -0
  216. package/include/ppc_wrappers/mm_malloc.h +45 -0
  217. package/include/ppc_wrappers/mmintrin.h +1453 -0
  218. package/include/ppc_wrappers/nmmintrin.h +26 -0
  219. package/include/ppc_wrappers/pmmintrin.h +145 -0
  220. package/include/ppc_wrappers/smmintrin.h +683 -0
  221. package/include/ppc_wrappers/tmmintrin.h +453 -0
  222. package/include/ppc_wrappers/x86gprintrin.h +17 -0
  223. package/include/ppc_wrappers/x86intrin.h +28 -0
  224. package/include/ppc_wrappers/xmmintrin.h +1827 -0
  225. package/include/prfchiintrin.h +61 -0
  226. package/include/prfchwintrin.h +57 -0
  227. package/include/profile/InstrProfData.inc +1063 -0
  228. package/include/profile/instr_prof_interface.h +88 -0
  229. package/include/ptrauth.h +485 -0
  230. package/include/ptwriteintrin.h +37 -0
  231. package/include/raointintrin.h +203 -0
  232. package/include/rdpruintrin.h +57 -0
  233. package/include/rdseedintrin.h +105 -0
  234. package/include/riscv_bitmanip.h +202 -0
  235. package/include/riscv_corev_alu.h +130 -0
  236. package/include/riscv_crypto.h +178 -0
  237. package/include/riscv_mips.h +36 -0
  238. package/include/riscv_nds.h +92 -0
  239. package/include/riscv_ntlh.h +28 -0
  240. package/include/riscv_packed_simd.h +644 -0
  241. package/include/riscv_vector.h +465 -0
  242. package/include/rtmintrin.h +45 -0
  243. package/include/s390intrin.h +25 -0
  244. package/include/sanitizer/allocator_interface.h +106 -0
  245. package/include/sanitizer/asan_interface.h +398 -0
  246. package/include/sanitizer/common_interface_defs.h +507 -0
  247. package/include/sanitizer/coverage_interface.h +36 -0
  248. package/include/sanitizer/dfsan_interface.h +220 -0
  249. package/include/sanitizer/hwasan_interface.h +109 -0
  250. package/include/sanitizer/linux_syscall_hooks.h +3112 -0
  251. package/include/sanitizer/lsan_interface.h +89 -0
  252. package/include/sanitizer/msan_interface.h +135 -0
  253. package/include/sanitizer/netbsd_syscall_hooks.h +5005 -0
  254. package/include/sanitizer/rtsan_interface.h +75 -0
  255. package/include/sanitizer/safestack_interface.h +50 -0
  256. package/include/sanitizer/scudo_interface.h +38 -0
  257. package/include/sanitizer/tsan_interface.h +316 -0
  258. package/include/sanitizer/tsan_interface_atomic.h +223 -0
  259. package/include/sanitizer/tysan_interface.h +36 -0
  260. package/include/sanitizer/ubsan_interface.h +64 -0
  261. package/include/serializeintrin.h +30 -0
  262. package/include/sgxintrin.h +60 -0
  263. package/include/sha512intrin.h +200 -0
  264. package/include/shaintrin.h +190 -0
  265. package/include/sifive_vector.h +192 -0
  266. package/include/sm3intrin.h +238 -0
  267. package/include/sm4evexintrin.h +32 -0
  268. package/include/sm4intrin.h +269 -0
  269. package/include/smmintrin.h +2352 -0
  270. package/include/spirvintrin.h +167 -0
  271. package/include/stdalign.h +24 -0
  272. package/include/stdarg.h +75 -0
  273. package/include/stdatomic.h +204 -0
  274. package/include/stdbool.h +39 -0
  275. package/include/stdckdint.h +42 -0
  276. package/include/stdcountof.h +15 -0
  277. package/include/stddef.h +139 -0
  278. package/include/stddefer.h +19 -0
  279. package/include/stdint.h +835 -0
  280. package/include/stdnoreturn.h +35 -0
  281. package/include/tbmintrin.h +128 -0
  282. package/include/tgmath.h +1368 -0
  283. package/include/tmmintrin.h +779 -0
  284. package/include/tsxldtrkintrin.h +56 -0
  285. package/include/uintrintrin.h +157 -0
  286. package/include/unwind.h +332 -0
  287. package/include/usermsrintrin.h +51 -0
  288. package/include/vadefs.h +51 -0
  289. package/include/vaesintrin.h +86 -0
  290. package/include/varargs.h +16 -0
  291. package/include/vecintrin.h +12868 -0
  292. package/include/velintrin.h +71 -0
  293. package/include/velintrin_approx.h +120 -0
  294. package/include/velintrin_gen.h +1257 -0
  295. package/include/vpclmulqdqintrin.h +30 -0
  296. package/include/waitpkgintrin.h +42 -0
  297. package/include/wasm_simd128.h +2160 -0
  298. package/include/wbnoinvdintrin.h +24 -0
  299. package/include/wmmintrin.h +23 -0
  300. package/include/x86gprintrin.h +49 -0
  301. package/include/x86intrin.h +35 -0
  302. package/include/xmmintrin.h +3176 -0
  303. package/include/xopintrin.h +780 -0
  304. package/include/xsavecintrin.h +84 -0
  305. package/include/xsaveintrin.h +63 -0
  306. package/include/xsaveoptintrin.h +34 -0
  307. package/include/xsavesintrin.h +44 -0
  308. package/include/xtestintrin.h +27 -0
  309. package/include/yvals_core.h +25 -0
  310. package/include/zos_wrappers/builtins.h +18 -0
  311. package/include/zos_wrappers/grp.h +19 -0
  312. package/include/zos_wrappers/locale.h +19 -0
  313. package/include/zos_wrappers/math.h +31 -0
  314. package/include/zos_wrappers/poll.h +19 -0
  315. package/include/zos_wrappers/stdlib.h +20 -0
  316. package/include/zos_wrappers/string.h +19 -0
  317. package/include/zos_wrappers/time.h +19 -0
  318. package/include/zos_wrappers/variant.h +19 -0
  319. package/index.js +5 -0
  320. package/lib/darwin/libclang_rt.asan_abi_ios.a +0 -0
  321. package/lib/darwin/libclang_rt.asan_abi_iossim.a +0 -0
  322. package/lib/darwin/libclang_rt.asan_abi_osx.a +0 -0
  323. package/lib/darwin/libclang_rt.asan_ios_dynamic.dylib +0 -0
  324. package/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib +0 -0
  325. package/lib/darwin/libclang_rt.asan_osx_dynamic.dylib +0 -0
  326. package/lib/darwin/libclang_rt.cc_kext.a +0 -0
  327. package/lib/darwin/libclang_rt.cc_kext_ios.a +0 -0
  328. package/lib/darwin/libclang_rt.fuzzer_interceptors_ios.a +0 -0
  329. package/lib/darwin/libclang_rt.fuzzer_interceptors_iossim.a +0 -0
  330. package/lib/darwin/libclang_rt.fuzzer_interceptors_osx.a +0 -0
  331. package/lib/darwin/libclang_rt.fuzzer_ios.a +0 -0
  332. package/lib/darwin/libclang_rt.fuzzer_iossim.a +0 -0
  333. package/lib/darwin/libclang_rt.fuzzer_no_main_ios.a +0 -0
  334. package/lib/darwin/libclang_rt.fuzzer_no_main_iossim.a +0 -0
  335. package/lib/darwin/libclang_rt.fuzzer_no_main_osx.a +0 -0
  336. package/lib/darwin/libclang_rt.fuzzer_osx.a +0 -0
  337. package/lib/darwin/libclang_rt.ios.a +0 -0
  338. package/lib/darwin/libclang_rt.iossim.a +0 -0
  339. package/lib/darwin/libclang_rt.lsan_ios_dynamic.dylib +0 -0
  340. package/lib/darwin/libclang_rt.lsan_iossim_dynamic.dylib +0 -0
  341. package/lib/darwin/libclang_rt.lsan_osx_dynamic.dylib +0 -0
  342. package/lib/darwin/libclang_rt.osx.a +0 -0
  343. package/lib/darwin/libclang_rt.profile_ios.a +0 -0
  344. package/lib/darwin/libclang_rt.profile_iossim.a +0 -0
  345. package/lib/darwin/libclang_rt.profile_osx.a +0 -0
  346. package/lib/darwin/libclang_rt.rtsan_ios_dynamic.dylib +0 -0
  347. package/lib/darwin/libclang_rt.rtsan_iossim_dynamic.dylib +0 -0
  348. package/lib/darwin/libclang_rt.rtsan_osx_dynamic.dylib +0 -0
  349. package/lib/darwin/libclang_rt.stats_client_ios.a +0 -0
  350. package/lib/darwin/libclang_rt.stats_client_iossim.a +0 -0
  351. package/lib/darwin/libclang_rt.stats_client_osx.a +0 -0
  352. package/lib/darwin/libclang_rt.stats_ios_dynamic.dylib +0 -0
  353. package/lib/darwin/libclang_rt.stats_iossim_dynamic.dylib +0 -0
  354. package/lib/darwin/libclang_rt.stats_osx_dynamic.dylib +0 -0
  355. package/lib/darwin/libclang_rt.tsan_ios_dynamic.dylib +0 -0
  356. package/lib/darwin/libclang_rt.tsan_iossim_dynamic.dylib +0 -0
  357. package/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib +0 -0
  358. package/lib/darwin/libclang_rt.tysan_ios_dynamic.dylib +0 -0
  359. package/lib/darwin/libclang_rt.tysan_iossim_dynamic.dylib +0 -0
  360. package/lib/darwin/libclang_rt.tysan_osx_dynamic.dylib +0 -0
  361. package/lib/darwin/libclang_rt.ubsan_ios_dynamic.dylib +0 -0
  362. package/lib/darwin/libclang_rt.ubsan_iossim_dynamic.dylib +0 -0
  363. package/lib/darwin/libclang_rt.ubsan_minimal_ios.a +0 -0
  364. package/lib/darwin/libclang_rt.ubsan_minimal_ios_dynamic.dylib +0 -0
  365. package/lib/darwin/libclang_rt.ubsan_minimal_iossim.a +0 -0
  366. package/lib/darwin/libclang_rt.ubsan_minimal_iossim_dynamic.dylib +0 -0
  367. package/lib/darwin/libclang_rt.ubsan_minimal_osx.a +0 -0
  368. package/lib/darwin/libclang_rt.ubsan_minimal_osx_dynamic.dylib +0 -0
  369. package/lib/darwin/libclang_rt.ubsan_osx_dynamic.dylib +0 -0
  370. package/package.json +40 -1
  371. package/share/asan_ignorelist.txt +14 -0
  372. package/share/cfi_ignorelist.txt +17 -0
@@ -0,0 +1,3176 @@
1
+ /*===---- xmmintrin.h - SSE 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 __XMMINTRIN_H
11
+ #define __XMMINTRIN_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 <mmintrin.h>
18
+
19
+ typedef float __v4sf __attribute__((__vector_size__(16)));
20
+ typedef float __m128 __attribute__((__vector_size__(16), __aligned__(16)));
21
+
22
+ typedef float __m128_u __attribute__((__vector_size__(16), __aligned__(1)));
23
+
24
+ /* Unsigned types */
25
+ typedef unsigned int __v4su __attribute__((__vector_size__(16)));
26
+ typedef unsigned short __v8hu __attribute__((__vector_size__(16)));
27
+ typedef unsigned char __v16qu __attribute__((__vector_size__(16)));
28
+
29
+ /* This header should only be included in a hosted environment as it depends on
30
+ * a standard library to provide allocation routines. */
31
+ #if __STDC_HOSTED__
32
+ #include <mm_malloc.h>
33
+ #endif
34
+
35
+ /* Define the default attributes for the functions in this file. */
36
+ #define __DEFAULT_FN_ATTRS \
37
+ __attribute__((__always_inline__, __nodebug__, __target__("sse"), \
38
+ __min_vector_width__(128)))
39
+ #define __DEFAULT_FN_ATTRS_SSE2 \
40
+ __attribute__((__always_inline__, __nodebug__, __target__("sse2"), \
41
+ __min_vector_width__(128)))
42
+
43
+ #if defined(__cplusplus) && (__cplusplus >= 201103L)
44
+ #define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr
45
+ #define __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR __DEFAULT_FN_ATTRS_SSE2 constexpr
46
+ #else
47
+ #define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS
48
+ #define __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR __DEFAULT_FN_ATTRS_SSE2
49
+ #endif
50
+
51
+ #define __trunc64(x) \
52
+ (__m64) __builtin_shufflevector((__v2di)(x), __extension__(__v2di){}, 0)
53
+ #define __zext128(x) \
54
+ (__m128i) __builtin_shufflevector((__v2si)(x), __extension__(__v2si){}, 0, \
55
+ 1, 2, 3)
56
+ #define __anyext128(x) \
57
+ (__m128i) __builtin_shufflevector((__v2si)(x), __extension__(__v2si){}, 0, \
58
+ 1, -1, -1)
59
+ #define __zeroupper64(x) \
60
+ (__m128i) __builtin_shufflevector((__v4si)(x), __extension__(__v4si){}, 0, \
61
+ 1, 4, 5)
62
+
63
+ /// Adds the 32-bit float values in the low-order bits of the operands.
64
+ ///
65
+ /// \headerfile <x86intrin.h>
66
+ ///
67
+ /// This intrinsic corresponds to the <c> VADDSS / ADDSS </c> instructions.
68
+ ///
69
+ /// \param __a
70
+ /// A 128-bit vector of [4 x float] containing one of the source operands.
71
+ /// The lower 32 bits of this operand are used in the calculation.
72
+ /// \param __b
73
+ /// A 128-bit vector of [4 x float] containing one of the source operands.
74
+ /// The lower 32 bits of this operand are used in the calculation.
75
+ /// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the sum
76
+ /// of the lower 32 bits of both operands. The upper 96 bits are copied from
77
+ /// the upper 96 bits of the first source operand.
78
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
79
+ _mm_add_ss(__m128 __a, __m128 __b) {
80
+ __a[0] += __b[0];
81
+ return __a;
82
+ }
83
+
84
+ /// Adds two 128-bit vectors of [4 x float], and returns the results of
85
+ /// the addition.
86
+ ///
87
+ /// \headerfile <x86intrin.h>
88
+ ///
89
+ /// This intrinsic corresponds to the <c> VADDPS / ADDPS </c> instructions.
90
+ ///
91
+ /// \param __a
92
+ /// A 128-bit vector of [4 x float] containing one of the source operands.
93
+ /// \param __b
94
+ /// A 128-bit vector of [4 x float] containing one of the source operands.
95
+ /// \returns A 128-bit vector of [4 x float] containing the sums of both
96
+ /// operands.
97
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
98
+ _mm_add_ps(__m128 __a, __m128 __b) {
99
+ return (__m128)((__v4sf)__a + (__v4sf)__b);
100
+ }
101
+
102
+ /// Subtracts the 32-bit float value in the low-order bits of the second
103
+ /// operand from the corresponding value in the first operand.
104
+ ///
105
+ /// \headerfile <x86intrin.h>
106
+ ///
107
+ /// This intrinsic corresponds to the <c> VSUBSS / SUBSS </c> instructions.
108
+ ///
109
+ /// \param __a
110
+ /// A 128-bit vector of [4 x float] containing the minuend. The lower 32 bits
111
+ /// of this operand are used in the calculation.
112
+ /// \param __b
113
+ /// A 128-bit vector of [4 x float] containing the subtrahend. The lower 32
114
+ /// bits of this operand are used in the calculation.
115
+ /// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the
116
+ /// difference of the lower 32 bits of both operands. The upper 96 bits are
117
+ /// copied from the upper 96 bits of the first source operand.
118
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
119
+ _mm_sub_ss(__m128 __a, __m128 __b) {
120
+ __a[0] -= __b[0];
121
+ return __a;
122
+ }
123
+
124
+ /// Subtracts each of the values of the second operand from the first
125
+ /// operand, both of which are 128-bit vectors of [4 x float] and returns
126
+ /// the results of the subtraction.
127
+ ///
128
+ /// \headerfile <x86intrin.h>
129
+ ///
130
+ /// This intrinsic corresponds to the <c> VSUBPS / SUBPS </c> instructions.
131
+ ///
132
+ /// \param __a
133
+ /// A 128-bit vector of [4 x float] containing the minuend.
134
+ /// \param __b
135
+ /// A 128-bit vector of [4 x float] containing the subtrahend.
136
+ /// \returns A 128-bit vector of [4 x float] containing the differences between
137
+ /// both operands.
138
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
139
+ _mm_sub_ps(__m128 __a, __m128 __b) {
140
+ return (__m128)((__v4sf)__a - (__v4sf)__b);
141
+ }
142
+
143
+ /// Multiplies two 32-bit float values in the low-order bits of the
144
+ /// operands.
145
+ ///
146
+ /// \headerfile <x86intrin.h>
147
+ ///
148
+ /// This intrinsic corresponds to the <c> VMULSS / MULSS </c> instructions.
149
+ ///
150
+ /// \param __a
151
+ /// A 128-bit vector of [4 x float] containing one of the source operands.
152
+ /// The lower 32 bits of this operand are used in the calculation.
153
+ /// \param __b
154
+ /// A 128-bit vector of [4 x float] containing one of the source operands.
155
+ /// The lower 32 bits of this operand are used in the calculation.
156
+ /// \returns A 128-bit vector of [4 x float] containing the product of the lower
157
+ /// 32 bits of both operands. The upper 96 bits are copied from the upper 96
158
+ /// bits of the first source operand.
159
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
160
+ _mm_mul_ss(__m128 __a, __m128 __b) {
161
+ __a[0] *= __b[0];
162
+ return __a;
163
+ }
164
+
165
+ /// Multiplies two 128-bit vectors of [4 x float] and returns the
166
+ /// results of the multiplication.
167
+ ///
168
+ /// \headerfile <x86intrin.h>
169
+ ///
170
+ /// This intrinsic corresponds to the <c> VMULPS / MULPS </c> instructions.
171
+ ///
172
+ /// \param __a
173
+ /// A 128-bit vector of [4 x float] containing one of the source operands.
174
+ /// \param __b
175
+ /// A 128-bit vector of [4 x float] containing one of the source operands.
176
+ /// \returns A 128-bit vector of [4 x float] containing the products of both
177
+ /// operands.
178
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
179
+ _mm_mul_ps(__m128 __a, __m128 __b) {
180
+ return (__m128)((__v4sf)__a * (__v4sf)__b);
181
+ }
182
+
183
+ /// Divides the value in the low-order 32 bits of the first operand by
184
+ /// the corresponding value in the second operand.
185
+ ///
186
+ /// \headerfile <x86intrin.h>
187
+ ///
188
+ /// This intrinsic corresponds to the <c> VDIVSS / DIVSS </c> instructions.
189
+ ///
190
+ /// \param __a
191
+ /// A 128-bit vector of [4 x float] containing the dividend. The lower 32
192
+ /// bits of this operand are used in the calculation.
193
+ /// \param __b
194
+ /// A 128-bit vector of [4 x float] containing the divisor. The lower 32 bits
195
+ /// of this operand are used in the calculation.
196
+ /// \returns A 128-bit vector of [4 x float] containing the quotients of the
197
+ /// lower 32 bits of both operands. The upper 96 bits are copied from the
198
+ /// upper 96 bits of the first source operand.
199
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
200
+ _mm_div_ss(__m128 __a, __m128 __b) {
201
+ __a[0] /= __b[0];
202
+ return __a;
203
+ }
204
+
205
+ /// Divides two 128-bit vectors of [4 x float].
206
+ ///
207
+ /// \headerfile <x86intrin.h>
208
+ ///
209
+ /// This intrinsic corresponds to the <c> VDIVPS / DIVPS </c> instructions.
210
+ ///
211
+ /// \param __a
212
+ /// A 128-bit vector of [4 x float] containing the dividend.
213
+ /// \param __b
214
+ /// A 128-bit vector of [4 x float] containing the divisor.
215
+ /// \returns A 128-bit vector of [4 x float] containing the quotients of both
216
+ /// operands.
217
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
218
+ _mm_div_ps(__m128 __a, __m128 __b) {
219
+ return (__m128)((__v4sf)__a / (__v4sf)__b);
220
+ }
221
+
222
+ /// Calculates the square root of the value stored in the low-order bits
223
+ /// of a 128-bit vector of [4 x float].
224
+ ///
225
+ /// \headerfile <x86intrin.h>
226
+ ///
227
+ /// This intrinsic corresponds to the <c> VSQRTSS / SQRTSS </c> instructions.
228
+ ///
229
+ /// \param __a
230
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
231
+ /// used in the calculation.
232
+ /// \returns A 128-bit vector of [4 x float] containing the square root of the
233
+ /// value in the low-order bits of the operand.
234
+ static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_sqrt_ss(__m128 __a) {
235
+ __a[0] = __builtin_elementwise_sqrt(__a[0]);
236
+ return __a;
237
+ }
238
+
239
+ /// Calculates the square roots of the values stored in a 128-bit vector
240
+ /// of [4 x float].
241
+ ///
242
+ /// \headerfile <x86intrin.h>
243
+ ///
244
+ /// This intrinsic corresponds to the <c> VSQRTPS / SQRTPS </c> instructions.
245
+ ///
246
+ /// \param __a
247
+ /// A 128-bit vector of [4 x float].
248
+ /// \returns A 128-bit vector of [4 x float] containing the square roots of the
249
+ /// values in the operand.
250
+ static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_sqrt_ps(__m128 __a) {
251
+ return __builtin_elementwise_sqrt(__a);
252
+ }
253
+
254
+ /// Calculates the approximate reciprocal of the value stored in the
255
+ /// low-order bits of a 128-bit vector of [4 x float].
256
+ ///
257
+ /// \headerfile <x86intrin.h>
258
+ ///
259
+ /// This intrinsic corresponds to the <c> VRCPSS / RCPSS </c> instructions.
260
+ ///
261
+ /// \param __a
262
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
263
+ /// used in the calculation.
264
+ /// \returns A 128-bit vector of [4 x float] containing the approximate
265
+ /// reciprocal of the value in the low-order bits of the operand.
266
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
267
+ _mm_rcp_ss(__m128 __a)
268
+ {
269
+ return (__m128)__builtin_ia32_rcpss((__v4sf)__a);
270
+ }
271
+
272
+ /// Calculates the approximate reciprocals of the values stored in a
273
+ /// 128-bit vector of [4 x float].
274
+ ///
275
+ /// \headerfile <x86intrin.h>
276
+ ///
277
+ /// This intrinsic corresponds to the <c> VRCPPS / RCPPS </c> instructions.
278
+ ///
279
+ /// \param __a
280
+ /// A 128-bit vector of [4 x float].
281
+ /// \returns A 128-bit vector of [4 x float] containing the approximate
282
+ /// reciprocals of the values in the operand.
283
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
284
+ _mm_rcp_ps(__m128 __a)
285
+ {
286
+ return (__m128)__builtin_ia32_rcpps((__v4sf)__a);
287
+ }
288
+
289
+ /// Calculates the approximate reciprocal of the square root of the value
290
+ /// stored in the low-order bits of a 128-bit vector of [4 x float].
291
+ ///
292
+ /// \headerfile <x86intrin.h>
293
+ ///
294
+ /// This intrinsic corresponds to the <c> VRSQRTSS / RSQRTSS </c> instructions.
295
+ ///
296
+ /// \param __a
297
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
298
+ /// used in the calculation.
299
+ /// \returns A 128-bit vector of [4 x float] containing the approximate
300
+ /// reciprocal of the square root of the value in the low-order bits of the
301
+ /// operand.
302
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
303
+ _mm_rsqrt_ss(__m128 __a)
304
+ {
305
+ return __builtin_ia32_rsqrtss((__v4sf)__a);
306
+ }
307
+
308
+ /// Calculates the approximate reciprocals of the square roots of the
309
+ /// values stored in a 128-bit vector of [4 x float].
310
+ ///
311
+ /// \headerfile <x86intrin.h>
312
+ ///
313
+ /// This intrinsic corresponds to the <c> VRSQRTPS / RSQRTPS </c> instructions.
314
+ ///
315
+ /// \param __a
316
+ /// A 128-bit vector of [4 x float].
317
+ /// \returns A 128-bit vector of [4 x float] containing the approximate
318
+ /// reciprocals of the square roots of the values in the operand.
319
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
320
+ _mm_rsqrt_ps(__m128 __a)
321
+ {
322
+ return __builtin_ia32_rsqrtps((__v4sf)__a);
323
+ }
324
+
325
+ /// Compares two 32-bit float values in the low-order bits of both
326
+ /// operands and returns the lesser value in the low-order bits of the
327
+ /// vector of [4 x float].
328
+ ///
329
+ /// If either value in a comparison is NaN, returns the value from \a __b.
330
+ ///
331
+ /// \headerfile <x86intrin.h>
332
+ ///
333
+ /// This intrinsic corresponds to the <c> VMINSS / MINSS </c> instructions.
334
+ ///
335
+ /// \param __a
336
+ /// A 128-bit vector of [4 x float] containing one of the operands. The lower
337
+ /// 32 bits of this operand are used in the comparison.
338
+ /// \param __b
339
+ /// A 128-bit vector of [4 x float] containing one of the operands. The lower
340
+ /// 32 bits of this operand are used in the comparison.
341
+ /// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the
342
+ /// minimum value between both operands. The upper 96 bits are copied from
343
+ /// the upper 96 bits of the first source operand.
344
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_min_ss(__m128 __a,
345
+ __m128 __b) {
346
+ return __builtin_ia32_minss((__v4sf)__a, (__v4sf)__b);
347
+ }
348
+
349
+ /// Compares two 128-bit vectors of [4 x float] and returns the lesser
350
+ /// of each pair of values.
351
+ ///
352
+ /// If either value in a comparison is NaN, returns the value from \a __b.
353
+ ///
354
+ /// \headerfile <x86intrin.h>
355
+ ///
356
+ /// This intrinsic corresponds to the <c> VMINPS / MINPS </c> instructions.
357
+ ///
358
+ /// \param __a
359
+ /// A 128-bit vector of [4 x float] containing one of the operands.
360
+ /// \param __b
361
+ /// A 128-bit vector of [4 x float] containing one of the operands.
362
+ /// \returns A 128-bit vector of [4 x float] containing the minimum values
363
+ /// between both operands.
364
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_min_ps(__m128 __a,
365
+ __m128 __b) {
366
+ return __builtin_ia32_minps((__v4sf)__a, (__v4sf)__b);
367
+ }
368
+
369
+ /// Compares two 32-bit float values in the low-order bits of both
370
+ /// operands and returns the greater value in the low-order bits of a 128-bit
371
+ /// vector of [4 x float].
372
+ ///
373
+ /// If either value in a comparison is NaN, returns the value from \a __b.
374
+ ///
375
+ /// \headerfile <x86intrin.h>
376
+ ///
377
+ /// This intrinsic corresponds to the <c> VMAXSS / MAXSS </c> instructions.
378
+ ///
379
+ /// \param __a
380
+ /// A 128-bit vector of [4 x float] containing one of the operands. The lower
381
+ /// 32 bits of this operand are used in the comparison.
382
+ /// \param __b
383
+ /// A 128-bit vector of [4 x float] containing one of the operands. The lower
384
+ /// 32 bits of this operand are used in the comparison.
385
+ /// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the
386
+ /// maximum value between both operands. The upper 96 bits are copied from
387
+ /// the upper 96 bits of the first source operand.
388
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_max_ss(__m128 __a,
389
+ __m128 __b) {
390
+ return __builtin_ia32_maxss((__v4sf)__a, (__v4sf)__b);
391
+ }
392
+
393
+ /// Compares two 128-bit vectors of [4 x float] and returns the greater
394
+ /// of each pair of values.
395
+ ///
396
+ /// If either value in a comparison is NaN, returns the value from \a __b.
397
+ ///
398
+ /// \headerfile <x86intrin.h>
399
+ ///
400
+ /// This intrinsic corresponds to the <c> VMAXPS / MAXPS </c> instructions.
401
+ ///
402
+ /// \param __a
403
+ /// A 128-bit vector of [4 x float] containing one of the operands.
404
+ /// \param __b
405
+ /// A 128-bit vector of [4 x float] containing one of the operands.
406
+ /// \returns A 128-bit vector of [4 x float] containing the maximum values
407
+ /// between both operands.
408
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_max_ps(__m128 __a,
409
+ __m128 __b) {
410
+ return __builtin_ia32_maxps((__v4sf)__a, (__v4sf)__b);
411
+ }
412
+
413
+ /// Performs a bitwise AND of two 128-bit vectors of [4 x float].
414
+ ///
415
+ /// \headerfile <x86intrin.h>
416
+ ///
417
+ /// This intrinsic corresponds to the <c> VANDPS / ANDPS </c> instructions.
418
+ ///
419
+ /// \param __a
420
+ /// A 128-bit vector containing one of the source operands.
421
+ /// \param __b
422
+ /// A 128-bit vector containing one of the source operands.
423
+ /// \returns A 128-bit vector of [4 x float] containing the bitwise AND of the
424
+ /// values between both operands.
425
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
426
+ _mm_and_ps(__m128 __a, __m128 __b) {
427
+ return (__m128)((__v4su)__a & (__v4su)__b);
428
+ }
429
+
430
+ /// Performs a bitwise AND of two 128-bit vectors of [4 x float], using
431
+ /// the one's complement of the values contained in the first source
432
+ /// operand.
433
+ ///
434
+ /// \headerfile <x86intrin.h>
435
+ ///
436
+ /// This intrinsic corresponds to the <c> VANDNPS / ANDNPS </c> instructions.
437
+ ///
438
+ /// \param __a
439
+ /// A 128-bit vector of [4 x float] containing the first source operand. The
440
+ /// one's complement of this value is used in the bitwise AND.
441
+ /// \param __b
442
+ /// A 128-bit vector of [4 x float] containing the second source operand.
443
+ /// \returns A 128-bit vector of [4 x float] containing the bitwise AND of the
444
+ /// one's complement of the first operand and the values in the second
445
+ /// operand.
446
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
447
+ _mm_andnot_ps(__m128 __a, __m128 __b) {
448
+ return (__m128)(~(__v4su)__a & (__v4su)__b);
449
+ }
450
+
451
+ /// Performs a bitwise OR of two 128-bit vectors of [4 x float].
452
+ ///
453
+ /// \headerfile <x86intrin.h>
454
+ ///
455
+ /// This intrinsic corresponds to the <c> VORPS / ORPS </c> instructions.
456
+ ///
457
+ /// \param __a
458
+ /// A 128-bit vector of [4 x float] containing one of the source operands.
459
+ /// \param __b
460
+ /// A 128-bit vector of [4 x float] containing one of the source operands.
461
+ /// \returns A 128-bit vector of [4 x float] containing the bitwise OR of the
462
+ /// values between both operands.
463
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
464
+ _mm_or_ps(__m128 __a, __m128 __b) {
465
+ return (__m128)((__v4su)__a | (__v4su)__b);
466
+ }
467
+
468
+ /// Performs a bitwise exclusive OR of two 128-bit vectors of
469
+ /// [4 x float].
470
+ ///
471
+ /// \headerfile <x86intrin.h>
472
+ ///
473
+ /// This intrinsic corresponds to the <c> VXORPS / XORPS </c> instructions.
474
+ ///
475
+ /// \param __a
476
+ /// A 128-bit vector of [4 x float] containing one of the source operands.
477
+ /// \param __b
478
+ /// A 128-bit vector of [4 x float] containing one of the source operands.
479
+ /// \returns A 128-bit vector of [4 x float] containing the bitwise exclusive OR
480
+ /// of the values between both operands.
481
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
482
+ _mm_xor_ps(__m128 __a, __m128 __b) {
483
+ return (__m128)((__v4su)__a ^ (__v4su)__b);
484
+ }
485
+
486
+ /// Compares two 32-bit float values in the low-order bits of both
487
+ /// operands for equality.
488
+ ///
489
+ /// The comparison returns 0x0 for false, 0xFFFFFFFF for true, in the
490
+ /// low-order bits of a vector [4 x float].
491
+ /// If either value in a comparison is NaN, returns false.
492
+ ///
493
+ /// \headerfile <x86intrin.h>
494
+ ///
495
+ /// This intrinsic corresponds to the <c> VCMPEQSS / CMPEQSS </c> instructions.
496
+ ///
497
+ /// \param __a
498
+ /// A 128-bit vector of [4 x float] containing one of the operands. The lower
499
+ /// 32 bits of this operand are used in the comparison.
500
+ /// \param __b
501
+ /// A 128-bit vector of [4 x float] containing one of the operands. The lower
502
+ /// 32 bits of this operand are used in the comparison.
503
+ /// \returns A 128-bit vector of [4 x float] containing the comparison results
504
+ /// in the low-order bits.
505
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
506
+ _mm_cmpeq_ss(__m128 __a, __m128 __b)
507
+ {
508
+ return (__m128)__builtin_ia32_cmpeqss((__v4sf)__a, (__v4sf)__b);
509
+ }
510
+
511
+ /// Compares each of the corresponding 32-bit float values of the
512
+ /// 128-bit vectors of [4 x float] for equality.
513
+ ///
514
+ /// Each comparison returns 0x0 for false, 0xFFFFFFFF for true.
515
+ /// If either value in a comparison is NaN, returns false.
516
+ ///
517
+ /// \headerfile <x86intrin.h>
518
+ ///
519
+ /// This intrinsic corresponds to the <c> VCMPEQPS / CMPEQPS </c> instructions.
520
+ ///
521
+ /// \param __a
522
+ /// A 128-bit vector of [4 x float].
523
+ /// \param __b
524
+ /// A 128-bit vector of [4 x float].
525
+ /// \returns A 128-bit vector of [4 x float] containing the comparison results.
526
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
527
+ _mm_cmpeq_ps(__m128 __a, __m128 __b)
528
+ {
529
+ return (__m128)__builtin_ia32_cmpeqps((__v4sf)__a, (__v4sf)__b);
530
+ }
531
+
532
+ /// Compares two 32-bit float values in the low-order bits of both
533
+ /// operands to determine if the value in the first operand is less than the
534
+ /// corresponding value in the second operand.
535
+ ///
536
+ /// The comparison returns 0x0 for false, 0xFFFFFFFF for true, in the
537
+ /// low-order bits of a vector of [4 x float].
538
+ /// If either value in a comparison is NaN, returns false.
539
+ ///
540
+ /// \headerfile <x86intrin.h>
541
+ ///
542
+ /// This intrinsic corresponds to the <c> VCMPLTSS / CMPLTSS </c> instructions.
543
+ ///
544
+ /// \param __a
545
+ /// A 128-bit vector of [4 x float] containing one of the operands. The lower
546
+ /// 32 bits of this operand are used in the comparison.
547
+ /// \param __b
548
+ /// A 128-bit vector of [4 x float] containing one of the operands. The lower
549
+ /// 32 bits of this operand are used in the comparison.
550
+ /// \returns A 128-bit vector of [4 x float] containing the comparison results
551
+ /// in the low-order bits.
552
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
553
+ _mm_cmplt_ss(__m128 __a, __m128 __b)
554
+ {
555
+ return (__m128)__builtin_ia32_cmpltss((__v4sf)__a, (__v4sf)__b);
556
+ }
557
+
558
+ /// Compares each of the corresponding 32-bit float values of the
559
+ /// 128-bit vectors of [4 x float] to determine if the values in the first
560
+ /// operand are less than those in the second operand.
561
+ ///
562
+ /// Each comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
563
+ /// If either value in a comparison is NaN, returns false.
564
+ ///
565
+ /// \headerfile <x86intrin.h>
566
+ ///
567
+ /// This intrinsic corresponds to the <c> VCMPLTPS / CMPLTPS </c> instructions.
568
+ ///
569
+ /// \param __a
570
+ /// A 128-bit vector of [4 x float].
571
+ /// \param __b
572
+ /// A 128-bit vector of [4 x float].
573
+ /// \returns A 128-bit vector of [4 x float] containing the comparison results.
574
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
575
+ _mm_cmplt_ps(__m128 __a, __m128 __b)
576
+ {
577
+ return (__m128)__builtin_ia32_cmpltps((__v4sf)__a, (__v4sf)__b);
578
+ }
579
+
580
+ /// Compares two 32-bit float values in the low-order bits of both
581
+ /// operands to determine if the value in the first operand is less than or
582
+ /// equal to the corresponding value in the second operand.
583
+ ///
584
+ /// The comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true, in
585
+ /// the low-order bits of a vector of [4 x float].
586
+ /// If either value in a comparison is NaN, returns false.
587
+ ///
588
+ /// \headerfile <x86intrin.h>
589
+ ///
590
+ /// This intrinsic corresponds to the <c> VCMPLESS / CMPLESS </c> instructions.
591
+ ///
592
+ /// \param __a
593
+ /// A 128-bit vector of [4 x float] containing one of the operands. The lower
594
+ /// 32 bits of this operand are used in the comparison.
595
+ /// \param __b
596
+ /// A 128-bit vector of [4 x float] containing one of the operands. The lower
597
+ /// 32 bits of this operand are used in the comparison.
598
+ /// \returns A 128-bit vector of [4 x float] containing the comparison results
599
+ /// in the low-order bits.
600
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
601
+ _mm_cmple_ss(__m128 __a, __m128 __b)
602
+ {
603
+ return (__m128)__builtin_ia32_cmpless((__v4sf)__a, (__v4sf)__b);
604
+ }
605
+
606
+ /// Compares each of the corresponding 32-bit float values of the
607
+ /// 128-bit vectors of [4 x float] to determine if the values in the first
608
+ /// operand are less than or equal to those in the second operand.
609
+ ///
610
+ /// Each comparison returns 0x0 for false, 0xFFFFFFFF for true.
611
+ /// If either value in a comparison is NaN, returns false.
612
+ ///
613
+ /// \headerfile <x86intrin.h>
614
+ ///
615
+ /// This intrinsic corresponds to the <c> VCMPLEPS / CMPLEPS </c> instructions.
616
+ ///
617
+ /// \param __a
618
+ /// A 128-bit vector of [4 x float].
619
+ /// \param __b
620
+ /// A 128-bit vector of [4 x float].
621
+ /// \returns A 128-bit vector of [4 x float] containing the comparison results.
622
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
623
+ _mm_cmple_ps(__m128 __a, __m128 __b)
624
+ {
625
+ return (__m128)__builtin_ia32_cmpleps((__v4sf)__a, (__v4sf)__b);
626
+ }
627
+
628
+ /// Compares two 32-bit float values in the low-order bits of both
629
+ /// operands to determine if the value in the first operand is greater than
630
+ /// the corresponding value in the second operand.
631
+ ///
632
+ /// The comparison returns 0x0 for false, 0xFFFFFFFF for true, in the
633
+ /// low-order bits of a vector of [4 x float].
634
+ /// If either value in a comparison is NaN, returns false.
635
+ ///
636
+ /// \headerfile <x86intrin.h>
637
+ ///
638
+ /// This intrinsic corresponds to the <c> VCMPLTSS / CMPLTSS </c> instructions.
639
+ ///
640
+ /// \param __a
641
+ /// A 128-bit vector of [4 x float] containing one of the operands. The lower
642
+ /// 32 bits of this operand are used in the comparison.
643
+ /// \param __b
644
+ /// A 128-bit vector of [4 x float] containing one of the operands. The lower
645
+ /// 32 bits of this operand are used in the comparison.
646
+ /// \returns A 128-bit vector of [4 x float] containing the comparison results
647
+ /// in the low-order bits.
648
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
649
+ _mm_cmpgt_ss(__m128 __a, __m128 __b)
650
+ {
651
+ return (__m128)__builtin_shufflevector((__v4sf)__a,
652
+ (__v4sf)__builtin_ia32_cmpltss((__v4sf)__b, (__v4sf)__a),
653
+ 4, 1, 2, 3);
654
+ }
655
+
656
+ /// Compares each of the corresponding 32-bit float values of the
657
+ /// 128-bit vectors of [4 x float] to determine if the values in the first
658
+ /// operand are greater than those in the second operand.
659
+ ///
660
+ /// Each comparison returns 0x0 for false, 0xFFFFFFFF for true.
661
+ /// If either value in a comparison is NaN, returns false.
662
+ ///
663
+ /// \headerfile <x86intrin.h>
664
+ ///
665
+ /// This intrinsic corresponds to the <c> VCMPLTPS / CMPLTPS </c> instructions.
666
+ ///
667
+ /// \param __a
668
+ /// A 128-bit vector of [4 x float].
669
+ /// \param __b
670
+ /// A 128-bit vector of [4 x float].
671
+ /// \returns A 128-bit vector of [4 x float] containing the comparison results.
672
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
673
+ _mm_cmpgt_ps(__m128 __a, __m128 __b)
674
+ {
675
+ return (__m128)__builtin_ia32_cmpltps((__v4sf)__b, (__v4sf)__a);
676
+ }
677
+
678
+ /// Compares two 32-bit float values in the low-order bits of both
679
+ /// operands to determine if the value in the first operand is greater than
680
+ /// or equal to the corresponding value in the second operand.
681
+ ///
682
+ /// Each comparison returns 0x0 for false, 0xFFFFFFFF for true, in the
683
+ /// low-order bits of a vector of [4 x float].
684
+ /// If either value in a comparison is NaN, returns false.
685
+ ///
686
+ /// \headerfile <x86intrin.h>
687
+ ///
688
+ /// This intrinsic corresponds to the <c> VCMPLESS / CMPLESS </c> instructions.
689
+ ///
690
+ /// \param __a
691
+ /// A 128-bit vector of [4 x float] containing one of the operands. The lower
692
+ /// 32 bits of this operand are used in the comparison.
693
+ /// \param __b
694
+ /// A 128-bit vector of [4 x float] containing one of the operands. The lower
695
+ /// 32 bits of this operand are used in the comparison.
696
+ /// \returns A 128-bit vector of [4 x float] containing the comparison results
697
+ /// in the low-order bits.
698
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
699
+ _mm_cmpge_ss(__m128 __a, __m128 __b)
700
+ {
701
+ return (__m128)__builtin_shufflevector((__v4sf)__a,
702
+ (__v4sf)__builtin_ia32_cmpless((__v4sf)__b, (__v4sf)__a),
703
+ 4, 1, 2, 3);
704
+ }
705
+
706
+ /// Compares each of the corresponding 32-bit float values of the
707
+ /// 128-bit vectors of [4 x float] to determine if the values in the first
708
+ /// operand are greater than or equal to those in the second operand.
709
+ ///
710
+ /// Each comparison returns 0x0 for false, 0xFFFFFFFFFFFFFFFF for true.
711
+ /// If either value in a comparison is NaN, returns false.
712
+ ///
713
+ /// \headerfile <x86intrin.h>
714
+ ///
715
+ /// This intrinsic corresponds to the <c> VCMPLEPS / CMPLEPS </c> instructions.
716
+ ///
717
+ /// \param __a
718
+ /// A 128-bit vector of [4 x float].
719
+ /// \param __b
720
+ /// A 128-bit vector of [4 x float].
721
+ /// \returns A 128-bit vector of [4 x float] containing the comparison results.
722
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
723
+ _mm_cmpge_ps(__m128 __a, __m128 __b)
724
+ {
725
+ return (__m128)__builtin_ia32_cmpleps((__v4sf)__b, (__v4sf)__a);
726
+ }
727
+
728
+ /// Compares two 32-bit float values in the low-order bits of both operands
729
+ /// for inequality.
730
+ ///
731
+ /// The comparison returns 0x0 for false, 0xFFFFFFFF for true, in the
732
+ /// low-order bits of a vector of [4 x float].
733
+ /// If either value in a comparison is NaN, returns true.
734
+ ///
735
+ /// \headerfile <x86intrin.h>
736
+ ///
737
+ /// This intrinsic corresponds to the <c> VCMPNEQSS / CMPNEQSS </c>
738
+ /// instructions.
739
+ ///
740
+ /// \param __a
741
+ /// A 128-bit vector of [4 x float] containing one of the operands. The lower
742
+ /// 32 bits of this operand are used in the comparison.
743
+ /// \param __b
744
+ /// A 128-bit vector of [4 x float] containing one of the operands. The lower
745
+ /// 32 bits of this operand are used in the comparison.
746
+ /// \returns A 128-bit vector of [4 x float] containing the comparison results
747
+ /// in the low-order bits.
748
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
749
+ _mm_cmpneq_ss(__m128 __a, __m128 __b)
750
+ {
751
+ return (__m128)__builtin_ia32_cmpneqss((__v4sf)__a, (__v4sf)__b);
752
+ }
753
+
754
+ /// Compares each of the corresponding 32-bit float values of the
755
+ /// 128-bit vectors of [4 x float] for inequality.
756
+ ///
757
+ /// Each comparison returns 0x0 for false, 0xFFFFFFFF for true.
758
+ /// If either value in a comparison is NaN, returns true.
759
+ ///
760
+ /// \headerfile <x86intrin.h>
761
+ ///
762
+ /// This intrinsic corresponds to the <c> VCMPNEQPS / CMPNEQPS </c>
763
+ /// instructions.
764
+ ///
765
+ /// \param __a
766
+ /// A 128-bit vector of [4 x float].
767
+ /// \param __b
768
+ /// A 128-bit vector of [4 x float].
769
+ /// \returns A 128-bit vector of [4 x float] containing the comparison results.
770
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
771
+ _mm_cmpneq_ps(__m128 __a, __m128 __b)
772
+ {
773
+ return (__m128)__builtin_ia32_cmpneqps((__v4sf)__a, (__v4sf)__b);
774
+ }
775
+
776
+ /// Compares two 32-bit float values in the low-order bits of both
777
+ /// operands to determine if the value in the first operand is not less than
778
+ /// the corresponding value in the second operand.
779
+ ///
780
+ /// Each comparison returns 0x0 for false, 0xFFFFFFFF for true, in the
781
+ /// low-order bits of a vector of [4 x float].
782
+ /// If either value in a comparison is NaN, returns true.
783
+ ///
784
+ /// \headerfile <x86intrin.h>
785
+ ///
786
+ /// This intrinsic corresponds to the <c> VCMPNLTSS / CMPNLTSS </c>
787
+ /// instructions.
788
+ ///
789
+ /// \param __a
790
+ /// A 128-bit vector of [4 x float] containing one of the operands. The lower
791
+ /// 32 bits of this operand are used in the comparison.
792
+ /// \param __b
793
+ /// A 128-bit vector of [4 x float] containing one of the operands. The lower
794
+ /// 32 bits of this operand are used in the comparison.
795
+ /// \returns A 128-bit vector of [4 x float] containing the comparison results
796
+ /// in the low-order bits.
797
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
798
+ _mm_cmpnlt_ss(__m128 __a, __m128 __b)
799
+ {
800
+ return (__m128)__builtin_ia32_cmpnltss((__v4sf)__a, (__v4sf)__b);
801
+ }
802
+
803
+ /// Compares each of the corresponding 32-bit float values of the
804
+ /// 128-bit vectors of [4 x float] to determine if the values in the first
805
+ /// operand are not less than those in the second operand.
806
+ ///
807
+ /// Each comparison returns 0x0 for false, 0xFFFFFFFF for true.
808
+ /// If either value in a comparison is NaN, returns true.
809
+ ///
810
+ /// \headerfile <x86intrin.h>
811
+ ///
812
+ /// This intrinsic corresponds to the <c> VCMPNLTPS / CMPNLTPS </c>
813
+ /// instructions.
814
+ ///
815
+ /// \param __a
816
+ /// A 128-bit vector of [4 x float].
817
+ /// \param __b
818
+ /// A 128-bit vector of [4 x float].
819
+ /// \returns A 128-bit vector of [4 x float] containing the comparison results.
820
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
821
+ _mm_cmpnlt_ps(__m128 __a, __m128 __b)
822
+ {
823
+ return (__m128)__builtin_ia32_cmpnltps((__v4sf)__a, (__v4sf)__b);
824
+ }
825
+
826
+ /// Compares two 32-bit float values in the low-order bits of both
827
+ /// operands to determine if the value in the first operand is not less than
828
+ /// or equal to the corresponding value in the second operand.
829
+ ///
830
+ /// Each comparison returns 0x0 for false, 0xFFFFFFFF for true, in the
831
+ /// low-order bits of a vector of [4 x float].
832
+ /// If either value in a comparison is NaN, returns true.
833
+ ///
834
+ /// \headerfile <x86intrin.h>
835
+ ///
836
+ /// This intrinsic corresponds to the <c> VCMPNLESS / CMPNLESS </c>
837
+ /// instructions.
838
+ ///
839
+ /// \param __a
840
+ /// A 128-bit vector of [4 x float] containing one of the operands. The lower
841
+ /// 32 bits of this operand are used in the comparison.
842
+ /// \param __b
843
+ /// A 128-bit vector of [4 x float] containing one of the operands. The lower
844
+ /// 32 bits of this operand are used in the comparison.
845
+ /// \returns A 128-bit vector of [4 x float] containing the comparison results
846
+ /// in the low-order bits.
847
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
848
+ _mm_cmpnle_ss(__m128 __a, __m128 __b)
849
+ {
850
+ return (__m128)__builtin_ia32_cmpnless((__v4sf)__a, (__v4sf)__b);
851
+ }
852
+
853
+ /// Compares each of the corresponding 32-bit float values of the
854
+ /// 128-bit vectors of [4 x float] to determine if the values in the first
855
+ /// operand are not less than or equal to those in the second operand.
856
+ ///
857
+ /// Each comparison returns 0x0 for false, 0xFFFFFFFF for true.
858
+ /// If either value in a comparison is NaN, returns true.
859
+ ///
860
+ /// \headerfile <x86intrin.h>
861
+ ///
862
+ /// This intrinsic corresponds to the <c> VCMPNLEPS / CMPNLEPS </c>
863
+ /// instructions.
864
+ ///
865
+ /// \param __a
866
+ /// A 128-bit vector of [4 x float].
867
+ /// \param __b
868
+ /// A 128-bit vector of [4 x float].
869
+ /// \returns A 128-bit vector of [4 x float] containing the comparison results.
870
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
871
+ _mm_cmpnle_ps(__m128 __a, __m128 __b)
872
+ {
873
+ return (__m128)__builtin_ia32_cmpnleps((__v4sf)__a, (__v4sf)__b);
874
+ }
875
+
876
+ /// Compares two 32-bit float values in the low-order bits of both
877
+ /// operands to determine if the value in the first operand is not greater
878
+ /// than the corresponding value in the second operand.
879
+ ///
880
+ /// Each comparison returns 0x0 for false, 0xFFFFFFFF for true, in the
881
+ /// low-order bits of a vector of [4 x float].
882
+ /// If either value in a comparison is NaN, returns true.
883
+ ///
884
+ /// \headerfile <x86intrin.h>
885
+ ///
886
+ /// This intrinsic corresponds to the <c> VCMPNLTSS / CMPNLTSS </c>
887
+ /// instructions.
888
+ ///
889
+ /// \param __a
890
+ /// A 128-bit vector of [4 x float] containing one of the operands. The lower
891
+ /// 32 bits of this operand are used in the comparison.
892
+ /// \param __b
893
+ /// A 128-bit vector of [4 x float] containing one of the operands. The lower
894
+ /// 32 bits of this operand are used in the comparison.
895
+ /// \returns A 128-bit vector of [4 x float] containing the comparison results
896
+ /// in the low-order bits.
897
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
898
+ _mm_cmpngt_ss(__m128 __a, __m128 __b)
899
+ {
900
+ return (__m128)__builtin_shufflevector((__v4sf)__a,
901
+ (__v4sf)__builtin_ia32_cmpnltss((__v4sf)__b, (__v4sf)__a),
902
+ 4, 1, 2, 3);
903
+ }
904
+
905
+ /// Compares each of the corresponding 32-bit float values of the
906
+ /// 128-bit vectors of [4 x float] to determine if the values in the first
907
+ /// operand are not greater than those in the second operand.
908
+ ///
909
+ /// Each comparison returns 0x0 for false, 0xFFFFFFFF for true.
910
+ /// If either value in a comparison is NaN, returns true.
911
+ ///
912
+ /// \headerfile <x86intrin.h>
913
+ ///
914
+ /// This intrinsic corresponds to the <c> VCMPNLTPS / CMPNLTPS </c>
915
+ /// instructions.
916
+ ///
917
+ /// \param __a
918
+ /// A 128-bit vector of [4 x float].
919
+ /// \param __b
920
+ /// A 128-bit vector of [4 x float].
921
+ /// \returns A 128-bit vector of [4 x float] containing the comparison results.
922
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
923
+ _mm_cmpngt_ps(__m128 __a, __m128 __b)
924
+ {
925
+ return (__m128)__builtin_ia32_cmpnltps((__v4sf)__b, (__v4sf)__a);
926
+ }
927
+
928
+ /// Compares two 32-bit float values in the low-order bits of both
929
+ /// operands to determine if the value in the first operand is not greater
930
+ /// than or equal to the corresponding value in the second operand.
931
+ ///
932
+ /// Each comparison returns 0x0 for false, 0xFFFFFFFF for true, in the
933
+ /// low-order bits of a vector of [4 x float].
934
+ /// If either value in a comparison is NaN, returns true.
935
+ ///
936
+ /// \headerfile <x86intrin.h>
937
+ ///
938
+ /// This intrinsic corresponds to the <c> VCMPNLESS / CMPNLESS </c>
939
+ /// instructions.
940
+ ///
941
+ /// \param __a
942
+ /// A 128-bit vector of [4 x float] containing one of the operands. The lower
943
+ /// 32 bits of this operand are used in the comparison.
944
+ /// \param __b
945
+ /// A 128-bit vector of [4 x float] containing one of the operands. The lower
946
+ /// 32 bits of this operand are used in the comparison.
947
+ /// \returns A 128-bit vector of [4 x float] containing the comparison results
948
+ /// in the low-order bits.
949
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
950
+ _mm_cmpnge_ss(__m128 __a, __m128 __b)
951
+ {
952
+ return (__m128)__builtin_shufflevector((__v4sf)__a,
953
+ (__v4sf)__builtin_ia32_cmpnless((__v4sf)__b, (__v4sf)__a),
954
+ 4, 1, 2, 3);
955
+ }
956
+
957
+ /// Compares each of the corresponding 32-bit float values of the
958
+ /// 128-bit vectors of [4 x float] to determine if the values in the first
959
+ /// operand are not greater than or equal to those in the second operand.
960
+ ///
961
+ /// Each comparison returns 0x0 for false, 0xFFFFFFFF for true.
962
+ /// If either value in a comparison is NaN, returns true.
963
+ ///
964
+ /// \headerfile <x86intrin.h>
965
+ ///
966
+ /// This intrinsic corresponds to the <c> VCMPNLEPS / CMPNLEPS </c>
967
+ /// instructions.
968
+ ///
969
+ /// \param __a
970
+ /// A 128-bit vector of [4 x float].
971
+ /// \param __b
972
+ /// A 128-bit vector of [4 x float].
973
+ /// \returns A 128-bit vector of [4 x float] containing the comparison results.
974
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
975
+ _mm_cmpnge_ps(__m128 __a, __m128 __b)
976
+ {
977
+ return (__m128)__builtin_ia32_cmpnleps((__v4sf)__b, (__v4sf)__a);
978
+ }
979
+
980
+ /// Compares two 32-bit float values in the low-order bits of both
981
+ /// operands to determine if the value in the first operand is ordered with
982
+ /// respect to the corresponding value in the second operand.
983
+ ///
984
+ /// A pair of floating-point values are ordered with respect to each
985
+ /// other if neither value is a NaN. Each comparison returns 0x0 for false,
986
+ /// 0xFFFFFFFF for true.
987
+ ///
988
+ /// \headerfile <x86intrin.h>
989
+ ///
990
+ /// This intrinsic corresponds to the <c> VCMPORDSS / CMPORDSS </c>
991
+ /// instructions.
992
+ ///
993
+ /// \param __a
994
+ /// A 128-bit vector of [4 x float] containing one of the operands. The lower
995
+ /// 32 bits of this operand are used in the comparison.
996
+ /// \param __b
997
+ /// A 128-bit vector of [4 x float] containing one of the operands. The lower
998
+ /// 32 bits of this operand are used in the comparison.
999
+ /// \returns A 128-bit vector of [4 x float] containing the comparison results
1000
+ /// in the low-order bits.
1001
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
1002
+ _mm_cmpord_ss(__m128 __a, __m128 __b)
1003
+ {
1004
+ return (__m128)__builtin_ia32_cmpordss((__v4sf)__a, (__v4sf)__b);
1005
+ }
1006
+
1007
+ /// Compares each of the corresponding 32-bit float values of the
1008
+ /// 128-bit vectors of [4 x float] to determine if the values in the first
1009
+ /// operand are ordered with respect to those in the second operand.
1010
+ ///
1011
+ /// A pair of floating-point values are ordered with respect to each
1012
+ /// other if neither value is a NaN. Each comparison returns 0x0 for false,
1013
+ /// 0xFFFFFFFF for true.
1014
+ ///
1015
+ /// \headerfile <x86intrin.h>
1016
+ ///
1017
+ /// This intrinsic corresponds to the <c> VCMPORDPS / CMPORDPS </c>
1018
+ /// instructions.
1019
+ ///
1020
+ /// \param __a
1021
+ /// A 128-bit vector of [4 x float].
1022
+ /// \param __b
1023
+ /// A 128-bit vector of [4 x float].
1024
+ /// \returns A 128-bit vector of [4 x float] containing the comparison results.
1025
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
1026
+ _mm_cmpord_ps(__m128 __a, __m128 __b)
1027
+ {
1028
+ return (__m128)__builtin_ia32_cmpordps((__v4sf)__a, (__v4sf)__b);
1029
+ }
1030
+
1031
+ /// Compares two 32-bit float values in the low-order bits of both
1032
+ /// operands to determine if the value in the first operand is unordered
1033
+ /// with respect to the corresponding value in the second operand.
1034
+ ///
1035
+ /// A pair of double-precision values are unordered with respect to each
1036
+ /// other if one or both values are NaN. Each comparison returns 0x0 for
1037
+ /// false, 0xFFFFFFFF for true.
1038
+ ///
1039
+ /// \headerfile <x86intrin.h>
1040
+ ///
1041
+ /// This intrinsic corresponds to the <c> VCMPUNORDSS / CMPUNORDSS </c>
1042
+ /// instructions.
1043
+ ///
1044
+ /// \param __a
1045
+ /// A 128-bit vector of [4 x float] containing one of the operands. The lower
1046
+ /// 32 bits of this operand are used in the comparison.
1047
+ /// \param __b
1048
+ /// A 128-bit vector of [4 x float] containing one of the operands. The lower
1049
+ /// 32 bits of this operand are used in the comparison.
1050
+ /// \returns A 128-bit vector of [4 x float] containing the comparison results
1051
+ /// in the low-order bits.
1052
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
1053
+ _mm_cmpunord_ss(__m128 __a, __m128 __b)
1054
+ {
1055
+ return (__m128)__builtin_ia32_cmpunordss((__v4sf)__a, (__v4sf)__b);
1056
+ }
1057
+
1058
+ /// Compares each of the corresponding 32-bit float values of the
1059
+ /// 128-bit vectors of [4 x float] to determine if the values in the first
1060
+ /// operand are unordered with respect to those in the second operand.
1061
+ ///
1062
+ /// A pair of double-precision values are unordered with respect to each
1063
+ /// other if one or both values are NaN. Each comparison returns 0x0 for
1064
+ /// false, 0xFFFFFFFFFFFFFFFF for true.
1065
+ ///
1066
+ /// \headerfile <x86intrin.h>
1067
+ ///
1068
+ /// This intrinsic corresponds to the <c> VCMPUNORDPS / CMPUNORDPS </c>
1069
+ /// instructions.
1070
+ ///
1071
+ /// \param __a
1072
+ /// A 128-bit vector of [4 x float].
1073
+ /// \param __b
1074
+ /// A 128-bit vector of [4 x float].
1075
+ /// \returns A 128-bit vector of [4 x float] containing the comparison results.
1076
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
1077
+ _mm_cmpunord_ps(__m128 __a, __m128 __b)
1078
+ {
1079
+ return (__m128)__builtin_ia32_cmpunordps((__v4sf)__a, (__v4sf)__b);
1080
+ }
1081
+
1082
+ /// Compares two 32-bit float values in the low-order bits of both
1083
+ /// operands for equality.
1084
+ ///
1085
+ /// The comparison returns 0 for false, 1 for true. If either value in a
1086
+ /// comparison is NaN, returns 0.
1087
+ ///
1088
+ /// \headerfile <x86intrin.h>
1089
+ ///
1090
+ /// This intrinsic corresponds to the <c> VCOMISS / COMISS </c>
1091
+ /// instructions.
1092
+ ///
1093
+ /// \param __a
1094
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1095
+ /// used in the comparison.
1096
+ /// \param __b
1097
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1098
+ /// used in the comparison.
1099
+ /// \returns An integer containing the comparison results.
1100
+ static __inline__ int __DEFAULT_FN_ATTRS
1101
+ _mm_comieq_ss(__m128 __a, __m128 __b)
1102
+ {
1103
+ return __builtin_ia32_comieq((__v4sf)__a, (__v4sf)__b);
1104
+ }
1105
+
1106
+ /// Compares two 32-bit float values in the low-order bits of both
1107
+ /// operands to determine if the first operand is less than the second
1108
+ /// operand.
1109
+ ///
1110
+ /// The comparison returns 0 for false, 1 for true. If either value in a
1111
+ /// comparison is NaN, returns 0.
1112
+ ///
1113
+ /// \headerfile <x86intrin.h>
1114
+ ///
1115
+ /// This intrinsic corresponds to the <c> VCOMISS / COMISS </c>
1116
+ /// instructions.
1117
+ ///
1118
+ /// \param __a
1119
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1120
+ /// used in the comparison.
1121
+ /// \param __b
1122
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1123
+ /// used in the comparison.
1124
+ /// \returns An integer containing the comparison results.
1125
+ static __inline__ int __DEFAULT_FN_ATTRS
1126
+ _mm_comilt_ss(__m128 __a, __m128 __b)
1127
+ {
1128
+ return __builtin_ia32_comilt((__v4sf)__a, (__v4sf)__b);
1129
+ }
1130
+
1131
+ /// Compares two 32-bit float values in the low-order bits of both
1132
+ /// operands to determine if the first operand is less than or equal to the
1133
+ /// second operand.
1134
+ ///
1135
+ /// The comparison returns 0 for false, 1 for true. If either value in a
1136
+ /// comparison is NaN, returns 0.
1137
+ ///
1138
+ /// \headerfile <x86intrin.h>
1139
+ ///
1140
+ /// This intrinsic corresponds to the <c> VCOMISS / COMISS </c> instructions.
1141
+ ///
1142
+ /// \param __a
1143
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1144
+ /// used in the comparison.
1145
+ /// \param __b
1146
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1147
+ /// used in the comparison.
1148
+ /// \returns An integer containing the comparison results.
1149
+ static __inline__ int __DEFAULT_FN_ATTRS
1150
+ _mm_comile_ss(__m128 __a, __m128 __b)
1151
+ {
1152
+ return __builtin_ia32_comile((__v4sf)__a, (__v4sf)__b);
1153
+ }
1154
+
1155
+ /// Compares two 32-bit float values in the low-order bits of both
1156
+ /// operands to determine if the first operand is greater than the second
1157
+ /// operand.
1158
+ ///
1159
+ /// The comparison returns 0 for false, 1 for true. If either value in a
1160
+ /// comparison is NaN, returns 0.
1161
+ ///
1162
+ /// \headerfile <x86intrin.h>
1163
+ ///
1164
+ /// This intrinsic corresponds to the <c> VCOMISS / COMISS </c> instructions.
1165
+ ///
1166
+ /// \param __a
1167
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1168
+ /// used in the comparison.
1169
+ /// \param __b
1170
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1171
+ /// used in the comparison.
1172
+ /// \returns An integer containing the comparison results.
1173
+ static __inline__ int __DEFAULT_FN_ATTRS
1174
+ _mm_comigt_ss(__m128 __a, __m128 __b)
1175
+ {
1176
+ return __builtin_ia32_comigt((__v4sf)__a, (__v4sf)__b);
1177
+ }
1178
+
1179
+ /// Compares two 32-bit float values in the low-order bits of both
1180
+ /// operands to determine if the first operand is greater than or equal to
1181
+ /// the second operand.
1182
+ ///
1183
+ /// The comparison returns 0 for false, 1 for true. If either value in a
1184
+ /// comparison is NaN, returns 0.
1185
+ ///
1186
+ /// \headerfile <x86intrin.h>
1187
+ ///
1188
+ /// This intrinsic corresponds to the <c> VCOMISS / COMISS </c> instructions.
1189
+ ///
1190
+ /// \param __a
1191
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1192
+ /// used in the comparison.
1193
+ /// \param __b
1194
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1195
+ /// used in the comparison.
1196
+ /// \returns An integer containing the comparison results.
1197
+ static __inline__ int __DEFAULT_FN_ATTRS
1198
+ _mm_comige_ss(__m128 __a, __m128 __b)
1199
+ {
1200
+ return __builtin_ia32_comige((__v4sf)__a, (__v4sf)__b);
1201
+ }
1202
+
1203
+ /// Compares two 32-bit float values in the low-order bits of both
1204
+ /// operands to determine if the first operand is not equal to the second
1205
+ /// operand.
1206
+ ///
1207
+ /// The comparison returns 0 for false, 1 for true. If either value in a
1208
+ /// comparison is NaN, returns 1.
1209
+ ///
1210
+ /// \headerfile <x86intrin.h>
1211
+ ///
1212
+ /// This intrinsic corresponds to the <c> VCOMISS / COMISS </c> instructions.
1213
+ ///
1214
+ /// \param __a
1215
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1216
+ /// used in the comparison.
1217
+ /// \param __b
1218
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1219
+ /// used in the comparison.
1220
+ /// \returns An integer containing the comparison results.
1221
+ static __inline__ int __DEFAULT_FN_ATTRS
1222
+ _mm_comineq_ss(__m128 __a, __m128 __b)
1223
+ {
1224
+ return __builtin_ia32_comineq((__v4sf)__a, (__v4sf)__b);
1225
+ }
1226
+
1227
+ /// Performs an unordered comparison of two 32-bit float values using
1228
+ /// the low-order bits of both operands to determine equality.
1229
+ ///
1230
+ /// The comparison returns 0 for false, 1 for true. If either value in a
1231
+ /// comparison is NaN, returns 0.
1232
+ ///
1233
+ /// \headerfile <x86intrin.h>
1234
+ ///
1235
+ /// This intrinsic corresponds to the <c> VUCOMISS / UCOMISS </c> instructions.
1236
+ ///
1237
+ /// \param __a
1238
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1239
+ /// used in the comparison.
1240
+ /// \param __b
1241
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1242
+ /// used in the comparison.
1243
+ /// \returns An integer containing the comparison results.
1244
+ static __inline__ int __DEFAULT_FN_ATTRS
1245
+ _mm_ucomieq_ss(__m128 __a, __m128 __b)
1246
+ {
1247
+ return __builtin_ia32_ucomieq((__v4sf)__a, (__v4sf)__b);
1248
+ }
1249
+
1250
+ /// Performs an unordered comparison of two 32-bit float values using
1251
+ /// the low-order bits of both operands to determine if the first operand is
1252
+ /// less than the second operand.
1253
+ ///
1254
+ /// The comparison returns 0 for false, 1 for true. If either value in a
1255
+ /// comparison is NaN, returns 0.
1256
+ ///
1257
+ /// \headerfile <x86intrin.h>
1258
+ ///
1259
+ /// This intrinsic corresponds to the <c> VUCOMISS / UCOMISS </c> instructions.
1260
+ ///
1261
+ /// \param __a
1262
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1263
+ /// used in the comparison.
1264
+ /// \param __b
1265
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1266
+ /// used in the comparison.
1267
+ /// \returns An integer containing the comparison results.
1268
+ static __inline__ int __DEFAULT_FN_ATTRS
1269
+ _mm_ucomilt_ss(__m128 __a, __m128 __b)
1270
+ {
1271
+ return __builtin_ia32_ucomilt((__v4sf)__a, (__v4sf)__b);
1272
+ }
1273
+
1274
+ /// Performs an unordered comparison of two 32-bit float values using
1275
+ /// the low-order bits of both operands to determine if the first operand is
1276
+ /// less than or equal to the second operand.
1277
+ ///
1278
+ /// The comparison returns 0 for false, 1 for true. If either value in a
1279
+ /// comparison is NaN, returns 0.
1280
+ ///
1281
+ /// \headerfile <x86intrin.h>
1282
+ ///
1283
+ /// This intrinsic corresponds to the <c> VUCOMISS / UCOMISS </c> instructions.
1284
+ ///
1285
+ /// \param __a
1286
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1287
+ /// used in the comparison.
1288
+ /// \param __b
1289
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1290
+ /// used in the comparison.
1291
+ /// \returns An integer containing the comparison results.
1292
+ static __inline__ int __DEFAULT_FN_ATTRS
1293
+ _mm_ucomile_ss(__m128 __a, __m128 __b)
1294
+ {
1295
+ return __builtin_ia32_ucomile((__v4sf)__a, (__v4sf)__b);
1296
+ }
1297
+
1298
+ /// Performs an unordered comparison of two 32-bit float values using
1299
+ /// the low-order bits of both operands to determine if the first operand is
1300
+ /// greater than the second operand.
1301
+ ///
1302
+ /// The comparison returns 0 for false, 1 for true. If either value in a
1303
+ /// comparison is NaN, returns 0.
1304
+ ///
1305
+ /// \headerfile <x86intrin.h>
1306
+ ///
1307
+ /// This intrinsic corresponds to the <c> VUCOMISS / UCOMISS </c> instructions.
1308
+ ///
1309
+ /// \param __a
1310
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1311
+ /// used in the comparison.
1312
+ /// \param __b
1313
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1314
+ /// used in the comparison.
1315
+ /// \returns An integer containing the comparison results.
1316
+ static __inline__ int __DEFAULT_FN_ATTRS
1317
+ _mm_ucomigt_ss(__m128 __a, __m128 __b)
1318
+ {
1319
+ return __builtin_ia32_ucomigt((__v4sf)__a, (__v4sf)__b);
1320
+ }
1321
+
1322
+ /// Performs an unordered comparison of two 32-bit float values using
1323
+ /// the low-order bits of both operands to determine if the first operand is
1324
+ /// greater than or equal to the second operand.
1325
+ ///
1326
+ /// The comparison returns 0 for false, 1 for true. If either value in a
1327
+ /// comparison is NaN, returns 0.
1328
+ ///
1329
+ /// \headerfile <x86intrin.h>
1330
+ ///
1331
+ /// This intrinsic corresponds to the <c> VUCOMISS / UCOMISS </c> instructions.
1332
+ ///
1333
+ /// \param __a
1334
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1335
+ /// used in the comparison.
1336
+ /// \param __b
1337
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1338
+ /// used in the comparison.
1339
+ /// \returns An integer containing the comparison results.
1340
+ static __inline__ int __DEFAULT_FN_ATTRS
1341
+ _mm_ucomige_ss(__m128 __a, __m128 __b)
1342
+ {
1343
+ return __builtin_ia32_ucomige((__v4sf)__a, (__v4sf)__b);
1344
+ }
1345
+
1346
+ /// Performs an unordered comparison of two 32-bit float values using
1347
+ /// the low-order bits of both operands to determine inequality.
1348
+ ///
1349
+ /// The comparison returns 0 for false, 1 for true. If either value in a
1350
+ /// comparison is NaN, returns 0.
1351
+ ///
1352
+ /// \headerfile <x86intrin.h>
1353
+ ///
1354
+ /// This intrinsic corresponds to the <c> VUCOMISS / UCOMISS </c> instructions.
1355
+ ///
1356
+ /// \param __a
1357
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1358
+ /// used in the comparison.
1359
+ /// \param __b
1360
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1361
+ /// used in the comparison.
1362
+ /// \returns An integer containing the comparison results.
1363
+ static __inline__ int __DEFAULT_FN_ATTRS
1364
+ _mm_ucomineq_ss(__m128 __a, __m128 __b)
1365
+ {
1366
+ return __builtin_ia32_ucomineq((__v4sf)__a, (__v4sf)__b);
1367
+ }
1368
+
1369
+ /// Converts a float value contained in the lower 32 bits of a vector of
1370
+ /// [4 x float] into a 32-bit integer.
1371
+ ///
1372
+ /// If the converted value does not fit in a 32-bit integer, raises a
1373
+ /// floating-point invalid exception. If the exception is masked, returns
1374
+ /// the most negative integer.
1375
+ ///
1376
+ /// \headerfile <x86intrin.h>
1377
+ ///
1378
+ /// This intrinsic corresponds to the <c> VCVTSS2SI / CVTSS2SI </c>
1379
+ /// instructions.
1380
+ ///
1381
+ /// \param __a
1382
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1383
+ /// used in the conversion.
1384
+ /// \returns A 32-bit integer containing the converted value.
1385
+ static __inline__ int __DEFAULT_FN_ATTRS
1386
+ _mm_cvtss_si32(__m128 __a)
1387
+ {
1388
+ return __builtin_ia32_cvtss2si((__v4sf)__a);
1389
+ }
1390
+
1391
+ /// Converts a float value contained in the lower 32 bits of a vector of
1392
+ /// [4 x float] into a 32-bit integer.
1393
+ ///
1394
+ /// If the converted value does not fit in a 32-bit integer, raises a
1395
+ /// floating-point invalid exception. If the exception is masked, returns
1396
+ /// the most negative integer.
1397
+ ///
1398
+ /// \headerfile <x86intrin.h>
1399
+ ///
1400
+ /// This intrinsic corresponds to the <c> VCVTSS2SI / CVTSS2SI </c>
1401
+ /// instructions.
1402
+ ///
1403
+ /// \param __a
1404
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1405
+ /// used in the conversion.
1406
+ /// \returns A 32-bit integer containing the converted value.
1407
+ static __inline__ int __DEFAULT_FN_ATTRS
1408
+ _mm_cvt_ss2si(__m128 __a)
1409
+ {
1410
+ return _mm_cvtss_si32(__a);
1411
+ }
1412
+
1413
+ #ifdef __x86_64__
1414
+
1415
+ /// Converts a float value contained in the lower 32 bits of a vector of
1416
+ /// [4 x float] into a 64-bit integer.
1417
+ ///
1418
+ /// If the converted value does not fit in a 32-bit integer, raises a
1419
+ /// floating-point invalid exception. If the exception is masked, returns
1420
+ /// the most negative integer.
1421
+ ///
1422
+ /// \headerfile <x86intrin.h>
1423
+ ///
1424
+ /// This intrinsic corresponds to the <c> VCVTSS2SI / CVTSS2SI </c>
1425
+ /// instructions.
1426
+ ///
1427
+ /// \param __a
1428
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1429
+ /// used in the conversion.
1430
+ /// \returns A 64-bit integer containing the converted value.
1431
+ static __inline__ long long __DEFAULT_FN_ATTRS
1432
+ _mm_cvtss_si64(__m128 __a)
1433
+ {
1434
+ return __builtin_ia32_cvtss2si64((__v4sf)__a);
1435
+ }
1436
+
1437
+ #endif
1438
+
1439
+ /// Converts two low-order float values in a 128-bit vector of
1440
+ /// [4 x float] into a 64-bit vector of [2 x i32].
1441
+ ///
1442
+ /// If a converted value does not fit in a 32-bit integer, raises a
1443
+ /// floating-point invalid exception. If the exception is masked, returns
1444
+ /// the most negative integer.
1445
+ ///
1446
+ /// \headerfile <x86intrin.h>
1447
+ ///
1448
+ /// This intrinsic corresponds to the <c> CVTPS2PI </c> instruction.
1449
+ ///
1450
+ /// \param __a
1451
+ /// A 128-bit vector of [4 x float].
1452
+ /// \returns A 64-bit integer vector containing the converted values.
1453
+ static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
1454
+ _mm_cvtps_pi32(__m128 __a)
1455
+ {
1456
+ return __trunc64(__builtin_ia32_cvtps2dq((__v4sf)__zeroupper64(__a)));
1457
+ }
1458
+
1459
+ /// Converts two low-order float values in a 128-bit vector of
1460
+ /// [4 x float] into a 64-bit vector of [2 x i32].
1461
+ ///
1462
+ /// If a converted value does not fit in a 32-bit integer, raises a
1463
+ /// floating-point invalid exception. If the exception is masked, returns
1464
+ /// the most negative integer.
1465
+ ///
1466
+ /// \headerfile <x86intrin.h>
1467
+ ///
1468
+ /// This intrinsic corresponds to the <c> CVTPS2PI </c> instruction.
1469
+ ///
1470
+ /// \param __a
1471
+ /// A 128-bit vector of [4 x float].
1472
+ /// \returns A 64-bit integer vector containing the converted values.
1473
+ static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
1474
+ _mm_cvt_ps2pi(__m128 __a)
1475
+ {
1476
+ return _mm_cvtps_pi32(__a);
1477
+ }
1478
+
1479
+ /// Converts the lower (first) element of a vector of [4 x float] into a signed
1480
+ /// truncated (rounded toward zero) 32-bit integer.
1481
+ ///
1482
+ /// If the converted value does not fit in a 32-bit integer, raises a
1483
+ /// floating-point invalid exception. If the exception is masked, returns
1484
+ /// the most negative integer.
1485
+ ///
1486
+ /// \headerfile <x86intrin.h>
1487
+ ///
1488
+ /// This intrinsic corresponds to the <c> VCVTTSS2SI / CVTTSS2SI </c>
1489
+ /// instructions.
1490
+ ///
1491
+ /// \param __a
1492
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1493
+ /// used in the conversion.
1494
+ /// \returns A 32-bit integer containing the converted value.
1495
+ static __inline__ int __DEFAULT_FN_ATTRS
1496
+ _mm_cvttss_si32(__m128 __a)
1497
+ {
1498
+ return __builtin_ia32_cvttss2si((__v4sf)__a);
1499
+ }
1500
+
1501
+ /// Converts the lower (first) element of a vector of [4 x float] into a signed
1502
+ /// truncated (rounded toward zero) 32-bit integer.
1503
+ ///
1504
+ /// If the converted value does not fit in a 32-bit integer, raises a
1505
+ /// floating-point invalid exception. If the exception is masked, returns
1506
+ /// the most negative integer.
1507
+ ///
1508
+ /// \headerfile <x86intrin.h>
1509
+ ///
1510
+ /// This intrinsic corresponds to the <c> VCVTTSS2SI / CVTTSS2SI </c>
1511
+ /// instructions.
1512
+ ///
1513
+ /// \param __a
1514
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1515
+ /// used in the conversion.
1516
+ /// \returns A 32-bit integer containing the converted value.
1517
+ static __inline__ int __DEFAULT_FN_ATTRS
1518
+ _mm_cvtt_ss2si(__m128 __a)
1519
+ {
1520
+ return _mm_cvttss_si32(__a);
1521
+ }
1522
+
1523
+ #ifdef __x86_64__
1524
+ /// Converts the lower (first) element of a vector of [4 x float] into a signed
1525
+ /// truncated (rounded toward zero) 64-bit integer.
1526
+ ///
1527
+ /// If the converted value does not fit in a 64-bit integer, raises a
1528
+ /// floating-point invalid exception. If the exception is masked, returns
1529
+ /// the most negative integer.
1530
+ ///
1531
+ /// \headerfile <x86intrin.h>
1532
+ ///
1533
+ /// This intrinsic corresponds to the <c> VCVTTSS2SI / CVTTSS2SI </c>
1534
+ /// instructions.
1535
+ ///
1536
+ /// \param __a
1537
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1538
+ /// used in the conversion.
1539
+ /// \returns A 64-bit integer containing the converted value.
1540
+ static __inline__ long long __DEFAULT_FN_ATTRS
1541
+ _mm_cvttss_si64(__m128 __a)
1542
+ {
1543
+ return __builtin_ia32_cvttss2si64((__v4sf)__a);
1544
+ }
1545
+ #endif
1546
+
1547
+ /// Converts the lower (first) two elements of a 128-bit vector of [4 x float]
1548
+ /// into two signed truncated (rounded toward zero) 32-bit integers,
1549
+ /// returned in a 64-bit vector of [2 x i32].
1550
+ ///
1551
+ /// If a converted value does not fit in a 32-bit integer, raises a
1552
+ /// floating-point invalid exception. If the exception is masked, returns
1553
+ /// the most negative integer.
1554
+ ///
1555
+ /// \headerfile <x86intrin.h>
1556
+ ///
1557
+ /// This intrinsic corresponds to the <c> CVTTPS2PI / VTTPS2PI </c>
1558
+ /// instructions.
1559
+ ///
1560
+ /// \param __a
1561
+ /// A 128-bit vector of [4 x float].
1562
+ /// \returns A 64-bit integer vector containing the converted values.
1563
+ static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
1564
+ _mm_cvttps_pi32(__m128 __a)
1565
+ {
1566
+ return __trunc64(__builtin_ia32_cvttps2dq((__v4sf)__zeroupper64(__a)));
1567
+ }
1568
+
1569
+ /// Converts the lower (first) two elements of a 128-bit vector of [4 x float]
1570
+ /// into two signed truncated (rounded toward zero) 64-bit integers,
1571
+ /// returned in a 64-bit vector of [2 x i32].
1572
+ ///
1573
+ /// If a converted value does not fit in a 32-bit integer, raises a
1574
+ /// floating-point invalid exception. If the exception is masked, returns
1575
+ /// the most negative integer.
1576
+ ///
1577
+ /// \headerfile <x86intrin.h>
1578
+ ///
1579
+ /// This intrinsic corresponds to the <c> CVTTPS2PI </c> instruction.
1580
+ ///
1581
+ /// \param __a
1582
+ /// A 128-bit vector of [4 x float].
1583
+ /// \returns A 64-bit integer vector containing the converted values.
1584
+ static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
1585
+ _mm_cvtt_ps2pi(__m128 __a)
1586
+ {
1587
+ return _mm_cvttps_pi32(__a);
1588
+ }
1589
+
1590
+ /// Converts a 32-bit signed integer value into a floating point value
1591
+ /// and writes it to the lower 32 bits of the destination. The remaining
1592
+ /// higher order elements of the destination vector are copied from the
1593
+ /// corresponding elements in the first operand.
1594
+ ///
1595
+ /// \headerfile <x86intrin.h>
1596
+ ///
1597
+ /// This intrinsic corresponds to the <c> VCVTSI2SS / CVTSI2SS </c> instruction.
1598
+ ///
1599
+ /// \param __a
1600
+ /// A 128-bit vector of [4 x float].
1601
+ /// \param __b
1602
+ /// A 32-bit signed integer operand containing the value to be converted.
1603
+ /// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the
1604
+ /// converted value of the second operand. The upper 96 bits are copied from
1605
+ /// the upper 96 bits of the first operand.
1606
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_cvtsi32_ss(__m128 __a,
1607
+ int __b) {
1608
+ __a[0] = __b;
1609
+ return __a;
1610
+ }
1611
+
1612
+ /// Converts a 32-bit signed integer value into a floating point value
1613
+ /// and writes it to the lower 32 bits of the destination. The remaining
1614
+ /// higher order elements of the destination are copied from the
1615
+ /// corresponding elements in the first operand.
1616
+ ///
1617
+ /// \headerfile <x86intrin.h>
1618
+ ///
1619
+ /// This intrinsic corresponds to the <c> VCVTSI2SS / CVTSI2SS </c> instruction.
1620
+ ///
1621
+ /// \param __a
1622
+ /// A 128-bit vector of [4 x float].
1623
+ /// \param __b
1624
+ /// A 32-bit signed integer operand containing the value to be converted.
1625
+ /// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the
1626
+ /// converted value of the second operand. The upper 96 bits are copied from
1627
+ /// the upper 96 bits of the first operand.
1628
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_cvt_si2ss(__m128 __a,
1629
+ int __b) {
1630
+ return _mm_cvtsi32_ss(__a, __b);
1631
+ }
1632
+
1633
+ #ifdef __x86_64__
1634
+
1635
+ /// Converts a 64-bit signed integer value into a floating point value
1636
+ /// and writes it to the lower 32 bits of the destination. The remaining
1637
+ /// higher order elements of the destination are copied from the
1638
+ /// corresponding elements in the first operand.
1639
+ ///
1640
+ /// \headerfile <x86intrin.h>
1641
+ ///
1642
+ /// This intrinsic corresponds to the <c> VCVTSI2SS / CVTSI2SS </c> instruction.
1643
+ ///
1644
+ /// \param __a
1645
+ /// A 128-bit vector of [4 x float].
1646
+ /// \param __b
1647
+ /// A 64-bit signed integer operand containing the value to be converted.
1648
+ /// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the
1649
+ /// converted value of the second operand. The upper 96 bits are copied from
1650
+ /// the upper 96 bits of the first operand.
1651
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
1652
+ _mm_cvtsi64_ss(__m128 __a, long long __b) {
1653
+ __a[0] = __b;
1654
+ return __a;
1655
+ }
1656
+
1657
+ #endif
1658
+
1659
+ /// Converts two elements of a 64-bit vector of [2 x i32] into two
1660
+ /// floating point values and writes them to the lower 64-bits of the
1661
+ /// destination. The remaining higher order elements of the destination are
1662
+ /// copied from the corresponding elements in the first operand.
1663
+ ///
1664
+ /// \headerfile <x86intrin.h>
1665
+ ///
1666
+ /// This intrinsic corresponds to the <c> CVTPI2PS </c> instruction.
1667
+ ///
1668
+ /// \param __a
1669
+ /// A 128-bit vector of [4 x float].
1670
+ /// \param __b
1671
+ /// A 64-bit vector of [2 x i32]. The elements in this vector are converted
1672
+ /// and written to the corresponding low-order elements in the destination.
1673
+ /// \returns A 128-bit vector of [4 x float] whose lower 64 bits contain the
1674
+ /// converted value of the second operand. The upper 64 bits are copied from
1675
+ /// the upper 64 bits of the first operand.
1676
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1677
+ _mm_cvtpi32_ps(__m128 __a, __m64 __b)
1678
+ {
1679
+ return (__m128)__builtin_shufflevector(
1680
+ (__v4sf)__a,
1681
+ __builtin_convertvector((__v4si)__zext128(__b), __v4sf),
1682
+ 4, 5, 2, 3);
1683
+ }
1684
+
1685
+ /// Converts two elements of a 64-bit vector of [2 x i32] into two
1686
+ /// floating point values and writes them to the lower 64-bits of the
1687
+ /// destination. The remaining higher order elements of the destination are
1688
+ /// copied from the corresponding elements in the first operand.
1689
+ ///
1690
+ /// \headerfile <x86intrin.h>
1691
+ ///
1692
+ /// This intrinsic corresponds to the <c> CVTPI2PS </c> instruction.
1693
+ ///
1694
+ /// \param __a
1695
+ /// A 128-bit vector of [4 x float].
1696
+ /// \param __b
1697
+ /// A 64-bit vector of [2 x i32]. The elements in this vector are converted
1698
+ /// and written to the corresponding low-order elements in the destination.
1699
+ /// \returns A 128-bit vector of [4 x float] whose lower 64 bits contain the
1700
+ /// converted value from the second operand. The upper 64 bits are copied
1701
+ /// from the upper 64 bits of the first operand.
1702
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
1703
+ _mm_cvt_pi2ps(__m128 __a, __m64 __b)
1704
+ {
1705
+ return _mm_cvtpi32_ps(__a, __b);
1706
+ }
1707
+
1708
+ /// Extracts a float value contained in the lower 32 bits of a vector of
1709
+ /// [4 x float].
1710
+ ///
1711
+ /// \headerfile <x86intrin.h>
1712
+ ///
1713
+ /// This intrinsic has no corresponding instruction.
1714
+ ///
1715
+ /// \param __a
1716
+ /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1717
+ /// used in the extraction.
1718
+ /// \returns A 32-bit float containing the extracted value.
1719
+ static __inline__ float __DEFAULT_FN_ATTRS_CONSTEXPR
1720
+ _mm_cvtss_f32(__m128 __a) {
1721
+ return __a[0];
1722
+ }
1723
+
1724
+ /// Loads two packed float values from the address \a __p into the
1725
+ /// high-order bits of a 128-bit vector of [4 x float]. The low-order bits
1726
+ /// are copied from the low-order bits of the first operand.
1727
+ ///
1728
+ /// \headerfile <x86intrin.h>
1729
+ ///
1730
+ /// This intrinsic corresponds to the <c> VMOVHPD / MOVHPD </c> instruction.
1731
+ ///
1732
+ /// \param __a
1733
+ /// A 128-bit vector of [4 x float]. Bits [63:0] are written to bits [63:0]
1734
+ /// of the destination.
1735
+ /// \param __p
1736
+ /// A pointer to two packed float values. Bits [63:0] are written to bits
1737
+ /// [127:64] of the destination.
1738
+ /// \returns A 128-bit vector of [4 x float] containing the moved values.
1739
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
1740
+ _mm_loadh_pi(__m128 __a, const __m64 *__p)
1741
+ {
1742
+ typedef float __mm_loadh_pi_v2f32 __attribute__((__vector_size__(8)));
1743
+ struct __mm_loadh_pi_struct {
1744
+ __mm_loadh_pi_v2f32 __u;
1745
+ } __attribute__((__packed__, __may_alias__));
1746
+ __mm_loadh_pi_v2f32 __b = ((const struct __mm_loadh_pi_struct*)__p)->__u;
1747
+ __m128 __bb = __builtin_shufflevector(__b, __b, 0, 1, 0, 1);
1748
+ return __builtin_shufflevector(__a, __bb, 0, 1, 4, 5);
1749
+ }
1750
+
1751
+ /// Loads two packed float values from the address \a __p into the
1752
+ /// low-order bits of a 128-bit vector of [4 x float]. The high-order bits
1753
+ /// are copied from the high-order bits of the first operand.
1754
+ ///
1755
+ /// \headerfile <x86intrin.h>
1756
+ ///
1757
+ /// This intrinsic corresponds to the <c> VMOVLPD / MOVLPD </c> instruction.
1758
+ ///
1759
+ /// \param __a
1760
+ /// A 128-bit vector of [4 x float]. Bits [127:64] are written to bits
1761
+ /// [127:64] of the destination.
1762
+ /// \param __p
1763
+ /// A pointer to two packed float values. Bits [63:0] are written to bits
1764
+ /// [63:0] of the destination.
1765
+ /// \returns A 128-bit vector of [4 x float] containing the moved values.
1766
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
1767
+ _mm_loadl_pi(__m128 __a, const __m64 *__p)
1768
+ {
1769
+ typedef float __mm_loadl_pi_v2f32 __attribute__((__vector_size__(8)));
1770
+ struct __mm_loadl_pi_struct {
1771
+ __mm_loadl_pi_v2f32 __u;
1772
+ } __attribute__((__packed__, __may_alias__));
1773
+ __mm_loadl_pi_v2f32 __b = ((const struct __mm_loadl_pi_struct*)__p)->__u;
1774
+ __m128 __bb = __builtin_shufflevector(__b, __b, 0, 1, 0, 1);
1775
+ return __builtin_shufflevector(__a, __bb, 4, 5, 2, 3);
1776
+ }
1777
+
1778
+ /// Constructs a 128-bit floating-point vector of [4 x float]. The lower
1779
+ /// 32 bits of the vector are initialized with the single-precision
1780
+ /// floating-point value loaded from a specified memory location. The upper
1781
+ /// 96 bits are set to zero.
1782
+ ///
1783
+ /// \headerfile <x86intrin.h>
1784
+ ///
1785
+ /// This intrinsic corresponds to the <c> VMOVSS / MOVSS </c> instruction.
1786
+ ///
1787
+ /// \param __p
1788
+ /// A pointer to a 32-bit memory location containing a single-precision
1789
+ /// floating-point value.
1790
+ /// \returns An initialized 128-bit floating-point vector of [4 x float]. The
1791
+ /// lower 32 bits contain the value loaded from the memory location. The
1792
+ /// upper 96 bits are set to zero.
1793
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
1794
+ _mm_load_ss(const float *__p)
1795
+ {
1796
+ struct __mm_load_ss_struct {
1797
+ float __u;
1798
+ } __attribute__((__packed__, __may_alias__));
1799
+ float __u = ((const struct __mm_load_ss_struct*)__p)->__u;
1800
+ return __extension__ (__m128){ __u, 0, 0, 0 };
1801
+ }
1802
+
1803
+ /// Loads a 32-bit float value and duplicates it to all four vector
1804
+ /// elements of a 128-bit vector of [4 x float].
1805
+ ///
1806
+ /// \headerfile <x86intrin.h>
1807
+ ///
1808
+ /// This intrinsic corresponds to the <c> VBROADCASTSS / MOVSS + shuffling </c>
1809
+ /// instruction.
1810
+ ///
1811
+ /// \param __p
1812
+ /// A pointer to a float value to be loaded and duplicated.
1813
+ /// \returns A 128-bit vector of [4 x float] containing the loaded and
1814
+ /// duplicated values.
1815
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
1816
+ _mm_load1_ps(const float *__p)
1817
+ {
1818
+ struct __mm_load1_ps_struct {
1819
+ float __u;
1820
+ } __attribute__((__packed__, __may_alias__));
1821
+ float __u = ((const struct __mm_load1_ps_struct*)__p)->__u;
1822
+ return __extension__ (__m128){ __u, __u, __u, __u };
1823
+ }
1824
+
1825
+ #define _mm_load_ps1(p) _mm_load1_ps(p)
1826
+
1827
+ /// Loads a 128-bit floating-point vector of [4 x float] from an aligned
1828
+ /// memory location.
1829
+ ///
1830
+ /// \headerfile <x86intrin.h>
1831
+ ///
1832
+ /// This intrinsic corresponds to the <c> VMOVAPS / MOVAPS </c> instruction.
1833
+ ///
1834
+ /// \param __p
1835
+ /// A pointer to a 128-bit memory location. The address of the memory
1836
+ /// location has to be 128-bit aligned.
1837
+ /// \returns A 128-bit vector of [4 x float] containing the loaded values.
1838
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
1839
+ _mm_load_ps(const float *__p)
1840
+ {
1841
+ return *(const __m128*)__p;
1842
+ }
1843
+
1844
+ /// Loads a 128-bit floating-point vector of [4 x float] from an
1845
+ /// unaligned memory location.
1846
+ ///
1847
+ /// \headerfile <x86intrin.h>
1848
+ ///
1849
+ /// This intrinsic corresponds to the <c> VMOVUPS / MOVUPS </c> instruction.
1850
+ ///
1851
+ /// \param __p
1852
+ /// A pointer to a 128-bit memory location. The address of the memory
1853
+ /// location does not have to be aligned.
1854
+ /// \returns A 128-bit vector of [4 x float] containing the loaded values.
1855
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
1856
+ _mm_loadu_ps(const float *__p)
1857
+ {
1858
+ struct __loadu_ps {
1859
+ __m128_u __v;
1860
+ } __attribute__((__packed__, __may_alias__));
1861
+ return ((const struct __loadu_ps*)__p)->__v;
1862
+ }
1863
+
1864
+ /// Loads four packed float values, in reverse order, from an aligned
1865
+ /// memory location to 32-bit elements in a 128-bit vector of [4 x float].
1866
+ ///
1867
+ /// \headerfile <x86intrin.h>
1868
+ ///
1869
+ /// This intrinsic corresponds to the <c> VMOVAPS / MOVAPS + shuffling </c>
1870
+ /// instruction.
1871
+ ///
1872
+ /// \param __p
1873
+ /// A pointer to a 128-bit memory location. The address of the memory
1874
+ /// location has to be 128-bit aligned.
1875
+ /// \returns A 128-bit vector of [4 x float] containing the moved values, loaded
1876
+ /// in reverse order.
1877
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
1878
+ _mm_loadr_ps(const float *__p)
1879
+ {
1880
+ __m128 __a = _mm_load_ps(__p);
1881
+ return __builtin_shufflevector((__v4sf)__a, (__v4sf)__a, 3, 2, 1, 0);
1882
+ }
1883
+
1884
+ /// Create a 128-bit vector of [4 x float] with undefined values.
1885
+ ///
1886
+ /// \headerfile <x86intrin.h>
1887
+ ///
1888
+ /// This intrinsic has no corresponding instruction.
1889
+ ///
1890
+ /// \returns A 128-bit vector of [4 x float] containing undefined values.
1891
+ static __inline__ __m128 __DEFAULT_FN_ATTRS
1892
+ _mm_undefined_ps(void)
1893
+ {
1894
+ return (__m128)__builtin_ia32_undef128();
1895
+ }
1896
+
1897
+ /// Constructs a 128-bit floating-point vector of [4 x float]. The lower
1898
+ /// 32 bits of the vector are initialized with the specified single-precision
1899
+ /// floating-point value. The upper 96 bits are set to zero.
1900
+ ///
1901
+ /// \headerfile <x86intrin.h>
1902
+ ///
1903
+ /// This intrinsic corresponds to the <c> VMOVSS / MOVSS </c> instruction.
1904
+ ///
1905
+ /// \param __w
1906
+ /// A single-precision floating-point value used to initialize the lower 32
1907
+ /// bits of the result.
1908
+ /// \returns An initialized 128-bit floating-point vector of [4 x float]. The
1909
+ /// lower 32 bits contain the value provided in the source operand. The
1910
+ /// upper 96 bits are set to zero.
1911
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
1912
+ _mm_set_ss(float __w) {
1913
+ return __extension__ (__m128){ __w, 0.0f, 0.0f, 0.0f };
1914
+ }
1915
+
1916
+ /// Constructs a 128-bit floating-point vector of [4 x float], with each
1917
+ /// of the four single-precision floating-point vector elements set to the
1918
+ /// specified single-precision floating-point value.
1919
+ ///
1920
+ /// \headerfile <x86intrin.h>
1921
+ ///
1922
+ /// This intrinsic corresponds to the <c> VPERMILPS / PERMILPS </c> instruction.
1923
+ ///
1924
+ /// \param __w
1925
+ /// A single-precision floating-point value used to initialize each vector
1926
+ /// element of the result.
1927
+ /// \returns An initialized 128-bit floating-point vector of [4 x float].
1928
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
1929
+ _mm_set1_ps(float __w) {
1930
+ return __extension__ (__m128){ __w, __w, __w, __w };
1931
+ }
1932
+
1933
+ /* Microsoft specific. */
1934
+ /// Constructs a 128-bit floating-point vector of [4 x float], with each
1935
+ /// of the four single-precision floating-point vector elements set to the
1936
+ /// specified single-precision floating-point value.
1937
+ ///
1938
+ /// \headerfile <x86intrin.h>
1939
+ ///
1940
+ /// This intrinsic corresponds to the <c> VPERMILPS / PERMILPS </c> instruction.
1941
+ ///
1942
+ /// \param __w
1943
+ /// A single-precision floating-point value used to initialize each vector
1944
+ /// element of the result.
1945
+ /// \returns An initialized 128-bit floating-point vector of [4 x float].
1946
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
1947
+ _mm_set_ps1(float __w) {
1948
+ return _mm_set1_ps(__w);
1949
+ }
1950
+
1951
+ /// Constructs a 128-bit floating-point vector of [4 x float]
1952
+ /// initialized with the specified single-precision floating-point values.
1953
+ ///
1954
+ /// \headerfile <x86intrin.h>
1955
+ ///
1956
+ /// This intrinsic is a utility function and does not correspond to a specific
1957
+ /// instruction.
1958
+ ///
1959
+ /// \param __z
1960
+ /// A single-precision floating-point value used to initialize bits [127:96]
1961
+ /// of the result.
1962
+ /// \param __y
1963
+ /// A single-precision floating-point value used to initialize bits [95:64]
1964
+ /// of the result.
1965
+ /// \param __x
1966
+ /// A single-precision floating-point value used to initialize bits [63:32]
1967
+ /// of the result.
1968
+ /// \param __w
1969
+ /// A single-precision floating-point value used to initialize bits [31:0]
1970
+ /// of the result.
1971
+ /// \returns An initialized 128-bit floating-point vector of [4 x float].
1972
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
1973
+ _mm_set_ps(float __z, float __y, float __x, float __w) {
1974
+ return __extension__ (__m128){ __w, __x, __y, __z };
1975
+ }
1976
+
1977
+ /// Constructs a 128-bit floating-point vector of [4 x float],
1978
+ /// initialized in reverse order with the specified 32-bit single-precision
1979
+ /// float-point values.
1980
+ ///
1981
+ /// \headerfile <x86intrin.h>
1982
+ ///
1983
+ /// This intrinsic is a utility function and does not correspond to a specific
1984
+ /// instruction.
1985
+ ///
1986
+ /// \param __z
1987
+ /// A single-precision floating-point value used to initialize bits [31:0]
1988
+ /// of the result.
1989
+ /// \param __y
1990
+ /// A single-precision floating-point value used to initialize bits [63:32]
1991
+ /// of the result.
1992
+ /// \param __x
1993
+ /// A single-precision floating-point value used to initialize bits [95:64]
1994
+ /// of the result.
1995
+ /// \param __w
1996
+ /// A single-precision floating-point value used to initialize bits [127:96]
1997
+ /// of the result.
1998
+ /// \returns An initialized 128-bit floating-point vector of [4 x float].
1999
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
2000
+ _mm_setr_ps(float __z, float __y, float __x, float __w) {
2001
+ return __extension__ (__m128){ __z, __y, __x, __w };
2002
+ }
2003
+
2004
+ /// Constructs a 128-bit floating-point vector of [4 x float] initialized
2005
+ /// to zero.
2006
+ ///
2007
+ /// \headerfile <x86intrin.h>
2008
+ ///
2009
+ /// This intrinsic corresponds to the <c> VXORPS / XORPS </c> instruction.
2010
+ ///
2011
+ /// \returns An initialized 128-bit floating-point vector of [4 x float] with
2012
+ /// all elements set to zero.
2013
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
2014
+ _mm_setzero_ps(void) {
2015
+ return __extension__ (__m128){ 0.0f, 0.0f, 0.0f, 0.0f };
2016
+ }
2017
+
2018
+ /// Stores the upper 64 bits of a 128-bit vector of [4 x float] to a
2019
+ /// memory location.
2020
+ ///
2021
+ /// \headerfile <x86intrin.h>
2022
+ ///
2023
+ /// This intrinsic corresponds to the <c> VPEXTRQ / PEXTRQ </c> instruction.
2024
+ ///
2025
+ /// \param __p
2026
+ /// A pointer to a 64-bit memory location.
2027
+ /// \param __a
2028
+ /// A 128-bit vector of [4 x float] containing the values to be stored.
2029
+ static __inline__ void __DEFAULT_FN_ATTRS
2030
+ _mm_storeh_pi(__m64 *__p, __m128 __a)
2031
+ {
2032
+ typedef float __mm_storeh_pi_v2f32 __attribute__((__vector_size__(8)));
2033
+ struct __mm_storeh_pi_struct {
2034
+ __mm_storeh_pi_v2f32 __u;
2035
+ } __attribute__((__packed__, __may_alias__));
2036
+ ((struct __mm_storeh_pi_struct*)__p)->__u = __builtin_shufflevector(__a, __a, 2, 3);
2037
+ }
2038
+
2039
+ /// Stores the lower 64 bits of a 128-bit vector of [4 x float] to a
2040
+ /// memory location.
2041
+ ///
2042
+ /// \headerfile <x86intrin.h>
2043
+ ///
2044
+ /// This intrinsic corresponds to the <c> VMOVLPS / MOVLPS </c> instruction.
2045
+ ///
2046
+ /// \param __p
2047
+ /// A pointer to a memory location that will receive the float values.
2048
+ /// \param __a
2049
+ /// A 128-bit vector of [4 x float] containing the values to be stored.
2050
+ static __inline__ void __DEFAULT_FN_ATTRS
2051
+ _mm_storel_pi(__m64 *__p, __m128 __a)
2052
+ {
2053
+ typedef float __mm_storeh_pi_v2f32 __attribute__((__vector_size__(8)));
2054
+ struct __mm_storeh_pi_struct {
2055
+ __mm_storeh_pi_v2f32 __u;
2056
+ } __attribute__((__packed__, __may_alias__));
2057
+ ((struct __mm_storeh_pi_struct*)__p)->__u = __builtin_shufflevector(__a, __a, 0, 1);
2058
+ }
2059
+
2060
+ /// Stores the lower 32 bits of a 128-bit vector of [4 x float] to a
2061
+ /// memory location.
2062
+ ///
2063
+ /// \headerfile <x86intrin.h>
2064
+ ///
2065
+ /// This intrinsic corresponds to the <c> VMOVSS / MOVSS </c> instruction.
2066
+ ///
2067
+ /// \param __p
2068
+ /// A pointer to a 32-bit memory location.
2069
+ /// \param __a
2070
+ /// A 128-bit vector of [4 x float] containing the value to be stored.
2071
+ static __inline__ void __DEFAULT_FN_ATTRS
2072
+ _mm_store_ss(float *__p, __m128 __a)
2073
+ {
2074
+ struct __mm_store_ss_struct {
2075
+ float __u;
2076
+ } __attribute__((__packed__, __may_alias__));
2077
+ ((struct __mm_store_ss_struct*)__p)->__u = __a[0];
2078
+ }
2079
+
2080
+ /// Stores a 128-bit vector of [4 x float] to an unaligned memory
2081
+ /// location.
2082
+ ///
2083
+ /// \headerfile <x86intrin.h>
2084
+ ///
2085
+ /// This intrinsic corresponds to the <c> VMOVUPS / MOVUPS </c> instruction.
2086
+ ///
2087
+ /// \param __p
2088
+ /// A pointer to a 128-bit memory location. The address of the memory
2089
+ /// location does not have to be aligned.
2090
+ /// \param __a
2091
+ /// A 128-bit vector of [4 x float] containing the values to be stored.
2092
+ static __inline__ void __DEFAULT_FN_ATTRS
2093
+ _mm_storeu_ps(float *__p, __m128 __a)
2094
+ {
2095
+ struct __storeu_ps {
2096
+ __m128_u __v;
2097
+ } __attribute__((__packed__, __may_alias__));
2098
+ ((struct __storeu_ps*)__p)->__v = __a;
2099
+ }
2100
+
2101
+ /// Stores a 128-bit vector of [4 x float] into an aligned memory
2102
+ /// location.
2103
+ ///
2104
+ /// \headerfile <x86intrin.h>
2105
+ ///
2106
+ /// This intrinsic corresponds to the <c> VMOVAPS / MOVAPS </c> instruction.
2107
+ ///
2108
+ /// \param __p
2109
+ /// A pointer to a 128-bit memory location. The address of the memory
2110
+ /// location has to be 16-byte aligned.
2111
+ /// \param __a
2112
+ /// A 128-bit vector of [4 x float] containing the values to be stored.
2113
+ static __inline__ void __DEFAULT_FN_ATTRS
2114
+ _mm_store_ps(float *__p, __m128 __a)
2115
+ {
2116
+ *(__m128*)__p = __a;
2117
+ }
2118
+
2119
+ /// Stores the lower 32 bits of a 128-bit vector of [4 x float] into
2120
+ /// four contiguous elements in an aligned memory location.
2121
+ ///
2122
+ /// \headerfile <x86intrin.h>
2123
+ ///
2124
+ /// This intrinsic corresponds to <c> VMOVAPS / MOVAPS + shuffling </c>
2125
+ /// instruction.
2126
+ ///
2127
+ /// \param __p
2128
+ /// A pointer to a 128-bit memory location.
2129
+ /// \param __a
2130
+ /// A 128-bit vector of [4 x float] whose lower 32 bits are stored to each
2131
+ /// of the four contiguous elements pointed by \a __p.
2132
+ static __inline__ void __DEFAULT_FN_ATTRS
2133
+ _mm_store1_ps(float *__p, __m128 __a)
2134
+ {
2135
+ __a = __builtin_shufflevector((__v4sf)__a, (__v4sf)__a, 0, 0, 0, 0);
2136
+ _mm_store_ps(__p, __a);
2137
+ }
2138
+
2139
+ /// Stores the lower 32 bits of a 128-bit vector of [4 x float] into
2140
+ /// four contiguous elements in an aligned memory location.
2141
+ ///
2142
+ /// \headerfile <x86intrin.h>
2143
+ ///
2144
+ /// This intrinsic corresponds to <c> VMOVAPS / MOVAPS + shuffling </c>
2145
+ /// instruction.
2146
+ ///
2147
+ /// \param __p
2148
+ /// A pointer to a 128-bit memory location.
2149
+ /// \param __a
2150
+ /// A 128-bit vector of [4 x float] whose lower 32 bits are stored to each
2151
+ /// of the four contiguous elements pointed by \a __p.
2152
+ static __inline__ void __DEFAULT_FN_ATTRS
2153
+ _mm_store_ps1(float *__p, __m128 __a)
2154
+ {
2155
+ _mm_store1_ps(__p, __a);
2156
+ }
2157
+
2158
+ /// Stores float values from a 128-bit vector of [4 x float] to an
2159
+ /// aligned memory location in reverse order.
2160
+ ///
2161
+ /// \headerfile <x86intrin.h>
2162
+ ///
2163
+ /// This intrinsic corresponds to the <c> VMOVAPS / MOVAPS + shuffling </c>
2164
+ /// instruction.
2165
+ ///
2166
+ /// \param __p
2167
+ /// A pointer to a 128-bit memory location. The address of the memory
2168
+ /// location has to be 128-bit aligned.
2169
+ /// \param __a
2170
+ /// A 128-bit vector of [4 x float] containing the values to be stored.
2171
+ static __inline__ void __DEFAULT_FN_ATTRS
2172
+ _mm_storer_ps(float *__p, __m128 __a)
2173
+ {
2174
+ __a = __builtin_shufflevector((__v4sf)__a, (__v4sf)__a, 3, 2, 1, 0);
2175
+ _mm_store_ps(__p, __a);
2176
+ }
2177
+
2178
+ #define _MM_HINT_ET0 7
2179
+ #define _MM_HINT_ET1 6
2180
+ #define _MM_HINT_T0 3
2181
+ #define _MM_HINT_T1 2
2182
+ #define _MM_HINT_T2 1
2183
+ #define _MM_HINT_NTA 0
2184
+
2185
+ #ifndef _MSC_VER
2186
+ // If _MSC_VER is defined, we use the builtin variant of _mm_prefetch.
2187
+ // Otherwise, we provide this macro, which includes a cast, allowing the user
2188
+ // to pass a pointer of any time. The _mm_prefetch accepts char to match MSVC.
2189
+
2190
+ /// Loads one cache line of data from the specified address to a location
2191
+ /// closer to the processor.
2192
+ ///
2193
+ /// \headerfile <x86intrin.h>
2194
+ ///
2195
+ /// \code
2196
+ /// void _mm_prefetch(const void *a, const int sel);
2197
+ /// \endcode
2198
+ ///
2199
+ /// This intrinsic corresponds to the <c> PREFETCHNTA </c> instruction.
2200
+ ///
2201
+ /// \param a
2202
+ /// A pointer to a memory location containing a cache line of data.
2203
+ /// \param sel
2204
+ /// A predefined integer constant specifying the type of prefetch
2205
+ /// operation: \n
2206
+ /// _MM_HINT_NTA: Move data using the non-temporal access (NTA) hint. The
2207
+ /// PREFETCHNTA instruction will be generated. \n
2208
+ /// _MM_HINT_T0: Move data using the T0 hint. The PREFETCHT0 instruction will
2209
+ /// be generated. \n
2210
+ /// _MM_HINT_T1: Move data using the T1 hint. The PREFETCHT1 instruction will
2211
+ /// be generated. \n
2212
+ /// _MM_HINT_T2: Move data using the T2 hint. The PREFETCHT2 instruction will
2213
+ /// be generated.
2214
+ #define _mm_prefetch(a, sel) (__builtin_prefetch((const void *)(a), \
2215
+ ((sel) >> 2) & 1, (sel) & 0x3))
2216
+ #endif
2217
+
2218
+ /// Stores a 64-bit integer in the specified aligned memory location. To
2219
+ /// minimize caching, the data is flagged as non-temporal (unlikely to be
2220
+ /// used again soon).
2221
+ ///
2222
+ /// \headerfile <x86intrin.h>
2223
+ ///
2224
+ /// This intrinsic corresponds to the <c> MOVNTQ </c> instruction.
2225
+ ///
2226
+ /// \param __p
2227
+ /// A pointer to an aligned memory location used to store the register value.
2228
+ /// \param __a
2229
+ /// A 64-bit integer containing the value to be stored.
2230
+ static __inline__ void __DEFAULT_FN_ATTRS
2231
+ _mm_stream_pi(void *__p, __m64 __a)
2232
+ {
2233
+ __builtin_nontemporal_store(__a, (__m64 *)__p);
2234
+ }
2235
+
2236
+ /// Moves packed float values from a 128-bit vector of [4 x float] to a
2237
+ /// 128-bit aligned memory location. To minimize caching, the data is flagged
2238
+ /// as non-temporal (unlikely to be used again soon).
2239
+ ///
2240
+ /// \headerfile <x86intrin.h>
2241
+ ///
2242
+ /// This intrinsic corresponds to the <c> VMOVNTPS / MOVNTPS </c> instruction.
2243
+ ///
2244
+ /// \param __p
2245
+ /// A pointer to a 128-bit aligned memory location that will receive the
2246
+ /// single-precision floating-point values.
2247
+ /// \param __a
2248
+ /// A 128-bit vector of [4 x float] containing the values to be moved.
2249
+ static __inline__ void __DEFAULT_FN_ATTRS
2250
+ _mm_stream_ps(void *__p, __m128 __a)
2251
+ {
2252
+ __builtin_nontemporal_store((__v4sf)__a, (__v4sf*)__p);
2253
+ }
2254
+
2255
+ #if defined(__cplusplus)
2256
+ extern "C" {
2257
+ #endif
2258
+
2259
+ /// Forces strong memory ordering (serialization) between store
2260
+ /// instructions preceding this instruction and store instructions following
2261
+ /// this instruction, ensuring the system completes all previous stores
2262
+ /// before executing subsequent stores.
2263
+ ///
2264
+ /// \headerfile <x86intrin.h>
2265
+ ///
2266
+ /// This intrinsic corresponds to the <c> SFENCE </c> instruction.
2267
+ ///
2268
+ void _mm_sfence(void);
2269
+
2270
+ #if defined(__cplusplus)
2271
+ } // extern "C"
2272
+ #endif
2273
+
2274
+ /// Extracts 16-bit element from a 64-bit vector of [4 x i16] and
2275
+ /// returns it, as specified by the immediate integer operand.
2276
+ ///
2277
+ /// \headerfile <x86intrin.h>
2278
+ ///
2279
+ /// \code
2280
+ /// int _mm_extract_pi16(__m64 a, int n);
2281
+ /// \endcode
2282
+ ///
2283
+ /// This intrinsic corresponds to the <c> VPEXTRW / PEXTRW </c> instruction.
2284
+ ///
2285
+ /// \param a
2286
+ /// A 64-bit vector of [4 x i16].
2287
+ /// \param n
2288
+ /// An immediate integer operand that determines which bits are extracted: \n
2289
+ /// 0: Bits [15:0] are copied to the destination. \n
2290
+ /// 1: Bits [31:16] are copied to the destination. \n
2291
+ /// 2: Bits [47:32] are copied to the destination. \n
2292
+ /// 3: Bits [63:48] are copied to the destination.
2293
+ /// \returns A 16-bit integer containing the extracted 16 bits of packed data.
2294
+ #define _mm_extract_pi16(a, n) \
2295
+ ((int)(unsigned short)__builtin_ia32_vec_ext_v4hi((__v4hi)a, (int)n))
2296
+
2297
+ /// Copies data from the 64-bit vector of [4 x i16] to the destination,
2298
+ /// and inserts the lower 16-bits of an integer operand at the 16-bit offset
2299
+ /// specified by the immediate operand \a n.
2300
+ ///
2301
+ /// \headerfile <x86intrin.h>
2302
+ ///
2303
+ /// \code
2304
+ /// __m64 _mm_insert_pi16(__m64 a, int d, int n);
2305
+ /// \endcode
2306
+ ///
2307
+ /// This intrinsic corresponds to the <c> PINSRW </c> instruction.
2308
+ ///
2309
+ /// \param a
2310
+ /// A 64-bit vector of [4 x i16].
2311
+ /// \param d
2312
+ /// An integer. The lower 16-bit value from this operand is written to the
2313
+ /// destination at the offset specified by operand \a n.
2314
+ /// \param n
2315
+ /// An immediate integer operant that determines which the bits to be used
2316
+ /// in the destination. \n
2317
+ /// 0: Bits [15:0] are copied to the destination. \n
2318
+ /// 1: Bits [31:16] are copied to the destination. \n
2319
+ /// 2: Bits [47:32] are copied to the destination. \n
2320
+ /// 3: Bits [63:48] are copied to the destination. \n
2321
+ /// The remaining bits in the destination are copied from the corresponding
2322
+ /// bits in operand \a a.
2323
+ /// \returns A 64-bit integer vector containing the copied packed data from the
2324
+ /// operands.
2325
+ #define _mm_insert_pi16(a, d, n) \
2326
+ ((__m64)__builtin_ia32_vec_set_v4hi((__v4hi)a, (int)d, (int)n))
2327
+
2328
+ /// Compares each of the corresponding packed 16-bit integer values of
2329
+ /// the 64-bit integer vectors, and writes the greater value to the
2330
+ /// corresponding bits in the destination.
2331
+ ///
2332
+ /// \headerfile <x86intrin.h>
2333
+ ///
2334
+ /// This intrinsic corresponds to the <c> PMAXSW </c> instruction.
2335
+ ///
2336
+ /// \param __a
2337
+ /// A 64-bit integer vector containing one of the source operands.
2338
+ /// \param __b
2339
+ /// A 64-bit integer vector containing one of the source operands.
2340
+ /// \returns A 64-bit integer vector containing the comparison results.
2341
+ static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
2342
+ _mm_max_pi16(__m64 __a, __m64 __b) {
2343
+ return (__m64)__builtin_elementwise_max((__v4hi)__a, (__v4hi)__b);
2344
+ }
2345
+
2346
+ /// Compares each of the corresponding packed 8-bit unsigned integer
2347
+ /// values of the 64-bit integer vectors, and writes the greater value to the
2348
+ /// corresponding bits in the destination.
2349
+ ///
2350
+ /// \headerfile <x86intrin.h>
2351
+ ///
2352
+ /// This intrinsic corresponds to the <c> PMAXUB </c> instruction.
2353
+ ///
2354
+ /// \param __a
2355
+ /// A 64-bit integer vector containing one of the source operands.
2356
+ /// \param __b
2357
+ /// A 64-bit integer vector containing one of the source operands.
2358
+ /// \returns A 64-bit integer vector containing the comparison results.
2359
+ static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
2360
+ _mm_max_pu8(__m64 __a, __m64 __b) {
2361
+ return (__m64)__builtin_elementwise_max((__v8qu)__a, (__v8qu)__b);
2362
+ }
2363
+
2364
+ /// Compares each of the corresponding packed 16-bit integer values of
2365
+ /// the 64-bit integer vectors, and writes the lesser value to the
2366
+ /// corresponding bits in the destination.
2367
+ ///
2368
+ /// \headerfile <x86intrin.h>
2369
+ ///
2370
+ /// This intrinsic corresponds to the <c> PMINSW </c> instruction.
2371
+ ///
2372
+ /// \param __a
2373
+ /// A 64-bit integer vector containing one of the source operands.
2374
+ /// \param __b
2375
+ /// A 64-bit integer vector containing one of the source operands.
2376
+ /// \returns A 64-bit integer vector containing the comparison results.
2377
+ static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
2378
+ _mm_min_pi16(__m64 __a, __m64 __b) {
2379
+ return (__m64)__builtin_elementwise_min((__v4hi)__a, (__v4hi)__b);
2380
+ }
2381
+
2382
+ /// Compares each of the corresponding packed 8-bit unsigned integer
2383
+ /// values of the 64-bit integer vectors, and writes the lesser value to the
2384
+ /// corresponding bits in the destination.
2385
+ ///
2386
+ /// \headerfile <x86intrin.h>
2387
+ ///
2388
+ /// This intrinsic corresponds to the <c> PMINUB </c> instruction.
2389
+ ///
2390
+ /// \param __a
2391
+ /// A 64-bit integer vector containing one of the source operands.
2392
+ /// \param __b
2393
+ /// A 64-bit integer vector containing one of the source operands.
2394
+ /// \returns A 64-bit integer vector containing the comparison results.
2395
+ static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
2396
+ _mm_min_pu8(__m64 __a, __m64 __b) {
2397
+ return (__m64)__builtin_elementwise_min((__v8qu)__a, (__v8qu)__b);
2398
+ }
2399
+
2400
+ /// Takes the most significant bit from each 8-bit element in a 64-bit
2401
+ /// integer vector to create an 8-bit mask value. Zero-extends the value to
2402
+ /// 32-bit integer and writes it to the destination.
2403
+ ///
2404
+ /// \headerfile <x86intrin.h>
2405
+ ///
2406
+ /// This intrinsic corresponds to the <c> PMOVMSKB </c> instruction.
2407
+ ///
2408
+ /// \param __a
2409
+ /// A 64-bit integer vector containing the values with bits to be extracted.
2410
+ /// \returns The most significant bit from each 8-bit element in \a __a,
2411
+ /// written to bits [7:0].
2412
+ static __inline__ int __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
2413
+ _mm_movemask_pi8(__m64 __a) {
2414
+ return __builtin_ia32_pmovmskb128((__v16qi)__zext128(__a));
2415
+ }
2416
+
2417
+ /// Multiplies packed 16-bit unsigned integer values and writes the
2418
+ /// high-order 16 bits of each 32-bit product to the corresponding bits in
2419
+ /// the destination.
2420
+ ///
2421
+ /// \headerfile <x86intrin.h>
2422
+ ///
2423
+ /// This intrinsic corresponds to the <c> PMULHUW </c> instruction.
2424
+ ///
2425
+ /// \param __a
2426
+ /// A 64-bit integer vector containing one of the source operands.
2427
+ /// \param __b
2428
+ /// A 64-bit integer vector containing one of the source operands.
2429
+ /// \returns A 64-bit integer vector containing the products of both operands.
2430
+ static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
2431
+ _mm_mulhi_pu16(__m64 __a, __m64 __b)
2432
+ {
2433
+ return __trunc64(__builtin_ia32_pmulhuw128((__v8hu)__zext128(__a),
2434
+ (__v8hu)__zext128(__b)));
2435
+ }
2436
+
2437
+ /// Shuffles the 4 16-bit integers from a 64-bit integer vector to the
2438
+ /// destination, as specified by the immediate value operand.
2439
+ ///
2440
+ /// \headerfile <x86intrin.h>
2441
+ ///
2442
+ /// \code
2443
+ /// __m64 _mm_shuffle_pi16(__m64 a, const int n);
2444
+ /// \endcode
2445
+ ///
2446
+ /// This intrinsic corresponds to the <c> PSHUFW </c> instruction.
2447
+ ///
2448
+ /// \param a
2449
+ /// A 64-bit integer vector containing the values to be shuffled.
2450
+ /// \param n
2451
+ /// An immediate value containing an 8-bit value specifying which elements to
2452
+ /// copy from \a a. The destinations within the 64-bit destination are
2453
+ /// assigned values as follows: \n
2454
+ /// Bits [1:0] are used to assign values to bits [15:0] in the
2455
+ /// destination. \n
2456
+ /// Bits [3:2] are used to assign values to bits [31:16] in the
2457
+ /// destination. \n
2458
+ /// Bits [5:4] are used to assign values to bits [47:32] in the
2459
+ /// destination. \n
2460
+ /// Bits [7:6] are used to assign values to bits [63:48] in the
2461
+ /// destination. \n
2462
+ /// Bit value assignments: \n
2463
+ /// 00: assigned from bits [15:0] of \a a. \n
2464
+ /// 01: assigned from bits [31:16] of \a a. \n
2465
+ /// 10: assigned from bits [47:32] of \a a. \n
2466
+ /// 11: assigned from bits [63:48] of \a a. \n
2467
+ /// Note: To generate a mask, you can use the \c _MM_SHUFFLE macro.
2468
+ /// <c>_MM_SHUFFLE(b6, b4, b2, b0)</c> can create an 8-bit mask of the form
2469
+ /// <c>[b6, b4, b2, b0]</c>.
2470
+ /// \returns A 64-bit integer vector containing the shuffled values.
2471
+ #define _mm_shuffle_pi16(a, n) \
2472
+ ((__m64)__builtin_shufflevector((__v4hi)(__m64)(a), __extension__(__v4hi){}, \
2473
+ (n) & 0x3, ((n) >> 2) & 0x3, \
2474
+ ((n) >> 4) & 0x3, ((n) >> 6) & 0x3))
2475
+
2476
+ /// Conditionally copies the values from each 8-bit element in the first
2477
+ /// 64-bit integer vector operand to the specified memory location, as
2478
+ /// specified by the most significant bit in the corresponding element in the
2479
+ /// second 64-bit integer vector operand.
2480
+ ///
2481
+ /// To minimize caching, the data is flagged as non-temporal
2482
+ /// (unlikely to be used again soon).
2483
+ ///
2484
+ /// \headerfile <x86intrin.h>
2485
+ ///
2486
+ /// This intrinsic corresponds to the <c> MASKMOVQ </c> instruction.
2487
+ ///
2488
+ /// \param __d
2489
+ /// A 64-bit integer vector containing the values with elements to be copied.
2490
+ /// \param __n
2491
+ /// A 64-bit integer vector operand. The most significant bit from each 8-bit
2492
+ /// element determines whether the corresponding element in operand \a __d
2493
+ /// is copied. If the most significant bit of a given element is 1, the
2494
+ /// corresponding element in operand \a __d is copied.
2495
+ /// \param __p
2496
+ /// A pointer to a 64-bit memory location that will receive the conditionally
2497
+ /// copied integer values. The address of the memory location does not have
2498
+ /// to be aligned.
2499
+ static __inline__ void __DEFAULT_FN_ATTRS_SSE2
2500
+ _mm_maskmove_si64(__m64 __d, __m64 __n, char *__p)
2501
+ {
2502
+ // This is complex, because we need to support the case where __p is pointing
2503
+ // within the last 15 to 8 bytes of a page. In that case, using a 128-bit
2504
+ // write might cause a trap where a 64-bit maskmovq would not. (Memory
2505
+ // locations not selected by the mask bits might still cause traps.)
2506
+ __m128i __d128 = __anyext128(__d);
2507
+ __m128i __n128 = __zext128(__n);
2508
+ if (((__SIZE_TYPE__)__p & 0xfff) >= 4096-15 &&
2509
+ ((__SIZE_TYPE__)__p & 0xfff) <= 4096-8) {
2510
+ // If there's a risk of spurious trap due to a 128-bit write, back up the
2511
+ // pointer by 8 bytes and shift values in registers to match.
2512
+ __p -= 8;
2513
+ __d128 = (__m128i)__builtin_ia32_pslldqi128_byteshift((__v16qi)__d128, 8);
2514
+ __n128 = (__m128i)__builtin_ia32_pslldqi128_byteshift((__v16qi)__n128, 8);
2515
+ }
2516
+
2517
+ __builtin_ia32_maskmovdqu((__v16qi)__d128, (__v16qi)__n128, __p);
2518
+ }
2519
+
2520
+ /// Computes the rounded averages of the packed unsigned 8-bit integer
2521
+ /// values and writes the averages to the corresponding bits in the
2522
+ /// destination.
2523
+ ///
2524
+ /// \headerfile <x86intrin.h>
2525
+ ///
2526
+ /// This intrinsic corresponds to the <c> PAVGB </c> instruction.
2527
+ ///
2528
+ /// \param __a
2529
+ /// A 64-bit integer vector containing one of the source operands.
2530
+ /// \param __b
2531
+ /// A 64-bit integer vector containing one of the source operands.
2532
+ /// \returns A 64-bit integer vector containing the averages of both operands.
2533
+ static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
2534
+ _mm_avg_pu8(__m64 __a, __m64 __b) {
2535
+ return __trunc64(__builtin_ia32_pavgb128((__v16qu)__zext128(__a),
2536
+ (__v16qu)__zext128(__b)));
2537
+ }
2538
+
2539
+ /// Computes the rounded averages of the packed unsigned 16-bit integer
2540
+ /// values and writes the averages to the corresponding bits in the
2541
+ /// destination.
2542
+ ///
2543
+ /// \headerfile <x86intrin.h>
2544
+ ///
2545
+ /// This intrinsic corresponds to the <c> PAVGW </c> instruction.
2546
+ ///
2547
+ /// \param __a
2548
+ /// A 64-bit integer vector containing one of the source operands.
2549
+ /// \param __b
2550
+ /// A 64-bit integer vector containing one of the source operands.
2551
+ /// \returns A 64-bit integer vector containing the averages of both operands.
2552
+ static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
2553
+ _mm_avg_pu16(__m64 __a, __m64 __b) {
2554
+ return __trunc64(
2555
+ __builtin_ia32_pavgw128((__v8hu)__zext128(__a), (__v8hu)__zext128(__b)));
2556
+ }
2557
+
2558
+ /// Subtracts the corresponding 8-bit unsigned integer values of the two
2559
+ /// 64-bit vector operands and computes the absolute value for each of the
2560
+ /// difference. Then sum of the 8 absolute differences is written to the
2561
+ /// bits [15:0] of the destination; the remaining bits [63:16] are cleared.
2562
+ ///
2563
+ /// \headerfile <x86intrin.h>
2564
+ ///
2565
+ /// This intrinsic corresponds to the <c> PSADBW </c> instruction.
2566
+ ///
2567
+ /// \param __a
2568
+ /// A 64-bit integer vector containing one of the source operands.
2569
+ /// \param __b
2570
+ /// A 64-bit integer vector containing one of the source operands.
2571
+ /// \returns A 64-bit integer vector whose lower 16 bits contain the sums of the
2572
+ /// sets of absolute differences between both operands. The upper bits are
2573
+ /// cleared.
2574
+ static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
2575
+ _mm_sad_pu8(__m64 __a, __m64 __b) {
2576
+ return __trunc64(__builtin_ia32_psadbw128((__v16qu)__zext128(__a),
2577
+ (__v16qu)__zext128(__b)));
2578
+ }
2579
+
2580
+ #if defined(__cplusplus)
2581
+ extern "C" {
2582
+ #endif
2583
+
2584
+ /// Returns the contents of the MXCSR register as a 32-bit unsigned
2585
+ /// integer value.
2586
+ ///
2587
+ /// There are several groups of macros associated with this
2588
+ /// intrinsic, including:
2589
+ /// <ul>
2590
+ /// <li>
2591
+ /// For checking exception states: _MM_EXCEPT_INVALID, _MM_EXCEPT_DIV_ZERO,
2592
+ /// _MM_EXCEPT_DENORM, _MM_EXCEPT_OVERFLOW, _MM_EXCEPT_UNDERFLOW,
2593
+ /// _MM_EXCEPT_INEXACT. There is a convenience wrapper
2594
+ /// _MM_GET_EXCEPTION_STATE().
2595
+ /// </li>
2596
+ /// <li>
2597
+ /// For checking exception masks: _MM_MASK_UNDERFLOW, _MM_MASK_OVERFLOW,
2598
+ /// _MM_MASK_INVALID, _MM_MASK_DENORM, _MM_MASK_DIV_ZERO, _MM_MASK_INEXACT.
2599
+ /// There is a convenience wrapper _MM_GET_EXCEPTION_MASK().
2600
+ /// </li>
2601
+ /// <li>
2602
+ /// For checking rounding modes: _MM_ROUND_NEAREST, _MM_ROUND_DOWN,
2603
+ /// _MM_ROUND_UP, _MM_ROUND_TOWARD_ZERO. There is a convenience wrapper
2604
+ /// _MM_GET_ROUNDING_MODE().
2605
+ /// </li>
2606
+ /// <li>
2607
+ /// For checking flush-to-zero mode: _MM_FLUSH_ZERO_ON, _MM_FLUSH_ZERO_OFF.
2608
+ /// There is a convenience wrapper _MM_GET_FLUSH_ZERO_MODE().
2609
+ /// </li>
2610
+ /// <li>
2611
+ /// For checking denormals-are-zero mode: _MM_DENORMALS_ZERO_ON,
2612
+ /// _MM_DENORMALS_ZERO_OFF. There is a convenience wrapper
2613
+ /// _MM_GET_DENORMALS_ZERO_MODE().
2614
+ /// </li>
2615
+ /// </ul>
2616
+ ///
2617
+ /// For example, the following expression checks if an overflow exception has
2618
+ /// occurred:
2619
+ /// \code
2620
+ /// ( _mm_getcsr() & _MM_EXCEPT_OVERFLOW )
2621
+ /// \endcode
2622
+ ///
2623
+ /// The following expression gets the current rounding mode:
2624
+ /// \code
2625
+ /// _MM_GET_ROUNDING_MODE()
2626
+ /// \endcode
2627
+ ///
2628
+ /// \headerfile <x86intrin.h>
2629
+ ///
2630
+ /// This intrinsic corresponds to the <c> VSTMXCSR / STMXCSR </c> instruction.
2631
+ ///
2632
+ /// \returns A 32-bit unsigned integer containing the contents of the MXCSR
2633
+ /// register.
2634
+ unsigned int _mm_getcsr(void);
2635
+
2636
+ /// Sets the MXCSR register with the 32-bit unsigned integer value.
2637
+ ///
2638
+ /// There are several groups of macros associated with this intrinsic,
2639
+ /// including:
2640
+ /// <ul>
2641
+ /// <li>
2642
+ /// For setting exception states: _MM_EXCEPT_INVALID, _MM_EXCEPT_DIV_ZERO,
2643
+ /// _MM_EXCEPT_DENORM, _MM_EXCEPT_OVERFLOW, _MM_EXCEPT_UNDERFLOW,
2644
+ /// _MM_EXCEPT_INEXACT. There is a convenience wrapper
2645
+ /// _MM_SET_EXCEPTION_STATE(x) where x is one of these macros.
2646
+ /// </li>
2647
+ /// <li>
2648
+ /// For setting exception masks: _MM_MASK_UNDERFLOW, _MM_MASK_OVERFLOW,
2649
+ /// _MM_MASK_INVALID, _MM_MASK_DENORM, _MM_MASK_DIV_ZERO, _MM_MASK_INEXACT.
2650
+ /// There is a convenience wrapper _MM_SET_EXCEPTION_MASK(x) where x is one
2651
+ /// of these macros.
2652
+ /// </li>
2653
+ /// <li>
2654
+ /// For setting rounding modes: _MM_ROUND_NEAREST, _MM_ROUND_DOWN,
2655
+ /// _MM_ROUND_UP, _MM_ROUND_TOWARD_ZERO. There is a convenience wrapper
2656
+ /// _MM_SET_ROUNDING_MODE(x) where x is one of these macros.
2657
+ /// </li>
2658
+ /// <li>
2659
+ /// For setting flush-to-zero mode: _MM_FLUSH_ZERO_ON, _MM_FLUSH_ZERO_OFF.
2660
+ /// There is a convenience wrapper _MM_SET_FLUSH_ZERO_MODE(x) where x is
2661
+ /// one of these macros.
2662
+ /// </li>
2663
+ /// <li>
2664
+ /// For setting denormals-are-zero mode: _MM_DENORMALS_ZERO_ON,
2665
+ /// _MM_DENORMALS_ZERO_OFF. There is a convenience wrapper
2666
+ /// _MM_SET_DENORMALS_ZERO_MODE(x) where x is one of these macros.
2667
+ /// </li>
2668
+ /// </ul>
2669
+ ///
2670
+ /// For example, the following expression causes subsequent floating-point
2671
+ /// operations to round up:
2672
+ /// _mm_setcsr(_mm_getcsr() | _MM_ROUND_UP)
2673
+ ///
2674
+ /// The following example sets the DAZ and FTZ flags:
2675
+ /// \code
2676
+ /// void setFlags() {
2677
+ /// _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
2678
+ /// _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON);
2679
+ /// }
2680
+ /// \endcode
2681
+ ///
2682
+ /// \headerfile <x86intrin.h>
2683
+ ///
2684
+ /// This intrinsic corresponds to the <c> VLDMXCSR / LDMXCSR </c> instruction.
2685
+ ///
2686
+ /// \param __i
2687
+ /// A 32-bit unsigned integer value to be written to the MXCSR register.
2688
+ void _mm_setcsr(unsigned int __i);
2689
+
2690
+ #if defined(__cplusplus)
2691
+ } // extern "C"
2692
+ #endif
2693
+
2694
+ /// Selects 4 float values from the 128-bit operands of [4 x float], as
2695
+ /// specified by the immediate value operand.
2696
+ ///
2697
+ /// \headerfile <x86intrin.h>
2698
+ ///
2699
+ /// \code
2700
+ /// __m128 _mm_shuffle_ps(__m128 a, __m128 b, const int mask);
2701
+ /// \endcode
2702
+ ///
2703
+ /// This intrinsic corresponds to the <c> VSHUFPS / SHUFPS </c> instruction.
2704
+ ///
2705
+ /// \param a
2706
+ /// A 128-bit vector of [4 x float].
2707
+ /// \param b
2708
+ /// A 128-bit vector of [4 x float].
2709
+ /// \param mask
2710
+ /// An immediate value containing an 8-bit value specifying which elements to
2711
+ /// copy from \a a and \a b. \n
2712
+ /// Bits [3:0] specify the values copied from operand \a a. \n
2713
+ /// Bits [7:4] specify the values copied from operand \a b. \n
2714
+ /// The destinations within the 128-bit destination are assigned values as
2715
+ /// follows: \n
2716
+ /// Bits [1:0] are used to assign values to bits [31:0] in the
2717
+ /// destination. \n
2718
+ /// Bits [3:2] are used to assign values to bits [63:32] in the
2719
+ /// destination. \n
2720
+ /// Bits [5:4] are used to assign values to bits [95:64] in the
2721
+ /// destination. \n
2722
+ /// Bits [7:6] are used to assign values to bits [127:96] in the
2723
+ /// destination. \n
2724
+ /// Bit value assignments: \n
2725
+ /// 00: Bits [31:0] copied from the specified operand. \n
2726
+ /// 01: Bits [63:32] copied from the specified operand. \n
2727
+ /// 10: Bits [95:64] copied from the specified operand. \n
2728
+ /// 11: Bits [127:96] copied from the specified operand. \n
2729
+ /// Note: To generate a mask, you can use the \c _MM_SHUFFLE macro.
2730
+ /// <c>_MM_SHUFFLE(b6, b4, b2, b0)</c> can create an 8-bit mask of the form
2731
+ /// <c>[b6, b4, b2, b0]</c>.
2732
+ /// \returns A 128-bit vector of [4 x float] containing the shuffled values.
2733
+ #define _mm_shuffle_ps(a, b, mask) \
2734
+ ((__m128)__builtin_ia32_shufps((__v4sf)(__m128)(a), (__v4sf)(__m128)(b), \
2735
+ (int)(mask)))
2736
+
2737
+ /// Unpacks the high-order (index 2,3) values from two 128-bit vectors of
2738
+ /// [4 x float] and interleaves them into a 128-bit vector of [4 x float].
2739
+ ///
2740
+ /// \headerfile <x86intrin.h>
2741
+ ///
2742
+ /// This intrinsic corresponds to the <c> VUNPCKHPS / UNPCKHPS </c> instruction.
2743
+ ///
2744
+ /// \param __a
2745
+ /// A 128-bit vector of [4 x float]. \n
2746
+ /// Bits [95:64] are written to bits [31:0] of the destination. \n
2747
+ /// Bits [127:96] are written to bits [95:64] of the destination.
2748
+ /// \param __b
2749
+ /// A 128-bit vector of [4 x float].
2750
+ /// Bits [95:64] are written to bits [63:32] of the destination. \n
2751
+ /// Bits [127:96] are written to bits [127:96] of the destination.
2752
+ /// \returns A 128-bit vector of [4 x float] containing the interleaved values.
2753
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
2754
+ _mm_unpackhi_ps(__m128 __a, __m128 __b) {
2755
+ return __builtin_shufflevector((__v4sf)__a, (__v4sf)__b, 2, 6, 3, 7);
2756
+ }
2757
+
2758
+ /// Unpacks the low-order (index 0,1) values from two 128-bit vectors of
2759
+ /// [4 x float] and interleaves them into a 128-bit vector of [4 x float].
2760
+ ///
2761
+ /// \headerfile <x86intrin.h>
2762
+ ///
2763
+ /// This intrinsic corresponds to the <c> VUNPCKLPS / UNPCKLPS </c> instruction.
2764
+ ///
2765
+ /// \param __a
2766
+ /// A 128-bit vector of [4 x float]. \n
2767
+ /// Bits [31:0] are written to bits [31:0] of the destination. \n
2768
+ /// Bits [63:32] are written to bits [95:64] of the destination.
2769
+ /// \param __b
2770
+ /// A 128-bit vector of [4 x float]. \n
2771
+ /// Bits [31:0] are written to bits [63:32] of the destination. \n
2772
+ /// Bits [63:32] are written to bits [127:96] of the destination.
2773
+ /// \returns A 128-bit vector of [4 x float] containing the interleaved values.
2774
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
2775
+ _mm_unpacklo_ps(__m128 __a, __m128 __b) {
2776
+ return __builtin_shufflevector((__v4sf)__a, (__v4sf)__b, 0, 4, 1, 5);
2777
+ }
2778
+
2779
+ /// Constructs a 128-bit floating-point vector of [4 x float]. The lower
2780
+ /// 32 bits are set to the lower 32 bits of the second parameter. The upper
2781
+ /// 96 bits are set to the upper 96 bits of the first parameter.
2782
+ ///
2783
+ /// \headerfile <x86intrin.h>
2784
+ ///
2785
+ /// This intrinsic corresponds to the <c> VBLENDPS / BLENDPS / MOVSS </c>
2786
+ /// instruction.
2787
+ ///
2788
+ /// \param __a
2789
+ /// A 128-bit floating-point vector of [4 x float]. The upper 96 bits are
2790
+ /// written to the upper 96 bits of the result.
2791
+ /// \param __b
2792
+ /// A 128-bit floating-point vector of [4 x float]. The lower 32 bits are
2793
+ /// written to the lower 32 bits of the result.
2794
+ /// \returns A 128-bit floating-point vector of [4 x float].
2795
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
2796
+ _mm_move_ss(__m128 __a, __m128 __b) {
2797
+ __a[0] = __b[0];
2798
+ return __a;
2799
+ }
2800
+
2801
+ /// Constructs a 128-bit floating-point vector of [4 x float]. The lower
2802
+ /// 64 bits are set to the upper 64 bits of the second parameter. The upper
2803
+ /// 64 bits are set to the upper 64 bits of the first parameter.
2804
+ ///
2805
+ /// \headerfile <x86intrin.h>
2806
+ ///
2807
+ /// This intrinsic corresponds to the <c> VUNPCKHPD / UNPCKHPD </c> instruction.
2808
+ ///
2809
+ /// \param __a
2810
+ /// A 128-bit floating-point vector of [4 x float]. The upper 64 bits are
2811
+ /// written to the upper 64 bits of the result.
2812
+ /// \param __b
2813
+ /// A 128-bit floating-point vector of [4 x float]. The upper 64 bits are
2814
+ /// written to the lower 64 bits of the result.
2815
+ /// \returns A 128-bit floating-point vector of [4 x float].
2816
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
2817
+ _mm_movehl_ps(__m128 __a, __m128 __b) {
2818
+ return __builtin_shufflevector((__v4sf)__a, (__v4sf)__b, 6, 7, 2, 3);
2819
+ }
2820
+
2821
+ /// Constructs a 128-bit floating-point vector of [4 x float]. The lower
2822
+ /// 64 bits are set to the lower 64 bits of the first parameter. The upper
2823
+ /// 64 bits are set to the lower 64 bits of the second parameter.
2824
+ ///
2825
+ /// \headerfile <x86intrin.h>
2826
+ ///
2827
+ /// This intrinsic corresponds to the <c> VUNPCKLPD / UNPCKLPD </c> instruction.
2828
+ ///
2829
+ /// \param __a
2830
+ /// A 128-bit floating-point vector of [4 x float]. The lower 64 bits are
2831
+ /// written to the lower 64 bits of the result.
2832
+ /// \param __b
2833
+ /// A 128-bit floating-point vector of [4 x float]. The lower 64 bits are
2834
+ /// written to the upper 64 bits of the result.
2835
+ /// \returns A 128-bit floating-point vector of [4 x float].
2836
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
2837
+ _mm_movelh_ps(__m128 __a, __m128 __b) {
2838
+ return __builtin_shufflevector((__v4sf)__a, (__v4sf)__b, 0, 1, 4, 5);
2839
+ }
2840
+
2841
+ /// Converts a 64-bit vector of [4 x i16] into a 128-bit vector of [4 x
2842
+ /// float].
2843
+ ///
2844
+ /// \headerfile <x86intrin.h>
2845
+ ///
2846
+ /// This intrinsic corresponds to the <c> CVTPI2PS + COMPOSITE </c> instruction.
2847
+ ///
2848
+ /// \param __a
2849
+ /// A 64-bit vector of [4 x i16]. The elements of the destination are copied
2850
+ /// from the corresponding elements in this operand.
2851
+ /// \returns A 128-bit vector of [4 x float] containing the copied and converted
2852
+ /// values from the operand.
2853
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
2854
+ _mm_cvtpi16_ps(__m64 __a)
2855
+ {
2856
+ return __builtin_convertvector((__v4hi)__a, __v4sf);
2857
+ }
2858
+
2859
+ /// Converts a 64-bit vector of 16-bit unsigned integer values into a
2860
+ /// 128-bit vector of [4 x float].
2861
+ ///
2862
+ /// \headerfile <x86intrin.h>
2863
+ ///
2864
+ /// This intrinsic corresponds to the <c> CVTPI2PS + COMPOSITE </c> instruction.
2865
+ ///
2866
+ /// \param __a
2867
+ /// A 64-bit vector of 16-bit unsigned integer values. The elements of the
2868
+ /// destination are copied from the corresponding elements in this operand.
2869
+ /// \returns A 128-bit vector of [4 x float] containing the copied and converted
2870
+ /// values from the operand.
2871
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
2872
+ _mm_cvtpu16_ps(__m64 __a)
2873
+ {
2874
+ return __builtin_convertvector((__v4hu)__a, __v4sf);
2875
+ }
2876
+
2877
+ /// Converts the lower four 8-bit values from a 64-bit vector of [8 x i8]
2878
+ /// into a 128-bit vector of [4 x float].
2879
+ ///
2880
+ /// \headerfile <x86intrin.h>
2881
+ ///
2882
+ /// This intrinsic corresponds to the <c> CVTPI2PS + COMPOSITE </c> instruction.
2883
+ ///
2884
+ /// \param __a
2885
+ /// A 64-bit vector of [8 x i8]. The elements of the destination are copied
2886
+ /// from the corresponding lower 4 elements in this operand.
2887
+ /// \returns A 128-bit vector of [4 x float] containing the copied and converted
2888
+ /// values from the operand.
2889
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
2890
+ _mm_cvtpi8_ps(__m64 __a)
2891
+ {
2892
+ return __builtin_convertvector(
2893
+ __builtin_shufflevector((__v8qs)__a, __extension__ (__v8qs){},
2894
+ 0, 1, 2, 3), __v4sf);
2895
+ }
2896
+
2897
+ /// Converts the lower four unsigned 8-bit integer values from a 64-bit
2898
+ /// vector of [8 x u8] into a 128-bit vector of [4 x float].
2899
+ ///
2900
+ /// \headerfile <x86intrin.h>
2901
+ ///
2902
+ /// This intrinsic corresponds to the <c> CVTPI2PS + COMPOSITE </c> instruction.
2903
+ ///
2904
+ /// \param __a
2905
+ /// A 64-bit vector of unsigned 8-bit integer values. The elements of the
2906
+ /// destination are copied from the corresponding lower 4 elements in this
2907
+ /// operand.
2908
+ /// \returns A 128-bit vector of [4 x float] containing the copied and converted
2909
+ /// values from the source operand.
2910
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
2911
+ _mm_cvtpu8_ps(__m64 __a)
2912
+ {
2913
+ return __builtin_convertvector(
2914
+ __builtin_shufflevector((__v8qu)__a, __extension__ (__v8qu){},
2915
+ 0, 1, 2, 3), __v4sf);
2916
+ }
2917
+
2918
+ /// Converts the two 32-bit signed integer values from each 64-bit vector
2919
+ /// operand of [2 x i32] into a 128-bit vector of [4 x float].
2920
+ ///
2921
+ /// \headerfile <x86intrin.h>
2922
+ ///
2923
+ /// This intrinsic corresponds to the <c> CVTPI2PS + COMPOSITE </c> instruction.
2924
+ ///
2925
+ /// \param __a
2926
+ /// A 64-bit vector of [2 x i32]. The lower elements of the destination are
2927
+ /// copied from the elements in this operand.
2928
+ /// \param __b
2929
+ /// A 64-bit vector of [2 x i32]. The upper elements of the destination are
2930
+ /// copied from the elements in this operand.
2931
+ /// \returns A 128-bit vector of [4 x float] whose lower 64 bits contain the
2932
+ /// copied and converted values from the first operand. The upper 64 bits
2933
+ /// contain the copied and converted values from the second operand.
2934
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
2935
+ _mm_cvtpi32x2_ps(__m64 __a, __m64 __b)
2936
+ {
2937
+ return __builtin_convertvector(
2938
+ __builtin_shufflevector((__v2si)__a, (__v2si)__b,
2939
+ 0, 1, 2, 3), __v4sf);
2940
+ }
2941
+
2942
+ /// Converts each single-precision floating-point element of a 128-bit
2943
+ /// floating-point vector of [4 x float] into a 16-bit signed integer, and
2944
+ /// packs the results into a 64-bit integer vector of [4 x i16].
2945
+ ///
2946
+ /// If the floating-point element is NaN or infinity, or if the
2947
+ /// floating-point element is greater than 0x7FFFFFFF or less than -0x8000,
2948
+ /// it is converted to 0x8000. Otherwise if the floating-point element is
2949
+ /// greater than 0x7FFF, it is converted to 0x7FFF.
2950
+ ///
2951
+ /// \headerfile <x86intrin.h>
2952
+ ///
2953
+ /// This intrinsic corresponds to the <c> CVTPS2PI + COMPOSITE </c> instruction.
2954
+ ///
2955
+ /// \param __a
2956
+ /// A 128-bit floating-point vector of [4 x float].
2957
+ /// \returns A 64-bit integer vector of [4 x i16] containing the converted
2958
+ /// values.
2959
+ static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
2960
+ _mm_cvtps_pi16(__m128 __a)
2961
+ {
2962
+ return __trunc64(__builtin_ia32_packssdw128(
2963
+ (__v4si)__builtin_ia32_cvtps2dq((__v4sf)__a), (__v4si)_mm_setzero_ps()));
2964
+ }
2965
+
2966
+ /// Converts each single-precision floating-point element of a 128-bit
2967
+ /// floating-point vector of [4 x float] into an 8-bit signed integer, and
2968
+ /// packs the results into the lower 32 bits of a 64-bit integer vector of
2969
+ /// [8 x i8]. The upper 32 bits of the vector are set to 0.
2970
+ ///
2971
+ /// If the floating-point element is NaN or infinity, or if the
2972
+ /// floating-point element is greater than 0x7FFFFFFF or less than -0x80, it
2973
+ /// is converted to 0x80. Otherwise if the floating-point element is greater
2974
+ /// than 0x7F, it is converted to 0x7F.
2975
+ ///
2976
+ /// \headerfile <x86intrin.h>
2977
+ ///
2978
+ /// This intrinsic corresponds to the <c> CVTPS2PI + COMPOSITE </c> instruction.
2979
+ ///
2980
+ /// \param __a
2981
+ /// 128-bit floating-point vector of [4 x float].
2982
+ /// \returns A 64-bit integer vector of [8 x i8]. The lower 32 bits contain the
2983
+ /// converted values and the uppper 32 bits are set to zero.
2984
+ static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
2985
+ _mm_cvtps_pi8(__m128 __a)
2986
+ {
2987
+ __m64 __b, __c;
2988
+
2989
+ __b = _mm_cvtps_pi16(__a);
2990
+ __c = _mm_setzero_si64();
2991
+
2992
+ return _mm_packs_pi16(__b, __c);
2993
+ }
2994
+
2995
+ /// Extracts the sign bits from each single-precision floating-point
2996
+ /// element of a 128-bit floating-point vector of [4 x float] and returns the
2997
+ /// sign bits in bits [0:3] of the result. Bits [31:4] of the result are set
2998
+ /// to zero.
2999
+ ///
3000
+ /// \headerfile <x86intrin.h>
3001
+ ///
3002
+ /// This intrinsic corresponds to the <c> VMOVMSKPS / MOVMSKPS </c> instruction.
3003
+ ///
3004
+ /// \param __a
3005
+ /// A 128-bit floating-point vector of [4 x float].
3006
+ /// \returns A 32-bit integer value. Bits [3:0] contain the sign bits from each
3007
+ /// single-precision floating-point element of the parameter. Bits [31:4] are
3008
+ /// set to zero.
3009
+ static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR _mm_movemask_ps(__m128 __a) {
3010
+ return __builtin_ia32_movmskps((__v4sf)__a);
3011
+ }
3012
+
3013
+ /* Compare */
3014
+ #define _CMP_EQ_OQ 0x00 /* Equal (ordered, non-signaling) */
3015
+ #define _CMP_LT_OS 0x01 /* Less-than (ordered, signaling) */
3016
+ #define _CMP_LE_OS 0x02 /* Less-than-or-equal (ordered, signaling) */
3017
+ #define _CMP_UNORD_Q 0x03 /* Unordered (non-signaling) */
3018
+ #define _CMP_NEQ_UQ 0x04 /* Not-equal (unordered, non-signaling) */
3019
+ #define _CMP_NLT_US 0x05 /* Not-less-than (unordered, signaling) */
3020
+ #define _CMP_NLE_US 0x06 /* Not-less-than-or-equal (unordered, signaling) */
3021
+ #define _CMP_ORD_Q 0x07 /* Ordered (non-signaling) */
3022
+
3023
+ /// Compares each of the corresponding values of two 128-bit vectors of
3024
+ /// [4 x float], using the operation specified by the immediate integer
3025
+ /// operand.
3026
+ ///
3027
+ /// Each comparison returns 0x0 for false, 0xFFFFFFFF for true.
3028
+ /// If either value in a comparison is NaN, comparisons that are ordered
3029
+ /// return false, and comparisons that are unordered return true.
3030
+ ///
3031
+ /// \headerfile <x86intrin.h>
3032
+ ///
3033
+ /// \code
3034
+ /// __m128 _mm_cmp_ps(__m128 a, __m128 b, const int c);
3035
+ /// \endcode
3036
+ ///
3037
+ /// This intrinsic corresponds to the <c> (V)CMPPS </c> instruction.
3038
+ ///
3039
+ /// \param a
3040
+ /// A 128-bit vector of [4 x float].
3041
+ /// \param b
3042
+ /// A 128-bit vector of [4 x float].
3043
+ /// \param c
3044
+ /// An immediate integer operand, with bits [4:0] specifying which comparison
3045
+ /// operation to use: \n
3046
+ /// 0x00: Equal (ordered, non-signaling) \n
3047
+ /// 0x01: Less-than (ordered, signaling) \n
3048
+ /// 0x02: Less-than-or-equal (ordered, signaling) \n
3049
+ /// 0x03: Unordered (non-signaling) \n
3050
+ /// 0x04: Not-equal (unordered, non-signaling) \n
3051
+ /// 0x05: Not-less-than (unordered, signaling) \n
3052
+ /// 0x06: Not-less-than-or-equal (unordered, signaling) \n
3053
+ /// 0x07: Ordered (non-signaling) \n
3054
+ /// \returns A 128-bit vector of [4 x float] containing the comparison results.
3055
+ #define _mm_cmp_ps(a, b, c) \
3056
+ ((__m128)__builtin_ia32_cmpps((__v4sf)(__m128)(a), (__v4sf)(__m128)(b), (c)))
3057
+
3058
+ /// Compares each of the corresponding scalar values of two 128-bit
3059
+ /// vectors of [4 x float], using the operation specified by the immediate
3060
+ /// integer operand.
3061
+ ///
3062
+ /// Each comparison returns 0x0 for false, 0xFFFFFFFF for true.
3063
+ /// If either value in a comparison is NaN, comparisons that are ordered
3064
+ /// return false, and comparisons that are unordered return true.
3065
+ ///
3066
+ /// \headerfile <x86intrin.h>
3067
+ ///
3068
+ /// \code
3069
+ /// __m128 _mm_cmp_ss(__m128 a, __m128 b, const int c);
3070
+ /// \endcode
3071
+ ///
3072
+ /// This intrinsic corresponds to the <c> (V)CMPSS </c> instruction.
3073
+ ///
3074
+ /// \param a
3075
+ /// A 128-bit vector of [4 x float].
3076
+ /// \param b
3077
+ /// A 128-bit vector of [4 x float].
3078
+ /// \param c
3079
+ /// An immediate integer operand, with bits [4:0] specifying which comparison
3080
+ /// operation to use: \n
3081
+ /// 0x00: Equal (ordered, non-signaling) \n
3082
+ /// 0x01: Less-than (ordered, signaling) \n
3083
+ /// 0x02: Less-than-or-equal (ordered, signaling) \n
3084
+ /// 0x03: Unordered (non-signaling) \n
3085
+ /// 0x04: Not-equal (unordered, non-signaling) \n
3086
+ /// 0x05: Not-less-than (unordered, signaling) \n
3087
+ /// 0x06: Not-less-than-or-equal (unordered, signaling) \n
3088
+ /// 0x07: Ordered (non-signaling) \n
3089
+ /// \returns A 128-bit vector of [4 x float] containing the comparison results.
3090
+ #define _mm_cmp_ss(a, b, c) \
3091
+ ((__m128)__builtin_ia32_cmpss((__v4sf)(__m128)(a), (__v4sf)(__m128)(b), (c)))
3092
+
3093
+ #define _MM_ALIGN16 __attribute__((aligned(16)))
3094
+
3095
+ #define _MM_SHUFFLE(z, y, x, w) (((z) << 6) | ((y) << 4) | ((x) << 2) | (w))
3096
+
3097
+ #define _MM_EXCEPT_INVALID (0x0001U)
3098
+ #define _MM_EXCEPT_DENORM (0x0002U)
3099
+ #define _MM_EXCEPT_DIV_ZERO (0x0004U)
3100
+ #define _MM_EXCEPT_OVERFLOW (0x0008U)
3101
+ #define _MM_EXCEPT_UNDERFLOW (0x0010U)
3102
+ #define _MM_EXCEPT_INEXACT (0x0020U)
3103
+ #define _MM_EXCEPT_MASK (0x003fU)
3104
+
3105
+ #define _MM_MASK_INVALID (0x0080U)
3106
+ #define _MM_MASK_DENORM (0x0100U)
3107
+ #define _MM_MASK_DIV_ZERO (0x0200U)
3108
+ #define _MM_MASK_OVERFLOW (0x0400U)
3109
+ #define _MM_MASK_UNDERFLOW (0x0800U)
3110
+ #define _MM_MASK_INEXACT (0x1000U)
3111
+ #define _MM_MASK_MASK (0x1f80U)
3112
+
3113
+ #define _MM_ROUND_NEAREST (0x0000U)
3114
+ #define _MM_ROUND_DOWN (0x2000U)
3115
+ #define _MM_ROUND_UP (0x4000U)
3116
+ #define _MM_ROUND_TOWARD_ZERO (0x6000U)
3117
+ #define _MM_ROUND_MASK (0x6000U)
3118
+
3119
+ #define _MM_FLUSH_ZERO_MASK (0x8000U)
3120
+ #define _MM_FLUSH_ZERO_ON (0x8000U)
3121
+ #define _MM_FLUSH_ZERO_OFF (0x0000U)
3122
+
3123
+ #define _MM_GET_EXCEPTION_MASK() (_mm_getcsr() & _MM_MASK_MASK)
3124
+ #define _MM_GET_EXCEPTION_STATE() (_mm_getcsr() & _MM_EXCEPT_MASK)
3125
+ #define _MM_GET_FLUSH_ZERO_MODE() (_mm_getcsr() & _MM_FLUSH_ZERO_MASK)
3126
+ #define _MM_GET_ROUNDING_MODE() (_mm_getcsr() & _MM_ROUND_MASK)
3127
+
3128
+ #define _MM_SET_EXCEPTION_MASK(x) (_mm_setcsr((_mm_getcsr() & ~_MM_MASK_MASK) | (x)))
3129
+ #define _MM_SET_EXCEPTION_STATE(x) (_mm_setcsr((_mm_getcsr() & ~_MM_EXCEPT_MASK) | (x)))
3130
+ #define _MM_SET_FLUSH_ZERO_MODE(x) (_mm_setcsr((_mm_getcsr() & ~_MM_FLUSH_ZERO_MASK) | (x)))
3131
+ #define _MM_SET_ROUNDING_MODE(x) (_mm_setcsr((_mm_getcsr() & ~_MM_ROUND_MASK) | (x)))
3132
+
3133
+ #define _MM_TRANSPOSE4_PS(row0, row1, row2, row3) \
3134
+ do { \
3135
+ __m128 tmp3, tmp2, tmp1, tmp0; \
3136
+ tmp0 = _mm_unpacklo_ps((row0), (row1)); \
3137
+ tmp2 = _mm_unpacklo_ps((row2), (row3)); \
3138
+ tmp1 = _mm_unpackhi_ps((row0), (row1)); \
3139
+ tmp3 = _mm_unpackhi_ps((row2), (row3)); \
3140
+ (row0) = _mm_movelh_ps(tmp0, tmp2); \
3141
+ (row1) = _mm_movehl_ps(tmp2, tmp0); \
3142
+ (row2) = _mm_movelh_ps(tmp1, tmp3); \
3143
+ (row3) = _mm_movehl_ps(tmp3, tmp1); \
3144
+ } while (0)
3145
+
3146
+ /* Aliases for compatibility. */
3147
+ #define _m_pextrw _mm_extract_pi16
3148
+ #define _m_pinsrw _mm_insert_pi16
3149
+ #define _m_pmaxsw _mm_max_pi16
3150
+ #define _m_pmaxub _mm_max_pu8
3151
+ #define _m_pminsw _mm_min_pi16
3152
+ #define _m_pminub _mm_min_pu8
3153
+ #define _m_pmovmskb _mm_movemask_pi8
3154
+ #define _m_pmulhuw _mm_mulhi_pu16
3155
+ #define _m_pshufw _mm_shuffle_pi16
3156
+ #define _m_maskmovq _mm_maskmove_si64
3157
+ #define _m_pavgb _mm_avg_pu8
3158
+ #define _m_pavgw _mm_avg_pu16
3159
+ #define _m_psadbw _mm_sad_pu8
3160
+ #define _m_ _mm_
3161
+
3162
+ #undef __trunc64
3163
+ #undef __zext128
3164
+ #undef __anyext128
3165
+ #undef __zeroupper64
3166
+ #undef __DEFAULT_FN_ATTRS
3167
+ #undef __DEFAULT_FN_ATTRS_CONSTEXPR
3168
+ #undef __DEFAULT_FN_ATTRS_SSE2
3169
+ #undef __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
3170
+
3171
+ /* Ugly hack for backwards-compatibility (compatible with gcc) */
3172
+ #if defined(__SSE2__) && !__building_module(_Builtin_intrinsics)
3173
+ #include <emmintrin.h>
3174
+ #endif
3175
+
3176
+ #endif /* __XMMINTRIN_H */