title: Best way to load a 64-bit integer to a double precision SSE2 register?
body: <p>What is the best/fastest way to load a 64-bit integer value in an <code>xmm</code> SSE2 register in 32-bit mode?</p>
  
  <p>In 64-bit mode, <code>cvtsi2sd</code> can be used, but in 32-bit mode, it supports only 32-bit integers.</p>
  
  <p>So far I haven't found much beyond:</p>
  
  <ul>
  <li>use <code>fild</code>, <code>fstp</code> to stack then <code>movsd</code> to <code>xmm</code> register</li>
  <li>load the high 32-bit portion, multiply by 2^32, add the low 32-bit</li>
  </ul>
  
  <p>First solution is slow, second solution might introduce precision loss (<strong>edit:</strong> and it is slow anyway, since the low 32 bit have to be converted as unsigned...)</p>
  
  <p>Any better approach?</p>