iR5900: Cleanup variable scope.

Codacy.
This commit is contained in:
lightningterror 2022-06-24 18:00:18 +02:00
parent d7e09167fa
commit b54521de51
2 changed files with 12 additions and 14 deletions

View File

@ -54,17 +54,17 @@ REC_FUNC_DEL(MADDU1, _Rd_);
// if upper is 1, write in upper 64 bits of LO/HI
void recWritebackHILO(int info, int writed, int upper)
{
int regd, reglo = -1, reghi, savedlo = 0;
int savedlo = 0;
uptr loaddr = (uptr)&cpuRegs.LO.UL[upper ? 2 : 0];
uptr hiaddr = (uptr)&cpuRegs.HI.UL[upper ? 2 : 0];
u8 testlive = upper ? EEINST_LIVE2 : EEINST_LIVE0;
const uptr hiaddr = (uptr)&cpuRegs.HI.UL[upper ? 2 : 0];
const u8 testlive = upper ? EEINST_LIVE2 : EEINST_LIVE0;
if (g_pCurInstInfo->regs[XMMGPR_HI] & testlive)
xMOVSX(rcx, edx);
if (g_pCurInstInfo->regs[XMMGPR_LO] & testlive)
{
int reglo = 0;
if ((reglo = _checkXMMreg(XMMTYPE_GPRREG, XMMGPR_LO, MODE_READ)) >= 0)
{
if (xmmregs[reglo].mode & MODE_WRITE)
@ -87,7 +87,7 @@ void recWritebackHILO(int info, int writed, int upper)
{
_eeOnWriteReg(_Rd_, 1);
regd = -1;
int regd = -1;
if (g_pCurInstInfo->regs[_Rd_] & EEINST_XMM)
{
if (savedlo)
@ -112,6 +112,7 @@ void recWritebackHILO(int info, int writed, int upper)
if (g_pCurInstInfo->regs[XMMGPR_HI] & testlive)
{
int reghi = 0;
if ((reghi = _checkXMMreg(XMMTYPE_GPRREG, XMMGPR_HI, MODE_READ)) >= 0)
{
if (xmmregs[reghi].mode & MODE_WRITE)
@ -132,14 +133,13 @@ void recWritebackHILO(int info, int writed, int upper)
void recWritebackConstHILO(u64 res, int writed, int upper)
{
int reglo, reghi;
uptr loaddr = (uptr)&cpuRegs.LO.UL[upper ? 2 : 0];
uptr hiaddr = (uptr)&cpuRegs.HI.UL[upper ? 2 : 0];
u8 testlive = upper ? EEINST_LIVE2 : EEINST_LIVE0;
if (g_pCurInstInfo->regs[XMMGPR_LO] & testlive)
{
reglo = _allocCheckGPRtoXMM(g_pCurInstInfo, XMMGPR_LO, MODE_WRITE | MODE_READ);
int reglo = _allocCheckGPRtoXMM(g_pCurInstInfo, XMMGPR_LO, MODE_WRITE | MODE_READ);
if (reglo >= 0)
{
@ -158,7 +158,7 @@ void recWritebackConstHILO(u64 res, int writed, int upper)
if (g_pCurInstInfo->regs[XMMGPR_HI] & testlive)
{
reghi = _allocCheckGPRtoXMM(g_pCurInstInfo, XMMGPR_HI, MODE_WRITE | MODE_READ);
int reghi = _allocCheckGPRtoXMM(g_pCurInstInfo, XMMGPR_HI, MODE_WRITE | MODE_READ);
if (reghi >= 0)
{

View File

@ -294,7 +294,6 @@ void eeRecompileCode0(R5900FNPTR constcode, R5900FNPTR_INFO constscode, R5900FNP
// rt = rs op imm16
void eeRecompileCode1(R5900FNPTR constcode, R5900FNPTR_INFO noconstcode)
{
int mmreg1, mmreg2;
if (!_Rt_)
return;
@ -312,7 +311,7 @@ void eeRecompileCode1(R5900FNPTR constcode, R5900FNPTR_INFO noconstcode)
pxAssert(0);
// no const regs
mmreg1 = _allocCheckGPRtoXMM(g_pCurInstInfo, _Rs_, MODE_READ);
const int mmreg1 = _allocCheckGPRtoXMM(g_pCurInstInfo, _Rs_, MODE_READ);
if (mmreg1 >= 0)
{
@ -320,7 +319,7 @@ void eeRecompileCode1(R5900FNPTR constcode, R5900FNPTR_INFO noconstcode)
// check for last used, if so don't alloc a new XMM reg
_addNeededGPRtoXMMreg(_Rt_);
mmreg2 = _checkXMMreg(XMMTYPE_GPRREG, _Rt_, MODE_WRITE);
int mmreg2 = _checkXMMreg(XMMTYPE_GPRREG, _Rt_, MODE_WRITE);
if (mmreg2 < 0)
{
@ -357,7 +356,6 @@ void eeRecompileCode1(R5900FNPTR constcode, R5900FNPTR_INFO noconstcode)
// rd = rt op sa
void eeRecompileCode2(R5900FNPTR constcode, R5900FNPTR_INFO noconstcode)
{
int mmreg1, mmreg2;
if (!_Rd_)
return;
@ -375,7 +373,7 @@ void eeRecompileCode2(R5900FNPTR constcode, R5900FNPTR_INFO noconstcode)
pxAssert(0);
// no const regs
mmreg1 = _allocCheckGPRtoXMM(g_pCurInstInfo, _Rt_, MODE_READ);
const int mmreg1 = _allocCheckGPRtoXMM(g_pCurInstInfo, _Rt_, MODE_READ);
if (mmreg1 >= 0)
{
@ -383,7 +381,7 @@ void eeRecompileCode2(R5900FNPTR constcode, R5900FNPTR_INFO noconstcode)
// check for last used, if so don't alloc a new XMM reg
_addNeededGPRtoXMMreg(_Rd_);
mmreg2 = _checkXMMreg(XMMTYPE_GPRREG, _Rd_, MODE_WRITE);
int mmreg2 = _checkXMMreg(XMMTYPE_GPRREG, _Rd_, MODE_WRITE);
if (mmreg2 < 0)
{