generic implementation of Bits.toIntegralSized