title: Fast way to check whether an odd number of bits is set?
body: <p>I need to determine whether the number of bits set in a variable of some type (it might be a 32-bit unsigned or a 64-bit unsigned) is odd, or not. I've read:</p>
  
  <p><a href="https://stackoverflow.com/q/109023/1593077">How to count the number of set bits in a 32-bit integer?</a></p>
  
  <p>Which is of course quite useful, but I want to do better since I only need a binary answer, not the whole count. I suppose replacing the one-byte or two-byte LUT should be pretty fast, but maybe the non-LUT code can be improved somehow.</p>