3 ms·
clang may be getting better, but gcc isn't. Being 'careful how you write your code' is putting it mildly. IME you have to hold the compiler's hand at every ste
by secondcoming 2y ago
clang may be getting better, but gcc isn't.
Being 'careful how you write your code' is putting it mildly. IME you have to hold the compiler's hand at every step. Using 'bool' instead of 'int' can make gcc give up on autovectorisation, for example.
You need to use intrinsics, or a wrapper lib around them, if you want to be sure that SIMD is being used.