sh: rework register restore code for sh3/sh4/sh4a