3 ms·
> Your assembly skills have to be of quite a decent order to beat a modern compiler. Start with compiler output, add intrinsics where you can see help is neede
by 15155 9y ago
> Your assembly skills have to be of quite a decent order to beat a modern compiler.
Start with compiler output, add intrinsics where you can see help is needed, benchmark, repeat.
Pathologically-slow ASM is pretty rare from modern compilers in my experience.
- jzwinck 9y ago> Pathologically-slow ASM is pretty rare from modern compilers Here are some I've found: https://stackoverflow.com/questions/45496987/gcc-optimizes-fixed-range-based-for-loop-as-if-it-had-longer-variable-length https://stackoverflow.com/questions/45496987/gcc-optimizes-f... (horrific codegen for known-size C++11 loops in member functions, all GCC versions prior to 8 which is not yet released) https://stackoverflow.com/questions/43651923/gcc-fails-to-optimize-aligned-stdarray-like-c-array https://stackoverflow.com/questions/43651923/gcc-fails-to-op... (SIMD opportunity squandered when C++11 features are used) https://stackoverflow.com/questions/42263537/gcc-sometimes-doesnt-inline-stdarrayoperator https://stackoverflow.com/questions/42263537/gcc-sometimes-d... (failure to inline trivial operators) https://stackoverflow.com/questions/26052640/why-does-gcc-implement-isnan-more-efficiently-for-c-cmath-than-c-math-h https://stackoverflow.com/questions/26052640/why-does-gcc-im... (C isnan() not efficient, for many years)