For next time, please make this two different commits.
Okay, splited.
Also, it would seem that `sm4_encode_register()` might remain as a useful helper, doesn't it?
I don't think so. It wouldn't spare us from calling get_register_type_info_from_handler() (and the pertaining checks) in both sm4_write_dst_register() and sm4_write_src_register() in later patches.