Re: [fpc-devel] Register allocation question

2011-04-10 Thread Sergei Gorelkin
10.04.2011 00:49, Florian Klämpfl пишет: 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

Re: [fpc-devel] Register allocation question

2011-04-10 Thread Florian Klämpfl
Am 10.04.2011 12:38, schrieb Sergei Gorelkin: By now I had run the test suite in x86_64-linux, without regressions. Feel free to commit it then. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org

[fpc-devel] Register allocation question

2011-04-09 Thread Sergei Gorelkin
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

Re: [fpc-devel] Register allocation question

2011-04-09 Thread 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

Re: [fpc-devel] Register allocation question

2011-04-09 Thread Florian Klämpfl
Am 09.04.2011 20:08, schrieb Sergei Gorelkin: 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

Re: [fpc-devel] Register allocation question

2011-04-09 Thread Sergei Gorelkin
09.04.2011 22:26, Sergei Gorelkin пишет: 09.04.2011 22:13, Jonas Maebe пишет: 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 :( No, it

Re: [fpc-devel] Register allocation question

2011-04-09 Thread Sergei Gorelkin
09.04.2011 22:15, Florian Klämpfl пишет: The registers are allocated in the order defined in tcgx86_64.init_registers_allocators. However, there are rax etc. in front of rbx etc. The reason why rbx etc. are used might be calls to other procedures. Can you give an example which is affected by

Re: [fpc-devel] Register allocation question

2011-04-09 Thread Florian Klämpfl
Am 09.04.2011 21:04, schrieb Sergei Gorelkin: 09.04.2011 22:26, Sergei Gorelkin пишет: 09.04.2011 22:13, Jonas Maebe пишет: 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

Re: [fpc-devel] Register allocation question

2011-04-09 Thread Daniël Mantione
Op Sat, 9 Apr 2011, schreef Florian Klämpfl: Am 09.04.2011 21:04, schrieb Sergei Gorelkin: 09.04.2011 22:26, Sergei Gorelkin ?: 09.04.2011 22:13, Jonas Maebe ?: Simply changing the register order in the array to trgcpu.create in Tcgx86_64.init_register_allocators should do it.

Re: [fpc-devel] Register allocation question

2011-04-09 Thread Florian Klämpfl
Am 09.04.2011 21:34, schrieb Daniël Mantione: I think the challenge is do design some generic infrastructure to tell the register allocator about biasing it should do, and then to add some heuristics somewhere else (like leaf/non-leaf) to give the register allocator the proper instructions.

Re: [fpc-devel] Register allocation question

2011-04-09 Thread 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

Re: [fpc-devel] Register allocation question

2011-04-09 Thread Florian Klämpfl
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