Am 28.05.2018 um 01:55 schrieb J. Gareth Moreton:
> 
> In this case, the ".balign" hint adds 2 bytes to pad the loop.  However, my 
> question is this... why
> does it immediately jump to the end of the loop to check the condition (which 
> is very likely to be
> true on the first iteration), only to jump to the beginning again? 

Several reasons:
- it is not that easy to find a heuristics when the condition should be checked 
twice
- two conditional jumps waste an extra branch prediction table entry
- bigger code, higher cache usage

Weigthing these reasons against the little overhead of an extra unconditional 
jump, we decided to
use the currently used code generation strategy.
_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to