Skip to content

Commit

Permalink
Bump version number
Browse files Browse the repository at this point in the history
  • Loading branch information
drmortalwombat committed Mar 12, 2023
1 parent ecd0fbd commit 718d3ad
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 26 deletions.
68 changes: 50 additions & 18 deletions oscar64/NativeCodeGenerator.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "NativeCodeGenerator.h"
#include "CompilerTypes.h"

#define JUMP_TO_BRANCH 1

static bool CheckFunc;
static bool CheckCase;

Expand Down Expand Up @@ -4504,7 +4506,7 @@ int NativeCodeBasicBlock::PutJump(NativeCodeProcedure* proc, NativeCodeBasicBloc
return 1;
}
}
#if 1
#if JUMP_TO_BRANCH
else if (offset >= -126 && offset <= 129)
{
if (mNDataSet.mRegs[CPU_REG_C].mMode == NRDM_IMMEDIATE)
Expand Down Expand Up @@ -4564,7 +4566,7 @@ int NativeCodeBasicBlock::JumpByteSize(NativeCodeBasicBlock* target, int offset)
else
return 1;
}
#if 1
#if JUMP_TO_BRANCH
else if (offset >= -126 && offset <= 129)
{
if (mNDataSet.mRegs[CPU_REG_C].mMode == NRDM_IMMEDIATE)
Expand Down Expand Up @@ -13197,10 +13199,16 @@ bool NativeCodeBasicBlock::CombineSameXtoY(int xpos, int ypos, int end)
if (xpos < ypos)
{
if (CanCombineSameXtoY(xpos, ypos) &&
CanCombineSameXtoY(ypos, end))
CanCombineSameXtoY(ypos + 1, end) &&
!ReferencesYReg(xpos, ypos))
{
ReplaceXRegWithYReg(xpos, ypos);
ReplaceXRegWithYReg(ypos, end);
ReplaceXRegWithYReg(ypos + 1, end);
if (!(mIns[ypos].mLive & LIVE_CPU_REG_Z))
{
mIns[ypos].mType = ASMIT_NOP;
mIns[ypos].mMode = ASMIM_IMPLIED;
}
return true;
}
}
Expand All @@ -13209,13 +13217,11 @@ bool NativeCodeBasicBlock::CombineSameXtoY(int xpos, int ypos, int end)
if (CanCombineSameXtoY(xpos, end))
{
ReplaceXRegWithYReg(xpos, end);
#if 0
if (!(mIns[xpos].mLive & LIVE_CPU_REG_Z))
{
mIns[xpos].mType = ASMIT_NOP;
mIns[xpos].mMode = ASMIM_IMPLIED;
}
#endif
return true;
}
}
Expand All @@ -13228,10 +13234,16 @@ bool NativeCodeBasicBlock::CombineSameYtoX(int xpos, int ypos, int end)
if (ypos < xpos)
{
if (CanCombineSameYtoX(ypos, xpos) &&
CanCombineSameYtoX(xpos + 1, end))
CanCombineSameYtoX(xpos + 1, end) &&
!ReferencesXReg(ypos, xpos))
{
ReplaceYRegWithXReg(ypos, xpos);
ReplaceYRegWithXReg(xpos + 1, end);
if (!(mIns[xpos].mLive & LIVE_CPU_REG_Z))
{
mIns[xpos].mType = ASMIT_NOP;
mIns[xpos].mMode = ASMIM_IMPLIED;
}
return true;
}
}
Expand All @@ -13240,13 +13252,11 @@ bool NativeCodeBasicBlock::CombineSameYtoX(int xpos, int ypos, int end)
if (CanCombineSameYtoX(ypos, end))
{
ReplaceYRegWithXReg(ypos, end);
#if 0
if (!(mIns[ypos].mLive & LIVE_CPU_REG_Z))
{
mIns[ypos].mType = ASMIT_NOP;
mIns[ypos].mMode = ASMIM_IMPLIED;
}
#endif
return true;
}
}
Expand Down Expand Up @@ -19553,8 +19563,10 @@ bool NativeCodeBasicBlock::BypassRegisterConditionBlock(void)

for (i = 0; i < cblock->mIns.Size(); i++)
cblock->mIns[i].mLive |= LIVE_CPU_REG_Y;
changed = true;

changed = true;
cblock->mEntryRequiredRegs += CPU_REG_Y;
cblock->mExitRequiredRegs += CPU_REG_Y;
eblock->mEntryRequiredRegs += CPU_REG_Y;
CheckLive();
}
}
Expand Down Expand Up @@ -23629,7 +23641,7 @@ bool NativeCodeBasicBlock::Propagate16BitHighSum(void)

for (int i = 0; i + 5 < mIns.Size(); i++)
{
if (mIns[i + 0].mType == ASMIT_LDA && mIns[i + 0].mMode == ASMIM_ZERO_PAGE &&
if (mIns[i + 0].mType == ASMIT_LDA && mIns[i + 0].mMode == ASMIM_ZERO_PAGE && !(mIns[i + 0].mLive & LIVE_MEM) &&
mIns[i + 1].mType == ASMIT_STA && mIns[i + 1].mMode == ASMIM_ZERO_PAGE &&
mIns[i + 2].mType == ASMIT_CLC &&
mIns[i + 3].mType == ASMIT_LDA && mIns[i + 3].mMode == ASMIM_ZERO_PAGE && mIns[i + 3].mAddress == mIns[i + 0].mAddress + 1 && !(mIns[i + 3].mLive & LIVE_MEM) &&
Expand Down Expand Up @@ -27047,8 +27059,13 @@ bool NativeCodeBasicBlock::OptimizeSimpleLoopInvariant(NativeCodeProcedure* proc
{
if (!prevBlock)
return OptimizeSimpleLoopInvariant(proc, full);
prevBlock->mIns.Push(NativeCodeInstruction(ASMIT_LDA, ASMIM_IMMEDIATE, mIns[i + 0].mAddress));
prevBlock->mIns.Push(NativeCodeInstruction(ASMIT_STA, ASMIM_ZERO_PAGE, mIns[i + 1].mAddress));

int k = prevBlock->mIns.Size();
while (k > 0 && (prevBlock->mIns[k - 1].mLive && LIVE_CPU_REG_A))
k--;

prevBlock->mIns.Insert(k, NativeCodeInstruction(ASMIT_LDA, ASMIM_IMMEDIATE, mIns[i + 0].mAddress));
prevBlock->mIns.Insert(k + 1, NativeCodeInstruction(ASMIT_STA, ASMIM_ZERO_PAGE, mIns[i + 1].mAddress));
mIns[i + 1].mType = ASMIT_NOP; mIns[i + 1].mMode = ASMIM_IMPLIED;
}
}
Expand Down Expand Up @@ -37410,7 +37427,7 @@ void NativeCodeProcedure::RebuildEntry(void)

void NativeCodeProcedure::Optimize(void)
{
CheckFunc = !strcmp(mInterProc->mIdent->mString, "tile_draw_p");
CheckFunc = !strcmp(mInterProc->mIdent->mString, "main");

#if 1
int step = 0;
Expand Down Expand Up @@ -37536,8 +37553,9 @@ void NativeCodeProcedure::Optimize(void)
} while (changed);
#endif



BuildDataFlowSets();
ResetVisited();
mEntryBlock->RemoveUnusedResultInstructions();

#if _DEBUG
ResetVisited();
Expand Down Expand Up @@ -37569,7 +37587,6 @@ void NativeCodeProcedure::Optimize(void)
}
}


#if 1
if (step == 3)
{
Expand Down Expand Up @@ -37601,6 +37618,7 @@ void NativeCodeProcedure::Optimize(void)
if (mEntryBlock->PropagateCommonSubExpression())
changed = true;
}

#if 1
if (step > 0)
{
Expand Down Expand Up @@ -37900,10 +37918,18 @@ void NativeCodeProcedure::Optimize(void)
if (mEntryBlock->SimplifyDiamond(this))
changed = true;

#if _DEBUG
ResetVisited();
mEntryBlock->CheckBlocks();
#endif
ResetVisited();
if (mEntryBlock->SimplifyLoopEnd(this))
changed = true;

#if _DEBUG
ResetVisited();
mEntryBlock->CheckBlocks();
#endif
}
#endif

Expand Down Expand Up @@ -38025,6 +38051,7 @@ void NativeCodeProcedure::Optimize(void)
else
cnt++;


} while (changed);

#if 1
Expand Down Expand Up @@ -38071,6 +38098,11 @@ void NativeCodeProcedure::Optimize(void)
}
}

BuildDataFlowSets();
ResetVisited();
if (mEntryBlock->RemoveUnusedResultInstructions())
changed = true;

#if _DEBUG
ResetVisited();
mEntryBlock->CheckBlocks();
Expand Down
2 changes: 1 addition & 1 deletion oscar64/oscar64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ int main2(int argc, const char** argv)

#else
strcpy(strProductName, "oscar64");
strcpy(strProductVersion, "1.17.189");
strcpy(strProductVersion, "1.17.190");

#ifdef __APPLE__
uint32_t length = sizeof(basePath);
Expand Down
8 changes: 4 additions & 4 deletions oscar64/oscar64.rc
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,17,189,0
PRODUCTVERSION 1,17,189,0
FILEVERSION 1,17,190,0
PRODUCTVERSION 1,17,190,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -43,12 +43,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "oscar64"
VALUE "FileDescription", "oscar64 compiler"
VALUE "FileVersion", "1.17.189.0"
VALUE "FileVersion", "1.17.190.0"
VALUE "InternalName", "oscar64.exe"
VALUE "LegalCopyright", "Copyright (C) 2021"
VALUE "OriginalFilename", "oscar64.exe"
VALUE "ProductName", "oscar64"
VALUE "ProductVersion", "1.17.189.0"
VALUE "ProductVersion", "1.17.190.0"
END
END
BLOCK "VarFileInfo"
Expand Down
6 changes: 3 additions & 3 deletions oscar64setup/oscar64setup.vdproj
Original file line number Diff line number Diff line change
Expand Up @@ -5066,15 +5066,15 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:oscar64"
"ProductCode" = "8:{85311ED7-CC4D-4512-840D-20C87C74DAC0}"
"PackageCode" = "8:{9C4FC9E1-982E-42B2-B9D0-8D5984BC0B2B}"
"ProductCode" = "8:{CE09AF37-F5A2-455C-9AA1-8BAEAE79A777}"
"PackageCode" = "8:{01E6782F-1F11-4C56-A8FA-B82388BF217B}"
"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.17.189"
"ProductVersion" = "8:1.17.190"
"Manufacturer" = "8:oscar64"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"
Expand Down

0 comments on commit 718d3ad

Please sign in to comment.