<font size=2 face="sans-serif">(When you receive 2 Mails I'm sorry. There
were problems with my mail program)</font>
<br>
<br><font size=2 face="sans-serif">Which kind of context would help you
to judge who is wrong?</font>
<br><font size=2 face="sans-serif">Do you want the two assembly files?
The C++ source code?</font>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">From:
</font><font size=1 face="sans-serif">Reid Kleckner <rnk@google.com></font>
<br><font size=1 color=#5f5f5f face="sans-serif">To:
</font><font size=1 face="sans-serif">bjoern.gaier@horiba.com</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Cc:
</font><font size=1 face="sans-serif">cfe-dev <cfe-dev@lists.llvm.org></font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date:
</font><font size=1 face="sans-serif">13.02.2018 19:37</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject:
</font><font size=1 face="sans-serif">Re: [cfe-dev]
Target-Triple changes in assembly; Who is wrong?</font>
<br>
<hr noshade>
<br>
<br>
<br><font size=3>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.</font>
<br>
<br><font size=3>If I had to guess, I'd say this is some struct return
ABI detail that's going wrong.</font>
<br>
<br><font size=3>On Mon, Feb 12, 2018 at 10:32 PM, via cfe-dev <</font><a href="mailto:cfe-dev@lists.llvm.org" target=_blank><font size=3 color=blue><u>cfe-dev@lists.llvm.org</u></font></a><font size=3>>
wrote:</font>
<br><font size=2 face="sans-serif">Hello Clang-People,</font><font size=3>
<br>
</font><font size=2 face="sans-serif"><br>
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><font size=3> </font><font size=2 face="sans-serif"><i><u><br>
--target=x86_64-pc-windows-msvc</u></i> and <i><u>--target=x86_64-pc-windows-elf</u></i>.</font><font size=3>
<br>
</font><font size=2 face="sans-serif"><br>
I let the dragon compile my code and wished for assembly output. The dragon
did fine but the output confused me.</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
When I looked into the functions I discovered strange difference. For example:</font><font size=3>
</font><font size=2 face="sans-serif"><u><br>
msvc</u> target generated:</font><font size=3> </font><font size=2 face="sans-serif"><br>
movq %rdx, %rax</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
but in <u>elf</u> the same line is:</font><font size=3> </font><font size=2 face="sans-serif"><br>
movq %rcx, %rax</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
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><font size=3>
<br>
</font><font size=2 face="sans-serif"><br>
Is the dragon wrong, or is it me?</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
Kind regards</font><font size=3> </font><font size=2 face="sans-serif"><br>
Björn</font><font size=3> </font><font size=2 face="sans-serif"><br>
<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>
</font><font size=3><br>
<br>
_______________________________________________<br>
cfe-dev mailing list</font><font size=3 color=blue><u><br>
</u></font><a href="mailto:cfe-dev@lists.llvm.org"><font size=3 color=blue><u>cfe-dev@lists.llvm.org</u></font></a><font size=3 color=blue><u><br>
</u></font><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" target=_blank><font size=3 color=blue><u>http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</u></font></a><font size=3><br>
</font>
<br>
<br>
<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><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>