<div dir="ltr">On Thu, Jul 11, 2013 at 10:42 PM, Duncan Sands <span dir="ltr"><<a href="mailto:duncan.sands@gmail.com" target="_blank">duncan.sands@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">Hi David,<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ } else {<br>
+ // 'shl CI2, x' produces [CI2, CI2 << (Width-1)]<br>
+ Lower = CI2Value;<br>
+ Upper = CI2Value.shl(Width - 1) + 1;<br>
<br>
<br>
this one seems wrong to me. Consider for example CI2 (in binary) equal to<br>
10001000<br>
Then Lower=10001000, Upper=00000001, but a left-shift by 1 of CI2 is<br>
00010000 which is not in the range Lower .. Upper.<br>
<br>
<br>
Thanks, I've updated the patch so that we will set Lower to zero and Upper to<br>
CI2 << CLZ(CI2) which is conservative but, AFAIK, correct.<br>
</blockquote>
<br></div>
are you sure?<br>
<br>
10110000<br>
<br>
Lower = 0, Upper = 10110000, but shifting left by two gives 11000000 which is<br>
out of the range.<br></blockquote><div><br></div><div style>Right again. I'm giving up on the general case, at least for now.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Ciao, Duncan.<br>
</blockquote></div><br></div></div>