From: Scott D. <sc...@da...> - 2001-11-07 00:23:25
|
I was out of town for three days and was overwelmed by the activity in SDCC when I got back! Great work guys! Unfortunately, I deleted Sandeep's message about register allocation... In the PIC Port, I just implemented something similar to what you (Sandeep) described, but it's at a much higher level. (Since I've deleted the message, I may be mis-remembering the details). The PIC has no accessible stack. Consequently, there's no push/pop available for passing parameters to and from functions. To get around this, I created a special block of "registers" in ralloc.c dedicated to passing parameters. (One of the benefits of the PIC is that all RAM can be accessed like a register.) I think what I've implemented could be incorporated at the iCode layer since these special registers have a very short live range. OTOH, there's a problem in some cases where the registers are getting duplicated. E.g. a temporary is "pushed" into these special registers only to be "popped" in the callee's context. Avoiding this kind of register duplication is very difficult without performing a call tree analysis. Guess what I intend to embark upon next :). BTW, The PIC port is starting to stabilize quite a bit now. There's still no linker support, but for simple, single-file applications, SDCC is almost usable for the PIC! Scott |