<div dir="ltr"><div class="gmail_extra"><div>On Fri, May 24, 2013 at 1:57 PM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br>
</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">> +  // Use ^ instead of - because both gcc and llvm can remove the associated ^<br>

> +  // in the __builtin_clz intrinsic on x86.<br>
> +  return countLeadingZeros(Val, ZB_Undefined) ^<br>
> +         (std::numeric_limits<T>::digits - 1);<br>
> +}<br>
<br>
<br>
</div>Hi, Michael,<br>
<br>
have you noticed: <a href="http://llvm.org/bugs/show_bug.cgi?id=16115#c3" target="_blank">http://llvm.org/bugs/show_bug.cgi?id=16115#c3</a> Is it<br>
correct to use ^ in here? If so, I guess the testcase in the bug was<br>
incorrectly reduced.<br></blockquote><div><br></div><div>Yeah, it was 31 -, not 32 -. However gcc 4.8 doesn't optimize the 31 - case, so I left it as ^ 31. </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<br>
Can you pleas add a FIXME about removing CountLeadingZeros_32 and<br>
CountLeadingZeros_64 and using countLeadingZeros instead?<br></blockquote><div><br></div><div>I'm going to remove them in a few min.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<br>
Cheers,<br>
Rafael<br>
</blockquote></div><br></div><div class="gmail_extra">- Michael Spencer<br></div><div class="gmail_extra"><br></div></div>