1 .. title:: clang-tidy - portability-simd-intrinsics
3 portability-simd-intrinsics
4 ===========================
6 Finds SIMD intrinsics calls and suggests ``std::experimental::simd`` (`P0214`_)
9 If the option :option:`Suggest` is set to `true`, for
13 _mm_add_epi32(a, b); // x86
14 vec_add(a, b); // Power
16 the check suggests an alternative: ``operator+`` on ``std::experimental::simd``
19 Otherwise, it just complains the intrinsics are non-portable (and there are
20 `P0214`_ alternatives).
22 Many architectures provide SIMD operations (e.g. x86 SSE/AVX, Power AltiVec/VSX,
23 ARM NEON). It is common that SIMD code implementing the same algorithm, is
24 written in multiple target-dispatching pieces to optimize for different
25 architectures or micro-architectures.
27 The C++ standard proposal `P0214`_ and its extensions cover many common SIMD
28 operations. By migrating from target-dependent intrinsics to `P0214`_
29 operations, the SIMD code can be simplified and pieces for different targets can
32 Refer to `P0214`_ for introduction and motivation for the data-parallel standard
40 If this option is set to `true` (default is `false`), the check will suggest
41 `P0214`_ alternatives, otherwise it only points out the intrinsic function is
46 The namespace used to suggest `P0214`_ alternatives. If not specified, `std::`
47 for `-std=c++20` and `std::experimental::` for `-std=c++11`.
49 .. _P0214: https://wg21.link/p0214