<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">I'm afraid targeting a 64-bit CPU and the O32 ABI is completely broken at the moment, it's one of the very long-standing issues I'm working towards. The main problem is that
a lot of the internals of the Mips LLVM backend derive their behaviour from the target CPU rather than the target ABI. In theory, the combination of mips3 and O32 is valid and should generate code pretty much the same way as mips2 and O32 does. In the current
implementation, the fact that mips3 has 64-bit GPR's tells a lot of the code generator to use 64-bit instructions and selects other behaviour that is correct for the N32/N64 ABI's but not for O32. For this (and many other) reasons, there's an assertion that
O32 is not used on a 64-bit CPU. <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Any patches that make progress on this will be warmly welcomed. In the meantime, the best I can suggest is to target mips2 and O32. That combination will work and will do
the same thing (aside from the precise ELF header flags) as mips3 and O32 would.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal">> How can I change the <b>fp=64</b> to <b>fp=32</b>? Have tried pass -mfp32 to mipsel-unknown-linux-gnu-clang++ but with no luck.<br>
<br>
<span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">In the current implementation, this is not possible.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">This also raises a point I haven't considered yet. The Mips3 architecture mandates that the FPU implementation is 64-bit, but if you're generating O32 code should we treat
it as being a 32-bit FPU? I suspect we should since it matches the treatment of GPR's.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">>
</span>Yes I known it works if uses <b>-mips64</b> etc, but I need mips3.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I'd be surprised if mips64 and O32 works. It's subject to the same problems as mips3 and O32.<span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> llvmdev-bounces@cs.uiuc.edu [mailto:llvmdev-bounces@cs.uiuc.edu]
<b>On Behalf Of </b>Weitian Leung<br>
<b>Sent:</b> 11 June 2015 04:43<br>
<b>To:</b> llvmdev@cs.uiuc.edu<br>
<b>Subject:</b> [LLVMdev] How to pick default floating point ABI?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Hello,<br>
I'm using clang on x86 cross build for mips, here is my main configure parameters<br>
llvm/configure \<br>
--prefix=/usr \<br>
--target=mipsel-unknown-linux-gnu \<br>
--enable-targets=mips \<br>
--enable-optimized \<br>
--enable-shared \<br>
--disable-assertions<br>
I want to build code for <b>mips3</b> with <b>o32</b> abi, but fails:<br>
<br>
<o:p></o:p></p>
<p class="MsoNormal">mipsel-unknown-linux-gnu-clang++ test.cpp -mips3<br>
/tmp/test-a51985.s: Assembler messages:<br>
/tmp/test-a51985.s:11: Warning: `fp=64' used with a 32-bit ABI<br>
/usr/local/bin/mipsel-unknown-linux-gnu-ld: Warning: a.out uses -mdouble-float (set by /opt/toolchain_clang/host/usr/mipsel-unknown-linux-gnu/sysroot/usr/lib/../lib/crt1.o), /tmp/test-d48db1.o uses -mgp32 -mfp64<o:p></o:p></p>
<p class="MsoNormal"> How can I change the <b>fp=64</b> to <b>fp=32</b>? Have tried pass -mfp32 to mipsel-unknown-linux-gnu-clang++ but with no luck.<br>
Though this is a warning, but it fails to compile Qt.<br>
Yes I known it works if uses <b>-mips64</b> etc, but I need mips3.<br>
<br>
Please let me know if I'm post to the wrong place, I'm new here.<br>
Thank you.<o:p></o:p></p>
<div>
<p class="MsoNormal">-- <br>
<i>Regards</i><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>