<div dir="ltr">Clang's Intel assembler parser isn't as robustly tested as the GNU assembler parser. This has been a recurring issue ever since we switched clang-cl's assembly output to the Intel dialect:<div><a href="https://bugs.llvm.org/show_bug.cgi?id=36676">https://bugs.llvm.org/show_bug.cgi?id=36676</a><br></div><div><br></div><div>I see the string repmovsdi here:</div><div><a href="https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/X86/X86InstrCompiler.td#L383">https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/X86/X86InstrCompiler.td#L383</a><br></div><div><br></div><div>I think it's just a typo, let me see if I can fix it...</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 24, 2021 at 4:06 AM Gaier, Bjoern via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="DE" style="overflow-wrap: break-word;">
<div class="gmail-m_1575151058700807095WordSection1">
<p class="MsoNormal"><span lang="EN-GB">Hello Clang-Devs,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">I run into a strange error with Clang-Cl - I hope I can explain it. We use Clang-Cl via the LLVM extension in Visual Studio and use it to compile our source code. One of the flags we set for the compiler is "/FA" which
gives us assembly output. Everything fine so far, no problems.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">I then add a simple copy loop to our code, that is copying int32 values from one address to another one. When compiling this construct Clang-Cl suddenly exited with: "error: invalid instruction mnemonic 'movsdi'".<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">However, when I remove the "/FA" flag everything compiles fine and runs fine in the end... Strangely, I couldn't figure out what the "movsdi" mnemonic is...<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">The Assembly code looks like this:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">.LBB15_31: # in Loop: Header=BB15_17 Depth=1<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> mov ecx, 32<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> mov edx, 4<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> call calloc<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> mov qword ptr [r12 + rbp + 96], rax<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> mov qword ptr [r12 + rbp + 88], rax<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> mov ecx, 32<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> mov rdi, rax<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> rep movsdi es:[rdi], [rsi]<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> jmp .LBB15_33<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">My Clang-Cl version is:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">clang version 11.0.0 (<a href="https://github.com/llvm/llvm-project.git" target="_blank">https://github.com/llvm/llvm-project.git</a> 176249bd6732a8044d457092ed932768724a6f06)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Target: x86_64-pc-windows-msvc<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Thread model: posix<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">The target is the same as in the version (x86_64-pc-windows-msvc).<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Does anyone know what is going on? <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Kind greetings<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Björn<u></u><u></u></span></p>
</div>
Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr. DE 114 165 789 Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Takashi Nagano, Junichi Tajika, Ergin Cansiz.
</div>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>