[fpc-devel] LEA instruction speed

J. Gareth Moreton gareth at moreton-family.com
Fri Oct 13 18:20:42 CEST 2023


It was a thought that crossed my mind when Stefan pointed out the 
translated Google Benchmark, but given that it hasn't yet been adapted 
to work outside of i386 and x86_64, you are right that it probably 
shouldn't be used for the time being.  The framework uses CPU timings to 
decide how many iterations to run, so obtaining such metrics is 
essential for its operation.  While I can probably get it to work for 
aarch64-linux, I don't know the first thing about polling CPUs on 
platforms I don't have access to!  It was a nice experiment in the meantime.

In regards to "blea" being in the test suite, i haven't yet put it into 
the normal test suite (using an include wrapper like I did with 
"tests/bench/bcase.pp") since it's primarily to evalutate LEA timings 
rather than testing compiler efficiency.  It's more of a 'utility' 
test.  The feedback from others has proven useful in determining the 
correctness of the new optimisation hint, which I intend to use to make 
the i386/x86_64 peephole optimizer smarter in regards to using LEA 
statements.

Kit

On 13/10/2023 16:36, Tomas Hajny via fpc-devel wrote:
> On 2023-10-13 17:08, J. Gareth Moreton via fpc-devel wrote:
>> Interesting!  That's a bug report to send to the maintainers of the
>> framework.  I'll need to have them fix it before I'd be willing to try
>> again with its use in FPC.
>>
>> Removed the reference.  Apologies - I'm rushing a bit.
>
> BTW, it's IMHO questionable whether a benchmark framework restricted 
> to just a subset of targets supported for the given architecture 
> should be really used within FPC source codes (if that's your 
> potential intention anyway). If it was intended for the testsuite, it 
> would immediately fail at compile time when checking the testsuite 
> under some other target, because the test doesn't specify that its use 
> should be restricted to certain targets (it's only restricted for i386 
> and x86_64 regardless of the operating system - that's fine for the 
> original version, but not for the benchmark framework).
>
> Tomas
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
>


More information about the fpc-devel mailing list