title: Sparse array compression using SIMD (AVX2)
body: <p>I have a sparse array <code>a</code> (mostly zeroes):</p>
  
  <pre><code>unsigned char a[1000000]; 
  </code></pre>
  
  <p>and I would like to create an array <code>b</code> of indexes to non-zero elements of <code>a</code> using SIMD instructions on Intel x64 architecture with AVX2. I'm looking for tips how to do it efficiently. Specifically, are there SIMD instruction(s) to get positions of consecutive non-zero elements in SIMD register, arranged contiguously?</p>