[fpc-devel] Re: Faster Implementation for IntToStr

Mark Morgan Lloyd markMLl.fpc-devel at telemetry.co.uk
Mon Sep 3 20:21:23 CEST 2012

Graeme Geldenhuys wrote:
> On 03/09/12 14:05, Mark Morgan Lloyd wrote:
>> Except that modifying the compiler to generate highly-optimised code for
>> specific high-level tasks is probably more work than having a fragment
>> of assembler that needs to be written once per target CPU.
> And writing the assembler for that one task fixes ONE problem, but still 
> needs to be rewritten for all other target CPU's. Improving the 
> assembler generated by FPC improves many tasks at once.

I very carefully used the word "specific", and I was thinking of cases 
where the compiler was able to recognise e.g. IntToStr() and apply 
knowledge of typical usage in its optimisations. You might remember that 
things like the Sieve of Eratosthenes went out of vogue as benchmarks 
specifically because compilers were recognising the code and "cheating".

Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

More information about the fpc-devel mailing list