title: How to enable instrinsic functions from the preprocessor
body: <p>I can find the n'th set bit of a 16-bit value by using a lookup table but this can't be done for a 32-bit value, without breaking it up and using several LUTs. This is discussed in <a href="https://stackoverflow.com/questions/45482787/how-to-efficiently-find-the-n-th-set-bit">How to efficiently find the n-th set bit?</a> which suggests a use similar to this</p>
  
  <pre><code>#include &lt;immintrin.h&gt;
  //...
  unsigned i = 0x6B5;                 // 11010110101
  unsigned n = 4;                     //    ^
  unsigned j = _pdep_u32(1u &lt;&lt; n, i);
  int bitnum = __builtin_ctz(j));     // result is bit 7
  </code></pre>
  
  <p>I have profiled this suggested loop method</p>
  
  <pre><code>j = i;
  for (k = 0; k &lt; n; k++)
      j &amp;= j - 1;
  return (__builtin_ctz(j));
  </code></pre>
  
  <p>against the two variants of the bit-twiddling code in an answer from <a href="https://stackoverflow.com/a/45487375/4142924"><strong>Nominal Animal</strong></a>. The branching variant of the twiddle was the fastest of the three code versions, not by much. However in my <em>actual</em> code, the above snippet using <code>__builtin_ctz</code> was faster. There are other answers such as from <a href="https://stackoverflow.com/a/45484680/4142924"><strong>fuz</strong></a> who suggests what I found too: the bit-twiddles take a similar time as the loop method.</p>
  
  <p>So I now want to try using <code>_pdep_u32</code> but am unable to get <code>_pdep_u32</code> recognised. I read in <a href="https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/X86-Built-in-Functions.html" rel="nofollow noreferrer">gcc.gnu.org</a></p>
  
  <blockquote>
    <p>The following built-in functions are available when <code>-mbmi2</code> is used.<br>
    ...<br>
    <code>unsigned int _pdep_u32 (unsigned int, unsigned int)</code><br>
    <code>unsigned long long _pdep_u64 (unsigned long long, unsigned long long)</code><br>
    ...  </p>
  </blockquote>
  
  <p>However I am using an online compiler and don't have access to the options.</p>
  
  <p><strong>Is there a way to enable options with the preprocessor?</strong></p>
  
  <p>There is plenty of material about controlling the preprocessor from command line options, but I can't find how to do it the other way round.</p>
  
  <p>Ultimately I want to use the 64-bit version <code>_pdep_u64</code>.</p>