I'm writing an x86 assembly program and I want to check a register (it is not 0), to see if more than one bit is on.
Is there a simple way of doing it or should I just loop and shift until I see a 2nd set bit or get to the end?
I don't need the total number of set bits, that would be
- Hamming weight ( number of 1 in a number) mixing C with assembly
- How to count the number of set bits in a 32-bit integer?
Is there something faster than doing one of those and checking for popcnt(x) > 1
?