<div dir="ltr">On Thu, Jul 18, 2013 at 4:40 AM, Jay Foad <span dir="ltr"><<a href="mailto:jay.foad@gmail.com" target="_blank">jay.foad@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> +    // fold (or (shl x, (*ext y)), (srl x, (*ext (and (sub 32, y), 31)))) -><br>
> +    //   (rotl x, y)<br>
> +    // fold (or (shl x, (*ext y)), (srl x, (*ext (and (sub 32, y), 31)))) -><br>
> +    //   (rotr x, (sub 32, y))<br>
<br>
"and (sub 32, y), 31" should be "and (sub 0, y), 31". There are four<br>
occurrences of this in the whole patch.<br></blockquote><div><br></div><div>Sorry about that, the comment is fixed in the attached patch.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
> +          if (SUBC->getAPIntValue() == 0 &&<br>
> +              ANDC->getAPIntValue() == OpSizeInBits - 1 &&<br>
> +              RExtOp0.getOperand(0).getOperand(1) == LExtOp0)<br>
<br>
Do you need an explicit check that OpSizeInBits is a power of two?<br></blockquote><div><br></div><div>Good catch, we do indeed need such a check, fixed in the attached patch.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<span class="HOEnZb"><font color="#888888"><br>
Jay.<br>
</font></span></blockquote></div><br></div></div>