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: Question about register allocation (GCC 4.1)


Thomas Bernard wrote:
So basically this is known at compile-time. Such as "dynamic" register allocator.
Is it that possible and what are the implications on the register allocator ???

The IA-64 case is much simpler. We have variable sized overlapping register windows. GCC already has register window support for sparc and i960 (since obsoleted).


The dynamic part is hard though. I didn't try to solve that. I have at most 96 locals, 8 inputs, and 8 outputs. The port is defined to have 80 locals, 8 inputs, and 8 outputs, i.e. the size of the input/output sets is fixed at their maximums. After register allocation, I look through the input/output register sets to see how many were actually used, and I just allocate that many. The only down side is that if some inputs and outputs are unused, then I can't add them to the local set. However, given that I have 80 of them, it is very rare to run out. Also, since input/output registers can be used for other stuff besides input/output arguments, it is even rarer to run out of locals and still have unused input/output regs left. So I don't worry about it.
--
Jim Wilson, GNU Tools Support, http://www.specifix.com



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