[PATCH] D113932: [x86/asm] Let EmitMSInlineAsmStr() handle variants too

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 15 12:33:07 PST 2021


thakis created this revision.
thakis added a reviewer: hans.
Herald added subscribers: pengfei, hiraditya.
thakis requested review of this revision.
Herald added a project: LLVM.

This is preparation for D113707 <https://reviews.llvm.org/D113707>, where I want to make `-masm=intel`
emit `asm inteldialect` instructions.

`{movq %rbx, %rax|mov rax, rbx}` is supposed to evaluate to the bit
between { and | for att and to the bit between | and } for intel.
Since intel will become `asm inteldialect`, which alls EmitMSInlineAsmStr(),
EmitMSInlineAsmStr() has to support variants as well.

(clang translates `{...|...}` to `$(...$|...$)`. I'm not sure why
it doesn't just send along only the first `...` or the second `...`
to LLVM, but given the notes in PR23933 let's not do a big
reorganization in this codepath.)

This makes EmitMSInlineAsmStr() and EmitGCCInlineAsmStr()
even more alike.


https://reviews.llvm.org/D113932

Files:
  llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
  llvm/test/CodeGen/X86/asm-dialect.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113932.387356.patch
Type: text/x-patch
Size: 7405 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211115/c5204c58/attachment.bin>


More information about the llvm-commits mailing list