At the moment I'm trying to fix some Linux bugs. When I compile Lazarus with it, I get about a 5% speed increase for -O1 and a 15% speed increase for -O3, but someone else reported a 2% slowdown for -O2 on their own test project. Either way, I hope my fundamental theory is sound... reducing the number of code passes... and I can convince Florian that the possible increase in maintenance difficulty is worth the performance gain. If that's successful, then I'll port the relevant code over to i386.
When it's totally stable, I'll definitely run your own project through it to see what we get. There are other little speed savings that can be made here and there that add to the running total. Most of it is simple refactoring.
For your bug report, I had a look at the Intel® 64 and IA-32 Architectures Software Developer’s Manual to check on some of the assembler routines, and the ones where LEA contains an immediate operand are actually invalid. My guess though is that the immediate was being converted into a reference that doesn't contain any registers. I'm not sure if and how an assembler should support that though, even if it's possible to represent the arrangement in raw machine code. Something for investigation, that's for sure.
Gareth
On Tue 04/12/18 19:29 , Simon Kissel sent:
Hi Gareth,
A regression like this is quite serious. I'd recommend opening a bug report with a reproducible case so we can investigate and hopefully
fix it within the day.
created a test project, and opened two tickets:
https://bugs.freepascal.org/view.php?id=34646 [1]
https://bugs.freepascal.org/view.php?id=34647 [2]
At the moment I'm experimenting with increasing the speed of the optimizer for x86_64, and then porting to i386 when it's proven successful. Having teething problems though!
Sounds great. I wish more of our products had 64bit CPUs...
What's the speed-up you are seeing on my test project so far?
Best regards,
Simon
