public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rsandifo at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/98542] Redundant loads in vectorised loop
Date: Thu, 07 Jan 2021 10:44:07 +0000	[thread overview]
Message-ID: <bug-98542-4-yMkOEkD7C3@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-98542-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98542

--- Comment #4 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
(In reply to rguenther@suse.de from comment #3)
> On Wed, 6 Jan 2021, rsandifo at gcc dot gnu.org wrote:
> 
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98542
> > 
> > --- Comment #2 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
> > With the follow-on mentioned (“i” being 32-bits rather than 64) we'd
> > still want to treat the structure access as a single group, even though
> > the fields are different sizes.
> 
> Supporting that is going to be tricky though.  Presumably this only
> works for { int, double }, not for { int, int, double } and accessing
> the 2nd int (or it all depends on endianess?).
It should work for both in the SVE example.  The idea is that the
int field will be loaded into an unpacked vector, with each 32-bit
element being stored in a 64-bit container.  We then need to extend
the int (if the int starts off in the low half) or right-shift the
container (if the int starts off in the high half).  The nice thing
about the gather example is that the extend case can be folded into
the gather itself.

Like you say, the choice between extending and shifting will depend
on which int we need and on the endianness.  All four combinations
should be doable though.

      parent reply	other threads:[~2021-01-07 10:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-05 16:17 [Bug tree-optimization/98542] New: " rsandifo at gcc dot gnu.org
2021-01-06  9:01 ` [Bug tree-optimization/98542] " rguenth at gcc dot gnu.org
2021-01-06 13:16 ` rsandifo at gcc dot gnu.org
2021-01-07  7:38 ` rguenther at suse dot de
2021-01-07 10:44 ` rsandifo at gcc dot gnu.org [this message]

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=bug-98542-4-yMkOEkD7C3@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).