Calculate bit number in the codegen.