Skip to content

Commit

Permalink
Bump version number
Browse files Browse the repository at this point in the history
  • Loading branch information
drmortalwombat committed Nov 26, 2023
1 parent d5026ed commit 8fd560a
Show file tree
Hide file tree
Showing 5 changed files with 343 additions and 10 deletions.
76 changes: 74 additions & 2 deletions oscar64/NativeCodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1602,6 +1602,62 @@ bool NativeCodeInstruction::MayBeSameAddress(const NativeCodeInstruction& ins, b
return false;
}

bool NativeCodeInstruction::MayReference(const NativeCodeInstruction& ins, bool sameXY) const
{
if (!ins.ChangesAddress())
return false;

if (mMode == ASMIM_IMMEDIATE || mMode == ASMIM_IMMEDIATE_ADDRESS || mMode == ASMIM_IMPLIED)
return false;

if (mType == ASMIT_JSR)
{
if (ins.mMode == ASMIM_ZERO_PAGE)
return ReferencesZeroPage(ins.mAddress);
else
return true;
}

if (ins.mMode == ASMIM_ZERO_PAGE)
return ReferencesZeroPage(ins.mAddress);
else if (mMode == ASMIM_ZERO_PAGE)
return false;
else if (mMode == ASMIM_ABSOLUTE)
{
if (ins.mMode == ASMIM_ABSOLUTE)
return mLinkerObject == ins.mLinkerObject && mAddress == ins.mAddress;
else if (ins.mMode == ASMIM_ABSOLUTE_X || ins.mMode == ASMIM_ABSOLUTE_Y)
return mLinkerObject == ins.mLinkerObject;
else if (ins.mMode == ASMIM_INDIRECT_Y || ins.mMode == ASMIM_INDIRECT_X)
return ins.mAddress != BC_REG_STACK;
else
return false;
}
else if (mMode == ASMIM_ABSOLUTE_X || mMode == ASMIM_ABSOLUTE_Y)
{
if (ins.mMode == ASMIM_ABSOLUTE || ins.mMode == ASMIM_ABSOLUTE_X || ins.mMode == ASMIM_ABSOLUTE_Y)
{
if (mLinkerObject != ins.mLinkerObject)
return false;
else
return mMode != ins.mMode || !sameXY || mAddress == ins.mAddress;
}
else if (ins.mMode == ASMIM_INDIRECT_Y || ins.mMode == ASMIM_INDIRECT_X)
return ins.mAddress != BC_REG_STACK;
else
return false;
}
else if (mMode == ASMIM_INDIRECT_Y || mMode == ASMIM_INDIRECT_X)
{
if (ins.mMode == ASMIM_ABSOLUTE || ins.mMode == ASMIM_ABSOLUTE_X || ins.mMode == ASMIM_ABSOLUTE_Y)
return mAddress != BC_REG_STACK;
else
return ins.mMode == ASMIM_INDIRECT_Y || ins.mMode == ASMIM_INDIRECT_X;
}
else
return false;
}

bool NativeCodeInstruction::MayBeChangedOnAddress(const NativeCodeInstruction& ins, bool sameXY) const
{
if (mMode == ASMIM_IMMEDIATE || mMode == ASMIM_IMMEDIATE_ADDRESS)
Expand Down Expand Up @@ -3718,6 +3774,20 @@ bool NativeCodeInstruction::ValueForwarding(NativeRegisterDataSet& data, AsmInsT
mMode = ASMIM_IMPLIED;
changed = true;
}
else if (final && data.mRegs[CPU_REG_A].mMode == NRDM_IMMEDIATE && data.mRegs[mAddress].mMode == NRDM_IMMEDIATE &&
data.mRegs[mAddress].mValue == ((data.mRegs[CPU_REG_A].mValue - 1) & 255))
{
mType = ASMIT_INC;
data.mRegs[mAddress].mValue = data.mRegs[CPU_REG_A].mValue;
changed = true;
}
else if (final && data.mRegs[CPU_REG_A].mMode == NRDM_IMMEDIATE && data.mRegs[mAddress].mMode == NRDM_IMMEDIATE &&
data.mRegs[mAddress].mValue == ((data.mRegs[CPU_REG_A].mValue + 1) & 255))
{
mType = ASMIT_DEC;
data.mRegs[mAddress].mValue = data.mRegs[CPU_REG_A].mValue;
changed = true;
}
else
{
data.ResetZeroPage(mAddress);
Expand Down Expand Up @@ -22149,7 +22219,8 @@ bool NativeCodeBasicBlock::MayBeMovedBeforeBlock(int start, int end)

for (int j = start; j < end; j++)
{
if (mIns[i].MayBeChangedOnAddress(mIns[j]) || mIns[j].MayBeChangedOnAddress(mIns[i]))
if (mIns[i].MayBeChangedOnAddress(mIns[j]) || mIns[j].MayBeChangedOnAddress(mIns[i]) ||
mIns[i].MayReference(mIns[j]) || mIns[j].MayReference(mIns[i]))
return false;
}
}
Expand Down Expand Up @@ -43193,7 +43264,7 @@ void NativeCodeProcedure::Compile(InterCodeProcedure* proc)
{
mInterProc = proc;

CheckFunc = !strcmp(mInterProc->mIdent->mString, "format_expression");
CheckFunc = !strcmp(mInterProc->mIdent->mString, "board_draw_item");

int nblocks = proc->mBlocks.Size();
tblocks = new NativeCodeBasicBlock * [nblocks];
Expand Down Expand Up @@ -44613,6 +44684,7 @@ void NativeCodeProcedure::Optimize(void)
else
cnt++;


} while (changed);

#if 1
Expand Down
1 change: 1 addition & 0 deletions oscar64/NativeCodeGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ class NativeCodeInstruction
bool UsesMemoryOf(const NativeCodeInstruction& ins) const;
bool SameEffectiveAddress(const NativeCodeInstruction& ins) const;
bool MayBeChangedOnAddress(const NativeCodeInstruction& ins, bool sameXY = false) const;
bool MayReference(const NativeCodeInstruction& ins, bool sameXY = false) const;
bool MayBeSameAddress(const NativeCodeInstruction& ins, bool sameXY = false) const;
bool IsSame(const NativeCodeInstruction& ins) const;
bool IsSameLS(const NativeCodeInstruction& ins) const;
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.26.226");
strcpy(strProductVersion, "1.26.227");

#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,26,226,0
PRODUCTVERSION 1,26,226,0
FILEVERSION 1,26,227,0
PRODUCTVERSION 1,26,227,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.26.226.0"
VALUE "FileVersion", "1.26.227.0"
VALUE "InternalName", "oscar64.exe"
VALUE "LegalCopyright", "Copyright (C) 2021"
VALUE "OriginalFilename", "oscar64.exe"
VALUE "ProductName", "oscar64"
VALUE "ProductVersion", "1.26.226.0"
VALUE "ProductVersion", "1.26.227.0"
END
END
BLOCK "VarFileInfo"
Expand Down
Loading

0 comments on commit 8fd560a

Please sign in to comment.