@@ -20,23 +20,6 @@ class BitSetSupport
2020public:
2121 static const unsigned BitsInByte = 8 ;
2222
23- // This maps 4-bit ("nibble") values into the number of 1 bits they contain.
24- static unsigned BitCountTable[16 ];
25-
26- // Returns the number of 1 bits in the binary representation of "u".
27- template <typename T>
28- static unsigned CountBitsInIntegral (T u)
29- {
30- unsigned res = 0 ;
31- // We process "u" in 4-bit nibbles, hence the "*2" below.
32- for (unsigned int i = 0 ; i < sizeof (T) * 2 ; i++)
33- {
34- res += BitCountTable[u & 0xf ];
35- u >>= 4 ;
36- }
37- return res;
38- }
39-
4023#ifdef DEBUG
4124 // This runs the "TestSuite" method for a few important instantiations of BitSet.
4225 static void TestSuite (CompAllocator env);
@@ -74,19 +57,6 @@ class BitSetSupport
7457 };
7558};
7659
77- template <>
78- FORCEINLINE unsigned BitSetSupport::CountBitsInIntegral<unsigned >(unsigned c)
79- {
80- // Make sure we're 32 bit.
81- assert (sizeof (unsigned ) == 4 );
82- c = (c & 0x55555555 ) + ((c >> 1 ) & 0x55555555 );
83- c = (c & 0x33333333 ) + ((c >> 2 ) & 0x33333333 );
84- c = (c & 0x0f0f0f0f ) + ((c >> 4 ) & 0x0f0f0f0f );
85- c = (c & 0x00ff00ff ) + ((c >> 8 ) & 0x00ff00ff );
86- c = (c & 0x0000ffff ) + ((c >> 16 ) & 0x0000ffff );
87- return c;
88- }
89-
9060// A "BitSet" represents a set of integers from a "universe" [0..N-1]. This implementation assumes that "N"
9161// (the "Size") is provided by the "Env" template argument type discussed below, and accessed from the Env
9262// via a static method of the BitSetTraits type discussed below. The intent of "BitSet" is that the set is
0 commit comments