ee: use xRegister32 for 1st argument of _eeMoveGPRtoR

This commit is contained in:
Gregory Hainaut 2015-11-26 19:29:05 +01:00
parent 8737db97e7
commit 6291910b02
8 changed files with 31 additions and 31 deletions

View File

@ -256,7 +256,7 @@ void recMTC0()
{
case 12:
iFlushCall(FLUSH_INTERPRETER);
_eeMoveGPRtoR(ECX, _Rt_);
_eeMoveGPRtoR(ecx, _Rt_);
xCALL( WriteCP0Status );
break;

View File

@ -103,7 +103,7 @@ extern u32 g_cpuHasConstReg, g_cpuFlushedConstReg;
u32* _eeGetConstReg(int reg);
// finds where the GPR is stored and moves lower 32 bits to EAX
void _eeMoveGPRtoR(x86IntRegType to, int fromgpr);
void _eeMoveGPRtoR(const x86Emitter::xRegister32& to, int fromgpr);
void _eeMoveGPRtoM(u32 to, int fromgpr);
void _eeMoveGPRtoRm(x86IntRegType to, int fromgpr);
void eeSignExtendTo(int gpr, bool onlyupper=false);

View File

@ -140,7 +140,7 @@ void recMTSAB()
xMOV(ptr32[&cpuRegs.sa], ((g_cpuConstRegs[_Rs_].UL[0] & 0xF) ^ (_Imm_ & 0xF)) );
}
else {
_eeMoveGPRtoR(EAX, _Rs_);
_eeMoveGPRtoR(eax, _Rs_);
xAND(eax, 0xF);
xXOR(eax, _Imm_&0xf);
xMOV(ptr[&cpuRegs.sa], eax);
@ -153,7 +153,7 @@ void recMTSAH()
xMOV(ptr32[&cpuRegs.sa], ((g_cpuConstRegs[_Rs_].UL[0] & 0x7) ^ (_Imm_ & 0x7)) << 1);
}
else {
_eeMoveGPRtoR(EAX, _Rs_);
_eeMoveGPRtoR(eax, _Rs_);
xAND(eax, 0x7);
xXOR(eax, _Imm_&0x7);
xSHL(eax, 1);

View File

@ -340,7 +340,7 @@ int _allocX86reg(int x86reg, int type, int reg, int mode)
_deleteMMXreg(MMX_GPR+reg, 1);
_deleteGPRtoXMMreg(reg, 1);
_eeMoveGPRtoR(x86reg, reg);
_eeMoveGPRtoR(xRegister32(x86reg), reg);
_deleteMMXreg(MMX_GPR+reg, 0);
_deleteGPRtoXMMreg(reg, 0);

View File

@ -152,24 +152,24 @@ u32* _eeGetConstReg(int reg)
return &cpuRegs.GPR.r[ reg ].UL[0];
}
void _eeMoveGPRtoR(x86IntRegType to, int fromgpr)
void _eeMoveGPRtoR(const xRegister32& to, int fromgpr)
{
if( fromgpr == 0 )
xXOR(xRegister32(to), xRegister32(to )); // zero register should use xor, thanks --air
xXOR(to, to); // zero register should use xor, thanks --air
else if( GPR_IS_CONST1(fromgpr) )
xMOV(xRegister32(to), g_cpuConstRegs[fromgpr].UL[0] );
xMOV(to, g_cpuConstRegs[fromgpr].UL[0] );
else {
int mmreg;
if( (mmreg = _checkXMMreg(XMMTYPE_GPRREG, fromgpr, MODE_READ)) >= 0 && (xmmregs[mmreg].mode&MODE_WRITE)) {
xMOVD(xRegister32(to), xRegisterSSE(mmreg));
xMOVD(to, xRegisterSSE(mmreg));
}
else if( (mmreg = _checkMMXreg(MMX_GPR+fromgpr, MODE_READ)) >= 0 && (mmxregs[mmreg].mode&MODE_WRITE) ) {
xMOVD(xRegister32(to), xRegisterMMX(mmreg));
xMOVD(to, xRegisterMMX(mmreg));
SetMMXstate();
}
else {
xMOV(xRegister32(to), ptr[&cpuRegs.GPR.r[ fromgpr ].UL[ 0 ] ]);
xMOV(to, ptr[&cpuRegs.GPR.r[ fromgpr ].UL[ 0 ] ]);
}
}
}
@ -964,7 +964,7 @@ void SetBranchReg( u32 reg )
// }
// }
_allocX86reg(ESI, X86TYPE_PCWRITEBACK, 0, MODE_WRITE);
_eeMoveGPRtoR(ESI, reg);
_eeMoveGPRtoR(esi, reg);
if (EmuConfig.Gamefixes.GoemonTlbHack) {
xMOV(ecx, esi);
@ -1268,7 +1268,7 @@ void recMemcheck(u32 op, u32 bits, bool store)
iFlushCall(FLUSH_EVERYTHING|FLUSH_PC);
// compute accessed address
_eeMoveGPRtoR(ECX, (op >> 21) & 0x1F);
_eeMoveGPRtoR(ecx, (op >> 21) & 0x1F);
if ((s16)op != 0)
xADD(ecx, (s16)op);
if (bits == 128)

View File

@ -96,7 +96,7 @@ void recJALR()
{
int newpc = pc + 4;
_allocX86reg(ESI, X86TYPE_PCWRITEBACK, 0, MODE_WRITE);
_eeMoveGPRtoR(ESI, _Rs_);
_eeMoveGPRtoR(esi, _Rs_);
if (EmuConfig.Gamefixes.GoemonTlbHack) {
xMOV(ecx, esi);

View File

@ -129,7 +129,7 @@ void recLoad64( u32 bits, bool sign )
else
{
// Load ECX with the source memory address that we're reading from.
_eeMoveGPRtoR(ECX, _Rs_);
_eeMoveGPRtoR(ecx, _Rs_);
if (_Imm_ != 0)
xADD(ecx, _Imm_);
if (bits == 128) // force 16 byte alignment on 128 bit reads
@ -163,7 +163,7 @@ void recLoad32( u32 bits, bool sign )
else
{
// Load ECX with the source memory address that we're reading from.
_eeMoveGPRtoR(ECX, _Rs_);
_eeMoveGPRtoR(ecx, _Rs_);
if (_Imm_ != 0)
xADD(ecx, _Imm_ );
@ -202,7 +202,7 @@ void recStore(u32 bits)
if (bits < 64)
{
_eeMoveGPRtoR(EDX, _Rt_);
_eeMoveGPRtoR(edx, _Rt_);
}
else if (bits == 128 || bits == 64)
{
@ -223,7 +223,7 @@ void recStore(u32 bits)
}
else
{
_eeMoveGPRtoR(ECX, _Rs_);
_eeMoveGPRtoR(ecx, _Rs_);
if (_Imm_ != 0)
xADD(ecx, _Imm_);
if (bits == 128)
@ -261,7 +261,7 @@ void recLWL()
iFlushCall(FLUSH_FULLVTLB);
_deleteEEreg(_Rt_, 1);
_eeMoveGPRtoR(ECX, _Rs_);
_eeMoveGPRtoR(ecx, _Rs_);
if (_Imm_ != 0)
xADD(ecx, _Imm_);
@ -307,7 +307,7 @@ void recLWR()
iFlushCall(FLUSH_FULLVTLB);
_deleteEEreg(_Rt_, 1);
_eeMoveGPRtoR(ECX, _Rs_);
_eeMoveGPRtoR(ecx, _Rs_);
if (_Imm_ != 0)
xADD(ecx, _Imm_);
@ -355,7 +355,7 @@ void recSWL()
#ifdef REC_STORES
iFlushCall(FLUSH_FULLVTLB);
_eeMoveGPRtoR(ECX, _Rs_);
_eeMoveGPRtoR(ecx, _Rs_);
if (_Imm_ != 0)
xADD(ecx, _Imm_);
@ -378,12 +378,12 @@ void recSWL()
// mask write and OR -> edx
xMOV(ecx, 24);
xSUB(ecx, edi);
_eeMoveGPRtoR(EAX, _Rt_);
_eeMoveGPRtoR(eax, _Rt_);
xSHR(eax, cl);
xOR(edx, eax);
}
_eeMoveGPRtoR(ECX, _Rs_);
_eeMoveGPRtoR(ecx, _Rs_);
if (_Imm_ != 0)
xADD(ecx, _Imm_);
xAND(ecx, ~3);
@ -403,7 +403,7 @@ void recSWR()
#ifdef REC_STORES
iFlushCall(FLUSH_FULLVTLB);
_eeMoveGPRtoR(ECX, _Rs_);
_eeMoveGPRtoR(ecx, _Rs_);
if (_Imm_ != 0)
xADD(ecx, _Imm_);
@ -426,12 +426,12 @@ void recSWR()
{
// mask write and OR -> edx
xMOV(ecx, edi);
_eeMoveGPRtoR(EAX, _Rt_);
_eeMoveGPRtoR(eax, _Rt_);
xSHL(eax, cl);
xOR(edx, eax);
}
_eeMoveGPRtoR(ECX, _Rs_);
_eeMoveGPRtoR(ecx, _Rs_);
if (_Imm_ != 0)
xADD(ecx, _Imm_);
xAND(ecx, ~3);
@ -501,7 +501,7 @@ void recLWC1()
}
else
{
_eeMoveGPRtoR(ECX, _Rs_);
_eeMoveGPRtoR(ecx, _Rs_);
if (_Imm_ != 0)
xADD(ecx, _Imm_);
@ -528,7 +528,7 @@ void recSWC1()
}
else
{
_eeMoveGPRtoR(ECX, _Rs_);
_eeMoveGPRtoR(ecx, _Rs_);
if (_Imm_ != 0)
xADD(ecx, _Imm_);
@ -568,7 +568,7 @@ void recLQC2()
}
else
{
_eeMoveGPRtoR(ECX, _Rs_);
_eeMoveGPRtoR(ecx, _Rs_);
if (_Imm_ != 0)
xADD(ecx, _Imm_);
@ -593,7 +593,7 @@ void recSQC2()
}
else
{
_eeMoveGPRtoR(ECX, _Rs_);
_eeMoveGPRtoR(ecx, _Rs_);
if (_Imm_ != 0)
xADD(ecx, _Imm_);

View File

@ -269,7 +269,7 @@ void recMTHILO(int hi)
xMOV(ptr32[(u32*)(addrhilo+4)], g_cpuConstRegs[_Rs_].UL[1] );
}
else {
_eeMoveGPRtoR(ECX, _Rs_);
_eeMoveGPRtoR(ecx, _Rs_);
_flushEEreg(_Rs_);
xMOV(eax, ptr[&cpuRegs.GPR.r[ _Rs_ ].UL[ 0 ]]);
xMOV(edx, ptr[&cpuRegs.GPR.r[ _Rs_ ].UL[ 1 ]]);