From 03671a55344bb1ee33eb50d86a5f8cfc1c2e4aa1 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 23 Mar 2018 10:10:15 -0400 Subject: [PATCH] Arm64Emitter: Remove duplicate IsPowerOf2 function We can just use the generified version in MathUtil. --- Source/Core/Common/Arm64Emitter.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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