Made optimization steps aware of long branches better.

This commit is contained in:
acqn 2020-09-18 20:23:02 +08:00 committed by Oliver Schmidt
parent 2fcd8b934a
commit 07cc6a3d20
3 changed files with 8 additions and 3 deletions

View File

@ -944,7 +944,9 @@ unsigned OptCmp9 (CodeSeg* S)
if (L[0]->OPC == OP65_SBC &&
CS_GetEntries (S, L+1, I+1, 4) &&
(L[1]->OPC == OP65_BVC ||
L[1]->OPC == OP65_BVS) &&
L[1]->OPC == OP65_BVS ||
L[1]->OPC == OP65_JVC ||
L[1]->OPC == OP65_JVS) &&
L[1]->JumpTo != 0 &&
L[1]->JumpTo->Owner == L[3] &&
L[2]->OPC == OP65_EOR &&

View File

@ -988,7 +988,7 @@ unsigned OptPtrLoad12 (CodeSeg* S)
L[4]->OPC == OP65_CLC &&
L[5]->OPC == OP65_ADC &&
CE_IsKnownImm (L[5], 1) &&
L[6]->OPC == OP65_BCC &&
(L[6]->OPC == OP65_BCC || L[6]->OPC == OP65_JCC) &&
L[6]->JumpTo != 0 &&
L[6]->JumpTo->Owner == L[8] &&
L[7]->OPC == OP65_INX &&

View File

@ -341,7 +341,10 @@ unsigned OptShift2 (CodeSeg* S)
L[0] = CS_GetEntry (S, I);
/* Check for the sequence */
if ((L[0]->OPC == OP65_BPL || L[0]->OPC == OP65_BCC) &&
if ((L[0]->OPC == OP65_BPL ||
L[0]->OPC == OP65_BCC ||
L[0]->OPC == OP65_JPL ||
L[0]->OPC == OP65_JCC) &&
L[0]->JumpTo != 0 &&
CS_GetEntries (S, L+1, I+1, 3) &&
L[1]->OPC == OP65_DEX &&