This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: (define_address ...) suggestions needed
- To: Bernd Schmidt <bernds at balti dot cygnus dot co dot uk>
- Subject: Re: (define_address ...) suggestions needed
- From: Denis Chertykov <denisc at overta dot ru>
- Date: 12 Jan 2000 00:17:51 +0300
- Cc: Denis Chertykov <denisc at overta dot ru>, gcc at gcc dot gnu dot org
- References: <Pine.LNX.4.10.10001112040540.7432-100000@balti.cygnus.co.uk>
Bernd Schmidt <bernds@balti.cygnus.co.uk> writes:
> Some machines support nested MEMs, so this has to be supported in some way.
>
> What might be useful is to specify a constraint letter for every addressing
> mode. GCC currently has a few hardcoded ones ('<', '>', 'm', 'o',
> ...); it
IMHO after (define_address ...) will be fully supported only one
constraint 'm' will be needed. See below.
> would be nice if every pattern could specify exactly what kind of addresses
> it can accept in an operand.
> This might solve a problem we have on the Thumb
> where different insns accept different base register classes when loading
> from memory.
IMHO this is a two different things (one true BASE_REG_CLASS and
insn pattern - address patterns link).
My second step will be substitute BASE_REG_CLASS to something like
enum reg_class
BASE_REG_CLASS_FOR_ADDRESS (ADDRESS)
rtx ADDRESS;
{
int icode;
icode = recog_address (ADDRESS);
extract_address (ADDRESS, icode);
return REG_CLASS_FROM_LETTER (*insn_data[icode].operand[0].constraint);
}
Also I'm already thinking about linking (define_address ...) patterns
by names to lists for using it as predicates in (define_insn ...)'s.
This is a real possibility to avoid any memory constraints except 'm'.
(define_predicate "memory_thumb_cmd_source_operand"
["base","reg","immediate"] ;; (define_address ...) names
["register_operand", "immediate_operand"] ;; other existing predicates
)
(define_predicate "memory_thumb_cmd_destination_operand"
["base","reg"]
["register_operand"])
What you think ?
Denis.