[fpc-devel] Successful implementation of inline supportforpureassembler routines on x86

Marco van de Voort core at pascalprogramming.org
Mon Mar 18 12:05:33 CET 2019


Op 3/18/2019 om 8:00 AM schreef Sven Barth via fpc-devel:
> J. Gareth Moreton <gareth at moreton-family.com 
> <mailto:gareth at moreton-family.com>> schrieb am So., 17. März 2019, 23:27:
>
> And I believe that this is the advantage of intrinsics, because here 
> the compiler *can* decide to use a different register. Especially if 
> the compiler supports instruction scheduling and such.
> At work I've worked with AES-NI and I definitively preferred to work 
> with the intrinsics and didn't have to care about what registers to 
> use, because the compiler and optimizer took care of that.

(well, better double check output, it is not always ideal)

I've seen nice examples in simd lib 
(http://ermig1979.github.io/Simd/index.html), where they use generics to 
bundle intrinsics into blocks, and then reuse them multiple times, e.g. 
3 times for the first, bulk and last line of an image.

> That is something that Pascal should stand for: ease of use. Assembler 
> is not easy to use.
>
If something is generic enough to be an intrinsic, it should be an 
intrinsic and as secured as much as possible.

Inlinable assembler however is something to get some of that defining 
power also in the user's hand. It doesn't really matter that there are 
border cases, as long as they can be described, since assembler is 
intrinsically unportable anyway. But having something like that is quite 
important I think. Though examples come more from my embedded, and less 
from my PC work (even though I use AVX2 there. Intrinsics would be 
better for many cases)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190318/25c49c8f/attachment.html>


More information about the fpc-devel mailing list