Hacker News new | ask | show | jobs
by remar 2127 days ago
Do you have a quick explanation or resource that explains why [1] is true?

Just curious as I've wanted to get better at being able to understanding assembly output by gcc/clang but don't think I've come across this advice explicitly before.

1 comments

I should maybe rephrase [1] to: if you're deciding between two different ways of writing the same function for performance reasons, you should use the optimized assembly output to decide (or the same compiler flags as what you use in production). There can be big differences between the unoptimized and optimized code: https://godbolt.org/z/fszhjj.

Unoptimized assembly IS useful if you just want to learn or understand assembly itself.