4 ms·
If you compile the code on said absolutely-latest-CPU, -mtune=native for GCC and Clang, -xHost for ICC. I don't use MSVC, but /arch:AVX will get you the AVX in
by sparky 13y ago
If you compile the code on said absolutely-latest-CPU, -mtune=native for GCC and Clang, -xHost for ICC.
I don't use MSVC, but /arch:AVX will get you the AVX instructions found on Sandy Bridge and Ivy Bridge. AFAIK, there is no generic "tune generated code for host" flag for MSVC, and AVX2 is not supported at all yet.
You'll probably need to pass optimization-level and vectorization flags to see more of an effect, but for the most part, the biggest gains will come when optimized libraries come out with new ASM- or intrinsic-based variants for the new ISA extension.