MathExtras: Bring Count(Trailing|Leading)Ones and CountPopulation in line with countTrailingZeros

Update all callers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228930 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer
2015-02-12 15:35:40 +00:00
parent 6950b93dfd
commit d913d9d2c3
26 changed files with 129 additions and 147 deletions

View File

@@ -147,9 +147,7 @@ SDValue XformMskToBitPosU3Imm(uint8_t Imm) {
// Return true if there is exactly one bit set in V, i.e., if V is one of the
// following integers: 2^0, 2^1, ..., 2^31.
bool ImmIsSingleBit(uint32_t v) const {
uint32_t c = CountPopulation_64(v);
// Only return true if we counted 1 bit.
return c == 1;
return isPowerOf2_32(v);
}
// XformM5ToU5Imm - Return a target constant with the specified value, of type