[llvm-commits] [llvm] r172670 - /llvm/trunk/include/llvm/Support/MathExtras.h

Aaron Ballman aaron at aaronballman.com
Wed Jan 16 15:17:21 PST 2013


Author: aaronballman
Date: Wed Jan 16 17:17:21 2013
New Revision: 172670

URL: http://llvm.org/viewvc/llvm-project?rev=172670&view=rev
Log:
Wrapping __popcnt64 for MSVC so that it's only used on 64-bit builds.

Modified:
    llvm/trunk/include/llvm/Support/MathExtras.h

Modified: llvm/trunk/include/llvm/Support/MathExtras.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/MathExtras.h?rev=172670&r1=172669&r2=172670&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/MathExtras.h (original)
+++ llvm/trunk/include/llvm/Support/MathExtras.h Wed Jan 16 17:17:21 2013
@@ -317,7 +317,7 @@
 inline unsigned CountPopulation_64(uint64_t Value) {
 #if __GNUC__ >= 4
   return __builtin_popcountll(Value);
-#elif defined(_MSC_VER)
+#elif defined(_MSC_VER) && defined(_M_X64)
   return __popcnt64(Value);
 #else
   uint64_t v = Value - ((Value >> 1) & 0x5555555555555555ULL);





More information about the llvm-commits mailing list