From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id EF38B38515ED; Thu, 24 Jun 2021 13:34:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EF38B38515ED MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r12-1787] libstdc++: Ensure unrolled loops inline the lambda X-Act-Checkin: gcc X-Git-Author: Matthias Kretz X-Git-Refname: refs/heads/master X-Git-Oldrev: d5125819d86274383041571daa3698d72bbac661 X-Git-Newrev: 8888795ad16fc5ebf112b5bac091dc1ebb6c45d1 Message-Id: <20210624133448.EF38B38515ED@sourceware.org> Date: Thu, 24 Jun 2021 13:34:48 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2021 13:34:49 -0000 https://gcc.gnu.org/g:8888795ad16fc5ebf112b5bac091dc1ebb6c45d1 commit r12-1787-g8888795ad16fc5ebf112b5bac091dc1ebb6c45d1 Author: Matthias Kretz Date: Thu Jun 24 14:20:15 2021 +0100 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: --- libstdc++-v3/include/experimental/bits/simd.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libstdc++-v3/include/experimental/bits/simd.h b/libstdc++-v3/include/experimental/bits/simd.h index 163f1b574e2..c396ebd3ee3 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]...); }