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

Sven Barth pascaldragon at googlemail.com
Mon Mar 18 08:00:34 CET 2019


J. Gareth Moreton <gareth at moreton-family.com> schrieb am So., 17. März
2019, 23:27:

> I think one of the main issues with intrinsics is that you don't have much
> control over where results are stored.  Unless you're chaining a load of
> intrinsics together in a mess of function calls in actual parameters, the
> result is going to have to be stored in a local variable, which even on
> good days will end up being stored on the stack, and problems can occur if
> the stack isn't aligned and you're using SSE or AVX instructions.  After
> that, when you call the next intrinsic that uses the result, it will have
> to recall that data from memory.
>

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.
That is something that Pascal should stand for: ease of use. Assembler is
not easy to use.

Regards,
Sven

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


More information about the fpc-devel mailing list