[fpc-pascal] cpu_relax() in freepascal

Matias Vara matiasevara at gmail.com
Fri Nov 3 10:47:48 CET 2017


Hello,

I think it would be better if I put my question in context. In order to
tell the processor that we are in a loop, the pause instruction could be
used (also I think the "rep nop" produces the same opcode). This tells the
processor that we are in a loop so it improves the access to the cache and
the branching mechanism. My question is if the compiler is doing any
improvement of this kind in a loop or I should write my own "pause"
procedure/macro. For more info
https://software.intel.com/en-us/articles/benefitting-power-and-performance-sleep-loops

Cheers!

2017-10-29 16:59 GMT+01:00 Matias Vara <matiasevara at gmail.com>:

> Hello everyone,
>
> I want to implement the cpu_relax() function in order to use it inside
> loops. However before, I would like to know if the fpc compiler is doing an
> optimization of this kind.
>
> Kinds regards, Matias.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20171103/cf958c61/attachment.html>


More information about the fpc-pascal mailing list