[fpc-devel] Register allocation question

Sergei Gorelkin sergei_gorelkin at mail.ru
Sat Apr 9 20:26:57 CEST 2011

09.04.2011 22:13, Jonas Maebe пишет:
> On 09 Apr 2011, at 20:08, Sergei Gorelkin wrote:
>> I wonder whether it is possible to assign a priority (or order) of registers for FPC's register allocator. Currently registers are allocated in the order of ordinals defined in cpubase.pas. On i386 it doesn't make any difference, but on x86_64 'nonvolatile' rbx (and in Win64 also rsi and rdi) are always used before 'volatile' ones r8..r11. Reversing this order would help avoiding stackframes in simple procedures, resulting in nicer code.
>> Maybe somebody could share some clues about if this is possible and where to start looking?
> Simply changing the register order in the array to trgcpu.create in Tcgx86_64.init_register_allocators should do it.
Hmm, that was the first thing I tried, but it doesnt't seem to make any difference :(


More information about the fpc-devel mailing list