| ▲ | glouwbug 40 minutes ago | |||||||
Learn which instructions SIMD nicely (sqrt / fabs, etc). Use ternaries in loops for masking. Use trig identities and lookup tables (don't recompute sin(3t) when you can use two vector multiples using a table of sin(t) eg. sin(t) * sin(t) * sin(t)). Use divisible constexpr constants in loops to eliminate the SIMD tail. Be careful with type casts and floats. `float x; x += 0.5` will introduce *cvt instructions even if the compiler statically knew better otherwise (use 0.5f). Compile with --fast-math and friends so errno doesn't invalidate your SIMD pipeline. | ||||||||
| ▲ | MaxBarraclough 26 minutes ago | parent | next [-] | |||||||
That has a similar problem to the article, it's trying to fit far too much into too small a format. What you've written mostly makes sense to someone who already has a solid understanding of SIMD and of C++ (although I can't say I follow all of it), but the target audience is people who don't. For them, each point needs a much lengthier explanation. | ||||||||
| ||||||||
| ▲ | creata 29 minutes ago | parent | prev [-] | |||||||
Most applications (including most applications that care about numerical performance) should not use -ffast-math. | ||||||||