18.11.2014 23:29, Wang, Shawn ?????: > I have a general question about using CPUID to detect supported instruction > set. > What if we are compiling the software with some old hardware which does not > support SSE4.2, but run it on new hardware which does support SSE4.2. Is > there still a static way to force the compiler to turn on the SSE4.2 support? > I guess for SSE4.2, most of the CPU has support for it now. But for AVX2, > this might not be the case. According to gcc 4.7 changes (https://gcc.gnu.org/gcc-4.7/changes.html) they've added support for AVX2 instructions since that version. Use -mavx2 or -march=core-avx2. The latter seems to be supported by ICC as well, according to Google :)
-- Sincerely, Yerden Zhumabekov State Technical Service Astana, KZ