You'll have to do the work yourself.

Here is some logic to help you out:

-x & (x+1)
= rightmost zero bit
= 0 if no zero bits in set