[fpc-devel] Register allocation question

Sergei Gorelkin sergei_gorelkin at mail.ru
Sat Apr 9 20:08:18 CEST 2011


Hello,

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?

Regards,
Sergei



More information about the fpc-devel mailing list