public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <iant@google.com>
To: srimeruva@cse.iitb.ac.in
Cc: gcc-help@gcc.gnu.org
Subject: Re: match_dup as internal operands
Date: Wed, 21 Dec 2011 00:02:00 -0000	[thread overview]
Message-ID: <mcrvcpa6c0r.fsf@dhcp-172-18-216-180.mtv.corp.google.com> (raw)
In-Reply-To: <ab38551f74fe0b1a415229dc537655db.squirrel@www.cse.iitb.ac.in>	(srimeruva@cse.iitb.ac.in's message of "Wed, 21 Dec 2011 02:31:59	+0530")

srimeruva@cse.iitb.ac.in writes:

> what is the advantage of using match_dup for internal operands as
>
> (define_expand "zero_extendhisi2"
>  [(set (match_operand:SI 0 "register_operand" "")
>  (and:SI (subreg:SI
>  (match_operand:HI 1 "register_operand" "")
>  0)
>  (match_dup 2)))]
>  ""
>  "operands[2]
>     = force_reg (SImode, GEN_INT (65535)); ")

This would normally be used for a named pattern which does not expect
operand[2] to be filled in.  Since there is no operand[2], using a
match_operand does not make sense.  But since operand[2] needs to be
referenced in the generated pattern, it has to appear somehow.
match_dup is a reasonable compromise, because match_dup always matches.

Ian

  reply	other threads:[~2011-12-20 23:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1324405305.17587.ezmlm@gcc.gnu.org>
2011-12-20 21:15 ` srimeruva
2011-12-21  0:02   ` Ian Lance Taylor [this message]
2012-02-04  7:06   ` constraints validation in reload pass srimeruva
2012-02-04 11:49     ` Georg-Johann Lay
2012-02-04 12:02   ` match_dup as internal operands Georg-Johann Lay

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=mcrvcpa6c0r.fsf@dhcp-172-18-216-180.mtv.corp.google.com \
    --to=iant@google.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=srimeruva@cse.iitb.ac.in \
    /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).