The goal of this patch is twofold:
First, it removes a wrong comment (at least, not correctly describing what the function does).
Then, it rewrites the function to use a stringswitch where the registers are enumerated explicitly instead of being computed programmatically. Other than being much shorter, it's much easier to read (and given the ABI won't change anytime soon, I don't think there's need to generalize).
While here, I added an assert that the register name is always empty, as the previous implementation of the function assumed so.
Do we want to add unittests for this to make sure the thing don't regress? I think it's a good thing to to anyway, but I wanted to reach consensus (and probably can be done in a follow-up commit).