[fpc-devel] Successful implementation of inline support for pure assembler routines on x86
J. Gareth Moreton
gareth at moreton-family.com
Fri Mar 15 11:32:03 CET 2019
Sorry for the slightly long-winded title. This was something I've been
working on for the past few weeks to allow the use of "inline" with certain
x86 assembler routines, subject to restrictions for safety reasons. I
have successfully written code that implements this support while ensuring
it doesn't affect platforms with a different assembly languages.
Regression tests have passed, as have some new tests, some of which test
modified RTL assembler functions that have had "inline" added to their list
There was a previous concern about it breaking too much and it being
impossible to implement on all platforms - the latter point may be true,
but through the careful use of virtual methods within the compiler, it
should be possible to extend the inline support one platform at a time
without breaking the others.
All the details, including a PDF specification that explains the design
and implementation choices, a couple of existing tests that touch on the
functionality, along with any new tests, limitations or problems found, can
be found here: https://bugs.freepascal.org/view.php?id=35232
I hope it proves to be insightful and useful.
Gareth aka. Kit
P.S. Though this feature can be used for implementing intrinsics, it is
not a direct replacement for them because instructions like SHUFPS cannot
be flexibly encoded due to its immediate operand (i.e. it has to be a raw
number... it can't take its value from a parameter).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-devel