public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <rdsandiford@googlemail.com>
To: James Greenhalgh <james.greenhalgh@arm.com>
Cc: gcc-patches@gcc.gnu.org,  gerald@pfeifer.com, 	joseph@codesourcery.com
Subject: Re: [Patch docs 4/5] Update "Output Template/Statement" from md.texi
Date: Mon, 12 Jan 2015 22:19:00 -0000	[thread overview]
Message-ID: <87wq4r8x93.fsf@googlemail.com> (raw)
In-Reply-To: <1420543302-11008-5-git-send-email-james.greenhalgh@arm.com>	(James Greenhalgh's message of "Tue, 6 Jan 2015 11:21:41 +0000")

James Greenhalgh <james.greenhalgh@arm.com> writes:
>  If the output control string starts with a @samp{@@}, then it is actually
>  a series of templates, each on a separate line.  (Blank lines and
>  leading spaces and tabs are ignored.)  The templates correspond to the
> -pattern's constraint alternatives (@pxref{Multi-Alternative}).  For example,
> -if a target machine has a two-address add instruction @samp{addr} to add
> -into a register and another @samp{addm} to add a register to memory, you
> -might write this pattern:
> +pattern's constraint alternatives (@pxref{Multi-Alternative}).
> +
> +For example, if a target machine has a two-address add instruction
> +@samp{addreg} to add into a register and another @samp{addmem} to add
> +a register to memory, this pattern could be used to describe the
> +instructions.
>  
>  @smallexample
>  (define_insn "addsi3"
>    [(set (match_operand:SI 0 "general_operand" "=r,m")
>          (plus:SI (match_operand:SI 1 "general_operand" "0,0")
> -                 (match_operand:SI 2 "general_operand" "g,r")))]
> +                 (match_operand:SI 2 "general_operand" "r,r")))]
>    ""
>    "@@
> -   addr %2,%0
> -   addm %2,%0")
> +   addreg %2,%0
> +   addmem %2,%0")
>  @end smallexample

While there, I think we should tighten the predicates to
nonimmediate_operand for operands 0 and 1 and -- given the
new constraints -- register_operand for operand 2.

Thanks,
Richard

  parent reply	other threads:[~2015-01-12 22:11 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-06 11:21 [Patch docs 0/5] Update some of md.texi James Greenhalgh
2015-01-06 11:22 ` [Patch docs 2/5] Update "Instruction Patterns" in md.texi James Greenhalgh
2015-01-08 22:00   ` Jeff Law
2015-01-09  2:19     ` Segher Boessenkool
2015-01-11 17:40     ` James Greenhalgh
2015-01-12 22:31   ` Richard Sandiford
2015-01-06 11:22 ` [Patch docs 3/5] Update "RTL Template" " James Greenhalgh
2015-01-12 22:04   ` Jeff Law
2015-01-12 22:11   ` Richard Sandiford
2015-01-06 11:22 ` [Patch docs 4/5] Update "Output Template/Statement" from md.texi James Greenhalgh
2015-01-12 21:46   ` Jeff Law
2015-01-12 22:19   ` Richard Sandiford [this message]
2015-01-06 11:22 ` [Patch docs 1/5] Update the first section of md.texi James Greenhalgh
2015-01-06 16:56   ` James Greenhalgh
2015-01-06 18:55     ` Joseph Myers
2015-01-08 21:43       ` Jeff Law
2015-01-09  2:11         ` Segher Boessenkool
2015-01-12 22:29   ` Richard Sandiford
2015-01-06 11:23 ` [Patch docs 5/5] Update "Predicates" from md.texi James Greenhalgh
2015-01-12 22:42   ` Richard Sandiford
2015-01-06 14:57 ` [Patch docs 0/5] Update some of md.texi Joseph Myers
2015-01-06 15:26   ` James Greenhalgh
2015-01-06 17:31     ` Sandra Loosemore
2015-01-06 18:46     ` Joseph Myers

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=87wq4r8x93.fsf@googlemail.com \
    --to=rdsandiford@googlemail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gerald@pfeifer.com \
    --cc=james.greenhalgh@arm.com \
    --cc=joseph@codesourcery.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).