public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Peter Bergner <bergner@linux.ibm.com>
Cc: acsawdey@linux.ibm.com, gcc-patches@gcc.gnu.org, wschmidt@linux.ibm.com
Subject: Re: [PATCH,rs6000] Make MMA builtins use opaque modes
Date: Tue, 17 Nov 2020 17:01:43 -0600	[thread overview]
Message-ID: <20201117230143.GF2672@gate.crashing.org> (raw)
In-Reply-To: <7a81891c-cad1-b83a-bd8c-0e132d7a607f@linux.ibm.com>

On Tue, Nov 17, 2020 at 12:41:58PM -0600, Peter Bergner wrote:
> > +;; Return 1 if this operand is valid for an MMA disassemble insn.
> > +(define_predicate "mma_disassemble_output_operand"
> > +  (match_code "reg,subreg,mem")
> > +{
> > +  if (REG_P (op) && !vsx_register_operand (op, mode))
> > +    return false;
> > +  return true;
> > +})
> 
> Do we really want to accept subregs here?  If so, why are they not also required
> to be vsx_register_operand()?

That *does* allow subregs!

;; Return 1 if op is a VSX register.
(define_predicate "vsx_register_operand"
  (match_operand 0 "register_operand")
{
  if (SUBREG_P (op))
    {
      if (TARGET_NO_SF_SUBREG && sf_subreg_operand (op, mode))
        return 0;

      op = SUBREG_REG (op);
    }

...

int
register_operand (rtx op, machine_mode mode)
{
  if (GET_CODE (op) == SUBREG)
    {
      rtx sub = SUBREG_REG (op);

      /* Before reload, we can allow (SUBREG (MEM...)) as a register operand
         because it is guaranteed to be reloaded into one.
         Just make sure the MEM is valid in itself.
         (Ideally, (SUBREG (MEM)...) should not exist after reload,
         but currently it does result from (SUBREG (REG)...) where the
         reg went on the stack.)  */
      if (!REG_P (sub) && (reload_completed || !MEM_P (sub)))
        return 0;
    }
  else if (!REG_P (op))
    return 0;
  return general_operand (op, mode);
}

(The SFmode thing and subregs-of-mem are complifying things, just to
keep things interesting.)

We need to allow subregs of reg pretty much always, for reinterpret_cast
like things (say, changing one vector mode to another).


Segher

  reply	other threads:[~2020-11-17 23:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-17 17:48 acsawdey
2020-11-17 18:41 ` Peter Bergner
2020-11-17 23:01   ` Segher Boessenkool [this message]
2020-11-17 23:24     ` Peter Bergner
2020-11-17 22:42 ` Segher Boessenkool
2020-11-19 18:58   ` [PATCH,rs6000] Make MMA builtins use opaque modes [v2] acsawdey
2020-11-19 20:08     ` Peter Bergner
2020-11-20  1:02     ` Aaron Sawdey
2020-11-20 19:10     ` Segher Boessenkool

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=20201117230143.GF2672@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=acsawdey@linux.ibm.com \
    --cc=bergner@linux.ibm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=wschmidt@linux.ibm.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).