One aspect of GCC optimisation that still amazes me is it’s ability to convert specific repetitive operations into highly-efficient mathematical sequence equations.
One example is that GCC can convert an function in where you sum all the integers up to the number specified as an input variable using a for loop, into the equation x * (x + 1) / 2.
This is covered in more detail here.
Posted: October 7th, 2015 at 3:21 pm
Last Updated on: June 16th, 2016 at 5:01 pm