public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Richard Biener <richard.guenther@gmail.com>
Cc: Jeff Law <jeffreyalaw@gmail.com>,
	liuhongt <hongtao.liu@intel.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>,
	Richard Sandiford <rdsandiford@googlemail.com>
Subject: Re: [PATCH] Relax condition of (vec_concat:M(vec_select op0 idx0)(vec_select op0 idx1)) to allow different modes between op0 and M, but have same inner mode.
Date: Fri, 24 Sep 2021 08:06:57 -0500	[thread overview]
Message-ID: <20210924130657.GB17780@gate.crashing.org> (raw)
In-Reply-To: <CAFiYyc0_=6wBrwq7UjmeTQsRG-XbdjGpCfQi+kVr+F3rDoPeEw@mail.gmail.com>

On Mon, Sep 13, 2021 at 04:24:13PM +0200, Richard Biener wrote:
> On Mon, Sep 13, 2021 at 4:10 PM Jeff Law via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
> > I'm not convinced that we need the inner mode to match anything.  As
> > long as the vec_concat's mode is twice the size of the vec_select modes
> > and the vec_select mode is <= the mode of its operands ISTM this is
> > fine.   We  might want the modes of the vec_select to match, but I don't
> > think that's strictly necessary either, they just need to be the same
> > size.  ie, we could have somethig like
> >
> > (vec_concat:V2DF (vec_select:DF (reg:V4DF)) (vec_select:DI (reg:V4DI)))
> >
> > I'm not sure if that level of generality is useful though.  If we want
> > the modes of the vec_selects to match I think we could still support
> >
> > (vec_concat:V2DF (vec_select:DF (reg:V4DF)) (vec_select:DF (reg:V8DF)))
> >
> > Thoughts?
> 
> I think the component or scalar modes of the elements to concat need to match
> the component mode of the result.  I don't think you example involving
> a cat of DF and DI is too useful - but you could use a subreg around the DI
> value ;)

I agree.

If you want to concatenate components of different modes, you should
change mode first, using subregs for example.

("Inner mode" is something of subregs btw, "component mode" is what this
concept of modes is called, the name GET_MODE_INNER is a bit confusing
though :-) )

Btw, the documentation for "concat" says
  @findex concat
  @item (concat@var{m} @var{rtx} @var{rtx})
  This RTX represents the concatenation of two other RTXs.  This is used
  for complex values.  It should only appear in the RTL attached to
  declarations and during RTL generation.  It should not appear in the
  ordinary insn chain.
which needs some updating (in many ways).


Segher

  reply	other threads:[~2021-09-24 13:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-10  4:36 liuhongt
2021-09-13 14:09 ` Jeff Law
2021-09-13 14:24   ` Richard Biener
2021-09-24 13:06     ` Segher Boessenkool [this message]
2021-09-27  9:49       ` Hongtao Liu
2021-09-27 12:07         ` Richard Biener
2021-09-28  1:48           ` Jeff Law
2021-09-13 15:09   ` Hongtao Liu
2021-09-13 15:19   ` Hongtao Liu
2021-09-24 10:58     ` Hongtao Liu

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=20210924130657.GB17780@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hongtao.liu@intel.com \
    --cc=jeffreyalaw@gmail.com \
    --cc=rdsandiford@googlemail.com \
    --cc=richard.guenther@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).