[fpc-devel] fpc_ compilerproc

J. Gareth Moreton gareth at moreton-family.com
Wed Jun 25 08:42:03 CEST 2025


If I'm right in thinking, things like "fpc_abs_real" are fallback 
functions that have to be overridden by a platform-specific 
implementation, and return runtime errors if they aren't implemented.  
In many cases, such internal compiler routines are not called at all 
because there's a direct instruction available in the architecture (e.g. 
for integer min and max functions, AArch64 has SMIN and SMAX 
respectively, but x86 doesn't have such direct operations).

I may have gotten a few details wrong - it's been a while since I worked 
on the RTL (last time was to implement a more optimised exponential 
function, and to be cleverer with optimising min/max functions).

Kit

On 25/06/2025 07:07, Mattias Gaertner via fpc-devel wrote:
> Hi,
>
> How do the fpc_ compileprocs in the rtl like fpc_abs_real work?
>
> Some platforms have assembler code, others just raises an error.
>
> They are included by a comment:
>
> { documenting compiler proc. is useless, they shouldn't be used by the 
> user anyways }
> {$ifndef fpdocsystem}
> {$i compproc.inc}
>
> They are included if fpdocsystem is *not* defined, but the comment 
> says they are for documentation only. Confusing.
>
>
> Mattias
>
>
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
>

-- 
This email has been checked for viruses by Avast antivirus software.
www.avast.com


More information about the fpc-devel mailing list