This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Controlling what kind of value ends in a register
- From: Jim Wilson <wilson at specifixinc dot com>
- To: Alexandre Courbot <Alexandre dot Courbot at lifl dot fr>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 17 Sep 2003 00:38:29 -0700
- Subject: Re: Controlling what kind of value ends in a register
- References: <200309161811.02260.Alexandre.Courbot@lifl.fr>
Alexandre Courbot wrote:
My machine definition requires that one kind of register class (named
POINTER_REGS) is exclusively used to hold addresses.
You didn't mention why addresses always have to be in POINTER_REGS. The
precise reason why may affect the answer. You also haven't clearly
shown what is going wrong.
There are a number of issues here. You might want
GO_IF_LEGITIMATE_ADDRESS to only accept registers in POINTER_REGS. You
might want to define a constraint letter for the POINTER_REGS register
class and use it in all instructions that use addresses. If that
includes simple instructions like add, and you need to tell the
difference between an address add and an integer add, then you might
need to use PSImode or something similar for addresses so you can
distinguish them from integers. You might want BASE_REG_CLASS and
INDEX_REG_CLASS to be POINTER_REGS. You might want to define
PREFERRED_RELOAD_CLASS to restrict classes for pointers to POINTER_REGS.
You might need secondary reloads. You might need any number of other
stuff.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com