Fix analysis of register usage of inline assembler
This commit is contained in:
parent
ccdbbe799a
commit
067e169803
|
@ -434,6 +434,7 @@ InterCodeGenerator::ExValue InterCodeGenerator::CoerceType(InterCodeProcedure* p
|
||||||
v.mTemp = cins->mDst.mTemp;
|
v.mTemp = cins->mDst.mTemp;
|
||||||
v.mType = type;
|
v.mType = type;
|
||||||
}
|
}
|
||||||
|
#if 1
|
||||||
else if (type->mType == DT_TYPE_BOOL && v.mType->IsIntegerType() && v.mType->mType != DT_TYPE_BOOL)
|
else if (type->mType == DT_TYPE_BOOL && v.mType->IsIntegerType() && v.mType->mType != DT_TYPE_BOOL)
|
||||||
{
|
{
|
||||||
InterInstruction* zins = new InterInstruction(MapLocation(exp, inlineMapper), IC_CONSTANT);
|
InterInstruction* zins = new InterInstruction(MapLocation(exp, inlineMapper), IC_CONSTANT);
|
||||||
|
@ -455,6 +456,7 @@ InterCodeGenerator::ExValue InterCodeGenerator::CoerceType(InterCodeProcedure* p
|
||||||
v.mTemp = cins->mDst.mTemp;
|
v.mTemp = cins->mDst.mTemp;
|
||||||
v.mType = type;
|
v.mType = type;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
else if (v.mType->mSize < type->mSize)
|
else if (v.mType->mSize < type->mSize)
|
||||||
{
|
{
|
||||||
if (v.mType->mSize == 1 && type->mSize == 2)
|
if (v.mType->mSize == 1 && type->mSize == 2)
|
||||||
|
|
|
@ -1291,6 +1291,14 @@ void NativeCodeInstruction::BuildCollisionTable(NumberSet& liveTemps, NumberSet*
|
||||||
for (int i = BC_REG_TMP; i < BC_REG_TMP + mLinkerObject->mProc->mCallerSavedTemps; i++)
|
for (int i = BC_REG_TMP; i < BC_REG_TMP + mLinkerObject->mProc->mCallerSavedTemps; i++)
|
||||||
UpdateCollisionSet(liveTemps, collisionSets, i);
|
UpdateCollisionSet(liveTemps, collisionSets, i);
|
||||||
}
|
}
|
||||||
|
else if (mLinkerObject && mLinkerObject->mNumTemporaries)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mLinkerObject->mNumTemporaries; i++)
|
||||||
|
{
|
||||||
|
for (int j = 0; j < mLinkerObject->mTempSizes[i]; j++)
|
||||||
|
UpdateCollisionSet(liveTemps, collisionSets, mLinkerObject->mTemporaries[i] + j);
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (int i = BC_REG_TMP; i < BC_REG_TMP_SAVED; i++)
|
for (int i = BC_REG_TMP; i < BC_REG_TMP_SAVED; i++)
|
||||||
|
@ -1409,6 +1417,8 @@ bool NativeCodeInstruction::ChangesZeroPage(int address) const
|
||||||
return mType == ASMIT_INC || mType == ASMIT_DEC || mType == ASMIT_ASL || mType == ASMIT_LSR || mType == ASMIT_ROL || mType == ASMIT_ROR || mType == ASMIT_STA || mType == ASMIT_STX || mType == ASMIT_STY;
|
return mType == ASMIT_INC || mType == ASMIT_DEC || mType == ASMIT_ASL || mType == ASMIT_LSR || mType == ASMIT_ROL || mType == ASMIT_ROR || mType == ASMIT_STA || mType == ASMIT_STX || mType == ASMIT_STY;
|
||||||
else if (mType == ASMIT_JSR)
|
else if (mType == ASMIT_JSR)
|
||||||
{
|
{
|
||||||
|
if (address == BC_REG_WORK_Y)
|
||||||
|
return true;
|
||||||
if (address >= BC_REG_ACCU && address < BC_REG_ACCU + 4)
|
if (address >= BC_REG_ACCU && address < BC_REG_ACCU + 4)
|
||||||
return true;
|
return true;
|
||||||
if (address >= BC_REG_WORK && address < BC_REG_WORK + 8)
|
if (address >= BC_REG_WORK && address < BC_REG_WORK + 8)
|
||||||
|
@ -51801,7 +51811,7 @@ void NativeCodeProcedure::Compile(InterCodeProcedure* proc)
|
||||||
mInterProc = proc;
|
mInterProc = proc;
|
||||||
mInterProc->mLinkerObject->mNativeProc = this;
|
mInterProc->mLinkerObject->mNativeProc = this;
|
||||||
|
|
||||||
CheckFunc = !strcmp(mInterProc->mIdent->mString, "diggers_vacate_room");
|
CheckFunc = !strcmp(mInterProc->mIdent->mString, "bmmcu_line");
|
||||||
|
|
||||||
int nblocks = proc->mBlocks.Size();
|
int nblocks = proc->mBlocks.Size();
|
||||||
tblocks = new NativeCodeBasicBlock * [nblocks];
|
tblocks = new NativeCodeBasicBlock * [nblocks];
|
||||||
|
@ -53636,6 +53646,7 @@ void NativeCodeProcedure::Optimize(void)
|
||||||
ResetVisited();
|
ResetVisited();
|
||||||
mEntryBlock->CombineAlternateLoads();
|
mEntryBlock->CombineAlternateLoads();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
ResetVisited();
|
ResetVisited();
|
||||||
mEntryBlock->ReduceLocalYPressure();
|
mEntryBlock->ReduceLocalYPressure();
|
||||||
|
@ -53650,6 +53661,7 @@ void NativeCodeProcedure::Optimize(void)
|
||||||
CompressTemporaries(true);
|
CompressTemporaries(true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
ResetVisited();
|
ResetVisited();
|
||||||
NativeRegisterDataSet data;
|
NativeRegisterDataSet data;
|
||||||
|
|
Loading…
Reference in New Issue