FIx unary not for unsigned const long

This commit is contained in:
drmortalwombat 2024-09-15 19:54:00 +02:00
parent f2338f1d13
commit 723f407757
2 changed files with 6 additions and 3 deletions

View File

@ -575,7 +575,10 @@ Expression* Expression::ConstantFold(Errors * errors, LinkerSection * dataSectio
dec->mBase = TheUnsignedIntTypeDeclaration;
}
else
{
dec->mInteger &= 0xffffffff;
dec->mBase = TheUnsignedLongTypeDeclaration;
}
ex->mDecValue = dec;
ex->mDecType = dec->mBase;

View File

@ -24475,7 +24475,7 @@ bool NativeCodeBasicBlock::JoinTailCodeSequences(NativeCodeProcedure* proc, bool
changed = true;
}
}
else if (mIns[0].mType == ASMIT_LDA && mIns[0].mMode == ASMIM_ZERO_PAGE)
else if (mIns[0].mType == ASMIT_LDA && mIns[0].mMode == ASMIM_ZERO_PAGE && !(mIns[0].mLive & LIVE_CPU_REG_Z))
{
if (lblock->mIns[ls - 2].mType == ASMIT_LDA && lblock->mIns[ls - 2].mMode == ASMIM_ZERO_PAGE && lblock->mIns[ls - 2].mAddress == mIns[0].mAddress &&
lblock->mIns[ls - 1].mType == ASMIT_CMP)
@ -47412,6 +47412,7 @@ bool NativeCodeBasicBlock::PeepHoleOptimizerIterate6(int i, int pass)
mIns[i + 0].mType = ASMIT_NOP; mIns[i + 0].mMode = ASMIM_IMPLIED;
mIns[i + 1].mType = ASMIT_NOP; mIns[i + 1].mMode = ASMIM_IMPLIED;
mIns[i + 2].mType = ASMIT_NOP; mIns[i + 2].mMode = ASMIM_IMPLIED;
mIns[i + 3].mLive |= LIVE_CPU_REG_C;
mIns[i + 4].mType = ASMIT_ROL;
mIns[i + 5].mType = ASMIT_NOP; mIns[i + 5].mMode = ASMIM_IMPLIED;
return true;
@ -50685,7 +50686,7 @@ void NativeCodeProcedure::Compile(InterCodeProcedure* proc)
mInterProc = proc;
mInterProc->mLinkerObject->mNativeProc = this;
CheckFunc = !strcmp(mInterProc->mIdent->mString, "test");
CheckFunc = !strcmp(mInterProc->mIdent->mString, "intro_display");
int nblocks = proc->mBlocks.Size();
tblocks = new NativeCodeBasicBlock * [nblocks];
@ -52496,7 +52497,6 @@ void NativeCodeProcedure::Optimize(void)
else
cnt++;
} while (changed);
#if 1