Bump version number

This commit is contained in:
drmortalwombat 2023-03-12 22:47:19 +01:00
parent ecd0fbd364
commit 718d3ad940
4 changed files with 58 additions and 26 deletions

View File

@ -1,6 +1,8 @@
#include "NativeCodeGenerator.h" #include "NativeCodeGenerator.h"
#include "CompilerTypes.h" #include "CompilerTypes.h"
#define JUMP_TO_BRANCH 1
static bool CheckFunc; static bool CheckFunc;
static bool CheckCase; static bool CheckCase;
@ -4504,7 +4506,7 @@ int NativeCodeBasicBlock::PutJump(NativeCodeProcedure* proc, NativeCodeBasicBloc
return 1; return 1;
} }
} }
#if 1 #if JUMP_TO_BRANCH
else if (offset >= -126 && offset <= 129) else if (offset >= -126 && offset <= 129)
{ {
if (mNDataSet.mRegs[CPU_REG_C].mMode == NRDM_IMMEDIATE) if (mNDataSet.mRegs[CPU_REG_C].mMode == NRDM_IMMEDIATE)
@ -4564,7 +4566,7 @@ int NativeCodeBasicBlock::JumpByteSize(NativeCodeBasicBlock* target, int offset)
else else
return 1; return 1;
} }
#if 1 #if JUMP_TO_BRANCH
else if (offset >= -126 && offset <= 129) else if (offset >= -126 && offset <= 129)
{ {
if (mNDataSet.mRegs[CPU_REG_C].mMode == NRDM_IMMEDIATE) if (mNDataSet.mRegs[CPU_REG_C].mMode == NRDM_IMMEDIATE)
@ -13197,10 +13199,16 @@ bool NativeCodeBasicBlock::CombineSameXtoY(int xpos, int ypos, int end)
if (xpos < ypos) if (xpos < ypos)
{ {
if (CanCombineSameXtoY(xpos, ypos) && if (CanCombineSameXtoY(xpos, ypos) &&
CanCombineSameXtoY(ypos, end)) CanCombineSameXtoY(ypos + 1, end) &&
!ReferencesYReg(xpos, ypos))
{ {
ReplaceXRegWithYReg(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; return true;
} }
} }
@ -13209,13 +13217,11 @@ bool NativeCodeBasicBlock::CombineSameXtoY(int xpos, int ypos, int end)
if (CanCombineSameXtoY(xpos, end)) if (CanCombineSameXtoY(xpos, end))
{ {
ReplaceXRegWithYReg(xpos, end); ReplaceXRegWithYReg(xpos, end);
#if 0
if (!(mIns[xpos].mLive & LIVE_CPU_REG_Z)) if (!(mIns[xpos].mLive & LIVE_CPU_REG_Z))
{ {
mIns[xpos].mType = ASMIT_NOP; mIns[xpos].mType = ASMIT_NOP;
mIns[xpos].mMode = ASMIM_IMPLIED; mIns[xpos].mMode = ASMIM_IMPLIED;
} }
#endif
return true; return true;
} }
} }
@ -13228,10 +13234,16 @@ bool NativeCodeBasicBlock::CombineSameYtoX(int xpos, int ypos, int end)
if (ypos < xpos) if (ypos < xpos)
{ {
if (CanCombineSameYtoX(ypos, xpos) && if (CanCombineSameYtoX(ypos, xpos) &&
CanCombineSameYtoX(xpos + 1, end)) CanCombineSameYtoX(xpos + 1, end) &&
!ReferencesXReg(ypos, xpos))
{ {
ReplaceYRegWithXReg(ypos, xpos); ReplaceYRegWithXReg(ypos, xpos);
ReplaceYRegWithXReg(xpos + 1, end); ReplaceYRegWithXReg(xpos + 1, end);
if (!(mIns[xpos].mLive & LIVE_CPU_REG_Z))
{
mIns[xpos].mType = ASMIT_NOP;
mIns[xpos].mMode = ASMIM_IMPLIED;
}
return true; return true;
} }
} }
@ -13240,13 +13252,11 @@ bool NativeCodeBasicBlock::CombineSameYtoX(int xpos, int ypos, int end)
if (CanCombineSameYtoX(ypos, end)) if (CanCombineSameYtoX(ypos, end))
{ {
ReplaceYRegWithXReg(ypos, end); ReplaceYRegWithXReg(ypos, end);
#if 0
if (!(mIns[ypos].mLive & LIVE_CPU_REG_Z)) if (!(mIns[ypos].mLive & LIVE_CPU_REG_Z))
{ {
mIns[ypos].mType = ASMIT_NOP; mIns[ypos].mType = ASMIT_NOP;
mIns[ypos].mMode = ASMIM_IMPLIED; mIns[ypos].mMode = ASMIM_IMPLIED;
} }
#endif
return true; return true;
} }
} }
@ -19554,7 +19564,9 @@ bool NativeCodeBasicBlock::BypassRegisterConditionBlock(void)
for (i = 0; i < cblock->mIns.Size(); i++) for (i = 0; i < cblock->mIns.Size(); i++)
cblock->mIns[i].mLive |= LIVE_CPU_REG_Y; 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(); CheckLive();
} }
} }
@ -23629,7 +23641,7 @@ bool NativeCodeBasicBlock::Propagate16BitHighSum(void)
for (int i = 0; i + 5 < mIns.Size(); i++) 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 + 1].mType == ASMIT_STA && mIns[i + 1].mMode == ASMIM_ZERO_PAGE &&
mIns[i + 2].mType == ASMIT_CLC && 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) && 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) &&
@ -27047,8 +27059,13 @@ bool NativeCodeBasicBlock::OptimizeSimpleLoopInvariant(NativeCodeProcedure* proc
{ {
if (!prevBlock) if (!prevBlock)
return OptimizeSimpleLoopInvariant(proc, full); 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; mIns[i + 1].mType = ASMIT_NOP; mIns[i + 1].mMode = ASMIM_IMPLIED;
} }
} }
@ -37410,7 +37427,7 @@ void NativeCodeProcedure::RebuildEntry(void)
void NativeCodeProcedure::Optimize(void) void NativeCodeProcedure::Optimize(void)
{ {
CheckFunc = !strcmp(mInterProc->mIdent->mString, "tile_draw_p"); CheckFunc = !strcmp(mInterProc->mIdent->mString, "main");
#if 1 #if 1
int step = 0; int step = 0;
@ -37536,8 +37553,9 @@ void NativeCodeProcedure::Optimize(void)
} while (changed); } while (changed);
#endif #endif
BuildDataFlowSets();
ResetVisited();
mEntryBlock->RemoveUnusedResultInstructions();
#if _DEBUG #if _DEBUG
ResetVisited(); ResetVisited();
@ -37569,7 +37587,6 @@ void NativeCodeProcedure::Optimize(void)
} }
} }
#if 1 #if 1
if (step == 3) if (step == 3)
{ {
@ -37601,6 +37618,7 @@ void NativeCodeProcedure::Optimize(void)
if (mEntryBlock->PropagateCommonSubExpression()) if (mEntryBlock->PropagateCommonSubExpression())
changed = true; changed = true;
} }
#if 1 #if 1
if (step > 0) if (step > 0)
{ {
@ -37900,10 +37918,18 @@ void NativeCodeProcedure::Optimize(void)
if (mEntryBlock->SimplifyDiamond(this)) if (mEntryBlock->SimplifyDiamond(this))
changed = true; changed = true;
#if _DEBUG
ResetVisited();
mEntryBlock->CheckBlocks();
#endif
ResetVisited(); ResetVisited();
if (mEntryBlock->SimplifyLoopEnd(this)) if (mEntryBlock->SimplifyLoopEnd(this))
changed = true; changed = true;
#if _DEBUG
ResetVisited();
mEntryBlock->CheckBlocks();
#endif
} }
#endif #endif
@ -38025,6 +38051,7 @@ void NativeCodeProcedure::Optimize(void)
else else
cnt++; cnt++;
} while (changed); } while (changed);
#if 1 #if 1
@ -38071,6 +38098,11 @@ void NativeCodeProcedure::Optimize(void)
} }
} }
BuildDataFlowSets();
ResetVisited();
if (mEntryBlock->RemoveUnusedResultInstructions())
changed = true;
#if _DEBUG #if _DEBUG
ResetVisited(); ResetVisited();
mEntryBlock->CheckBlocks(); mEntryBlock->CheckBlocks();

View File

@ -74,7 +74,7 @@ int main2(int argc, const char** argv)
#else #else
strcpy(strProductName, "oscar64"); strcpy(strProductName, "oscar64");
strcpy(strProductVersion, "1.17.189"); strcpy(strProductVersion, "1.17.190");
#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,17,189,0 FILEVERSION 1,17,190,0
PRODUCTVERSION 1,17,189,0 PRODUCTVERSION 1,17,190,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.17.189.0" VALUE "FileVersion", "1.17.190.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.17.189.0" VALUE "ProductVersion", "1.17.190.0"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

View File

@ -5066,15 +5066,15 @@
{ {
"Name" = "8:Microsoft Visual Studio" "Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:oscar64" "ProductName" = "8:oscar64"
"ProductCode" = "8:{85311ED7-CC4D-4512-840D-20C87C74DAC0}" "ProductCode" = "8:{CE09AF37-F5A2-455C-9AA1-8BAEAE79A777}"
"PackageCode" = "8:{9C4FC9E1-982E-42B2-B9D0-8D5984BC0B2B}" "PackageCode" = "8:{01E6782F-1F11-4C56-A8FA-B82388BF217B}"
"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.17.189" "ProductVersion" = "8:1.17.190"
"Manufacturer" = "8:oscar64" "Manufacturer" = "8:oscar64"
"ARPHELPTELEPHONE" = "8:" "ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:" "ARPHELPLINK" = "8:"