title: Is the preference with SIMD to always get rid of branching?
body: <p>If you are writing some SIMD code that will be run by another program, is it always favorable to get rid of branching to increase performance? I heard that even doing extra operations just to avoid <code>if/else</code> statements, etc is still much faster.</p>
  
  <p>I ask this because I have some branching that I do that's basically like this:</p>
  
  <pre><code>//  axis; x=0, y=1, z=2
  
  float p, q;
  if (axis == 0)
  {
      p = point.y;
      q = point.z;
  }
  else if (axis == 1)
  {
      p = point.x;
      q = point.z;
  }
  else if (axis == 2)
  {
      p = point.x;
      q = point.y;
  }
  </code></pre>
  
  <p>Can I avoid this kind of branching with some clever trick?</p>