1
0
mirror of https://github.com/cc65/cc65.git synced 2024-07-09 01:28:58 +00:00

Use 125 bytes as range for short branches

git-svn-id: svn://svn.cc65.org/cc65/trunk@1062 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2001-10-18 19:24:18 +00:00
parent 21c6e1badb
commit b4393c9ac6

View File

@ -970,7 +970,6 @@ unsigned OptStoreLoad (CodeSeg* S)
if ((E->Info & OF_STORE) != 0 &&
(N = CS_GetNextEntry (S, I)) != 0 &&
!CE_HasLabel (N) &&
(N->Info & OF_LOAD) != 0 &&
E->AM == N->AM &&
((E->OPC == OP65_STA && N->OPC == OP65_LDA) ||
(E->OPC == OP65_STX && N->OPC == OP65_LDX) ||
@ -979,7 +978,7 @@ unsigned OptStoreLoad (CodeSeg* S)
(X = CS_GetNextEntry (S, I+1)) != 0 &&
(X->Info & OF_FBRA) == 0) {
/* Register value is not used, remove the load */
/* Register has already the correct value, remove the load */
CS_DelEntry (S, I+1);
/* Remember, we had changes */
@ -1118,11 +1117,11 @@ unsigned OptBranchDist (CodeSeg* S)
}
/* Make the branch short/long according to distance */
if ((E->Info & OF_LBRA) == 0 && Distance > 120) {
if ((E->Info & OF_LBRA) == 0 && Distance > 125) {
/* Short branch but long distance */
CE_ReplaceOPC (E, MakeLongBranch (E->OPC));
++Changes;
} else if ((E->Info & OF_LBRA) != 0 && Distance < 120) {
} else if ((E->Info & OF_LBRA) != 0 && Distance < 125) {
/* Long branch but short distance */
CE_ReplaceOPC (E, MakeShortBranch (E->OPC));
++Changes;