From: Matthias Kretz <m.kretz@gsi.de>
To: <gcc-patches@gcc.gnu.org>, <libstdc++@gcc.gnu.org>
Subject: [committed] libstdc++: Fix uses of non-reserved names in simd header
Date: Mon, 20 Feb 2023 17:31:55 +0100 [thread overview]
Message-ID: <12342604.nUPlyArG6x@minbar> (raw)
[-- Attachment #1: Type: text/plain, Size: 968 bytes --]
Tested x86_64-pc-linux. Pushed to trunk.
-- >8 --
Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
libstdc++-v3/ChangeLog:
* include/experimental/bits/simd.h (__extract_part, split):
Use reserved name for template parameter.
---
libstdc++-v3/include/experimental/bits/simd.h | 22 +++++++++----------
1 file changed, 11 insertions(+), 11 deletions(-)
--
──────────────────────────────────────────────────────────────────────────
Dr. Matthias Kretz https://mattkretz.github.io
GSI Helmholtz Centre for Heavy Ion Research https://gsi.de
stdₓ::simd
──────────────────────────────────────────────────────────────────────────
[-- Attachment #2: 0001-libstdc-Fix-uses-of-non-reserved-names-in-simd-heade.patch --]
[-- Type: text/x-patch, Size: 3771 bytes --]
diff --git a/libstdc++-v3/include/experimental/bits/simd.h b/libstdc++-v3/include/experimental/bits/simd.h
index ffe72fa6ccf..2f615d13b73 100644
--- a/libstdc++-v3/include/experimental/bits/simd.h
+++ b/libstdc++-v3/include/experimental/bits/simd.h
@@ -3783,7 +3783,7 @@ template <int _Index, int _Total, int _Combine = 1, typename _Tp, size_t _Np>
_SimdWrapper<_Tp, _Np / _Total * _Combine>
__extract_part(const _SimdWrapper<_Tp, _Np> __x);
-template <int Index, int Parts, int _Combine = 1, typename _Tp, typename _A0,
+template <int _Index, int _Parts, int _Combine = 1, typename _Tp, typename _A0,
typename... _As>
_GLIBCXX_SIMD_INTRINSIC auto
__extract_part(const _SimdTuple<_Tp, _A0, _As...>& __x);
@@ -3896,19 +3896,19 @@ template <size_t... _Sizes, typename _Tp, typename... _As>
// split<simd>(simd) {{{
template <typename _V, typename _Ap,
- size_t Parts = simd_size_v<typename _V::value_type, _Ap> / _V::size()>
- enable_if_t<simd_size_v<typename _V::value_type, _Ap> == Parts * _V::size()
- && is_simd_v<_V>, array<_V, Parts>>
+ size_t _Parts = simd_size_v<typename _V::value_type, _Ap> / _V::size()>
+ enable_if_t<simd_size_v<typename _V::value_type, _Ap> == _Parts * _V::size()
+ && is_simd_v<_V>, array<_V, _Parts>>
split(const simd<typename _V::value_type, _Ap>& __x)
{
using _Tp = typename _V::value_type;
- if constexpr (Parts == 1)
+ if constexpr (_Parts == 1)
{
return {simd_cast<_V>(__x)};
}
else if (__x._M_is_constprop())
{
- return __generate_from_n_evaluations<Parts, array<_V, Parts>>(
+ return __generate_from_n_evaluations<_Parts, array<_V, _Parts>>(
[&](auto __i) constexpr _GLIBCXX_SIMD_ALWAYS_INLINE_LAMBDA {
return _V([&](auto __j) constexpr _GLIBCXX_SIMD_ALWAYS_INLINE_LAMBDA
{ return __x[__i * _V::size() + __j]; });
@@ -3925,12 +3925,12 @@ template <typename _V, typename _Ap,
#ifdef _GLIBCXX_SIMD_USE_ALIASING_LOADS
const __may_alias<_Tp>* const __element_ptr
= reinterpret_cast<const __may_alias<_Tp>*>(&__data(__x));
- return __generate_from_n_evaluations<Parts, array<_V, Parts>>(
+ return __generate_from_n_evaluations<_Parts, array<_V, _Parts>>(
[&](auto __i) constexpr _GLIBCXX_SIMD_ALWAYS_INLINE_LAMBDA
{ return _V(__element_ptr + __i * _V::size(), vector_aligned); });
#else
const auto& __xx = __data(__x);
- return __generate_from_n_evaluations<Parts, array<_V, Parts>>(
+ return __generate_from_n_evaluations<_Parts, array<_V, _Parts>>(
[&](auto __i) constexpr _GLIBCXX_SIMD_ALWAYS_INLINE_LAMBDA {
[[maybe_unused]] constexpr size_t __offset
= decltype(__i)::value * _V::size();
@@ -3944,12 +3944,12 @@ template <typename _V, typename _Ap,
else if constexpr (is_same_v<typename _V::abi_type, simd_abi::scalar>)
{
// normally memcpy should work here as well
- return __generate_from_n_evaluations<Parts, array<_V, Parts>>(
+ return __generate_from_n_evaluations<_Parts, array<_V, _Parts>>(
[&](auto __i) constexpr _GLIBCXX_SIMD_ALWAYS_INLINE_LAMBDA { return __x[__i]; });
}
else
{
- return __generate_from_n_evaluations<Parts, array<_V, Parts>>(
+ return __generate_from_n_evaluations<_Parts, array<_V, _Parts>>(
[&](auto __i) constexpr _GLIBCXX_SIMD_ALWAYS_INLINE_LAMBDA {
if constexpr (__is_fixed_size_abi_v<typename _V::abi_type>)
return _V([&](auto __j) constexpr _GLIBCXX_SIMD_ALWAYS_INLINE_LAMBDA {
@@ -3957,7 +3957,7 @@ template <typename _V, typename _Ap,
});
else
return _V(__private_init,
- __extract_part<decltype(__i)::value, Parts>(__data(__x)));
+ __extract_part<decltype(__i)::value, _Parts>(__data(__x)));
});
}
}
next reply other threads:[~2023-02-20 16:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-20 16:31 Matthias Kretz [this message]
2023-02-20 16:36 ` 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=12342604.nUPlyArG6x@minbar \
--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).