title: Intel Compiler /QxCORE-AVX2 switch and compatibility with AMD Excavator/RyZen
body: <p>For some unknown reason Intel decided to does not support AVX2 via typical /arch: option. <strong>/arch:</strong> recognizes only following instructions <strong>IA32,SSE,SSE2,SSE3,AVX</strong>. So if you want to compile for AVX2 you are basically forced to activate <strong>/QxCORE-AVX2</strong> switch. The problem with this option is that it injects check code. That code at runtime checks if your cpu is compatible with selected intructions. If CPU is not compatible then this message pops-up. </p>
  
  <p><strong>Please verify that both the operating system and the processor support Intel(R)
  MOVBE, F16C, FMA, BMI, LZCNT and AVX2 instructions.</strong></p>
  
  <p>Now I'm worried that the same message may pop-up on AMD Excavator and RyZen CPU due to not being <strong>GenuineIntel</strong>. Unfortunately I do not have access to any AMD cpu so I can't check that on real cpu. To make your life easier I've compiled this simple code with activated /QxCORE-AVX2 option. </p>
  
  <pre><code>#include "stdafx.h"
  
  
  int _tmain(int argc, _TCHAR* argv[])
  {
      double a, b, c;
      a = 3.0;
      b = 2.0;
      c = 1.0;
  
      a = a*b + c;
  
      printf("a=%1.1f",a);
  
      return 0;
  }
  </code></pre>
  
  <p>and here is decompiled asm code: <a href="http://codepad.org/KL4Vq978" rel="nofollow noreferrer">http://codepad.org/KL4Vq978</a> </p>
  
  <p>My question to people who understand asm code is do you see anything what may block execution of this code on latest AMD cpus? If yes will this <a href="http://www.softpedia.com/get/Programming/Patchers/Intel-Compiler-Patcher.shtml" rel="nofollow noreferrer">http://www.softpedia.com/get/Programming/Patchers/Intel-Compiler-Patcher.shtml</a> help?</p>