3 ms·Slightly simpler: c = x ^ y; return popcount(((c >> 1) | 0x8080808080808080) - c) & 0x8080808080808080);by hairtuq 5y agoSlightly simpler: c = x ^ y; return popcount(((c >> 1) | 0x8080808080808080) - c) & 0x8080808080808080);