Bump version number

This commit is contained in:
drmortalwombat 2022-12-13 20:16:11 +01:00
parent ac0f4d232e
commit e202f8e5b5
7 changed files with 150 additions and 22 deletions

View File

@ -5622,10 +5622,10 @@ void InterCodeBasicBlock::UpdateLocalIntegerRangeSets(const GrowingVariableArray
IntegerValueRange tr; IntegerValueRange tr;
IntegerValueRange& sr(mLocalValueRange[ins->mSrc[0].mTemp]); IntegerValueRange& sr(mLocalValueRange[ins->mSrc[0].mTemp]);
tr.mMinState = vr.mMaxState; tr.mMinState = sr.mMaxState;
tr.mMinValue = -vr.mMaxValue; tr.mMinValue = -sr.mMaxValue;
tr.mMaxState = vr.mMinState; tr.mMaxState = sr.mMinState;
tr.mMaxValue = -vr.mMinValue; tr.mMaxValue = -sr.mMinValue;
vr = tr; vr = tr;
} }
break; break;
@ -6294,6 +6294,15 @@ void InterCodeBasicBlock::UpdateLocalIntegerRangeSets(const GrowingVariableArray
mInstructions[sz - 1]->mSrc[0].mTemp == mInstructions[sz - 2]->mDst.mTemp && IsIntegerType(mInstructions[sz - 2]->mSrc[0].mType)) mInstructions[sz - 1]->mSrc[0].mTemp == mInstructions[sz - 2]->mDst.mTemp && IsIntegerType(mInstructions[sz - 2]->mSrc[0].mType))
{ {
int s1 = mInstructions[sz - 2]->mSrc[1].mTemp, s0 = mInstructions[sz - 2]->mSrc[0].mTemp; int s1 = mInstructions[sz - 2]->mSrc[1].mTemp, s0 = mInstructions[sz - 2]->mSrc[0].mTemp;
int s1c = -1, s0c = -1;
if (sz > 2 && mInstructions[sz - 3]->mCode == IC_CONVERSION_OPERATOR && mInstructions[sz - 3]->mOperator == IA_EXT8TO16S)
{
if (s1 == mInstructions[sz - 3]->mSrc[0].mTemp)
s1c = mInstructions[sz - 3]->mDst.mTemp;
if (s0 == mInstructions[sz - 3]->mSrc[0].mTemp)
s0c = mInstructions[sz - 3]->mDst.mTemp;
}
switch (mInstructions[sz - 2]->mOperator) switch (mInstructions[sz - 2]->mOperator)
{ {
@ -6340,6 +6349,15 @@ void InterCodeBasicBlock::UpdateLocalIntegerRangeSets(const GrowingVariableArray
mFalseValueRange[s1].LimitMin(mInstructions[sz - 2]->mSrc[0].mIntConst); mFalseValueRange[s1].LimitMin(mInstructions[sz - 2]->mSrc[0].mIntConst);
mFalseValueRange[s1].LimitMaxWeak(SignedTypeMax(mInstructions[sz - 2]->mSrc[1].mType)); mFalseValueRange[s1].LimitMaxWeak(SignedTypeMax(mInstructions[sz - 2]->mSrc[1].mType));
if (s1c >= 0)
{
mTrueValueRange[s1c].LimitMax(mInstructions[sz - 2]->mSrc[0].mIntConst - 1);
mTrueValueRange[s1c].LimitMinWeak(SignedTypeMin(mInstructions[sz - 2]->mSrc[1].mType));
mFalseValueRange[s1c].LimitMin(mInstructions[sz - 2]->mSrc[0].mIntConst);
mFalseValueRange[s1c].LimitMaxWeak(SignedTypeMax(mInstructions[sz - 2]->mSrc[1].mType));
}
} }
else if (s1 < 0) else if (s1 < 0)
{ {
@ -6348,6 +6366,15 @@ void InterCodeBasicBlock::UpdateLocalIntegerRangeSets(const GrowingVariableArray
mFalseValueRange[s0].LimitMax(mInstructions[sz - 2]->mSrc[1].mIntConst); mFalseValueRange[s0].LimitMax(mInstructions[sz - 2]->mSrc[1].mIntConst);
mFalseValueRange[s0].LimitMinWeak(SignedTypeMin(mInstructions[sz - 2]->mSrc[0].mType)); mFalseValueRange[s0].LimitMinWeak(SignedTypeMin(mInstructions[sz - 2]->mSrc[0].mType));
if (s0c >= 0)
{
mTrueValueRange[s0c].LimitMin(mInstructions[sz - 2]->mSrc[1].mIntConst + 1);
mTrueValueRange[s0c].LimitMaxWeak(SignedTypeMax(mInstructions[sz - 2]->mSrc[0].mType));
mFalseValueRange[s0c].LimitMax(mInstructions[sz - 2]->mSrc[1].mIntConst);
mFalseValueRange[s0c].LimitMinWeak(SignedTypeMin(mInstructions[sz - 2]->mSrc[0].mType));
}
} }
else else
{ {
@ -13998,6 +14025,8 @@ void InterCodeProcedure::Close(void)
#if 1 #if 1
BuildTraces(false); BuildTraces(false);
PushSinglePathResultInstructions();
ResetVisited(); ResetVisited();
if (mEntryBlock->MergeSameConditionTraces()) if (mEntryBlock->MergeSameConditionTraces())
{ {
@ -14011,6 +14040,8 @@ void InterCodeProcedure::Close(void)
CheckUsedDefinedTemps(); CheckUsedDefinedTemps();
#endif #endif
PeepholeOptimization();
#if 1 #if 1
RebuildIntegerRangeSet(); RebuildIntegerRangeSet();
#endif #endif

View File

@ -20083,6 +20083,51 @@ bool NativeCodeBasicBlock::CombineImmediateADCUp(int at)
return false; return false;
} }
bool NativeCodeBasicBlock::MoveTXADCDown(int at)
{
int i = at + 4;
while (i < mIns.Size())
{
if (mIns[i].ChangesXReg())
return false;
if (mIns[i].ReferencesZeroPage(mIns[at + 3].mAddress))
return false;
if (!(mIns[i].mLive & (LIVE_CPU_REG_X | LIVE_CPU_REG_Z)))
{
mIns.Insert(i + 1, NativeCodeInstruction(ASMIT_STX, ASMIM_ZERO_PAGE, mIns[at + 3].mAddress));
switch (mIns[at + 2].mAddress)
{
case -2:
case 254:
mIns.Insert(i + 1, NativeCodeInstruction(ASMIT_DEX));
case -1:
case 255:
mIns.Insert(i + 1, NativeCodeInstruction(ASMIT_DEX));
break;
case 2:
mIns.Insert(i + 1, NativeCodeInstruction(ASMIT_INX));
case 1:
mIns.Insert(i + 1, NativeCodeInstruction(ASMIT_INX));
break;
}
while (i > at)
{
mIns[i].mLive |= LIVE_CPU_REG_X;
i--;
}
mIns.Remove(at, 4);
return true;
}
i++;
}
return false;
}
bool NativeCodeBasicBlock::CombineImmediateADCUpX(int at) bool NativeCodeBasicBlock::CombineImmediateADCUpX(int at)
{ {
int i = at; int i = at;
@ -22047,12 +22092,30 @@ bool NativeCodeBasicBlock::OptimizeSimpleLoopInvariant(NativeCodeProcedure* proc
if (i == mIns.Size()) if (i == mIns.Size())
{ {
int addr = mIns[ai].mAddress; int addr = mIns[ai].mAddress;
i = 0; bool fail = false, changey = false;
while (i < mIns.Size() &&
(mIns[i].mMode != ASMIM_ZERO_PAGE || mIns[i].mAddress != addr || for (int i = 0; i < mIns.Size(); i++)
mIns[i].mType == ASMIT_LDA || mIns[i].mType == ASMIT_STA || mIns[i].mType == ASMIT_INC || mIns[i].mType == ASMIT_DEC || mIns[i].mType == ASMIT_LDY)) {
i++; if (mIns[i].mType == ASMIT_LDY)
if (i == mIns.Size()) changey = false;
else if (mIns[i].ReferencesYReg() && changey)
{
fail = true;
break;
}
else if (mIns[i].mMode == ASMIM_ZERO_PAGE && mIns[i].mAddress == addr)
{
if (mIns[i].mType == ASMIT_STA || mIns[i].mType == ASMIT_INC || mIns[i].mType == ASMIT_DEC)
changey = true;
else if (mIns[i].mType != ASMIT_LDA)
{
fail = true;
break;
}
}
}
if (!fail)
{ {
if (!prevBlock) if (!prevBlock)
return OptimizeSimpleLoopInvariant(proc); return OptimizeSimpleLoopInvariant(proc);
@ -23322,7 +23385,6 @@ bool NativeCodeBasicBlock::OptimizeGenericLoop(NativeCodeProcedure* proc)
} }
break; break;
case ASMIT_LDA: case ASMIT_LDA:
case ASMIT_STA:
if (ins.mMode == ASMIM_ZERO_PAGE) if (ins.mMode == ASMIM_ZERO_PAGE)
{ {
if (ins.mAddress == yreg && yoffset != 0) if (ins.mAddress == yreg && yoffset != 0)
@ -23336,6 +23398,20 @@ bool NativeCodeBasicBlock::OptimizeGenericLoop(NativeCodeProcedure* proc)
zyreg[ins.mAddress]++; zyreg[ins.mAddress]++;
} }
break; break;
case ASMIT_STA:
if (ins.mMode == ASMIM_ZERO_PAGE)
{
if (ins.mAddress == yreg && (yoffset != 0 || (ins.mLive & LIVE_CPU_REG_Y)))
yreg = -2;
if (ins.mAddress == xreg && (xoffset != 0 || (ins.mLive & LIVE_CPU_REG_X)))
xreg = -2;
if (zxreg[ins.mAddress] >= 0)
zxreg[ins.mAddress]++;
if (zyreg[ins.mAddress] >= 0)
zyreg[ins.mAddress]++;
}
break;
case ASMIT_TYA: case ASMIT_TYA:
if (yoffset) if (yoffset)
yreg = -2; yreg = -2;
@ -25789,6 +25865,24 @@ bool NativeCodeBasicBlock::PeepHoleOptimizer(NativeCodeProcedure* proc, int pass
CheckLive(); CheckLive();
#endif #endif
#if 1
for (int i = 0; i + 4 < mIns.Size(); i++)
{
if (mIns[i + 0].mType == ASMIT_TXA &&
mIns[i + 1].mType == ASMIT_CLC &&
mIns[i + 2].mType == ASMIT_ADC && mIns[i + 2].mMode == ASMIM_IMMEDIATE && (mIns[i + 2].mAddress >= -2 && mIns[i + 2].mAddress <= 2 || mIns[i + 2].mAddress >= 254 && mIns[i + 2].mAddress < 256) &&
mIns[i + 3].mType == ASMIT_STA && mIns[i + 3].mMode == ASMIM_ZERO_PAGE && !(mIns[i + 3].mLive & (LIVE_CPU_REG_A | LIVE_CPU_REG_Z | LIVE_CPU_REG_C)))
{
if (MoveTXADCDown(i))
changed = true;
}
}
CheckLive();
#endif
#if 1 #if 1
bool progress = false; bool progress = false;
do { do {
@ -31515,7 +31609,6 @@ void NativeCodeProcedure::Optimize(void)
changed = true; changed = true;
#endif #endif
#if 1 #if 1
if (step >= 3) if (step >= 3)
{ {
@ -31535,6 +31628,7 @@ void NativeCodeProcedure::Optimize(void)
} }
} }
#if 1 #if 1
if (step == 3) if (step == 3)
{ {
@ -31552,6 +31646,7 @@ void NativeCodeProcedure::Optimize(void)
changed = true; changed = true;
} }
#endif #endif
#if 1 #if 1
if (step > 0) if (step > 0)
{ {
@ -31559,12 +31654,12 @@ void NativeCodeProcedure::Optimize(void)
if (mEntryBlock->OptimizeSimpleLoop(this)) if (mEntryBlock->OptimizeSimpleLoop(this))
changed = true; changed = true;
ResetVisited(); ResetVisited();
if (mEntryBlock->SimpleLoopReversal(this)) if (mEntryBlock->SimpleLoopReversal(this))
changed = true; changed = true;
} }
#endif #endif
#if 1 #if 1
ResetVisited(); ResetVisited();
if (mEntryBlock->MergeBasicBlocks()) if (mEntryBlock->MergeBasicBlocks())
@ -31617,7 +31712,6 @@ void NativeCodeProcedure::Optimize(void)
#endif #endif
#if _DEBUG #if _DEBUG
ResetVisited(); ResetVisited();
mEntryBlock->CheckBlocks(true); mEntryBlock->CheckBlocks(true);
@ -31875,6 +31969,7 @@ void NativeCodeProcedure::Optimize(void)
printf("Opps\n"); printf("Opps\n");
} }
#endif #endif
if (cnt > 200) if (cnt > 200)
{ {
changed = false; changed = false;
@ -31893,6 +31988,7 @@ void NativeCodeProcedure::Optimize(void)
else else
cnt++; cnt++;
} while (changed); } while (changed);
#if 1 #if 1

View File

@ -331,6 +331,7 @@ public:
bool MoveASLMemUp(int start); bool MoveASLMemUp(int start);
bool CombineImmediateADCUp(int at); bool CombineImmediateADCUp(int at);
bool CombineImmediateADCUpX(int at); bool CombineImmediateADCUpX(int at);
bool MoveTXADCDown(int at);
bool MoveZeroPageCrossBlockUp(int at, const NativeCodeInstruction & lins, const NativeCodeInstruction & sins); bool MoveZeroPageCrossBlockUp(int at, const NativeCodeInstruction & lins, const NativeCodeInstruction & sins);
bool ShortcutCrossBlockMoves(NativeCodeProcedure* proc); bool ShortcutCrossBlockMoves(NativeCodeProcedure* proc);

View File

@ -74,7 +74,7 @@ int main2(int argc, const char** argv)
#else #else
strcpy(strProductName, "oscar64"); strcpy(strProductName, "oscar64");
strcpy(strProductVersion, "1.12.174"); strcpy(strProductVersion, "1.12.175");
#ifdef __APPLE__ #ifdef __APPLE__
uint32_t length = sizeof(basePath); uint32_t length = sizeof(basePath);

View File

@ -25,8 +25,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,12,174,0 FILEVERSION 1,12,175,0
PRODUCTVERSION 1,12,174,0 PRODUCTVERSION 1,12,175,0
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -43,12 +43,12 @@ BEGIN
BEGIN BEGIN
VALUE "CompanyName", "oscar64" VALUE "CompanyName", "oscar64"
VALUE "FileDescription", "oscar64 compiler" VALUE "FileDescription", "oscar64 compiler"
VALUE "FileVersion", "1.12.174.0" VALUE "FileVersion", "1.12.175.0"
VALUE "InternalName", "oscar64.exe" VALUE "InternalName", "oscar64.exe"
VALUE "LegalCopyright", "Copyright (C) 2021" VALUE "LegalCopyright", "Copyright (C) 2021"
VALUE "OriginalFilename", "oscar64.exe" VALUE "OriginalFilename", "oscar64.exe"
VALUE "ProductName", "oscar64" VALUE "ProductName", "oscar64"
VALUE "ProductVersion", "1.12.174.0" VALUE "ProductVersion", "1.12.175.0"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

View File

@ -4450,15 +4450,15 @@
{ {
"Name" = "8:Microsoft Visual Studio" "Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:oscar64" "ProductName" = "8:oscar64"
"ProductCode" = "8:{2FD4FD95-A0D1-4DC0-A9F4-DE9085C7F327}" "ProductCode" = "8:{2D54553F-8D43-43A2-9E21-D8825A9DA799}"
"PackageCode" = "8:{9C02A8C7-2D5F-4FAB-8185-219EDC622E4E}" "PackageCode" = "8:{32868128-65EE-44DF-B846-310909366FA6}"
"UpgradeCode" = "8:{9AB61EFF-ACAC-4079-9950-8D96615CD4EF}" "UpgradeCode" = "8:{9AB61EFF-ACAC-4079-9950-8D96615CD4EF}"
"AspNetVersion" = "8:2.0.50727.0" "AspNetVersion" = "8:2.0.50727.0"
"RestartWWWService" = "11:FALSE" "RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE" "RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE" "InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:1.12.174" "ProductVersion" = "8:1.12.175"
"Manufacturer" = "8:oscar64" "Manufacturer" = "8:oscar64"
"ARPHELPTELEPHONE" = "8:" "ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:" "ARPHELPLINK" = "8:"

Binary file not shown.