public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Peter Barada <pbarada@mail.wm.sps.mot.com>
To: fcook377@hotmail.com
Cc: gcc@gcc.gnu.org, Ulrich.Weigand@de.ibm.com
Subject: Re: Different addressing modes?
Date: Wed, 21 May 2003 16:48:00 -0000	[thread overview]
Message-ID: <200305211646.h4LGkcx07667@hyper.wm.sps.mot.com> (raw)
In-Reply-To: <Sea1-F579yOh58ab4uF000127c5@hotmail.com> (fcook377@hotmail.com)


>I am still trying to get addressing modes correctly in my port. Basically my 
>architecture has the following addressing modes:
>
>  1) absolute
>  2) register indirect
>  3) register + offset
>  4) register + register

You may want to go back and read the Compiler internals documentation
where it talks about 'predicate' functions (such as general_operand,
nonimmediate_operand' that you can use to fine-tune what RTL the insns
patterns your port will accept.

As an example, in gcc/config/m68k/m68k.md, the 'pushasi' pattern is
used to push the address of a varaible/function, etc, and you can see
that the destination target predicate of the 'set' is push_operand
which restricts the RTL to only allow a push to the stack as the
destination, and specifies that the source of the 'set' is an
address_operand, a combination of predicates that are valid for the
pea instruction:

(define_insn "pushasi"
  [(set (match_operand:SI 0 "push_operand" "=m")
	(match_operand:SI 1 "address_operand" "p"))]
  ""
  "pea %a1")


-- 
Peter Barada                             Peter.Barada@motorola.com
Wizard                                   781-852-2768 (direct)
WaveMark Solutions(A Motorola Company)   781-270-0193 (fax)

  reply	other threads:[~2003-05-21 16:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-21 16:32 Fred Cook
2003-05-21 16:48 ` Peter Barada [this message]
2003-05-21 22:11 Ulrich Weigand

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=200305211646.h4LGkcx07667@hyper.wm.sps.mot.com \
    --to=pbarada@mail.wm.sps.mot.com \
    --cc=Ulrich.Weigand@de.ibm.com \
    --cc=fcook377@hotmail.com \
    --cc=gcc@gcc.gnu.org \
    /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).