This is the mail archive of the 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]

Re: readonly register

BELBACHIR Selim <> writes:

> In fact my final purpose is to replace $INP by a register bank in order to be able to read several inputs using pipelined instructions (and instruction scheduler). The fixed reg solution will prevent me from doing this. Is there another way to prevent the use of some registers during the reload pass without turning them into fixed register ?

I can't think of any simple way offhand.  My experience is that in
extreme cases the register allocator will try to use every available
register.  It sounds like you want the allocator to manage the register
bank, but you don't want it to use registers from that bank for outputs.
The allocator doesn't really work that way.  Perhaps there is a way that
I don't know about.


> -----Message d'origine-----
> DeÂ: Ian Lance Taylor [] 
> EnvoyÃÂ: jeudi 19 janvier 2012 00:17
> CcÂ:
> ObjetÂ: Re: readonly register
> BELBACHIR Selim <> writes:
>> I'm trying to support an 'in' instruction which reads a value on a peripheral and writes it into a $INP register.
>> The $INP register can be used in almost every insn as input operand (add, sub, mul ...).
>> I defined a builting to access the 'in' instruction.
>> How should I express to gcc that the $INP register can only be 'read' and must never be written?
>> For the moment, I encounter a problem during IRA pass where some of my 'classic' registers are reloaded into $INP (apparently because I have no register left).
> If you have a builtin to access the value, then you should be able to
> make it a fixed register.  The register allocator will never try to
> allocate a fixed register.
> Ian

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