title: Flipping sign on packed SSE floats
body: <p>I'm looking for the most efficient method of flipping the sign on all four floats packed in an SSE register.</p>
  
  <p>I have not found an intrinsic for doing this in the Intel Architecture software dev manual.  Below are the things I've already tried.  </p>
  
  <p>For each case I looped over the code 10 billion times and got the wall-time indicated.  I'm trying to at least match 4 seconds it takes my non-SIMD approach, which is using just the unary minus operator.</p>
  
  <p><BR>[48 sec]<BR>
  <code>_mm_sub_ps( _mm_setzero_ps(), vec );</code> </p>
  
  <p><BR>[32 sec]<BR>
  <code>_mm_mul_ps( _mm_set1_ps( -1.0f ), vec );</code></p>
  
  <p><BR>[9 sec]<BR></p>
  
  <pre>union NegativeMask {
      int   intRep;
      float fltRep;
  } negMask;
  negMask.intRep = 0x80000000;
  
  _mm_xor_ps( _mm_set1_ps( negMask.fltRep ), vec );
  </pre>
  
  <p><BR>The compiler is gcc 4.2 with -O3.  The CPU is an Intel Core 2 Duo.</p>