[fpc-pascal] Pascal Ardiono (avr) library

Joost van der Sluis joost at cnoc.nl
Sun Apr 4 15:36:05 CEST 2021



Op 04-04-2021 om 13:33 schreef Florian Klämpfl via fpc-pascal:
> 
> 
>> Am 04.04.2021 um 12:50 schrieb Joost van der Sluis via fpc-pascal <fpc-pascal at lists.freepascal.org>:
>>
>> Isn't it at least a good practice to store self at Y. So we have Z free for other calculations and can access members directly using ldd (),y+().
>>
>> But maybe that's difficult?
> 
> Using Y might be indeed difficult as the compiler knows only after register allocation that it does not need Y for other purposes. It would basically require the ability to redo code generation.

In my head I've been thinking a lot about another register-allocator:

During the code-generation the code-generation only asks the 
register-allocator 'I need a register now that cas capabilities X,Y and 
Z). Or: give me the same register as I used last time.

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.

Regards,

Joost.


More information about the fpc-pascal mailing list