Merge pull request #712 from lioncash/cast

Core: Fix cast warnings in DSPJitRegCache
This commit is contained in:
Pierre Bourdon 2014-08-01 17:49:46 -07:00
commit 1aab63bef7
2 changed files with 10 additions and 10 deletions

View File

@ -580,7 +580,7 @@ X64Reg DSPJitRegCache::makeABICallSafe(X64Reg reg)
return reg; return reg;
} }
int rbp_guest = xregs[RBP].guest_reg; size_t rbp_guest = xregs[RBP].guest_reg;
xregs[RBP].guest_reg = DSP_REG_USED; xregs[RBP].guest_reg = DSP_REG_USED;
X64Reg safe = findSpillFreeXReg(); X64Reg safe = findSpillFreeXReg();
_assert_msg_(DSPLLE, safe != INVALID_REG, "could not find register"); _assert_msg_(DSPLLE, safe != INVALID_REG, "could not find register");
@ -597,7 +597,7 @@ X64Reg DSPJitRegCache::makeABICallSafe(X64Reg reg)
return safe; return safe;
} }
void DSPJitRegCache::movToHostReg(int reg, X64Reg host_reg, bool load) void DSPJitRegCache::movToHostReg(size_t reg, X64Reg host_reg, bool load)
{ {
_assert_msg_(DSPLLE, reg >= 0 && reg <= DSP_REG_MAX_MEM_BACKED, _assert_msg_(DSPLLE, reg >= 0 && reg <= DSP_REG_MAX_MEM_BACKED,
"bad register name %x", reg); "bad register name %x", reg);
@ -645,7 +645,7 @@ void DSPJitRegCache::movToHostReg(int reg, X64Reg host_reg, bool load)
} }
} }
void DSPJitRegCache::movToHostReg(int reg, bool load) void DSPJitRegCache::movToHostReg(size_t reg, bool load)
{ {
_assert_msg_(DSPLLE, reg >= 0 && reg <= DSP_REG_MAX_MEM_BACKED, _assert_msg_(DSPLLE, reg >= 0 && reg <= DSP_REG_MAX_MEM_BACKED,
"bad register name %x", reg); "bad register name %x", reg);
@ -677,7 +677,7 @@ void DSPJitRegCache::movToHostReg(int reg, bool load)
movToHostReg(reg, tmp, load); movToHostReg(reg, tmp, load);
} }
void DSPJitRegCache::rotateHostReg(int reg, int shift, bool emit) void DSPJitRegCache::rotateHostReg(size_t reg, int shift, bool emit)
{ {
_assert_msg_(DSPLLE, reg >= 0 && reg <= DSP_REG_MAX_MEM_BACKED, _assert_msg_(DSPLLE, reg >= 0 && reg <= DSP_REG_MAX_MEM_BACKED,
"bad register name %x", reg); "bad register name %x", reg);
@ -725,7 +725,7 @@ void DSPJitRegCache::rotateHostReg(int reg, int shift, bool emit)
regs[reg].shift = shift; regs[reg].shift = shift;
} }
void DSPJitRegCache::movToMemory(int reg) void DSPJitRegCache::movToMemory(size_t reg)
{ {
_assert_msg_(DSPLLE, reg >= 0 && reg <= DSP_REG_MAX_MEM_BACKED, _assert_msg_(DSPLLE, reg >= 0 && reg <= DSP_REG_MAX_MEM_BACKED,
"bad register name %x", reg); "bad register name %x", reg);

View File

@ -44,7 +44,7 @@ class DSPJitRegCache
private: private:
struct X64CachedReg struct X64CachedReg
{ {
int guest_reg; //including DSPJitRegSpecial size_t guest_reg; //including DSPJitRegSpecial
bool pushed; bool pushed;
}; };
@ -85,10 +85,10 @@ private:
Gen::X64Reg findSpillFreeXReg(); Gen::X64Reg findSpillFreeXReg();
void spillXReg(Gen::X64Reg reg); void spillXReg(Gen::X64Reg reg);
void movToHostReg(int reg, Gen::X64Reg host_reg, bool load); void movToHostReg(size_t reg, Gen::X64Reg host_reg, bool load);
void movToHostReg(int reg, bool load); void movToHostReg(size_t reg, bool load);
void rotateHostReg(int reg, int shift, bool emit); void rotateHostReg(size_t reg, int shift, bool emit);
void movToMemory(int reg); void movToMemory(size_t reg);
void flushMemBackedRegs(); void flushMemBackedRegs();
public: public: