Deleted Added
sdiff udiff text old ( 11800:54436a1784dc ) new ( 11932:98961d1b51ca )
full compact
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;
9 * redistributions in binary form must reproduce the above copyright

--- 196 unchanged lines hidden (view full) ---

206 const uint64_t sum = 0x0101010101010101;
207
208 val -= (val >> 1) & m1; // 2 bits count -> 2 bits
209 val = (val & m2) + ((val >> 2) & m2); // 4 bits count -> 4 bits
210 val = (val + (val >> 4)) & m4; // 8 bits count -> 8 bits
211 return (val * sum) >> 56; // horizontal sum
212#endif // defined(__GNUC__) || (defined(__clang__) && __has_builtin(__builtin_popcountl))
213}
214#endif // __BASE_BITFIELD_HH__