title: The best way to shift a __m128i?
body: <p>I need to shift a __m128i variable, (say v), by m bits, in such a way that bits move through all of the variable (So, the resulting variable represents v*2^m).
  What is the best way to do this?!</p>
  
  <p>Note that _mm_slli_epi64 shifts v0 and v1 seperately: </p>
  
  <pre><code>r0 := v0 &lt;&lt; count
  r1 := v1 &lt;&lt; count
  </code></pre>
  
  <p>so the last bits of v0 missed, but I want to move those bits to r1.</p>
  
  <p>Edit:
  I looking for a code, faster than this (m&lt;64):</p>
  
  <pre><code>r0 = v0 &lt;&lt; m;
  r1 = v0 &gt;&gt; (64-m);
  r1 ^= v1 &lt;&lt; m;
  r2 = v1 &gt;&gt; (64-m);
  </code></pre>