Re: [fpc-pascal] cpu_relax() in freepascal

2017-11-03 Thread Matias Vara
Hi and thanks for the answers, This feature seems to be a compiler intrinsic at least in the Intel C > compiler. We don't have anything similar, so you have to fall back either > to an asm procedure or a line of inline assembler. The compiler is also > not doing an optimization similar to this. Fr

Re: [fpc-pascal] cpu_relax() in freepascal

2017-11-03 Thread Karoly Balogh (Charlie/SGR)
Hi, On Fri, 3 Nov 2017, Matias Vara wrote: > 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

Re: [fpc-pascal] cpu_relax() in freepascal

2017-11-03 Thread Adriaan van Os
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. I don't think one would you use that "inside a loop" or "to improve branching" but rather inside a wait-loo

Re: [fpc-pascal] cpu_relax() in freepascal

2017-11-03 Thread Matias Vara
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

[fpc-pascal] cpu_relax() in freepascal

2017-10-29 Thread Matias Vara
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. ___ fpc-pascal maillist - fpc-pascal@l