JitRegCache: Convert #define macro into a typed constant

This commit is contained in:
Lioncash 2016-12-20 22:43:02 -05:00
parent 4ae23fc45c
commit e291e8f1a7
2 changed files with 4 additions and 4 deletions

View File

@ -950,7 +950,7 @@ BitSet8 Jit64::ComputeStaticGQRs(const PPCAnalyst::CodeBlock& cb) const
BitSet32 Jit64::CallerSavedRegistersInUse() const BitSet32 Jit64::CallerSavedRegistersInUse() const
{ {
BitSet32 result; BitSet32 result;
for (int i = 0; i < NUMXREGS; i++) for (size_t i = 0; i < RegCache::NUM_XREGS; i++)
{ {
if (!gpr.IsFreeX(i)) if (!gpr.IsFreeX(i))
result[i] = true; result[i] = true;

View File

@ -31,11 +31,11 @@ struct X64CachedReg
bool locked; bool locked;
}; };
#define NUMXREGS 16
class RegCache class RegCache
{ {
public: public:
static constexpr size_t NUM_XREGS = 16;
RegCache(); RegCache();
virtual ~RegCache() = default; virtual ~RegCache() = default;
@ -129,6 +129,6 @@ protected:
float ScoreRegister(Gen::X64Reg xreg); float ScoreRegister(Gen::X64Reg xreg);
std::array<PPCCachedReg, 32> regs; std::array<PPCCachedReg, 32> regs;
std::array<X64CachedReg, NUMXREGS> xregs; std::array<X64CachedReg, NUM_XREGS> xregs;
Gen::XEmitter* emit; Gen::XEmitter* emit;
}; };