[PATCH] D113707: [clang] Make -masm=intel affect inline asm style

Nico Weber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 12 10:01:08 PST 2021


thakis added a comment.

Thanks for pointing out built-in headers, that's a great point. I started adding .att_syntax lines where needed, but the I realized that that doens't work: it's too late for things taking memory, since %0 replacement is done with asm writer setting before getting to reading the snippet. So %0 is replaced with (say) `[eax]` before things get to the asm parser, and then `.att_syntax` switches it to att syntax, and then it says "can't do `[eax]` in att syntax".

The official solution for this according to "Multiple assembler dialects in asm templates" in gcc docs->Extensions->Inline Assembly->Extended Asm is to write every inline asm snippet twice: `bt{l %[Offset],%[Base] | %[Base],%[Offset]}`. clang doesn't yet support {|}. So I think I have to update this patch to make clang support {|} and use that in the intrinsic headers where needed.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113707/new/

https://reviews.llvm.org/D113707



More information about the cfe-commits mailing list