So I've found out what's going on.  For some reason, at least under x86_64-win64 (probably due to the lack of native support of Extended), FPC uses the slow generic function for sin (and cos). This is the case for FPC 3.2.2 and the trunk.  I'll be doing some tests.

To clarify what I've been doing, I've been attempting to make a fast version of sin for single-precision parameters.  Though I've started to use hand-coded assembly language to gain more speed, the Pascal version is already significantly faster than the generic function on x86_64.

Kit

On 25/06/2024 18:24, J. Gareth Moreton via fpc-devel wrote:
Hi everyone,

This might be the silliest question, but where are functions like fpc_sin_real defined and implemented in the compiler, specifically for x86_64?  I'm playing around with a faster algorithm but can't seem to find the actual files where the code is implemented. Functions like fpc_frac_real have implementations (even though they're hand-coded assembly language), and parts of the compiler suggest that sin is handled internally, and there's even lines of code that directly insert FSIN instructions, and yet the end result seems to be "call fpc_sin_real".

Any insight would be greatly appreciated (I'm starting to suspect that fpc_sin_real is a generic and slow implementation).

Kit



--
This email has been checked for viruses by Avast antivirus software.
www.avast.com
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to