<div dir="ltr">Why not just<div><br></div><div><div>-  return __builtin_clzs(__X);</div><div>+  return (__X == 0 ? 16 : __builtin_clzs(__X));<br></div></div><div><br></div><div>and corresponding changes in the other functions in lzcntintrin.h</div><div><br></div><div>(+ the test changes)</div><div><br></div><div>Adding new builtins adds a maintenance and documentation burden.</div><div><br></div><div>-- Sean Silva</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 27, 2014 at 4:05 PM, Robinson, Paul <span dir="ltr"><<a href="mailto:Paul_Robinson@playstation.sony.com" target="_blank">Paul_Robinson@playstation.sony.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">New patch attached that defines new builtins and uses them in lzcntintrin.h.  This patch doesn't change anything about the behavior of the old builtins (although
 they come along for the ride when I refactored the CGBuiltins.cpp implementation).  I also tightened up the test for the lzcntintrin.h functions, as it didn't notice the incorrect translation.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Yeah I know I should have a doc update as well; I'll get to it, but I have to leave right now.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">--paulr<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
</div>
</div>

</blockquote></div><br></div>