title: Are there macros for SIMD instruction sets?
body: <p>Are there any macros that we can use for instruction set detection?</p>
  <p>I know that we have the runtime ones:</p>
  <pre class="lang-cs prettyprint-override"><code>if (Avx.IsSupported)
  {
  //...
  }
  </code></pre>
  <p>but do we have defined symboles for that e.g.</p>
  <pre class="lang-cs prettyprint-override"><code>#if AVX
  //...
  #endif
  </code></pre>
  <p>And if there are none, can we create ones or do we have a workaround for that?</p>
  <h2>NOTE</h2>
  <ul>
  <li>while playing with decompiler I found a weird &quot;recursion &quot;. But I think the ILSpy missed here.</li>
  </ul>
  <pre><code>.method public hidebysig specialname static 
      bool get_IsSupported () cil managed 
  {
      // Method begins at RVA 0x142fa4
      // Code size 6 (0x6)
      .maxstack 8
  
      // return IsSupported;
      IL_0000: call bool System.Runtime.Intrinsics.X86.Avx::get_IsSupported()
      IL_0005: ret
  } // end of method Avx::get_IsSupported
  </code></pre>
  <ul>
  <li>Also when I looked into a simple <code>asm</code> code I noticed the following:</li>
  </ul>
  <pre class="lang-cs prettyprint-override"><code>public int F() 
  {
      if (Avx.IsSupported)
          return 0;
      if (Avx2.IsSupported)
          return 1;
  
      return 2;
  }
  </code></pre>
  <p><strong>asm</strong></p>
  <pre><code>Program.F()
      L0000: xor eax, eax
      L0002: ret
  </code></pre>
  <p>As you can see it somehow figured out that Avx is supported and didn't include the branches. Is this a normal and well defined behaviour?</p>