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

RE: How to hide registers from local RA but not reload?


On 13 March 2007 19:56, Ian Lance Taylor wrote:

> "Dave Korn" <dave.korn@artimi.com> writes:
> 
>>   The intermediate cause is that lreg considers all the special-purpose reg
>> classes when allocating, and for some reason decides that several of the
>> special-purpose classes have equal cost (zero) to GENERAL_REGS.  The bit I
>> find strange about this is that it then decides to take the
>> highest-numbered class as the preferred register class, despite the fact
>> that it has a lot less members in it than GENERAL_REGS.  (There is no
>> overlap between the classes, so I haven't put them in the "wrong order",
>> as one is not a subset of the other). 
> 
> Did you set REGISTER_MOVE_COST for your new registers?

  Ah, no I didn't.  Having said that, do I really want to?  At the moment I
have no definition of it at all, so everything has the default cost 2.  Isn't
this right?  I want to use reloads to get the input operands from gprs into
the memory-mapped registers, and I have defined movsi3 patterns to exchange
between any of the specialised registers and the gprs, and I'm not sure in
what way you're suggesting I should uuse REGISTER_MOVE_COST.

 
>> Q.  Is it possible to do what I really want: to make the compiler aware of
>> some registers, but limit their usage to a single insn; to allow reload to
>> use these registers when directed to by a constraint letter, but for the
>> rest of the compiler to basically pretend they don't even exist.
> 
> This is more or less what the MIPS backend does with the HI and LO
> registers.  You might want to look at that.

  Thanks Ian, that sounds very much like what I'm looking for, I'll take a dig
through it.


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


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