<div dir="ltr">I recently submitted this question to <a href="http://stackoverflow.com/questions/16850309/clang-llvm-inline-assembly-multiple-constraints-with-useless-spills-reload">stackoverflow</a>, but it might need the attention of someone more familiar with clang / llvm internals.<div style>
I am using <b>Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)</b>.</div><div style><br></div><div style>Inline assembly for a 64 x 64 = 128 bit (x86-64) multiply:</div><div style><br></div><div style><b>__asm__ ("mulq %q3" : "=a" (rl), "=d" (rh) : "%0" (x), "rm" (y) : "cc")</b></div>
<div style><br></div><div style>yields:</div><div style><br></div><div style><div><b>movq    %rcx, -8(%rbp)</b></div><div><b>## InlineAsm Start</b></div><div><b>mulq -8(%rbp)</b></div><div><b>## InlineAsm End</b></div><div>
<br></div><div style>which stores and reloads the value. <b>"r" (y)</b> appears to correct this, yielding: <b>mulq %rcx</b>, but at the loss of the range of valid constraints, which could be an issue in the event of register pressure. The optimization level does not seem to affect the result. Furthermore, multiple alternative constraint syntax, such as: <b>"r,m" (y)</b>, appears to work, but simply ignores alternatives after the first, as evidenced by: <b>"m,r" (y)</b>. Have these issues been resolved or under consideration in current revisions?</div>
<div style><br></div><div style>I apologize for the bold-type, hyperlinks, etc., in advance. I'm not sure of the posting etiquette. The original stackoverflow question is more concise.</div></div></div>