Fix prevent swap of X and Y when used in JSR
This commit is contained in:
parent
b3d80bcb0f
commit
fafbbe82d1
|
@ -1097,7 +1097,7 @@ bool Compiler::GenerateCode(void)
|
||||||
if (mCompilerOptions & COPT_OPTIMIZE_BASIC)
|
if (mCompilerOptions & COPT_OPTIMIZE_BASIC)
|
||||||
{
|
{
|
||||||
mLinker->CombineSameConst();
|
mLinker->CombineSameConst();
|
||||||
// mLinker->InlineSimpleJumps();
|
mLinker->InlineSimpleJumps();
|
||||||
mLinker->CheckDirectJumps();
|
mLinker->CheckDirectJumps();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -997,6 +997,8 @@ bool NativeCodeInstruction::CanSwapXYReg(void)
|
||||||
return HasAsmInstructionMode(mType, ASMIM_ABSOLUTE_Y);
|
return HasAsmInstructionMode(mType, ASMIM_ABSOLUTE_Y);
|
||||||
else if (mMode == ASMIM_ABSOLUTE_Y)
|
else if (mMode == ASMIM_ABSOLUTE_Y)
|
||||||
return HasAsmInstructionMode(mType, ASMIM_ABSOLUTE_X);
|
return HasAsmInstructionMode(mType, ASMIM_ABSOLUTE_X);
|
||||||
|
else if (mType == ASMIT_JSR && (mFlags & (NCIF_USE_CPU_REG_X | NCIF_USE_CPU_REG_Y)))
|
||||||
|
return false;
|
||||||
else
|
else
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -45477,7 +45479,7 @@ void NativeCodeProcedure::Compile(InterCodeProcedure* proc)
|
||||||
{
|
{
|
||||||
mInterProc = proc;
|
mInterProc = proc;
|
||||||
|
|
||||||
CheckFunc = !strcmp(mInterProc->mIdent->mString, "main");
|
CheckFunc = !strcmp(mInterProc->mIdent->mString, "krnio_setbnk");
|
||||||
|
|
||||||
int nblocks = proc->mBlocks.Size();
|
int nblocks = proc->mBlocks.Size();
|
||||||
tblocks = new NativeCodeBasicBlock * [nblocks];
|
tblocks = new NativeCodeBasicBlock * [nblocks];
|
||||||
|
|
Loading…
Reference in New Issue