Use CPU register A for single byte parameter and returns
This commit is contained in:
parent
9a64bcc8b6
commit
d6fcb5f9ca
|
@ -8,7 +8,7 @@ LinkerRegion::LinkerRegion(void)
|
|||
{}
|
||||
|
||||
LinkerSection::LinkerSection(void)
|
||||
: mObjects(nullptr), mSections(nullptr)
|
||||
: mObjects(nullptr), mSections(nullptr), mFlags(0)
|
||||
{}
|
||||
|
||||
|
||||
|
@ -248,7 +248,7 @@ bool LinkerRegion::Allocate(Linker * linker, LinkerObject* lobj)
|
|||
int start = (mFreeChunks[i].mStart + lobj->mAlignment - 1) & ~(lobj->mAlignment - 1);
|
||||
int end = start + lobj->mSize;
|
||||
|
||||
if (!(linker->mCompilerOptions & COPT_OPTIMIZE_CODE_SIZE) && (lobj->mFlags & LOBJF_NO_CROSS) && lobj->mSize <= 256 && (start & 0xff00) != ((end - 1) & 0xff00))
|
||||
if (!(linker->mCompilerOptions & COPT_OPTIMIZE_CODE_SIZE) && (lobj->mFlags & LOBJF_NO_CROSS) && lobj->mSize <= 256 && (start & 0xff00) != ((end - 1) & 0xff00) && !(lobj->mSection->mFlags & LSECF_PACKED))
|
||||
;
|
||||
else if (end <= mFreeChunks[i].mEnd)
|
||||
{
|
||||
|
@ -282,7 +282,7 @@ bool LinkerRegion::Allocate(Linker * linker, LinkerObject* lobj)
|
|||
int start = (mStart + mUsed + lobj->mAlignment - 1) & ~(lobj->mAlignment - 1);
|
||||
int end = start + lobj->mSize;
|
||||
|
||||
if (!(linker->mCompilerOptions & COPT_OPTIMIZE_CODE_SIZE) && (lobj->mFlags & LOBJF_NO_CROSS) && lobj->mSize <= 256 && (start & 0xff00) != ((end - 1) & 0xff00))
|
||||
if (!(linker->mCompilerOptions & COPT_OPTIMIZE_CODE_SIZE) && (lobj->mFlags & LOBJF_NO_CROSS) && !(lobj->mFlags & LOBJF_FORCE_ALIGN) && lobj->mSize <= 256 && (start & 0xff00) != ((end - 1) & 0xff00) && !(lobj->mSection->mFlags & LSECF_PACKED))
|
||||
{
|
||||
start = (start + 0x00ff) & 0xff00;
|
||||
end = start + lobj->mSize;
|
||||
|
|
|
@ -111,6 +111,8 @@ public:
|
|||
uint32 mFlags;
|
||||
};
|
||||
|
||||
static const uint32 LSECF_PACKED = 0x00000001;
|
||||
|
||||
class LinkerSection
|
||||
{
|
||||
public:
|
||||
|
@ -121,6 +123,7 @@ public:
|
|||
|
||||
int mStart, mEnd, mSize;
|
||||
LinkerSectionType mType;
|
||||
uint32 mFlags;
|
||||
|
||||
LinkerSection(void);
|
||||
|
||||
|
@ -137,6 +140,15 @@ static const uint32 LOBJF_RELEVANT = 0x00000020;
|
|||
static const uint32 LOBJF_STATIC_STACK = 0x00000040;
|
||||
static const uint32 LOBJF_NO_CROSS = 0x00000080;
|
||||
static const uint32 LOBJF_ZEROPAGE = 0x00000100;
|
||||
static const uint32 LOBJF_FORCE_ALIGN = 0x00000200;
|
||||
|
||||
static const uint32 LOBJF_ARG_REG_A = 0x00001000;
|
||||
static const uint32 LOBJF_ARG_REG_X = 0x00002000;
|
||||
static const uint32 LOBJF_ARG_REG_Y = 0x00004000;
|
||||
|
||||
static const uint32 LOBJF_RET_REG_A = 0x00010000;
|
||||
static const uint32 LOBJF_RET_REG_X = 0x00020000;
|
||||
|
||||
|
||||
class LinkerObject
|
||||
{
|
||||
|
|
|
@ -284,6 +284,13 @@ bool NativeCodeInstruction::IsUsedResultInstructions(NumberSet& requiredTemps)
|
|||
requiredTemps -= CPU_REG_X;
|
||||
requiredTemps -= CPU_REG_Y;
|
||||
|
||||
if (mFlags & NCIF_USE_CPU_REG_A)
|
||||
requiredTemps += CPU_REG_A;
|
||||
if (mFlags & NCIF_USE_CPU_REG_X)
|
||||
requiredTemps += CPU_REG_X;
|
||||
if (mFlags & NCIF_USE_CPU_REG_Y)
|
||||
requiredTemps += CPU_REG_Y;
|
||||
|
||||
if (mFlags & NCIF_RUNTIME)
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
|
@ -298,9 +305,6 @@ bool NativeCodeInstruction::IsUsedResultInstructions(NumberSet& requiredTemps)
|
|||
requiredTemps += mParam + i;
|
||||
}
|
||||
|
||||
if (mFlags & NCIF_USE_CPU_REG_A)
|
||||
requiredTemps += CPU_REG_A;
|
||||
|
||||
if (mFlags & NCIF_FEXEC)
|
||||
{
|
||||
requiredTemps += BC_REG_LOCALS;
|
||||
|
@ -3715,6 +3719,22 @@ void NativeCodeInstruction::FilterRegUsage(NumberSet& requiredTemps, NumberSet&
|
|||
if (mType == ASMIT_JSR)
|
||||
{
|
||||
#if 1
|
||||
if (mFlags & NCIF_USE_CPU_REG_A)
|
||||
{
|
||||
if (!providedTemps[CPU_REG_A])
|
||||
requiredTemps += CPU_REG_A;
|
||||
}
|
||||
if (mFlags & NCIF_USE_CPU_REG_X)
|
||||
{
|
||||
if (!providedTemps[CPU_REG_X])
|
||||
requiredTemps += CPU_REG_X;
|
||||
}
|
||||
if (mFlags & NCIF_USE_CPU_REG_Y)
|
||||
{
|
||||
if (!providedTemps[CPU_REG_Y])
|
||||
requiredTemps += CPU_REG_Y;
|
||||
}
|
||||
|
||||
if (mFlags & NCIF_RUNTIME)
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
|
@ -3734,11 +3754,6 @@ void NativeCodeInstruction::FilterRegUsage(NumberSet& requiredTemps, NumberSet&
|
|||
requiredTemps += mParam + i;
|
||||
}
|
||||
}
|
||||
if (mFlags & NCIF_USE_CPU_REG_A)
|
||||
{
|
||||
if (!providedTemps[CPU_REG_A])
|
||||
requiredTemps += CPU_REG_A;
|
||||
}
|
||||
|
||||
if (mFlags & NCIF_FEXEC)
|
||||
{
|
||||
|
@ -11066,10 +11081,24 @@ void NativeCodeBasicBlock::CallAssembler(InterCodeProcedure* proc, NativeCodePro
|
|||
ins->mSrc[0].mLinkerObject->mNumTemporaries = ins->mNumOperands - 1;
|
||||
}
|
||||
|
||||
uint32 lf = 0;
|
||||
|
||||
if (ins->mSrc[0].mTemp < 0)
|
||||
{
|
||||
uint32 flags = NCIF_LOWER | NCIF_UPPER;
|
||||
if (ins->mSrc[0].mLinkerObject->mFlags & LOBJF_ARG_REG_A)
|
||||
{
|
||||
flags |= NCIF_USE_CPU_REG_A;
|
||||
mIns.Push(NativeCodeInstruction(ASMIT_LDA, ASMIM_ZERO_PAGE, BC_REG_FPARAMS));
|
||||
}
|
||||
if (ins->mSrc[0].mLinkerObject->mFlags & LOBJF_ARG_REG_X)
|
||||
flags |= NCIF_USE_CPU_REG_X;
|
||||
if (ins->mSrc[0].mLinkerObject->mFlags & LOBJF_ARG_REG_Y)
|
||||
flags |= NCIF_USE_CPU_REG_Y;
|
||||
|
||||
assert(ins->mSrc[0].mLinkerObject);
|
||||
mIns.Push(NativeCodeInstruction(ASMIT_JSR, ASMIM_ABSOLUTE, ins->mSrc[0].mIntConst, ins->mSrc[0].mLinkerObject));
|
||||
mIns.Push(NativeCodeInstruction(ASMIT_JSR, ASMIM_ABSOLUTE, ins->mSrc[0].mIntConst, ins->mSrc[0].mLinkerObject, flags));
|
||||
lf = ins->mSrc[0].mLinkerObject->mFlags;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -11097,12 +11126,18 @@ void NativeCodeBasicBlock::CallAssembler(InterCodeProcedure* proc, NativeCodePro
|
|||
}
|
||||
else
|
||||
{
|
||||
mIns.Push(NativeCodeInstruction(ASMIT_LDA, ASMIM_ZERO_PAGE, BC_REG_ACCU + 0));
|
||||
if (!(lf & LOBJF_RET_REG_A))
|
||||
mIns.Push(NativeCodeInstruction(ASMIT_LDA, ASMIM_ZERO_PAGE, BC_REG_ACCU + 0));
|
||||
mIns.Push(NativeCodeInstruction(ASMIT_STA, ASMIM_ZERO_PAGE, BC_REG_TMP + proc->mTempOffset[ins->mDst.mTemp] + 0));
|
||||
if (InterTypeSize[ins->mDst.mType] > 1)
|
||||
{
|
||||
mIns.Push(NativeCodeInstruction(ASMIT_LDA, ASMIM_ZERO_PAGE, BC_REG_ACCU + 1));
|
||||
mIns.Push(NativeCodeInstruction(ASMIT_STA, ASMIM_ZERO_PAGE, BC_REG_TMP + proc->mTempOffset[ins->mDst.mTemp] + 1));
|
||||
if (lf & LOBJF_RET_REG_X)
|
||||
mIns.Push(NativeCodeInstruction(ASMIT_STX, ASMIM_ZERO_PAGE, BC_REG_TMP + proc->mTempOffset[ins->mDst.mTemp] + 1));
|
||||
else
|
||||
{
|
||||
mIns.Push(NativeCodeInstruction(ASMIT_LDA, ASMIM_ZERO_PAGE, BC_REG_ACCU + 1));
|
||||
mIns.Push(NativeCodeInstruction(ASMIT_STA, ASMIM_ZERO_PAGE, BC_REG_TMP + proc->mTempOffset[ins->mDst.mTemp] + 1));
|
||||
}
|
||||
}
|
||||
if (InterTypeSize[ins->mDst.mType] > 2)
|
||||
{
|
||||
|
@ -11131,6 +11166,13 @@ void NativeCodeBasicBlock::BuildLocalRegSets(void)
|
|||
mExitRequiredRegs = NumberSet(NUM_REGS);
|
||||
mExitProvidedRegs = NumberSet(NUM_REGS);
|
||||
|
||||
if (mEntryRegA)
|
||||
mLocalProvidedRegs += CPU_REG_A;
|
||||
if (mEntryRegX)
|
||||
mLocalProvidedRegs += CPU_REG_X;
|
||||
if (mEntryRegY)
|
||||
mLocalProvidedRegs += CPU_REG_Y;
|
||||
|
||||
for (i = 0; i < mIns.Size(); i++)
|
||||
{
|
||||
mIns[i].FilterRegUsage(mLocalRequiredRegs, mLocalProvidedRegs);
|
||||
|
@ -11152,6 +11194,17 @@ void NativeCodeBasicBlock::BuildLocalRegSets(void)
|
|||
break;
|
||||
}
|
||||
|
||||
if (mExitRegA)
|
||||
{
|
||||
if (!mLocalProvidedRegs[CPU_REG_A])
|
||||
mLocalRequiredRegs += CPU_REG_A;
|
||||
}
|
||||
if (mExitRegX)
|
||||
{
|
||||
if (!mLocalProvidedRegs[CPU_REG_X])
|
||||
mLocalRequiredRegs += CPU_REG_X;
|
||||
}
|
||||
|
||||
mEntryRequiredRegs = mLocalRequiredRegs;
|
||||
mExitProvidedRegs = mLocalProvidedRegs;
|
||||
|
||||
|
@ -11988,7 +12041,6 @@ bool NativeCodeBasicBlock::ReduceLocalYPressure(void)
|
|||
}
|
||||
#endif
|
||||
int start = 0;
|
||||
|
||||
while (start < mIns.Size())
|
||||
{
|
||||
const NativeCodeInstruction& ins(mIns[start]);
|
||||
|
@ -13552,6 +13604,64 @@ bool NativeCodeBasicBlock::Split16BitLoopCount(NativeCodeProcedure* proc)
|
|||
return changed;
|
||||
}
|
||||
|
||||
bool NativeCodeBasicBlock::CrossBlockStoreLoadBypass(NativeCodeProcedure* proc)
|
||||
{
|
||||
bool changed = false;
|
||||
if (!mVisited)
|
||||
{
|
||||
mVisited = true;
|
||||
|
||||
if (mTrueJump && !mFalseJump && mIns.Size() > 0 && mTrueJump->mIns.Size() > 0)
|
||||
{
|
||||
int sz = mIns.Size();
|
||||
|
||||
if (mTrueJump->mIns[0].mType == ASMIT_LDA && mTrueJump->mIns[0].mMode == ASMIM_ZERO_PAGE && !(mTrueJump->mIns[0].mLive & LIVE_MEM))
|
||||
{
|
||||
if (mIns[sz - 1].mType == ASMIT_STA && mIns[sz - 1].mMode == ASMIM_ZERO_PAGE && mIns[sz - 1].mAddress == mTrueJump->mIns[0].mAddress)
|
||||
{
|
||||
NativeCodeBasicBlock* lblock = proc->AllocateBlock();
|
||||
|
||||
for (int i = 1; i < mTrueJump->mIns.Size(); i++)
|
||||
lblock->mIns.Push(mTrueJump->mIns[i]);
|
||||
mTrueJump->mIns.SetSize(1);
|
||||
|
||||
lblock->mTrueJump = mTrueJump->mTrueJump;
|
||||
lblock->mFalseJump = mTrueJump->mFalseJump;
|
||||
lblock->mBranch = mTrueJump->mBranch;
|
||||
|
||||
lblock->mNumEntries = 2;
|
||||
lblock->mEntryBlocks.Push(this);
|
||||
lblock->mEntryBlocks.Push(mTrueJump);
|
||||
|
||||
lblock->mEntryProvidedRegs = mTrueJump->mEntryRequiredRegs;
|
||||
lblock->mExitRequiredRegs = mTrueJump->mEntryRequiredRegs;
|
||||
lblock->mExitRequiredRegs += CPU_REG_A;
|
||||
|
||||
mTrueJump->mEntryRequiredRegs += CPU_REG_A;
|
||||
|
||||
mTrueJump->mEntryBlocks.Remove(mTrueJump->mEntryBlocks.IndexOf(this));
|
||||
mTrueJump->mNumEntries--;
|
||||
|
||||
mTrueJump->mFalseJump = nullptr;
|
||||
mTrueJump->mTrueJump = lblock;
|
||||
mTrueJump->mBranch = ASMIT_JMP;
|
||||
|
||||
mTrueJump = lblock;
|
||||
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mTrueJump && mTrueJump->CrossBlockStoreLoadBypass(proc))
|
||||
changed = true;
|
||||
if (mFalseJump && mFalseJump->CrossBlockStoreLoadBypass(proc))
|
||||
changed = true;
|
||||
}
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
||||
bool NativeCodeBasicBlock::ExpandADCToBranch(NativeCodeProcedure* proc)
|
||||
{
|
||||
bool changed = false;
|
||||
|
@ -16207,7 +16317,7 @@ bool NativeCodeBasicBlock::JoinTailCodeSequences(NativeCodeProcedure* proc, bool
|
|||
#endif
|
||||
|
||||
#if 1
|
||||
if (mIns.Size() >= 1 && mIns[0].mType == ASMIT_TAX && !(mIns[0].mLive & (LIVE_CPU_REG_A | LIVE_CPU_REG_Z)))
|
||||
if (mIns.Size() >= 1 && mIns[0].mType == ASMIT_TAX && !(mIns[0].mLive & (LIVE_CPU_REG_A | LIVE_CPU_REG_Z)) && !mEntryRegA)
|
||||
{
|
||||
int i = 0;
|
||||
while (i < mEntryBlocks.Size() && mEntryBlocks[i]->mIns.Size() > 0 && mEntryBlocks[i]->mIns.Last().mType == ASMIT_LDA && HasAsmInstructionMode(ASMIT_LDX, mEntryBlocks[i]->mIns.Last().mMode) && !mEntryBlocks[i]->mFalseJump)
|
||||
|
@ -19264,6 +19374,10 @@ bool NativeCodeBasicBlock::MoveLoadStoreOutOfXYRangeUp(int at)
|
|||
return false;
|
||||
if (mIns[at + 1].mMode == ASMIM_ABSOLUTE_Y && mIns[j].ChangesYReg())
|
||||
return false;
|
||||
if (mIns[at + 1].mMode == ASMIM_ZERO_PAGE && mIns[j].ChangesZeroPage(mIns[at + 1].mAddress))
|
||||
return false;
|
||||
if (mIns[at + 2].mMode == ASMIM_ZERO_PAGE && mIns[j].ChangesZeroPage(mIns[at + 2].mAddress))
|
||||
return false;
|
||||
|
||||
if (mIns[j].mType == ASMIT_LDA)
|
||||
{
|
||||
|
@ -22092,11 +22206,15 @@ bool NativeCodeBasicBlock::OptimizeSimpleLoopInvariant(NativeCodeProcedure* proc
|
|||
return OptimizeSimpleLoopInvariant(proc);
|
||||
|
||||
mIns[sz - 2].mType = ASMIT_LDY; mIns[sz - 2].mLive |= LIVE_CPU_REG_Y;
|
||||
mIns[sz - 1].mType = ASMIT_CPY;
|
||||
mIns[sz - 1].mType = ASMIT_CPY; mIns[sz - 1].mLive |= LIVE_CPU_REG_Y;
|
||||
|
||||
prevBlock->mIns.Push(mIns[0]);
|
||||
mIns.Remove(0);
|
||||
|
||||
mExitRequiredRegs += CPU_REG_Y;
|
||||
mEntryRequiredRegs += CPU_REG_Y;
|
||||
prevBlock->mExitRequiredRegs += CPU_REG_Y;
|
||||
|
||||
CheckLive();
|
||||
|
||||
return true;
|
||||
|
@ -22112,6 +22230,10 @@ bool NativeCodeBasicBlock::OptimizeSimpleLoopInvariant(NativeCodeProcedure* proc
|
|||
prevBlock->mIns.Push(mIns[0]);
|
||||
mIns.Remove(0);
|
||||
|
||||
mExitRequiredRegs += CPU_REG_Y;
|
||||
mEntryRequiredRegs += CPU_REG_Y;
|
||||
prevBlock->mExitRequiredRegs += CPU_REG_Y;
|
||||
|
||||
CheckLive();
|
||||
|
||||
return true;
|
||||
|
@ -22124,11 +22246,15 @@ bool NativeCodeBasicBlock::OptimizeSimpleLoopInvariant(NativeCodeProcedure* proc
|
|||
return OptimizeSimpleLoopInvariant(proc);
|
||||
|
||||
mIns[sz - 2].mType = ASMIT_LDX; mIns[sz - 2].mLive |= LIVE_CPU_REG_X;
|
||||
mIns[sz - 1].mType = ASMIT_CPX;
|
||||
mIns[sz - 1].mType = ASMIT_CPX; mIns[sz - 1].mLive |= LIVE_CPU_REG_X;
|
||||
|
||||
prevBlock->mIns.Push(mIns[0]);
|
||||
mIns.Remove(0);
|
||||
|
||||
mExitRequiredRegs += CPU_REG_X;
|
||||
mEntryRequiredRegs += CPU_REG_X;
|
||||
prevBlock->mExitRequiredRegs += CPU_REG_X;
|
||||
|
||||
CheckLive();
|
||||
|
||||
return true;
|
||||
|
@ -31108,6 +31234,11 @@ void NativeCodeBasicBlock::CheckLive(void)
|
|||
if (mBranch == ASMIT_BEQ || mBranch == ASMIT_BNE || mBranch == ASMIT_BPL || mBranch == ASMIT_BMI)
|
||||
live |= LIVE_CPU_REG_Z;
|
||||
|
||||
if (mIns.Size() > 0 && mIns[0].mMode == ASMIM_INDIRECT_Y && mEntryRequiredRegs.Size() > 0)
|
||||
{
|
||||
assert(mEntryRequiredRegs[CPU_REG_Y]);
|
||||
}
|
||||
|
||||
for (int j = mIns.Size() - 1; j >= 0; j--)
|
||||
{
|
||||
assert(mIns[j].mType != ASMIT_INV);
|
||||
|
@ -31459,6 +31590,12 @@ NativeCodeBasicBlock::NativeCodeBasicBlock(void)
|
|||
mDominator = nullptr;
|
||||
mLoopHeadBlock = nullptr;
|
||||
mLoopTailBlock = nullptr;
|
||||
mEntryRegA = false;
|
||||
mEntryRegX = false;
|
||||
mEntryRegY = false;
|
||||
mExitRegA = false;
|
||||
mExitRegX = false;
|
||||
|
||||
}
|
||||
|
||||
NativeCodeBasicBlock::~NativeCodeBasicBlock(void)
|
||||
|
@ -31705,6 +31842,29 @@ void NativeCodeProcedure::Compile(InterCodeProcedure* proc)
|
|||
mEntryBlock->mTrueJump = CompileBlock(mInterProc, mInterProc->mBlocks[0]);
|
||||
mEntryBlock->mBranch = ASMIT_JMP;
|
||||
|
||||
if (proc->mLeafProcedure && proc->mFastCallProcedure && !proc->mInterrupt && mNoFrame && mStackExpand == 0 && commonFrameSize == 0 && (mGenerator->mCompilerOptions & COPT_NATIVE))
|
||||
{
|
||||
#if 1
|
||||
if (proc->mParamVars.Size() == 1 && proc->mParamVars[0]->mSize == 1)
|
||||
{
|
||||
proc->mLinkerObject->mFlags |= LOBJF_ARG_REG_A;
|
||||
proc->mLinkerObject->mTemporaries[0]++;
|
||||
proc->mLinkerObject->mTempSizes[0]--;
|
||||
mEntryBlock->mIns.Insert(0, NativeCodeInstruction(ASMIT_STA, ASMIM_ZERO_PAGE, BC_REG_FPARAMS));
|
||||
mEntryBlock->mEntryRegA = true;
|
||||
}
|
||||
#endif
|
||||
#if 1
|
||||
if (mExitBlock->mIns[0].mFlags == NCIF_LOWER)
|
||||
{
|
||||
mExitBlock->mIns[0].mFlags = 0;
|
||||
mExitBlock->mIns.Insert(0, NativeCodeInstruction(ASMIT_LDA, ASMIM_ZERO_PAGE, BC_REG_ACCU));
|
||||
mExitBlock->mExitRegA = true;
|
||||
proc->mLinkerObject->mFlags |= LOBJF_RET_REG_A;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Optimize();
|
||||
|
||||
if (mEntryBlock->mIns.Size() > 0)
|
||||
|
@ -31727,6 +31887,7 @@ void NativeCodeProcedure::Compile(InterCodeProcedure* proc)
|
|||
|
||||
bool ignoreExpandCommonFrame = false;
|
||||
|
||||
|
||||
if (mInterProc->mInterrupt)
|
||||
{
|
||||
if (!mNoFrame || mStackExpand > 0 || commonFrameSize > 0)
|
||||
|
@ -32136,7 +32297,7 @@ void NativeCodeProcedure::RebuildEntry(void)
|
|||
|
||||
void NativeCodeProcedure::Optimize(void)
|
||||
{
|
||||
CheckFunc = !strcmp(mInterProc->mIdent->mString, "main");
|
||||
CheckFunc = !strcmp(mInterProc->mIdent->mString, "expand");
|
||||
|
||||
#if 1
|
||||
int step = 0;
|
||||
|
@ -32256,7 +32417,6 @@ void NativeCodeProcedure::Optimize(void)
|
|||
mEntryBlock->CheckBlocks();
|
||||
#endif
|
||||
|
||||
|
||||
#if 1
|
||||
ResetVisited();
|
||||
if (mEntryBlock->PeepHoleOptimizer(this, step))
|
||||
|
@ -32378,7 +32538,6 @@ void NativeCodeProcedure::Optimize(void)
|
|||
mEntryBlock->CheckBlocks(true);
|
||||
#endif
|
||||
|
||||
|
||||
#if 1
|
||||
if (step == 3)
|
||||
{
|
||||
|
@ -32426,6 +32585,8 @@ void NativeCodeProcedure::Optimize(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
if (step > 3 && !changed)
|
||||
{
|
||||
ResetVisited();
|
||||
|
@ -32478,7 +32639,7 @@ void NativeCodeProcedure::Optimize(void)
|
|||
{
|
||||
ResetVisited();
|
||||
mEntryBlock->GlobalRegisterXMap(j);
|
||||
if (j >= BC_REG_FPARAMS && j < BC_REG_FPARAMS_END)
|
||||
if (j >= BC_REG_FPARAMS && j < BC_REG_FPARAMS_END && !mEntryBlock->mEntryRegA)
|
||||
mEntryBlock->mTrueJump->mIns.Insert(0, NativeCodeInstruction(ASMIT_LDX, ASMIM_ZERO_PAGE, j));
|
||||
changed = true;
|
||||
xmapped = true;
|
||||
|
@ -32496,7 +32657,7 @@ void NativeCodeProcedure::Optimize(void)
|
|||
{
|
||||
ResetVisited();
|
||||
mEntryBlock->GlobalRegisterYMap(j);
|
||||
if (j >= BC_REG_FPARAMS && j < BC_REG_FPARAMS_END)
|
||||
if (j >= BC_REG_FPARAMS && j < BC_REG_FPARAMS_END && !mEntryBlock->mEntryRegA)
|
||||
mEntryBlock->mTrueJump->mIns.Insert(0, NativeCodeInstruction(ASMIT_LDY, ASMIM_ZERO_PAGE, j));
|
||||
changed = true;
|
||||
ymapped = true;
|
||||
|
@ -32623,8 +32784,17 @@ void NativeCodeProcedure::Optimize(void)
|
|||
changed = true;
|
||||
}
|
||||
#endif
|
||||
#if 1
|
||||
if (step == 2 && !changed)
|
||||
{
|
||||
ResetVisited();
|
||||
if (mEntryBlock->CrossBlockStoreLoadBypass(this))
|
||||
changed = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if 1
|
||||
if (cnt > 190)
|
||||
{
|
||||
|
@ -32650,6 +32820,7 @@ void NativeCodeProcedure::Optimize(void)
|
|||
else
|
||||
cnt++;
|
||||
|
||||
|
||||
} while (changed);
|
||||
|
||||
#if 1
|
||||
|
|
|
@ -173,6 +173,7 @@ public:
|
|||
|
||||
int mOffset, mSize, mPlace, mNumEntries, mNumEntered, mFrameOffset, mTemp;
|
||||
bool mPlaced, mCopied, mKnownShortBranch, mBypassed, mAssembled, mNoFrame, mVisited, mLoopHead, mVisiting, mLocked, mPatched, mPatchFail, mPatchChecked, mPatchStart, mPatchLoop, mPatchLoopChanged;
|
||||
bool mEntryRegA, mEntryRegX, mEntryRegY, mExitRegA, mExitRegX;
|
||||
NativeCodeBasicBlock * mDominator, * mSameBlock;
|
||||
|
||||
NativeCodeBasicBlock* mLoopHeadBlock, * mLoopTailBlock;
|
||||
|
@ -396,6 +397,7 @@ public:
|
|||
|
||||
bool CrossBlockXYShortcut(void);
|
||||
|
||||
|
||||
bool Check16BitSum(int at, NativeRegisterSum16Info& info);
|
||||
bool Propagate16BitSum(void);
|
||||
|
||||
|
@ -431,6 +433,7 @@ public:
|
|||
bool Split16BitLoopCount(NativeCodeProcedure* proc);
|
||||
bool SimplifyDiamond(NativeCodeProcedure* proc);
|
||||
bool SimplifyLoopEnd(NativeCodeProcedure* proc);
|
||||
bool CrossBlockStoreLoadBypass(NativeCodeProcedure* proc);
|
||||
|
||||
bool CanBytepassLoad(const NativeCodeInstruction& ains) const;
|
||||
|
||||
|
|
|
@ -3695,6 +3695,11 @@ void Parser::ParsePragma(void)
|
|||
type = LST_BSS;
|
||||
else if (!strcmp(mScanner->mTokenIdent->mString, "data"))
|
||||
type = LST_DATA;
|
||||
else if (!strcmp(mScanner->mTokenIdent->mString, "packed"))
|
||||
{
|
||||
type = LST_DATA;
|
||||
flags |= LSECF_PACKED;
|
||||
}
|
||||
else
|
||||
mErrors->Error(mScanner->mLocation, EERR_PRAGMA_PARAMETER, "Unknown section type");
|
||||
}
|
||||
|
@ -3711,6 +3716,8 @@ void Parser::ParsePragma(void)
|
|||
if (!lsec)
|
||||
lsec = mCompilationUnits->mLinker->AddSection(sectionIdent, type);
|
||||
|
||||
lsec->mFlags |= flags;
|
||||
|
||||
if (dstart)
|
||||
{
|
||||
dstart->mSection = lsec;
|
||||
|
@ -3808,7 +3815,9 @@ void Parser::ParsePragma(void)
|
|||
|
||||
Expression * exp = ParseRExpression();
|
||||
if (exp->mType == EX_CONSTANT && exp->mDecValue->mType == DT_CONST_INTEGER)
|
||||
{
|
||||
dec->mAlignment = exp->mDecValue->mInteger;
|
||||
}
|
||||
else
|
||||
mErrors->Error(mScanner->mLocation, EERR_PRAGMA_PARAMETER, "Integer number for alignment expected");
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ int main2(int argc, const char** argv)
|
|||
|
||||
#else
|
||||
strcpy(strProductName, "oscar64");
|
||||
strcpy(strProductVersion, "1.12.176");
|
||||
strcpy(strProductVersion, "1.13.177");
|
||||
|
||||
#ifdef __APPLE__
|
||||
uint32_t length = sizeof(basePath);
|
||||
|
|
|
@ -25,8 +25,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL
|
|||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,12,176,0
|
||||
PRODUCTVERSION 1,12,176,0
|
||||
FILEVERSION 1,13,177,0
|
||||
PRODUCTVERSION 1,13,177,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
|
@ -43,12 +43,12 @@ BEGIN
|
|||
BEGIN
|
||||
VALUE "CompanyName", "oscar64"
|
||||
VALUE "FileDescription", "oscar64 compiler"
|
||||
VALUE "FileVersion", "1.12.176.0"
|
||||
VALUE "FileVersion", "1.13.177.0"
|
||||
VALUE "InternalName", "oscar64.exe"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2021"
|
||||
VALUE "OriginalFilename", "oscar64.exe"
|
||||
VALUE "ProductName", "oscar64"
|
||||
VALUE "ProductVersion", "1.12.176.0"
|
||||
VALUE "ProductVersion", "1.13.177.0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
|
|
@ -4450,15 +4450,15 @@
|
|||
{
|
||||
"Name" = "8:Microsoft Visual Studio"
|
||||
"ProductName" = "8:oscar64"
|
||||
"ProductCode" = "8:{E0F08F69-BB99-4D80-9DBA-6C7898ED4DDB}"
|
||||
"PackageCode" = "8:{8623BC03-009C-4E14-9DC8-16C927655E48}"
|
||||
"ProductCode" = "8:{F395B181-BC67-45F0-ABC6-A1DD8AF53FD3}"
|
||||
"PackageCode" = "8:{9D340FCF-C068-44AE-91FF-DA164F68B9FB}"
|
||||
"UpgradeCode" = "8:{9AB61EFF-ACAC-4079-9950-8D96615CD4EF}"
|
||||
"AspNetVersion" = "8:2.0.50727.0"
|
||||
"RestartWWWService" = "11:FALSE"
|
||||
"RemovePreviousVersions" = "11:TRUE"
|
||||
"DetectNewerInstalledVersion" = "11:TRUE"
|
||||
"InstallAllUsers" = "11:FALSE"
|
||||
"ProductVersion" = "8:1.12.176"
|
||||
"ProductVersion" = "8:1.13.177"
|
||||
"Manufacturer" = "8:oscar64"
|
||||
"ARPHELPTELEPHONE" = "8:"
|
||||
"ARPHELPLINK" = "8:"
|
||||
|
|
Loading…
Reference in New Issue