Arm64Emitter: Remove duplicate IsPowerOf2 function

We can just use the generified version in MathUtil.
This commit is contained in:
Lioncash 2018-03-23 10:10:15 -04:00
parent 79f40fb8d7
commit 03671a5534
No known key found for this signature in database
GPG Key ID: 4E3C3CC1031BA9C7
1 changed files with 2 additions and 6 deletions

View File

@ -12,6 +12,7 @@
#include "Common/Arm64Emitter.h" #include "Common/Arm64Emitter.h"
#include "Common/Assert.h" #include "Common/Assert.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/MathUtil.h"
namespace Arm64Gen namespace Arm64Gen
{ {
@ -37,11 +38,6 @@ static uint64_t LargestPowerOf2Divisor(uint64_t value)
return value & -(int64_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)) #define V8_UINT64_C(x) ((uint64_t)(x))
bool IsImmArithmetic(uint64_t input, u32* val, bool* shift) 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 the repeat period d is not a power of two, it can't be encoded.
if (!IsPowerOfTwo(d)) if (!MathUtil::IsPow2<u64>(d))
return false; return false;
// If the bit stretch (b - a) does not fit within the mask derived from the // If the bit stretch (b - a) does not fit within the mask derived from the