[PATCH 46/67] upl: Factor out part of encode_reg() to new function