Revision: 23330
Author: [email protected]
Date: Mon Aug 25 04:24:39 2014 UTC
Log: Rename CountSetBits32 to CountPopulation32 for consistency.
[email protected]
Review URL: https://codereview.chromium.org/502803002
https://code.google.com/p/v8/source/detail?r=23330
Modified:
/branches/bleeding_edge/src/base/bits.h
/branches/bleeding_edge/src/compiler/arm/instruction-selector-arm.cc
/branches/bleeding_edge/src/data-flow.cc
/branches/bleeding_edge/src/frames.cc
/branches/bleeding_edge/test/base-unittests/bits-unittest.cc
=======================================
--- /branches/bleeding_edge/src/base/bits.h Wed Aug 20 12:10:41 2014 UTC
+++ /branches/bleeding_edge/src/base/bits.h Mon Aug 25 04:24:39 2014 UTC
@@ -17,8 +17,8 @@
namespace base {
namespace bits {
-// CountSetBits32(value) returns the number of bits set in |value|.
-inline uint32_t CountSetBits32(uint32_t value) {
+// CountPopulation32(value) returns the number of bits set in |value|.
+inline uint32_t CountPopulation32(uint32_t value) {
#if V8_HAS_BUILTIN_POPCOUNT
return __builtin_popcount(value);
#else
@@ -47,7 +47,7 @@
value = value | (value >> 4);
value = value | (value >> 8);
value = value | (value >> 16);
- return CountSetBits32(~value);
+ return CountPopulation32(~value);
#endif
}
=======================================
--- /branches/bleeding_edge/src/compiler/arm/instruction-selector-arm.cc
Thu Aug 21 11:56:46 2014 UTC
+++ /branches/bleeding_edge/src/compiler/arm/instruction-selector-arm.cc
Mon Aug 25 04:24:39 2014 UTC
@@ -423,7 +423,7 @@
}
if (IsSupported(ARMv7) && m.right().HasValue()) {
uint32_t value = m.right().Value();
- uint32_t width = base::bits::CountSetBits32(value);
+ uint32_t width = base::bits::CountPopulation32(value);
uint32_t msb = base::bits::CountLeadingZeros32(value);
if (width != 0 && msb + width == 32) {
DCHECK_EQ(0, base::bits::CountTrailingZeros32(value));
@@ -536,7 +536,7 @@
Int32BinopMatcher mleft(m.left().node());
if (mleft.right().HasValue()) {
uint32_t value = (mleft.right().Value() >> lsb) << lsb;
- uint32_t width = base::bits::CountSetBits32(value);
+ uint32_t width = base::bits::CountPopulation32(value);
uint32_t msb = base::bits::CountLeadingZeros32(value);
if (msb + width + lsb == 32) {
DCHECK_EQ(lsb, base::bits::CountTrailingZeros32(value));
=======================================
--- /branches/bleeding_edge/src/data-flow.cc Wed Aug 20 12:10:41 2014 UTC
+++ /branches/bleeding_edge/src/data-flow.cc Mon Aug 25 04:24:39 2014 UTC
@@ -45,7 +45,7 @@
int count = 0;
for (int i = 0; i < data_length_; i++) {
int data = data_[i];
- if (data != 0) count += base::bits::CountSetBits32(data);
+ if (data != 0) count += base::bits::CountPopulation32(data);
}
return count;
}
=======================================
--- /branches/bleeding_edge/src/frames.cc Wed Aug 20 12:10:41 2014 UTC
+++ /branches/bleeding_edge/src/frames.cc Mon Aug 25 04:24:39 2014 UTC
@@ -1579,9 +1579,7 @@
//
-------------------------------------------------------------------------
-int NumRegs(RegList reglist) {
- return base::bits::CountSetBits32(reglist);
-}
+int NumRegs(RegList reglist) { return
base::bits::CountPopulation32(reglist); }
struct JSCallerSavedCodeData {
=======================================
--- /branches/bleeding_edge/test/base-unittests/bits-unittest.cc Wed Aug 20
12:10:41 2014 UTC
+++ /branches/bleeding_edge/test/base-unittests/bits-unittest.cc Mon Aug 25
04:24:39 2014 UTC
@@ -10,13 +10,13 @@
namespace base {
namespace bits {
-TEST(BitsTest, CountSetBits32) {
- EXPECT_EQ(0u, CountSetBits32(0));
- EXPECT_EQ(1u, CountSetBits32(1));
- EXPECT_EQ(8u, CountSetBits32(0x11111111));
- EXPECT_EQ(16u, CountSetBits32(0xf0f0f0f0));
- EXPECT_EQ(24u, CountSetBits32(0xfff0f0ff));
- EXPECT_EQ(32u, CountSetBits32(0xffffffff));
+TEST(BitsTest, CountPopulation32) {
+ EXPECT_EQ(0u, CountPopulation32(0));
+ EXPECT_EQ(1u, CountPopulation32(1));
+ EXPECT_EQ(8u, CountPopulation32(0x11111111));
+ EXPECT_EQ(16u, CountPopulation32(0xf0f0f0f0));
+ EXPECT_EQ(24u, CountPopulation32(0xfff0f0ff));
+ EXPECT_EQ(32u, CountPopulation32(0xffffffff));
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.