3 ms·
Nowadays, most of the math code I worry about I throw into godbolt with -O3 then check the major instructions on Agner Fog. It's often immediately obvious that
by gary_0 5y ago
Nowadays, most of the math code I worry about I throw into godbolt with -O3 then check the major instructions on Agner Fog. It's often immediately obvious that a modern compiler+CPU is already using a tiny number of cycles to do what I want. (One exception is hot paths that might need to be optimized by hand to use SIMD intrinsics.)