<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Oct 29, 2009, at 2:25 PM, Chris Lattner wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On Oct 29, 2009, at 1:26 AM, Duncan Sands wrote:<br><blockquote type="cite">Hi,<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">      ConstantInt* Op1Int = dyn_cast<ConstantInt>(Op1);<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">      if (!Op1Int) return NULL;<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">      Value* Op1Pow = ConstantInt::get(Op1->getType(),<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">-                                       pow(2, Op1Int->getZExtValue()));<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">+                                       pow((double) 2, (double) Op1Int->getZExtValue()));<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">this is an integer power: 2 to the power of Op1Int.  This shouldn't be done like<br></blockquote><blockquote type="cite">this at all!  It's just a shift left for heavens sake - why the doubles?!  It<br></blockquote><blockquote type="cite">can other be done in uint64_t, or using the APInt shift methods.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">/me makes note to self to audit this code for other monstrosities.<br></blockquote><br>Victor, please take a look at this.<br><font class="Apple-style-span" color="#000000"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></blockquote><br></div><div>I am looking now at rewriting this to avoid the doubles.</div><div><br></div><div>Victor</div><div><br></div></body></html>