<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=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@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;}
@font-face
        {font-family:"Lucida Console";
        panose-1:2 11 6 9 4 5 4 2 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;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@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";color:#1F497D'>Hi Tim,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Wouldn’t it be possible to get rid of the “ri” MCInst versions quite easily, by adding a switch statement in<br></span><span style='font-size:10.0pt;font-family:"Lucida Console"'>llvm::LowerARMMachineInstrToMCInst</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>?<br>If possible, the switch statement would translate MachineInstr’s with one immediate operand to <br>MCInst’st with 2 operands (the immediate and the rotation). It seems to me that such a switch statement <br>would only need about 20 case statements.<br>While adding such a switch isn’t nice, it would mean that the duplication of MCInsts could be removed<br>immediately, which in my opinion is uglier than having 1 switch statement with about 20 cases in<br></span><span style='font-size:10.0pt;font-family:"Lucida Console"'>LowerARMMachineInstrToMCInst</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I have to say I’m not convinced (yet?) that also making the encoding of modified immediates more <br>explicit in MachineInstr’s would be very nice. Without having looked into it much, it seems to me that a <br>single switch statement with 20 cases is less ugly than adding lots of immediate+rotation values in places <br>where MachineInstr’s get created, especially because I’m assuming that at the point where you’re<br>creating MachineInstr’s, you’re actually not interested in how the immediate gets encoded in detail?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>With that switch statement, in the MC layer, instructions with modified immediates would always be<br>represented in the *rii form, i.e. as an immediate+a rotation, removing duplication. In MachineInstr’s <br>immediates would always be represented as a single integer, as is currently the case.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I’m sure I’m missing quite a lot of the details here, but would this approach seem reasonable to you?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thanks,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Kristof<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><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"'> llvm-commits-bounces@cs.uiuc.edu [mailto:llvm-commits-bounces@cs.uiuc.edu] <b>On Behalf Of </b>Renato Golin<br><b>Sent:</b> 27 August 2013 13:41<br><b>To:</b> reviews+D1432+public+43eb1c3b208b4e68@llvm-reviews.chandlerc.com<br><b>Cc:</b> LLVM Commits<br><b>Subject:</b> Re: [PATCH] ARM: use new modified-imm instructions for all MC-level purposes.<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Hi Tim,<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Overall, I like this change and I agree it's the way forward. I had some nitpick comments in phabricator, but I'm happy with the patch as it is. Feel free to ignore whatever doesn't make sense.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>cheers,<o:p></o:p></p></div><div><p class=MsoNormal>--renato<o:p></o:p></p></div></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p><div><p class=MsoNormal>On 17 August 2013 16:33, Tim Northover <<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a>> wrote:<o:p></o:p></p><p class=MsoNormal>  Noticed a couple of tidy ups just after posting. Isn't it always the way?<br>    + use "ARMModifiedImm" instead of "ModifiedImm" in printing. There's a Thumb one too.<br>    + An 80-col thing, that I'd even annotated "FIXME".<br><br>Hi grosbach,<br><br><a href="http://llvm-reviews.chandlerc.com/D1432" target="_blank">http://llvm-reviews.chandlerc.com/D1432</a><br><br>CHANGE SINCE LAST DIFF<br>  <a href="http://llvm-reviews.chandlerc.com/D1432?vs=3545&id=3547#toc" target="_blank">http://llvm-reviews.chandlerc.com/D1432?vs=3545&id=3547#toc</a><o:p></o:p></p><div><p class=MsoNormal><br>Files:<br>  lib/Target/ARM/ARMCodeEmitter.cpp<br>  lib/Target/ARM/ARMInstrInfo.td<br>  lib/Target/ARM/AsmParser/ARMAsmParser.cpp<br>  lib/Target/ARM/Disassembler/ARMDisassembler.cpp<br>  lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp<br>  lib/Target/ARM/InstPrinter/ARMInstPrinter.h<br>  lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp<br>  test/MC/ARM/basic-arm-instructions.s<br>  test/MC/ARM/diagnostics.s<o:p></o:p></p></div><p class=MsoNormal style='margin-bottom:12.0pt'>  test/MC/Disassembler/ARM/arm-tests.txt<br><br>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p></div></div></div></body></html>