Sub registers in inline assembly

I was wondering if llvm supports sub registers in an inline asm string.
For example, in gcc, using modifiers %w0 makes it possible to access ax if %0 refers to eax.

If there is any support, do you know where it is implemented ? I’d like to add such a support for another target.

Thank you !


Hi Damien,

It sure does. These are considered "modifier" characters and are handled in (e.g.) X86AsmPrinter::PrintAsmOperand.

You can send some C code with asms in it through x86 clang to see what IR it generates or use the llvm demo page.


Thank you Chris !
I didn’t realize this was just an asm printing issue… and I just checked X86ISelLowering.cpp where you have all the asm constraints…