Get the number of bits to set in a mask correct for a shl/lshr transform.