From: Matthias Kretz <m.kretz@gsi.de>
To: <gcc-patches@gcc.gnu.org>, <libstdc++@gcc.gnu.org>
Subject: [PATCH 09/11] libstdc++: Ensure unrolled loops inline the lambda
Date: Tue, 8 Jun 2021 14:11:58 +0200 [thread overview]
Message-ID: <8456007.brqZDK0HF6@excalibur> (raw)
In-Reply-To: <270527782.u9WJ3AIrlG@excalibur>
[-- Attachment #1: Type: text/plain, Size: 1088 bytes --]
From: Matthias Kretz <kretz@kde.org>
Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
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.
---
libstdc++-v3/include/experimental/bits/simd.h | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
--
──────────────────────────────────────────────────────────────────────────
Dr. Matthias Kretz https://mattkretz.github.io
GSI Helmholtz Centre for Heavy Ion Research https://gsi.de
std::experimental::simd https://github.com/VcDevel/std-simd
──────────────────────────────────────────────────────────────────────────
[-- Attachment #2: 0009-libstdc-Ensure-unrolled-loops-inline-the-lambda.patch --]
[-- Type: text/x-patch, Size: 1830 bytes --]
diff --git a/libstdc++-v3/include/experimental/bits/simd.h b/libstdc++-v3/include/experimental/bits/simd.h
index 5d243f22434..21100c1087d 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 <typename _Fp, size_t... _I>
- _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 <size_t _Np, typename _Fp>
// }}}
// __generate_from_n_evaluations{{{
template <typename _R, typename _Fp, size_t... _I>
- _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 <size_t _Np, typename _R, typename _Fp>
// }}}
// __call_with_n_evaluations{{{
template <size_t... _I, typename _F0, typename _FArgs>
- _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 <size_t _Np, typename _F0, typename _FArgs>
// }}}
// __call_with_subscripts{{{
template <size_t _First = 0, size_t... _It, typename _Tp, typename _Fp>
- _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]...); }
next prev parent reply other threads:[~2021-06-08 12:12 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-08 12:10 [PATCH 00/11] stdx::simd optimizations, corrections, and cleanups Matthias Kretz
2021-06-08 12:11 ` [PATCH 01/11] libstdc++: Improve copysign codegen Matthias Kretz
2021-06-08 12:11 ` [PATCH 02/11] libstdc++: Remove dead code Matthias Kretz
2021-06-08 12:11 ` [PATCH 03/11] libstdc++: Improve fixed_size codegen Matthias Kretz
2021-06-08 12:11 ` [PATCH 04/11] libstdc++: Make use of __builtin_bit_cast Matthias Kretz
2021-06-11 10:53 ` [PATCH 04/11 v2] " Matthias Kretz
2021-06-24 14:01 ` [PATCH 04/11 v3] " Matthias Kretz
2021-06-24 14:08 ` Jakub Jelinek
2021-06-24 14:11 ` Jonathan Wakely
2021-06-24 14:12 ` Jonathan Wakely
2021-06-24 14:21 ` Jakub Jelinek
2021-06-24 14:34 ` Jonathan Wakely
2021-06-24 14:40 ` Jonathan Wakely
2021-06-24 14:44 ` Jakub Jelinek
2021-06-25 11:23 ` Jonathan Wakely
2021-06-08 12:11 ` [PATCH 05/11] libstdc++: Remove incorrect fabs overload Matthias Kretz
2021-06-08 12:11 ` [PATCH 06/11] libstdc++: Minor simd_math cleanups Matthias Kretz
2021-06-08 12:11 ` [PATCH 07/11] libstdc++: Fix condition when AVX512F ldexp implementation is used Matthias Kretz
2021-06-08 12:11 ` [PATCH 08/11] libstdc++: Avoid raising fp exceptions in trunc, floor, and ceil Matthias Kretz
2021-06-08 12:11 ` Matthias Kretz [this message]
2021-06-08 12:12 ` [PATCH 10/11] libstdc++: Fix internal names: add missing underscores Matthias Kretz
2021-06-08 12:12 ` [PATCH 11/11] libstdc++: Fix ODR issues with different -m flags Matthias Kretz
2021-06-09 12:22 ` Richard Biener
2021-06-09 12:53 ` Matthias Kretz
2021-06-09 13:22 ` Richard Biener
2021-11-15 8:57 ` Matthias Kretz
2022-01-14 21:30 ` Jonathan Wakely
2022-01-17 0:08 ` Jonathan Wakely
2021-06-24 13:42 ` [PATCH 00/11] stdx::simd optimizations, corrections, and cleanups Jonathan Wakely
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8456007.brqZDK0HF6@excalibur \
--to=m.kretz@gsi.de \
--cc=gcc-patches@gcc.gnu.org \
--cc=libstdc++@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).