[llvm-commits] [llvm] r172645 - /llvm/trunk/include/llvm/Support/MathExtras.h
Timur Iskhodzhanov
timurrrr at google.com
Thu Jan 17 02:54:32 PST 2013
FYI,
I observe run-time failures since this build which might be related.
Can you please take a look?
http://llvm.org/bugs/show_bug.cgi?id=14982
--
Timur
Timur Iskhodzhanov,
Google Russia
2013/1/16 Michael J. Spencer <bigcheesegs at gmail.com>
> Author: mspencer
> Date: Wed Jan 16 13:52:12 2013
> New Revision: 172645
>
> URL: http://llvm.org/viewvc/llvm-project?rev=172645&view=rev
> Log:
> [Support] Add MSVC intrinsic for CountPopulation.
>
> Patch by Jakub Staszak.
>
> 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=172645&r1=172644&r2=172645&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/Support/MathExtras.h (original)
> +++ llvm/trunk/include/llvm/Support/MathExtras.h Wed Jan 16 13:52:12 2013
> @@ -299,6 +299,8 @@
> inline unsigned CountPopulation_32(uint32_t Value) {
> #if __GNUC__ >= 4
> return __builtin_popcount(Value);
> +#elif _MSC_VER
> + return __popcnt(Value);
> #else
> uint32_t v = Value - ((Value >> 1) & 0x55555555);
> v = (v & 0x33333333) + ((v >> 2) & 0x33333333);
> @@ -311,6 +313,8 @@
> inline unsigned CountPopulation_64(uint64_t Value) {
> #if __GNUC__ >= 4
> return __builtin_popcountll(Value);
> +#elif _MSC_VER
> + return __popcnt64(Value);
> #else
> uint64_t v = Value - ((Value >> 1) & 0x5555555555555555ULL);
> v = (v & 0x3333333333333333ULL) + ((v >> 2) & 0x3333333333333333ULL);
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130117/9e301f08/attachment.html>
More information about the llvm-commits
mailing list