[fpc-devel] Register allocation question

Florian Klämpfl florian at freepascal.org
Sat Apr 9 22:49:08 CEST 2011


Am 09.04.2011 22:22, schrieb Sergei Gorelkin:
> 09.04.2011 23:10, Florian Klämpfl пишет:
>>
>> Problem is, this might hurt non leaf functions. Maybe the register
>> allocators can be initialized differently for leave and non-leave
>> functions?
> 
> I understand the concern, but it should be handled somehow already. If
> we consider a non-leaf function that is complex enough to consume all 14
> registers, what difference does the order of allocation make? 

It is not needed to use all 14, but it might be more benefical to use
those which are preserved across a function call.

> When
> making a call, it must know which registers will be destroyed and which
> won't, otherwise result will be wrong anyway.
> What I see confirms what I think: non-leaf functions continue to use
> rbx, rsi and rdi, not r8..r11.

So the code for those does not change?



More information about the fpc-devel mailing list