And how disable / enable loop unrolling in code?I compile with -O3 option.Can be unrolled while and repeat loops or only for?
Can be unrolled while and repeat loops or only for?
Quote from: julkas on December 20, 2019, 05:22:22 pmCan be unrolled while and repeat loops or only for?AFAIK only FOR loops are candidates to be unrolled.
According to the documentations:https://wiki.freepascal.org/Optimizationhttps://www.freepascal.org/docs-html/current/prog/progsu58.htmlif (-O3 or -O4) and (FPC version >= 3.04) then loop unrolling onor you can manually turn it on by{$OPTIMIZATION LOOPUNROLL}
Code: Pascal [Select][+][-]{$optimization noloopunroll}
Looks like that isn't documented, but adding 'NO' in front of an optimization will turn it off. The same way as it's done on the commandline(this is documented)
-O<x> Optimizations: [...] -Oo[NO]<x> Enable or disable optimizations; see fpc -i or fpc -io for possible values
Unroll till 1500 muops?
https://wiki.freepascal.org/Optimizationhttps://www.freepascal.org/docs-html/current/prog/progsu58.html