Fix movement of LDY/STY pair that conflicts with Z flag usage
This commit is contained in:
parent
4a49456a57
commit
634b7914ea
|
@ -24449,7 +24449,7 @@ bool NativeCodeBasicBlock::PeepHoleOptimizer(NativeCodeProcedure* proc, int pass
|
||||||
{
|
{
|
||||||
int j = i;
|
int j = i;
|
||||||
while (j + 2 < mIns.Size() &&
|
while (j + 2 < mIns.Size() &&
|
||||||
!mIns[j + 2].ReferencesYReg() && !(mIns[j + 2].SameEffectiveAddress(mIns[j + 0]) && mIns[j + 2].ChangesAddress()) && !mIns[j + 2].MayBeChangedOnAddress(mIns[j + 1]))
|
!mIns[j + 2].ReferencesYReg() && !(mIns[j + 2].SameEffectiveAddress(mIns[j + 0]) && mIns[j + 2].ChangesAddress()) && !mIns[j + 2].MayBeChangedOnAddress(mIns[j + 1]) && !(mIns[j + 2].mLive & LIVE_CPU_REG_Z))
|
||||||
{
|
{
|
||||||
mIns[j + 0].mLive |= mIns[j + 2].mLive;
|
mIns[j + 0].mLive |= mIns[j + 2].mLive;
|
||||||
mIns[j + 1].mLive |= mIns[j + 2].mLive;
|
mIns[j + 1].mLive |= mIns[j + 2].mLive;
|
||||||
|
@ -24465,7 +24465,7 @@ bool NativeCodeBasicBlock::PeepHoleOptimizer(NativeCodeProcedure* proc, int pass
|
||||||
{
|
{
|
||||||
int j = i;
|
int j = i;
|
||||||
while (j + 2 < mIns.Size() &&
|
while (j + 2 < mIns.Size() &&
|
||||||
!mIns[j + 2].ReferencesXReg() && !(mIns[j + 2].SameEffectiveAddress(mIns[j + 0]) && mIns[j + 2].ChangesAddress()) && !mIns[j + 2].MayBeChangedOnAddress(mIns[j + 1]))
|
!mIns[j + 2].ReferencesXReg() && !(mIns[j + 2].SameEffectiveAddress(mIns[j + 0]) && mIns[j + 2].ChangesAddress()) && !mIns[j + 2].MayBeChangedOnAddress(mIns[j + 1]) && !(mIns[j + 2].mLive & LIVE_CPU_REG_Z))
|
||||||
{
|
{
|
||||||
mIns[j + 0].mLive |= mIns[j + 2].mLive;
|
mIns[j + 0].mLive |= mIns[j + 2].mLive;
|
||||||
mIns[j + 1].mLive |= mIns[j + 2].mLive;
|
mIns[j + 1].mLive |= mIns[j + 2].mLive;
|
||||||
|
@ -30280,7 +30280,8 @@ void NativeCodeProcedure::RebuildEntry(void)
|
||||||
|
|
||||||
void NativeCodeProcedure::Optimize(void)
|
void NativeCodeProcedure::Optimize(void)
|
||||||
{
|
{
|
||||||
CheckFunc = !strcmp(mInterProc->mIdent->mString, "title_line_expand");
|
CheckFunc = !strcmp(mInterProc->mIdent->mString, "zombie_move");
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
int step = 0;
|
int step = 0;
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
|
@ -30393,6 +30394,7 @@ void NativeCodeProcedure::Optimize(void)
|
||||||
mEntryBlock->CheckBlocks();
|
mEntryBlock->CheckBlocks();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
ResetVisited();
|
ResetVisited();
|
||||||
if (mEntryBlock->PeepHoleOptimizer(this, step))
|
if (mEntryBlock->PeepHoleOptimizer(this, step))
|
||||||
|
@ -30400,7 +30402,6 @@ void NativeCodeProcedure::Optimize(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if (cnt == 2)
|
// if (cnt == 2)
|
||||||
// return;
|
// return;
|
||||||
#if 1
|
#if 1
|
||||||
|
@ -30763,7 +30764,7 @@ void NativeCodeProcedure::Optimize(void)
|
||||||
else
|
else
|
||||||
cnt++;
|
cnt++;
|
||||||
|
|
||||||
// if (CheckFunc && step == 3 && cnt == 4)
|
// if (CheckFunc && cnt == 3)
|
||||||
// return;
|
// return;
|
||||||
|
|
||||||
} while (changed);
|
} while (changed);
|
||||||
|
|
Loading…
Reference in New Issue