<div dir="ltr">FYI,<div>I observe run-time failures since this build which might be related.</div><div>Can you please take a look?</div><div><a href="http://llvm.org/bugs/show_bug.cgi?id=14982" target="_blank" class="cremed">http://llvm.org/bugs/show_bug.cgi?id=14982</a><br>


</div><div><br></div><div>--</div><div>Timur</div><div class="gmail_extra"><br clear="all"><div>Timur Iskhodzhanov, <br>Google Russia <br><br></div>
<br><br><div class="gmail_quote">2013/1/16 Michael J. Spencer <span dir="ltr"><<a href="mailto:bigcheesegs@gmail.com" target="_blank" class="cremed">bigcheesegs@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


Author: mspencer<br>
Date: Wed Jan 16 13:52:12 2013<br>
New Revision: 172645<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=172645&view=rev" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-project?rev=172645&view=rev</a><br>
Log:<br>
[Support] Add MSVC intrinsic for CountPopulation.<br>
<br>
Patch by Jakub Staszak.<br>
<br>
Modified:<br>
    llvm/trunk/include/llvm/Support/MathExtras.h<br>
<br>
Modified: llvm/trunk/include/llvm/Support/MathExtras.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/MathExtras.h?rev=172645&r1=172644&r2=172645&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/MathExtras.h?rev=172645&r1=172644&r2=172645&view=diff</a><br>



==============================================================================<br>
--- llvm/trunk/include/llvm/Support/MathExtras.h (original)<br>
+++ llvm/trunk/include/llvm/Support/MathExtras.h Wed Jan 16 13:52:12 2013<br>
@@ -299,6 +299,8 @@<br>
 inline unsigned CountPopulation_32(uint32_t Value) {<br>
 #if __GNUC__ >= 4<br>
   return __builtin_popcount(Value);<br>
+#elif _MSC_VER<br>
+  return __popcnt(Value);<br>
 #else<br>
   uint32_t v = Value - ((Value >> 1) & 0x55555555);<br>
   v = (v & 0x33333333) + ((v >> 2) & 0x33333333);<br>
@@ -311,6 +313,8 @@<br>
 inline unsigned CountPopulation_64(uint64_t Value) {<br>
 #if __GNUC__ >= 4<br>
   return __builtin_popcountll(Value);<br>
+#elif _MSC_VER<br>
+  return __popcnt64(Value);<br>
 #else<br>
   uint64_t v = Value - ((Value >> 1) & 0x5555555555555555ULL);<br>
   v = (v & 0x3333333333333333ULL) + ((v >> 2) & 0x3333333333333333ULL);<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank" class="cremed">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="cremed">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>