MathExtras: Bring Count(Trailing|Leading)Ones and CountPopulation in line with countT...
[oota-llvm.git] / lib / Target / AArch64 / AArch64ExpandPseudoInsts.cpp
index c850680d4c6d0e13fbaba3a30ad84dbeb0f0374a..41b1132d3fd38129f7157d73eace56806f7c618e 100644 (file)
@@ -229,7 +229,7 @@ static bool isStartChunk(uint64_t Chunk) {
   if (Chunk == 0 || Chunk == UINT64_MAX)
     return false;
 
-  return (CountLeadingOnes_64(Chunk) + countTrailingZeros(Chunk)) == 64;
+  return isMask_64(~Chunk);
 }
 
 /// \brief Check whether this chunk matches the pattern '0...1...' This pattern
@@ -239,7 +239,7 @@ static bool isEndChunk(uint64_t Chunk) {
   if (Chunk == 0 || Chunk == UINT64_MAX)
     return false;
 
-  return (countLeadingZeros(Chunk) + CountTrailingOnes_64(Chunk)) == 64;
+  return isMask_64(Chunk);
 }
 
 /// \brief Clear or set all bits in the chunk at the given index.