<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.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
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;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:EN-GB;}
.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">> > > No, it's been known for a while that the use of macro instructions isn't a<br>
> > > good idea in the compiler. It's why we switched the gcc port away from<br>
> > > using them as well.<br>
> ><br>
> > Out of curiosity, when did the switch happen? I thought it was emitting macros last time I looked (probably around June) but I could be mistaken.<o:p></o:p></p>
<p class="MsoNormal">> ><o:p></o:p></p>
<p class="MsoNormal">> 2001/2002? At one point it emitted things like la, etc.<o:p></o:p></p>
<p class="MsoNormal">> -eric<o:p></o:p></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"">In that case it seems much more likely that I misread the cases I'm remembering. Maybe the mnemonic made it look like a macro but the operands used meant it was really a
 plain instruction.<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""> Eric Christopher [mailto:echristo@gmail.com]
<br>
<b>Sent:</b> 07 January 2015 17:52<br>
<b>To:</b> Daniel Sanders; reviews+D6638+public+9dbc664d9cbf7b31@reviews.llvm.org; Toma Tabacu<br>
<b>Cc:</b> cfe-commits@cs.uiuc.edu<br>
<b>Subject:</b> Re: [PATCH] [mips] Always clobber $1 for MIPS inline asm.<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Wed Jan 07 2015 at 8:40:55 AM Daniel Sanders <<a href="mailto:Daniel.Sanders@imgtec.com">Daniel.Sanders@imgtec.com</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal">> From: Eric Christopher [<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>]<br>
> Sent: 06 January 2015 20:15<br>
> To: Toma Tabacu; Daniel Sanders<br>
> Cc: <a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
> Subject: Re: [PATCH] [mips] Always clobber $1 for MIPS inline asm.<br>
><br>
> > We could stop using $at but why is that beneficial? Why does universally<br>
> >  reserving a register to support an (uncommon) construct make more sense to<br>
> >  you than having that construct properly indicate that it may clobber a<br>
> >  specific register? The former sounds like a sledgehammer to me.<br>
><br>
> Totally is, but blindly adding clobbers is much the same, just a more<br>
> focused hammer. I'm not against it, mostly that the original discussion<br>
> didn't say any of these things.<br>
<br>
Agreed. It's currently a compromise between precision and difficulty of implementation.<br>
<br>
> > The work pre-dates me but as far as I can tell the developers of the Mips<br>
> >  port deliberately decided not to reserve $at and emit code in '.set noat'<br>
> >  mode. Presumably this was to see how much of gcc's $at usage is essential<br>
> >  to the correct operation of the output code. It turns out that<br>
><br>
> No, it's been known for a while that the use of macro instructions isn't a<br>
> good idea in the compiler. It's why we switched the gcc port away from<br>
> using them as well.<br>
<br>
Out of curiosity, when did the switch happen? I thought it was emitting macros last time I looked (probably around June) but I could be mistaken.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">2001/2002? At one point it emitted things like la, etc.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">-eric<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal"><br>
> > the answer is 'almost none'. In LLVM's CodeGen, $at isn't particularly<br>
> >  special. The few instructions/macros/relocations that need a temporary<br>
> >  register to be $at describe this with an implicit def of AT. Branches like<br>
> >  B are a good example of this (it's worth pointing out that most of the time<br>
> >  we don't really need to clobber $at since the branch target will be in<br>
> >  range). Where the temporary doesn't really need to be $at, we just ask the<br>
> >  register allocator to give us any register. The hard work to avoid<br>
> >  reserving $at is already done and I don't see a good reason to change the<br>
> >  original decision.<br>
><br>
> Agreed. Please do make sure that the places where you need to do this are<br>
> commented though. It's pretty poorly commented at the moment.<br>
><br>
> -eric<br>
<br>
Toma: Could you add a suitable comment to getClobbers()?<br>
<br>
> <a href="http://reviews.llvm.org/D6638" target="_blank">http://reviews.llvm.org/D6638</a><br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</body>
</html>