title: Load address calculation when using AVX2 gather instructions
body: <p>Looking at the AVX2 intrinsics documentation there are gathered load instructions such as <code>VPGATHERDD</code>:</p>
  
  <pre><code>__m128i _mm_i32gather_epi32 (int const * base, __m128i index, const int scale);
  </code></pre>
  
  <p>What isn't clear to me from the documentation is whether the calculated load address is an  <em>element</em> address or a <em>byte</em> address, i.e. is the load address for element <code>i</code>:</p>
  
  <pre><code>load_addr = base + index[i] * scale;               // (1) element addressing ?
  </code></pre>
  
  <p>or:</p>
  
  <pre><code>load_addr = (char *)base + index[i] * scale;       // (2) byte addressing ?
  </code></pre>
  
  <p>From the <a href="http://software.intel.com/sites/products/documentation/studio/composer/en-us/2011Update/compiler_c/intref_cls/common/intref_avx2_mm256_i32gather_epi32.htm">Intel docs</a> it looks like it might be (2), but this doesn't make much sense given that the smallest element size for gathered loads is 32 bits - why would you want to load from misaligned addresses (i.e. use scale &lt; 4) ?</p>