summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorflacs <tilkax@gmail.com>2015-08-15 09:47:56 +0200
committerflacs <tilkax@gmail.com>2015-08-15 09:47:56 +0200
commite28fa1588febbfe24d37009ed38f89d4121d2473 (patch)
treeb7f9b22a2171bb297d2d51ef8a525f2988dd8877 /Source
parent70e91af405342e4843f0e7225a4fc39b00b9a67c (diff)
parentdd5cc34951402264c022d234776b334d3198072c (diff)
Merge pull request #2850 from Tilka/alloc_order
Jit64: clean up GetAllocationOrder()
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Core/PowerPC/Jit64/JitRegCache.cpp18
-rw-r--r--Source/Core/Core/PowerPC/Jit64/JitRegCache.h6
2 files changed, 12 insertions, 12 deletions
diff --git a/Source/Core/Core/PowerPC/Jit64/JitRegCache.cpp b/Source/Core/Core/PowerPC/Jit64/JitRegCache.cpp
index c546f84002..11ec44538b 100644
--- a/Source/Core/Core/PowerPC/Jit64/JitRegCache.cpp
+++ b/Source/Core/Core/PowerPC/Jit64/JitRegCache.cpp
@@ -131,10 +131,10 @@ float RegCache::ScoreRegister(X64Reg xr)
X64Reg RegCache::GetFreeXReg()
{
size_t aCount;
- const int* aOrder = GetAllocationOrder(aCount);
+ const X64Reg* aOrder = GetAllocationOrder(&aCount);
for (size_t i = 0; i < aCount; i++)
{
- X64Reg xr = (X64Reg)aOrder[i];
+ X64Reg xr = aOrder[i];
if (!xregs[xr].locked && xregs[xr].free)
{
return xr;
@@ -226,9 +226,9 @@ void GPRRegCache::SetImmediate32(size_t preg, u32 immValue)
regs[preg].location = Imm32(immValue);
}
-const int* GPRRegCache::GetAllocationOrder(size_t& count)
+const X64Reg* GPRRegCache::GetAllocationOrder(size_t* count)
{
- static const int allocationOrder[] =
+ static const X64Reg allocationOrder[] =
{
// R12, when used as base register, for example in a LEA, can generate bad code! Need to look into this.
#ifdef _WIN32
@@ -237,17 +237,17 @@ const int* GPRRegCache::GetAllocationOrder(size_t& count)
R12, R13, R14, R15, RSI, RDI, R8, R9, R10, R11, RCX
#endif
};
- count = sizeof(allocationOrder) / sizeof(const int);
+ *count = sizeof(allocationOrder) / sizeof(X64Reg);
return allocationOrder;
}
-const int* FPURegCache::GetAllocationOrder(size_t& count)
+const X64Reg* FPURegCache::GetAllocationOrder(size_t* count)
{
- static const int allocationOrder[] =
+ static const X64Reg allocationOrder[] =
{
XMM6, XMM7, XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, XMM2, XMM3, XMM4, XMM5
};
- count = sizeof(allocationOrder) / sizeof(int);
+ *count = sizeof(allocationOrder) / sizeof(X64Reg);
return allocationOrder;
}
@@ -395,7 +395,7 @@ int RegCache::NumFreeRegisters()
{
int count = 0;
size_t aCount;
- const int* aOrder = GetAllocationOrder(aCount);
+ const X64Reg* aOrder = GetAllocationOrder(&aCount);
for (size_t i = 0; i < aCount; i++)
if (!xregs[aOrder[i]].locked && xregs[aOrder[i]].free)
count++;
diff --git a/Source/Core/Core/PowerPC/Jit64/JitRegCache.h b/Source/Core/Core/PowerPC/Jit64/JitRegCache.h
index ca2838dab3..4c7f280609 100644
--- a/Source/Core/Core/PowerPC/Jit64/JitRegCache.h
+++ b/Source/Core/Core/PowerPC/Jit64/JitRegCache.h
@@ -42,7 +42,7 @@ protected:
std::array<PPCCachedReg, 32> regs;
std::array<X64CachedReg, NUMXREGS> xregs;
- virtual const int *GetAllocationOrder(size_t& count) = 0;
+ virtual const Gen::X64Reg* GetAllocationOrder(size_t* count) = 0;
virtual BitSet32 GetRegUtilization() = 0;
virtual BitSet32 CountRegsIn(size_t preg, u32 lookahead) = 0;
@@ -176,7 +176,7 @@ public:
void StoreRegister(size_t preg, const Gen::OpArg& newLoc) override;
void LoadRegister(size_t preg, Gen::X64Reg newLoc) override;
Gen::OpArg GetDefaultLocation(size_t reg) const override;
- const int* GetAllocationOrder(size_t& count) override;
+ const Gen::X64Reg* GetAllocationOrder(size_t* count) override;
void SetImmediate32(size_t preg, u32 immValue);
BitSet32 GetRegUtilization() override;
BitSet32 CountRegsIn(size_t preg, u32 lookahead) override;
@@ -188,7 +188,7 @@ class FPURegCache final : public RegCache
public:
void StoreRegister(size_t preg, const Gen::OpArg& newLoc) override;
void LoadRegister(size_t preg, Gen::X64Reg newLoc) override;
- const int* GetAllocationOrder(size_t& count) override;
+ const Gen::X64Reg* GetAllocationOrder(size_t* count) override;
Gen::OpArg GetDefaultLocation(size_t reg) const override;
BitSet32 GetRegUtilization() override;
BitSet32 CountRegsIn(size_t preg, u32 lookahead) override;