title: SIMD, SSE, AVX - mask 8 floats by unsigned char?
body: <p>How can I mask 8 floats in my <code>__m256</code> variable via bits in my <code>unsigned char</code> variable? (their values are not known during compilation)</p>
  
  <pre><code>__m256 flts = _mm256_set1_ps(5.0f);
  unsigned char = 0b10010111;//just for example, but can be any value during runtime
  </code></pre>
  
  <p>Desired output would have <code>flts</code> contain 5, 0, 0, 5, 0, 5, 5, 5</p>
  
  <p>Is there an efficient instruction on <a href="https://software.intel.com/sites/landingpage/IntrinsicsGuide/" rel="nofollow noreferrer">Intel Intrinsics Guide</a>?</p>
  
  <p>Processor only supports instructions up to AVX (but not AVX2 or beyond)</p>