Kenneth Graves wrote:

From: Leopold Toetsch <[EMAIL PROTECTED]>

[ optimized register allocation ]



Is there a stub of this functionality in the code somewhere?
(Or some notes about how it might be approached?)

No, not yet. Currently local variables (and parameters if a sub calls another sub) are allocated registers from #16 up. A subroutine call (as well as your yield code) does savetop/restoretop to preserve these registers.
So this should work for now, if no more then 16 registers are needed, that is for not too complicated code.



I'm either going to have to put this in the CLU compiler, or in IMCC.

I think its up to imcc to handle that stuff. If e.g. a parameter doesn't live beyond a subroutine call, it can get register numbers in the low range. If then no registers of this kind have to be preserved, imcc can change the register save opcode accordingly. A HL can hardly emit that kind of code.



--kag

leo





Reply via email to