title: x86_64 best way to reduce 64 bit register to 32 bit retaining zero or non-zero status
body: <p>I am looking for the fastest / most space efficient way of reducing a 64-bit register to a 32-bit register, only retaining the zero / non-zero status of the 64-bit register.</p>
  <p>My current best idea that works for all values is <code>popcntq</code><br />
  (1c tput, 3c latency on mainstream Intel, 5 byte code size):</p>
  <pre><code>// rax is either zero or non-zero
  popcntq %rax, %rax
  // eax will be zero if rax was zero, otherwise it will be non-zero
  </code></pre>
  <p><strong>NOTE: It will not work to just use the 32-bit <code>eax</code> directly: if <code>rax</code> was say <code>2^61</code> the zero / non-zero status of <code>eax</code> is not the same as of <code>rax</code></strong></p>
  <p>Is there some better clever method?</p>