[fpc-devel] Successful implementationofinlinesupportforpureassembler routines on x86

Jonas Maebe jonas at freepascal.org
Tue Mar 19 09:04:00 CET 2019


On 2019-03-18 23:41, J. Gareth Moreton wrote:

> I guess there's no place for me here.  I don't have the facilities or 
> knowledge to develop beyond i386 and x86_64, and there's too much 
> conflict.  You win.  What am I but a rowdy tyke who doesn't listen to 
> his elders and betters?

I don't consider myself to be better than you, and you giving up is not 
me "winning". You also don't need to develop beyond i386/x86-64, but you 
do have to take into account that they exist. This means that unless a 
feature is inherently specific to a particular platform, it has to be 
generalisable and can be made to function in a predictable way 
everywhere (within the bounds of defined behaviour; what that is, is 
defined by the implementer of the functionality, but it should be 
possible to specify it and preferably with not too many rules, so it can 
be understood easily by users and other platform maintainers alike).

That is not possible for parsing and trying to understand inline 
assembly using automated means. It is very fragile, which makes 
specifying the defined behaviour very hard. It needs a ton of 
exceptions, many of which will be platform specific, which makes its 
functionality unpredictable.

> I guess I don't understand the philosophy of FPC after all, or can even 
> program well.

This is not about your programming skills, those are quite good. It is, 
however, indeed very much about FPC's philosophy. That said, this 
particular feature is something that at least most other compilers (even 
for other languages) don't implement either, afaik. Most of them even 
don't support defining pure assembler functions inside the host 
language's source file, and require you to use external assembler files. 
They do allow you to inline regular functions that contain inline 
assembly though.


Jonas



More information about the fpc-devel mailing list