This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Different addressing modes?
- From: Peter Barada <pbarada at mail dot wm dot sps dot mot dot com>
- To: fcook377 at hotmail dot com
- Cc: gcc at gcc dot gnu dot org, Ulrich dot Weigand at de dot ibm dot com
- Date: Wed, 21 May 2003 12:46:38 -0400
- Subject: Re: Different addressing modes?
- References: <Sea1-F579yOh58ab4uF000127c5@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)