title: is i=(i+1)&3 faster than i=(i+1)%4
body: <p>I am optimizing a c++ code. 
  at one critical step, I want to implement the following function <code>y=f(x)</code>: </p>
  
  <pre><code>f(0)=1
  
  f(1)=2
  
  f(2)=3
  
  f(3)=0
  </code></pre>
  
  <p>which one is faster ? using a lookup table or  <code>i=(i+1)&amp;3</code>  or  <code>i=(i+1)%4</code> ? or any better suggestion?</p>