VixlUtils: Remove IsPowerOf2()

std::has_single_bit already does this.
This commit is contained in:
Lioncache committed 2025-09-03 05:46:29 -04:00
1 parent 05c814b8c1
commit a144622a06
1 file changed
+1 -6
+1 -6
View File
@@ -158,7 +158,7 @@ static bool IsImmLogical(uint64_t value, unsigned width, unsigned* n = nullptr,
}
// If the repeat period d is not a power of two, it can't be encoded.
if (!IsPowerOf2(d)) {
if (!std::has_single_bit(uint32_t(d))) {
return false;
}
@@ -284,11 +284,6 @@ INT_1_TO_63_LIST(DECLARE_IS_UINT_N)
private:
template<typename V>
static inline bool IsPowerOf2(V value) {
return (value != 0) && ((value & (value - 1)) == 0);
}
// Some compilers dislike negating unsigned integers,
// so we provide an equivalent.
template<typename T>