summaryrefslogtreecommitdiffstats
path: root/runtime/base/bit_vector.cc
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2014-05-02 11:53:22 +0100
committerVladimir Marko <vmarko@google.com>2014-05-02 12:21:02 +0100
commit8194963098247be6bca9cc4a54dbfa65c73e8ccc (patch)
tree547cc708e06e6541676b17066023ae6f07b2049b /runtime/base/bit_vector.cc
parent56a341a82ece9aa4f2a071629f3e1fd1adf988ae (diff)
downloadandroid_art-8194963098247be6bca9cc4a54dbfa65c73e8ccc.tar.gz
android_art-8194963098247be6bca9cc4a54dbfa65c73e8ccc.tar.bz2
android_art-8194963098247be6bca9cc4a54dbfa65c73e8ccc.zip
Replace CountOneBits and __builtin_popcount with POPCOUNT.
Clean up utils.h, make some functions constexpr. Change-Id: I2399100280cbce81c3c4f5765f0680c1ddcb5883
Diffstat (limited to 'runtime/base/bit_vector.cc')
-rw-r--r--runtime/base/bit_vector.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/base/bit_vector.cc b/runtime/base/bit_vector.cc
index 12c0352ef5..3df5101fa3 100644
--- a/runtime/base/bit_vector.cc
+++ b/runtime/base/bit_vector.cc
@@ -201,7 +201,7 @@ void BitVector::Subtract(const BitVector *src) {
uint32_t BitVector::NumSetBits() const {
uint32_t count = 0;
for (uint32_t word = 0; word < storage_size_; word++) {
- count += __builtin_popcount(storage_[word]);
+ count += POPCOUNT(storage_[word]);
}
return count;
}
@@ -331,10 +331,10 @@ uint32_t BitVector::NumSetBits(const uint32_t* storage, uint32_t end) {
uint32_t count = 0u;
for (uint32_t word = 0u; word < word_end; word++) {
- count += __builtin_popcount(storage[word]);
+ count += POPCOUNT(storage[word]);
}
if (partial_word_bits != 0u) {
- count += __builtin_popcount(storage[word_end] & ~(0xffffffffu << partial_word_bits));
+ count += POPCOUNT(storage[word_end] & ~(0xffffffffu << partial_word_bits));
}
return count;
}