From: Matthias Kretz Date: Thu, 24 Jun 2021 13:20:15 +0000 (+0100) Subject: libstdc++: Ensure unrolled loops inline the lambda X-Git-Tag: basepoints/gcc-13~6526 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8888795ad16fc5ebf112b5bac091dc1ebb6c45d1;p=thirdparty%2Fgcc.git libstdc++: Ensure unrolled loops inline the lambda Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd.h (__execute_on_index_sequence) (__execute_on_index_sequence_with_return) (__call_with_n_evaluations, __call_with_subscripts): Add flatten attribute. --- diff --git a/libstdc++-v3/include/experimental/bits/simd.h b/libstdc++-v3/include/experimental/bits/simd.h index 163f1b574e20..c396ebd3ee33 100644 --- a/libstdc++-v3/include/experimental/bits/simd.h +++ b/libstdc++-v3/include/experimental/bits/simd.h @@ -234,7 +234,8 @@ namespace __detail // unrolled/pack execution helpers // __execute_n_times{{{ template - _GLIBCXX_SIMD_INTRINSIC constexpr void + [[__gnu__::__flatten__]] _GLIBCXX_SIMD_INTRINSIC constexpr + void __execute_on_index_sequence(_Fp&& __f, index_sequence<_I...>) { ((void)__f(_SizeConstant<_I>()), ...); } @@ -254,7 +255,8 @@ template // }}} // __generate_from_n_evaluations{{{ template - _GLIBCXX_SIMD_INTRINSIC constexpr _R + [[__gnu__::__flatten__]] _GLIBCXX_SIMD_INTRINSIC constexpr + _R __execute_on_index_sequence_with_return(_Fp&& __f, index_sequence<_I...>) { return _R{__f(_SizeConstant<_I>())...}; } @@ -269,7 +271,8 @@ template // }}} // __call_with_n_evaluations{{{ template - _GLIBCXX_SIMD_INTRINSIC constexpr auto + [[__gnu__::__flatten__]] _GLIBCXX_SIMD_INTRINSIC constexpr + auto __call_with_n_evaluations(index_sequence<_I...>, _F0&& __f0, _FArgs&& __fargs) { return __f0(__fargs(_SizeConstant<_I>())...); } @@ -285,7 +288,8 @@ template // }}} // __call_with_subscripts{{{ template - _GLIBCXX_SIMD_INTRINSIC constexpr auto + [[__gnu__::__flatten__]] _GLIBCXX_SIMD_INTRINSIC constexpr + auto __call_with_subscripts(_Tp&& __x, index_sequence<_It...>, _Fp&& __fun) { return __fun(__x[_First + _It]...); }