Day 2 of Advent of Compiler Optimisations!
How do you add two integers on x86-64? You might expect `add`, but the compiler has other ideas—it uses an instruction designed for calculating memory addresses instead! Why would it choose this unusual approach, and what advantages does it bring? The answer reveals something fascinating about x86's quirky architecture.
Read more: https://xania.org/202512/02-adding-integers
Watch: https://youtu.be/BOvg0sGJnes