diff --git a/Source/Core/Common/Arm64Emitter.cpp b/Source/Core/Common/Arm64Emitter.cpp index eb5c17c69a..139d90d40e 100644 --- a/Source/Core/Common/Arm64Emitter.cpp +++ b/Source/Core/Common/Arm64Emitter.cpp @@ -12,6 +12,7 @@ #include "Common/Arm64Emitter.h" #include "Common/Assert.h" #include "Common/CommonTypes.h" +#include "Common/MathUtil.h" namespace Arm64Gen { @@ -37,11 +38,6 @@ static uint64_t LargestPowerOf2Divisor(uint64_t value) return value & -(int64_t)value; } -static bool IsPowerOfTwo(uint64_t x) -{ - return (x != 0) && ((x & (x - 1)) == 0); -} - #define V8_UINT64_C(x) ((uint64_t)(x)) bool IsImmArithmetic(uint64_t input, u32* val, bool* shift) @@ -187,7 +183,7 @@ bool IsImmLogical(uint64_t value, unsigned int width, unsigned int* n, unsigned } // If the repeat period d is not a power of two, it can't be encoded. - if (!IsPowerOfTwo(d)) + if (!MathUtil::IsPow2(d)) return false; // If the bit stretch (b - a) does not fit within the mask derived from the