mirror of https://github.com/PCSX2/pcsx2.git
core: overload _freeX86reg with xRegister32
This commit is contained in:
parent
6291910b02
commit
743e615224
|
@ -268,6 +268,7 @@ template< typename T > void xWrite( T val );
|
|||
// Diagnostics -- returns a string representation of this register. Return string
|
||||
// is a valid non-null string for any Id, valid or invalid. No assertions are generated.
|
||||
const char* GetName();
|
||||
int GetId() const { return Id; }
|
||||
};
|
||||
|
||||
class xRegisterInt : public xRegisterBase
|
||||
|
|
|
@ -126,6 +126,7 @@ void _deleteX86reg(int type, int reg, int flush);
|
|||
int _checkX86reg(int type, int reg, int mode);
|
||||
void _addNeededX86reg(int type, int reg);
|
||||
void _clearNeededX86regs();
|
||||
void _freeX86reg(const x86Emitter::xRegister32& x86reg);
|
||||
void _freeX86reg(int x86reg);
|
||||
void _freeX86regs();
|
||||
void _flushCachedRegs();
|
||||
|
|
|
@ -574,9 +574,9 @@ void _psxMoveGPRtoRm(x86IntRegType to, int fromgpr)
|
|||
void _psxFlushCall(int flushtype)
|
||||
{
|
||||
// x86-32 ABI : These registers are not preserved across calls:
|
||||
_freeX86reg( EAX );
|
||||
_freeX86reg( ECX );
|
||||
_freeX86reg( EDX );
|
||||
_freeX86reg( eax );
|
||||
_freeX86reg( ecx );
|
||||
_freeX86reg( edx );
|
||||
|
||||
if( flushtype & FLUSH_CACHED_REGS )
|
||||
_psxFlushConstRegs();
|
||||
|
|
|
@ -442,6 +442,12 @@ void _deleteX86reg(int type, int reg, int flush)
|
|||
}
|
||||
}
|
||||
|
||||
// Temporary solution to support eax/ebx... type
|
||||
void _freeX86reg(const x86Emitter::xRegister32& x86reg)
|
||||
{
|
||||
_freeX86reg(x86reg.GetId());
|
||||
}
|
||||
|
||||
void _freeX86reg(int x86reg)
|
||||
{
|
||||
pxAssert( x86reg >= 0 && x86reg < (int)iREGCNT_GPR );
|
||||
|
|
|
@ -1039,9 +1039,9 @@ void LoadBranchState()
|
|||
void iFlushCall(int flushtype)
|
||||
{
|
||||
// Free registers that are not saved across function calls (x86-32 ABI):
|
||||
_freeX86reg(EAX);
|
||||
_freeX86reg(ECX);
|
||||
_freeX86reg(EDX);
|
||||
_freeX86reg(eax);
|
||||
_freeX86reg(ecx);
|
||||
_freeX86reg(edx);
|
||||
|
||||
if ((flushtype & FLUSH_PC) && !g_cpuFlushedPC) {
|
||||
xMOV(ptr32[&cpuRegs.pc], pc);
|
||||
|
|
|
@ -345,7 +345,7 @@ void VU_ADD_SUB(u32 regd, u32 regt, int is_sub, int info)
|
|||
if (temp2 == ECX)
|
||||
{
|
||||
temp2 = ALLOCTEMPX86(0);
|
||||
_freeX86reg(ECX);
|
||||
_freeX86reg(ecx);
|
||||
}
|
||||
|
||||
xMOVAPS(ptr[&VU_addsub_reg[0][0]], xRegisterSSE(regd));
|
||||
|
@ -440,7 +440,7 @@ void VU_ADD_SUB_SS(u32 regd, u32 regt, int is_sub, int is_mem, int info)
|
|||
if (temp2 == ECX)
|
||||
{
|
||||
temp2 = ALLOCTEMPX86(0);
|
||||
_freeX86reg(ECX);
|
||||
_freeX86reg(ecx);
|
||||
}
|
||||
|
||||
xMOVAPS(ptr[&VU_addsub_reg[0][0]], xRegisterSSE(regd));
|
||||
|
|
Loading…
Reference in New Issue