public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <richard.sandiford@arm.com>
To: Srinivas Yadav <vasusrinivas.vasu14@gmail.com>
Cc: libstdc++@gcc.gnu.org,  gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] libstdc++: add ARM SVE support to std::experimental::simd
Date: Mon, 11 Dec 2023 11:02:07 +0000	[thread overview]
Message-ID: <mptzfyhhuj4.fsf@arm.com> (raw)
In-Reply-To: <mpt8r62kwxi.fsf@arm.com> (Richard Sandiford's message of "Sun, 10 Dec 2023 13:29:45 +0000")

Richard Sandiford <richard.sandiford@arm.com> writes:
>   template <size_t _Bits, size_t _Width>
>     struct _SveMaskWrapper
>     {
>       ...
>
>       _GLIBCXX_SIMD_INTRINSIC constexpr value_type
>       operator[](size_t __i) const
>       {
>         return _BuiltinSveMaskType::__sve_mask_active_count(
>                 _BuiltinSveVectorType::__sve_active_mask(),
>                 svand_z(_BuiltinSveVectorType::__sve_active_mask(),
>                         svcmpeq(_BuiltinSveVectorType::__sve_active_mask(),
>                                 _BuiltinSveMaskType::__index0123,
>                                 typename _BuiltinSveMaskType::__sve_mask_uint_type(__i)),
>                         _M_data));
>       }
>
> A simpler way to do this might be to use svdup_u<width>_z (_M_data, 1, 0)
> and then svorrv on the result.

Sorry for the nonsense comment.  I was thinking of a different operation.
But GCC knows how to index a fixed-length data vector, so it might be
worth using:

  svdup_u<width>_z (_M_data, 1)[__i]

Thanks,
Richard

  reply	other threads:[~2023-12-11 11:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-24 15:59 Srinivas Yadav
2023-12-10 13:29 ` Richard Sandiford
2023-12-11 11:02   ` Richard Sandiford [this message]
2024-01-04  7:42   ` Srinivas Yadav
2024-01-04  9:10     ` Andrew Pinski
2024-01-18  7:27       ` Matthias Kretz
2024-01-18  7:40         ` Andrew Pinski
2024-01-18  8:40           ` Matthias Kretz
2024-01-18  6:54   ` Matthias Kretz
2024-01-23 20:57     ` Richard Sandiford
2024-03-27 11:53       ` Matthias Kretz
2024-03-27 13:34         ` Richard Sandiford
2024-03-28 14:48           ` Matthias Kretz
2024-02-09 14:28   ` [PATCH v2] " Srinivas Yadav Singanaboina
2024-03-08  9:57     ` Matthias Kretz
2024-03-27  9:50       ` Jonathan Wakely
2024-03-27 10:07         ` Richard Sandiford
2024-03-27 10:30           ` Matthias Kretz
2024-03-27 12:13             ` Richard Sandiford
2024-03-27 12:47               ` Jonathan Wakely
2024-03-27 14:18         ` Matthias Kretz

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=mptzfyhhuj4.fsf@arm.com \
    --to=richard.sandiford@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    --cc=vasusrinivas.vasu14@gmail.com \
    /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).