title: How do applications determine if instruction set is available and use it in case it is?
body: <p>Just interesting how it works in games and other software.<br />
  More precisely, I'm asking for a solution in <code>C++</code>.<br />
  Something like:</p>
  <pre><code>if AMX available -&gt; Use AMX version of the math library
  else if AVX-512 available -&gt; Use AVX-512 version of the math library
  else if AVX-256 available -&gt; Use AVX-256 version of the math library
  etc.  
  </code></pre>
  <p>The basic idea I have is to compile the library in different DLLs and swap them on runtime but it seems not to be the best solution for me.</p>