[fpc-devel] Thoughts: Make FillChar etc. an intrinsic for specialised performance potential

Jeppe Johansen jeppe at j-software.dk
Sat Apr 16 16:50:46 CEST 2022

On 4/16/22 16:41, Sven Barth via fpc-devel wrote:
> Benito van der Zander via fpc-devel <fpc-devel at lists.freepascal.org> 
> schrieb am Sa., 16. Apr. 2022, 15:43:
>     Hi,
>     it could always inline it.
>     For small sizes do that mov and for large sizes do rep stosb on
>     x86. It is very fast nowadays. Faster than FillChar on my Intel
>     laptop. (except for mid sizes like 128 bytes)
> FillChar is on most platforms an assembly function and FPC *never* 
> inlines assembly functions.
But having it as an intrinsic would allow the CG to generate optimal 
sequences for certain cases, and otherwise fall back to the inherited 
method which just inserts a call to the RTL Fill* procedures.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20220416/849e6dda/attachment-0001.htm>

More information about the fpc-devel mailing list