2018-03-08 00:57:42 +08:00
|
|
|
.. title:: clang-tidy - portability-simd-intrinsics
|
[clang-tidy] Add `readability-simd-intrinsics` check.
Summary:
Many architectures provide SIMD operations (e.g. x86 SSE/AVX, Power AltiVec/VSX,
ARM NEON). It is common that SIMD code implementing the same algorithm, is
written in multiple target-dispatching pieces to optimize for different
architectures or micro-architectures.
The C++ standard proposal P0214 and its extensions cover many common SIMD
operations. By migrating from target-dependent intrinsics to P0214 operations,
the SIMD code can be simplified and pieces for different targets can be unified.
Refer to http://wg21.link/p0214 for introduction and motivation for the
data-parallel standard library.
Subscribers: klimek, aemerson, mgorny, xazax.hun, kristof.beyls, hintonda, cfe-commits
Differential Revision: https://reviews.llvm.org/D42983
llvm-svn: 325272
2018-02-16 01:56:43 +08:00
|
|
|
|
2018-03-08 00:57:42 +08:00
|
|
|
portability-simd-intrinsics
|
[clang-tidy] Add `readability-simd-intrinsics` check.
Summary:
Many architectures provide SIMD operations (e.g. x86 SSE/AVX, Power AltiVec/VSX,
ARM NEON). It is common that SIMD code implementing the same algorithm, is
written in multiple target-dispatching pieces to optimize for different
architectures or micro-architectures.
The C++ standard proposal P0214 and its extensions cover many common SIMD
operations. By migrating from target-dependent intrinsics to P0214 operations,
the SIMD code can be simplified and pieces for different targets can be unified.
Refer to http://wg21.link/p0214 for introduction and motivation for the
data-parallel standard library.
Subscribers: klimek, aemerson, mgorny, xazax.hun, kristof.beyls, hintonda, cfe-commits
Differential Revision: https://reviews.llvm.org/D42983
llvm-svn: 325272
2018-02-16 01:56:43 +08:00
|
|
|
===========================
|
|
|
|
|
2018-02-17 03:31:28 +08:00
|
|
|
Finds SIMD intrinsics calls and suggests ``std::experimental::simd`` (`P0214`_)
|
|
|
|
alternatives.
|
[clang-tidy] Add `readability-simd-intrinsics` check.
Summary:
Many architectures provide SIMD operations (e.g. x86 SSE/AVX, Power AltiVec/VSX,
ARM NEON). It is common that SIMD code implementing the same algorithm, is
written in multiple target-dispatching pieces to optimize for different
architectures or micro-architectures.
The C++ standard proposal P0214 and its extensions cover many common SIMD
operations. By migrating from target-dependent intrinsics to P0214 operations,
the SIMD code can be simplified and pieces for different targets can be unified.
Refer to http://wg21.link/p0214 for introduction and motivation for the
data-parallel standard library.
Subscribers: klimek, aemerson, mgorny, xazax.hun, kristof.beyls, hintonda, cfe-commits
Differential Revision: https://reviews.llvm.org/D42983
llvm-svn: 325272
2018-02-16 01:56:43 +08:00
|
|
|
|
|
|
|
If the option ``Suggest`` is set to non-zero, for
|
|
|
|
|
|
|
|
.. code-block:: c++
|
|
|
|
|
|
|
|
_mm_add_epi32(a, b); // x86
|
|
|
|
vec_add(a, b); // Power
|
|
|
|
|
2018-02-17 03:31:28 +08:00
|
|
|
the check suggests an alternative: ``operator+`` on ``std::experimental::simd``
|
|
|
|
objects.
|
[clang-tidy] Add `readability-simd-intrinsics` check.
Summary:
Many architectures provide SIMD operations (e.g. x86 SSE/AVX, Power AltiVec/VSX,
ARM NEON). It is common that SIMD code implementing the same algorithm, is
written in multiple target-dispatching pieces to optimize for different
architectures or micro-architectures.
The C++ standard proposal P0214 and its extensions cover many common SIMD
operations. By migrating from target-dependent intrinsics to P0214 operations,
the SIMD code can be simplified and pieces for different targets can be unified.
Refer to http://wg21.link/p0214 for introduction and motivation for the
data-parallel standard library.
Subscribers: klimek, aemerson, mgorny, xazax.hun, kristof.beyls, hintonda, cfe-commits
Differential Revision: https://reviews.llvm.org/D42983
llvm-svn: 325272
2018-02-16 01:56:43 +08:00
|
|
|
|
2018-02-17 03:31:28 +08:00
|
|
|
Otherwise, it just complains the intrinsics are non-portable (and there are
|
|
|
|
`P0214`_ alternatives).
|
[clang-tidy] Add `readability-simd-intrinsics` check.
Summary:
Many architectures provide SIMD operations (e.g. x86 SSE/AVX, Power AltiVec/VSX,
ARM NEON). It is common that SIMD code implementing the same algorithm, is
written in multiple target-dispatching pieces to optimize for different
architectures or micro-architectures.
The C++ standard proposal P0214 and its extensions cover many common SIMD
operations. By migrating from target-dependent intrinsics to P0214 operations,
the SIMD code can be simplified and pieces for different targets can be unified.
Refer to http://wg21.link/p0214 for introduction and motivation for the
data-parallel standard library.
Subscribers: klimek, aemerson, mgorny, xazax.hun, kristof.beyls, hintonda, cfe-commits
Differential Revision: https://reviews.llvm.org/D42983
llvm-svn: 325272
2018-02-16 01:56:43 +08:00
|
|
|
|
|
|
|
Many architectures provide SIMD operations (e.g. x86 SSE/AVX, Power AltiVec/VSX,
|
|
|
|
ARM NEON). It is common that SIMD code implementing the same algorithm, is
|
|
|
|
written in multiple target-dispatching pieces to optimize for different
|
|
|
|
architectures or micro-architectures.
|
|
|
|
|
|
|
|
The C++ standard proposal `P0214`_ and its extensions cover many common SIMD
|
2018-02-17 03:31:28 +08:00
|
|
|
operations. By migrating from target-dependent intrinsics to `P0214`_
|
|
|
|
operations, the SIMD code can be simplified and pieces for different targets can
|
|
|
|
be unified.
|
[clang-tidy] Add `readability-simd-intrinsics` check.
Summary:
Many architectures provide SIMD operations (e.g. x86 SSE/AVX, Power AltiVec/VSX,
ARM NEON). It is common that SIMD code implementing the same algorithm, is
written in multiple target-dispatching pieces to optimize for different
architectures or micro-architectures.
The C++ standard proposal P0214 and its extensions cover many common SIMD
operations. By migrating from target-dependent intrinsics to P0214 operations,
the SIMD code can be simplified and pieces for different targets can be unified.
Refer to http://wg21.link/p0214 for introduction and motivation for the
data-parallel standard library.
Subscribers: klimek, aemerson, mgorny, xazax.hun, kristof.beyls, hintonda, cfe-commits
Differential Revision: https://reviews.llvm.org/D42983
llvm-svn: 325272
2018-02-16 01:56:43 +08:00
|
|
|
|
|
|
|
Refer to `P0214`_ for introduction and motivation for the data-parallel standard
|
|
|
|
library.
|
|
|
|
|
|
|
|
Options
|
|
|
|
-------
|
|
|
|
|
|
|
|
.. option:: Suggest
|
|
|
|
|
2018-02-17 03:31:28 +08:00
|
|
|
If this option is set to non-zero (default is `0`), the check will suggest
|
|
|
|
`P0214`_ alternatives, otherwise it only points out the intrinsic function is
|
|
|
|
non-portable.
|
[clang-tidy] Add `readability-simd-intrinsics` check.
Summary:
Many architectures provide SIMD operations (e.g. x86 SSE/AVX, Power AltiVec/VSX,
ARM NEON). It is common that SIMD code implementing the same algorithm, is
written in multiple target-dispatching pieces to optimize for different
architectures or micro-architectures.
The C++ standard proposal P0214 and its extensions cover many common SIMD
operations. By migrating from target-dependent intrinsics to P0214 operations,
the SIMD code can be simplified and pieces for different targets can be unified.
Refer to http://wg21.link/p0214 for introduction and motivation for the
data-parallel standard library.
Subscribers: klimek, aemerson, mgorny, xazax.hun, kristof.beyls, hintonda, cfe-commits
Differential Revision: https://reviews.llvm.org/D42983
llvm-svn: 325272
2018-02-16 01:56:43 +08:00
|
|
|
|
2018-03-08 00:57:42 +08:00
|
|
|
.. option:: Std
|
|
|
|
|
|
|
|
The namespace used to suggest `P0214`_ alternatives. If not specified, `std::`
|
|
|
|
for `-std=c++2a` and `std::experimental::` for `-std=c++11`.
|
|
|
|
|
2019-01-23 03:19:48 +08:00
|
|
|
.. _P0214: https://wg21.link/p0214
|