title: 128-bit shifts using assembly language?
body: <p>What is the most efficient way to do 128 bit shift on a modern Intel CPU (core i7, sandy bridge).</p>
  
  <p>A similar code is in my most inner loop:</p>
  
  <pre><code>u128 a[N];
  void xor() {
    for (int i = 0; i &lt; N; ++i) {
      a[i] = a[i] ^ (a[i] &gt;&gt; 1) ^ (a[i] &gt;&gt; 2);
    }
  }
  </code></pre>
  
  <p>The data in <code>a[N]</code> is almost random.</p>