public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Rask Ingemann Lambertsen <rask@sygehus.dk>
To: Pompapathi V Gadad <pompapathi@gmail.com>
Cc: "Gadad, Pompapathi V" <Pompapathi.V.Gadad@nsc.com>,
	        gcc-patches@gcc.gnu.org
Subject: Re: Re: [Patch] New: CR16 port
Date: Fri, 13 Jul 2007 15:23:00 -0000	[thread overview]
Message-ID: <20070713144426.GB5690@sygehus.dk> (raw)
In-Reply-To: <4697387B.20908@gmail.com>

On Fri, Jul 13, 2007 at 02:01:55PM +0530, Pompapathi V Gadad wrote:
> Rask Ingemann Lambertsen wrote:

> >>+(define_insn "mov<mode>_regs"
[4 mov patterns in total]
> >
> >These would normally be one pattern with five alternatives. A reg->reg
> >copy can turn into a reg->mem copy during reload, for example.
> >
> Well, I started with suggestion you had: Having 5 alternatives in a single pattern.
> It turns out that some of the pattern generated pass through predicate test but won't find
> an appropriate alternative. For example, in CR16 ISA, immediate memory store instruction
> does not have 32-bit store operation variant. Therefore, I had to break up the single pattern into
> multiple patterns. The store immediate pattern have "SHORT" (stands for QI and HI) macro
> expansion while others have ALLMT (stands for QI, HI, SI, SF)

   You could define "LONG" to expand to SI and SF and use something like
this:

(define_insn "*mov<mode>"
  [(set (match_operand:LONG 0 "nonimmediate_operand"	"=r, r, r,m")
	(match_operand:LONG 1 "general_operand"		"r,<iF>,m,r"))]
  "register_operand (operands[0], <MODE>mode)
   || register_operand (operands[1], <MODE>mode)"
  "@
   mov<tIsa>\t%1, %0
   mov<tIsa>\t%1, %0
   load<tIsa>\t%1, %0
   stor<tIsa>\t%1, %0"
  [(set_attr "length" "2,<lImmArith>,<lImmArith>,<lImmArith>")]
)

(define_insn "*mov<mode>"
  [(set (match_operand:SHORT 0 "nonimmediate_operand"	"=r, r, r,m, m")
	(match_operand:SHORT 1 "general_operand"	"r,<iF>,m,r,<LL>"))]
  "!store_operand (operands[0], <MODE>mode)
   || register_operand (operands[1], <MODE>mode)
   || u4bits_operand (operands[1], <MODE>mode)"
  "@
   mov<tIsa>\t%1, %0
   mov<tIsa>\t%1, %0
   load<tIsa>\t%1, %0
   stor<tIsa>\t%1, %0
   stor<tIsaShort>\t%1, %0"
  [(set_attr "length" "2,<lImmArith>,<lImmArith>,<lImmArith>,<lImmShort>")]
)

   You may have to adjust the predicates a little.

-- 
Rask Ingemann Lambertsen

  reply	other threads:[~2007-07-13 14:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-10  7:11 Gadad, Pompapathi V
2007-07-11 23:41 ` Rask Ingemann Lambertsen
2007-07-13  9:22   ` Pompapathi V Gadad
2007-07-13 15:23     ` Rask Ingemann Lambertsen [this message]
2007-07-14  4:00       ` Pompapathi V Gadad
2007-07-16  9:14         ` Pompapathi V Gadad
2007-07-16 12:25           ` 'Rask Ingemann Lambertsen'
2007-07-16 13:01             ` Pompapathi V Gadad
2007-07-16 13:08               ` Pompapathi V Gadad
2007-07-20  9:48                 ` Pompapathi V Gadad
2007-07-21 14:33                 ` 'Rask Ingemann Lambertsen'
2007-07-25  9:40                   ` Pompapathi V Gadad
2007-07-30  8:33                     ` 'Rask Ingemann Lambertsen'
2007-07-30  9:14                       ` Pompapathi V Gadad
2007-08-03 13:03                         ` 'Rask Ingemann Lambertsen'
2007-08-06  4:44                           ` Pompapathi V Gadad
2007-08-06 10:43                             ` 'Rask Ingemann Lambertsen'
2007-08-06 10:49                               ` Pompapathi V Gadad
2007-07-21 12:20               ` 'Rask Ingemann Lambertsen'
2007-07-13 15:56 ` Rask Ingemann Lambertsen

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=20070713144426.GB5690@sygehus.dk \
    --to=rask@sygehus.dk \
    --cc=Pompapathi.V.Gadad@nsc.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=pompapathi@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).