4 ms·
> gcc and clang at least have options so you can optimize for specific CPUs. I'm not sure how good they are They are not very good at it, and can't be. You can
by astrange 4y ago
> gcc and clang at least have options so you can optimize for specific CPUs. I'm not sure how good they are
They are not very good at it, and can't be. You can look inside them and see the models are pretty simple; the best you can do is optimize for the first step (decoder) of the CPU and avoid instructions called out in the optimization manual as being especially slow. But on an OoO CPU there's not much else you can do ahead of time, since branches and memory accesses are unpredictable and much slower than in-CPU resource stalls.