simplify log2 check; currently we rely more on compiler than build system PiperOrigin-RevId: 598794971