count_trailing_zeros is defined only for uintx arguments, which means it doesn't work properly for a 64-bit argument on 32-bit JVMs, since the value will be downcast to 32-bit.
We should consider making this a template function.
We should consider making this a template function.