<div dir="ltr">Just for the record, attached is the patch which fixes the code deciding<div>whether an immediate is in canonic encoding.</div><div><br></div><div>Regards,</div><div>Mihai</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Fri, Aug 23, 2013 at 12:04 PM, Mihail Popa <span dir="ltr"><<a href="mailto:mihail.popa@gmail.com" target="_blank">mihail.popa@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="im"><span style="font-family:arial,sans-serif;font-size:13px">> This isn't quite right. "#1, #30" is not canonical, for example (I</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">> only know this because I made the same mistake in my patch at first).</span><br>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div></div><div><span style="font-family:arial,sans-serif;font-size:13px">Yes, indeed. Thanks for spotting that.</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>

</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Mihai</span></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 22, 2013 at 11:46 AM, Tim Northover <span dir="ltr"><<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Mihai,<br>
<br>
I think the approach is interesting, but a dead end. It cements the<br>
duplicated instructions rather than moving towards unification.<br>
<br>
<a href="http://llvm-reviews.chandlerc.com/D1432" target="_blank">http://llvm-reviews.chandlerc.com/D1432</a> *does* move that way (and also<br>
converts "add r0, #0, #0" back into "add r0, #0" automatically).<br>
<br>
That said, I did have a look at the code and spotted this:<br>
<br>
+  static inline bool isSOImmCanonical(unsigned Val, unsigned Rot) {<br>
+    if (Rot == 0) return true;<br>
+    if (Val == 0 && Rot != 0) return false;<br>
+    return (Val % 4) != 0;<br>
+  }<br>
<br>
This isn't quite right. "#1, #30" is not canonical, for example (I<br>
only know this because I made the same mistake in my patch at first).<br>
<br>
Cheers.<br>
<span><font color="#888888"><br>
Tim.<br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div>