[fpc-pascal] Pascal Ardiono (avr) library
Florian Klämpfl
florian at freepascal.org
Sun Apr 4 17:51:17 CEST 2021
>>>
>>> And then, afterwards, once code has been generated for the whole 'block', the register-allocator fills in the registers. And store/restores them when needed. This can be done using an algorithm that uses a tree to 'peel-down' (is this English?) all the solutions. Just like is done with a regular-expression parser.
>>>
>>> Just dreaming. I don't have the time to work on it, and I don't even know how it works at the moment. But that would seem to be the ideal solution to me.
>> But this is how it is basically currently done?
>
> But why do you need to redo the code generation? At the moment the real registers are assigned, you do know if you need the y register for some specific task, no?
Well, thinking about it, maybe yes with some hacky approach. The issue is: only after register allocation it is known if temps. for spilling are needed. If any local data is used (local vars, temps, temps for spilling etc) then a frame pointer is needed, and if spilling temps are needed is only known when register allocation is complete.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20210404/f4bafad1/attachment.htm>
More information about the fpc-pascal
mailing list