It seems that I can use "%k0" (rather than just "%0") in an asm template to force the (register) operand to "long" size (i.e. a value in %al referenced as %k0 comes out as %eax in the generated assembly). This doesn't seem to be documented anywhere. I presume there may be other such character prefixes which have similar functions.
I should add that I'm prepared to send a patch for the documentation if someone will tell me what the operands are and what they do.
Every target have slightly different operand modifiers. They are usually "documented" in config/*/*.md or config/*/*.c, but I think it is incorrect to documented them for real because people will then abuse them.
You've got to be kidding - these things are genuinely useful. What sort of abuse are you worried about? In any case, I'd like to know if that is the general consensus among maintainers. I'm not going to write documentation and submit a patch if it's not going to be accepted.
I recently stumbled across section 6.43.2.7 of the manual, which does in fact document the operand modifiers for (and only for) x86. Modifiers for other architectures are not documented.
These modifiers are intended primarily for use by Machine Descriptions. As a result, some of them aren't going to be meaningful/usable by inline asm code. And it makes sense to leave open the option to change their meaning should future MD work require it, something that documenting them all would prevent. On the other hand, some of these values are indeed quite useful for inline asm. The compromise, as evidenced by 6.43.2.7 (added in v5.x), is to document certain commonly needed/used modifiers (such as the %k0 referenced above). If there is some additional modifier that you need, I'd recommend opening a new bug and making an explicit case for it. In the meantime, I recommend closing this bug (as fixed).
*** Bug 39440 has been marked as a duplicate of this bug. ***
*** Bug 43319 has been marked as a duplicate of this bug. ***