public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <iant@google.com>
To: Mohamed Shafi <shafitvm@gmail.com>
Cc: Richard Henderson <rth@redhat.com>, GCC <gcc@gcc.gnu.org>
Subject: Re: How to write shift and add pattern?
Date: Mon, 09 Nov 2009 15:26:00 -0000	[thread overview]
Message-ID: <mcrd43rra72.fsf@dhcp-172-17-9-151.mtv.corp.google.com> (raw)
In-Reply-To: <ba0bd44d0911090452u3f8a641aj4b0f6d94f45e0260@mail.gmail.com> (Mohamed Shafi's message of "Mon\, 9 Nov 2009 18\:22\:58 +0530")

Mohamed Shafi <shafitvm@gmail.com> writes:

>    Ok the constrain for address register is 'a'. Thats typo in the
> pattern that i given here. The proper pattern is
>
>  (define_insn "*saddl"
>    [(set (match_operand:SI 0 "register_operand" "=a,d")
>        (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "a,d")
>                          (match_operand:SI 2 "const24_operand" "J,J"))
>                 (match_operand:SI 3 "register_operand" "0,0")))]
>
> So how can i choose the address registers over data registers if that
> is more profitable?

If it is cheaper to move two values from data registers to address
registers than it is to use two data registers for this instruction,
then you should omit the d,d,J alternative.

If it is cheaper to move one value from a data register to an address
register than it is to use two data registers for this instruction,
then you should use !, as in "=a,!d".

Otherwise you should use ?, as in "=a,?d".  You can additional ?'s for
additional tuning if appropriate.

Ian

  reply	other threads:[~2009-11-09 15:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-28 19:56 Mohamed Shafi
2009-08-28 23:49 ` Richard Henderson
2009-11-06 13:30   ` Mohamed Shafi
2009-11-06 15:34     ` Ian Lance Taylor
2009-11-09 12:53       ` Mohamed Shafi
2009-11-09 15:26         ` Ian Lance Taylor [this message]
2009-11-06 16:17     ` Richard Henderson
2009-11-09 12:49       ` Mohamed Shafi

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=mcrd43rra72.fsf@dhcp-172-17-9-151.mtv.corp.google.com \
    --to=iant@google.com \
    --cc=gcc@gcc.gnu.org \
    --cc=rth@redhat.com \
    --cc=shafitvm@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).