diff options
author | 2014-05-02 11:53:22 +0100 | |
---|---|---|
committer | 2014-05-02 12:21:02 +0100 | |
commit | 8194963098247be6bca9cc4a54dbfa65c73e8ccc (patch) | |
tree | 547cc708e06e6541676b17066023ae6f07b2049b /compiler | |
parent | 56a341a82ece9aa4f2a071629f3e1fd1adf988ae (diff) |
Replace CountOneBits and __builtin_popcount with POPCOUNT.
Clean up utils.h, make some functions constexpr.
Change-Id: I2399100280cbce81c3c4f5765f0680c1ddcb5883
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/dex/quick/codegen_util.cc | 4 | ||||
-rw-r--r-- | compiler/utils/arm/assembler_arm.cc | 2 | ||||
-rw-r--r-- | compiler/utils/mips/assembler_mips.cc | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/compiler/dex/quick/codegen_util.cc b/compiler/dex/quick/codegen_util.cc index b030bb4ec8..0596d4fff0 100644 --- a/compiler/dex/quick/codegen_util.cc +++ b/compiler/dex/quick/codegen_util.cc @@ -1018,8 +1018,8 @@ CompiledMethod* Mir2Lir::GetCompiledMethod() { vmap_encoder.PushBackUnsigned(fp_vmap_table_[i] + VmapTable::kEntryAdjustment); } } else { - DCHECK_EQ(__builtin_popcount(core_spill_mask_), 0); - DCHECK_EQ(__builtin_popcount(fp_spill_mask_), 0); + DCHECK_EQ(POPCOUNT(core_spill_mask_), 0); + DCHECK_EQ(POPCOUNT(fp_spill_mask_), 0); DCHECK_EQ(core_vmap_table_.size(), 0u); DCHECK_EQ(fp_vmap_table_.size(), 0u); vmap_encoder.PushBackUnsigned(0u); // Size is 0. diff --git a/compiler/utils/arm/assembler_arm.cc b/compiler/utils/arm/assembler_arm.cc index effc38e4c4..5c839dd54e 100644 --- a/compiler/utils/arm/assembler_arm.cc +++ b/compiler/utils/arm/assembler_arm.cc @@ -1107,7 +1107,7 @@ int32_t ArmAssembler::EncodeBranchOffset(int offset, int32_t inst) { // The offset is off by 8 due to the way the ARM CPUs read PC. offset -= 8; CHECK_ALIGNED(offset, 4); - CHECK(IsInt(CountOneBits(kBranchOffsetMask), offset)) << offset; + CHECK(IsInt(POPCOUNT(kBranchOffsetMask), offset)) << offset; // Properly preserve only the bits supported in the instruction. offset >>= 2; diff --git a/compiler/utils/mips/assembler_mips.cc b/compiler/utils/mips/assembler_mips.cc index 45d3a97ac1..9001f8a41f 100644 --- a/compiler/utils/mips/assembler_mips.cc +++ b/compiler/utils/mips/assembler_mips.cc @@ -123,7 +123,7 @@ void MipsAssembler::EmitJump(Label* label, bool link) { int32_t MipsAssembler::EncodeBranchOffset(int offset, int32_t inst, bool is_jump) { CHECK_ALIGNED(offset, 4); - CHECK(IsInt(CountOneBits(kBranchOffsetMask), offset)) << offset; + CHECK(IsInt(POPCOUNT(kBranchOffsetMask), offset)) << offset; // Properly preserve only the bits supported in the instruction. offset >>= 2; |