Search code examples
c++visual-c++visual-studio-2012vectorizationavx2

Does /arch:AVX enable AVX2?


Does /arch:AVX enable AVX2 (with 256-bit integer SIMD instructions and some new FP shuffles) on the Visual Studio 2012 Update 4?

Line of thought:

  • Yes, it enables AVX because VS doesn't mention AVX2. But I think VS can do AVX2 because my intrinsic work.

  • No, it doesn't because AVX and AVX2 are separate CPU features
    (Sandybridge vs. Haswell, or Excavator/Zen vs. Bulldozer),
    just like SSE and SSE2 are separate

AVX2


Solution

  • It refers to AVX not AVX2. According to Microsoft this applies (mostly) to floating point operations. VS2012 supports AVX2 intrinsic functions regardless of this flag. AVX is available on i3, i5 and i7 variants of SandyBridge and IvyBridge. AVX2 started with Haswell.