<div dir="ltr">Without the context of the code being compiled, it's impossible to say if LLVM is right or not. It's worth mentioning though that there is no __thiscall convention on x64. That's a 32-bit-only thing.<div><br></div><div>If I had to guess, I'd say this is some struct return ABI detail that's going wrong.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 12, 2018 at 10:32 PM, via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><font size="2" face="sans-serif">Hello Clang-People,</font>
<br>
<br><font size="2" face="sans-serif">I try to understand the system behind
the target triple of clang - but I don't get it. I used clang to compile
the same code with two different targets:</font>
<br><font size="2" face="sans-serif"><i><u>--target=x86_64-pc-windows-<wbr>msvc</u></i>
and <i><u>--target=x86_64-pc-windows-elf</u></i><wbr>.</font>
<br>
<br><font size="2" face="sans-serif">I let the dragon compile my code and
wished for assembly output. The dragon did fine but the output confused
me.</font>
<br>
<br><font size="2" face="sans-serif">When I looked into the functions I discovered
strange difference. For example:</font>
<br><font size="2" face="sans-serif"><u>msvc</u> target generated:</font>
<br><font size="2" face="sans-serif">movq        %rdx,
%rax</font>
<br>
<br><font size="2" face="sans-serif">but in <u>elf</u> the same line is:</font>
<br><font size="2" face="sans-serif">movq        %rcx,
%rax</font>
<br>
<br><font size="2" face="sans-serif">Why is there (and in other places) such
difference? The target is still windows, but the elf code is breaking the
windows __thiscall calling convention. I expected that both output are
compatible to windows.</font>
<br>
<br><font size="2" face="sans-serif">Is the dragon wrong, or is it me?</font>
<br>
<br><font size="2" face="sans-serif">Kind regards</font>
<br><font size="2" face="sans-serif">Björn</font>
<br><font size="2" face="sans-serif"><br>
Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr.
DE 114 165 789<br>
Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko
Lampert, Hiroshi Kawamura, Takashi Nagano, Takeshi Fukushima.<br>
<br>
</font><br>______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>