This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Specifics of `BASE_REG_CLASS` macro?


Hi,

I am configuring a GCC backend for my CPU architecture. However, I am
uncertain as to what I should define the `BASE_REG_CLASS` macro to.

> Macro: BASE_REG_CLASS
>
> A macro whose definition is the name of the class to which a valid
> base register must belong. A base register is one used in an address
> which is the register value plus a displacement.

So, I understand that this macro should return a class of registers
which may appear in instructions of the following form:

`move *(%reg + $offset), %reg`

My architecture only permits register dereferencing with no offset,
apart from the stack register. My questions are:

Should I consequently define the BASE_REG_CLASS macro to return the
stack pointer register class, and second...

What is the consequence of having no general registers be capable of
being dereferenced with an immediate offset, in terms of the
implementation-specific code that I would need to add, alongside the
standard assortment of machine description files?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]