1
0
mirror of https://github.com/cc65/cc65.git synced 2024-07-05 21:29:03 +00:00

Adjust several optimizer information pieces

git-svn-id: svn://svn.cc65.org/cc65/trunk@667 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2001-03-24 16:28:18 +00:00
parent d1530bc0a2
commit 4ab743143b

View File

@ -144,6 +144,7 @@ static const struct {
{ "\tjsr\tbool", 0, REG_NONE, REG_AX },
{ "\tjsr\tdecaxy", 1, REG_ALL, REG_AX },
{ "\tjsr\tdecax", 0, REG_AX, REG_AX },
{ "\tjsr\tdecsp", 0, REG_NONE, REG_A },
{ "\tjsr\tldax0sp", 1, REG_Y, REG_AX },
{ "\tjsr\tldaxysp", 1, REG_Y, REG_AX },
{ "\tjsr\tpusha", 1, REG_A, REG_Y },
@ -4027,6 +4028,9 @@ static Line* OptOneBlock (Line* L)
} else if (LineFullMatch (L, "\tjsr\tdeceaxy")) {
/* We know about this function */
A = X = -1;
} else if (LineMatch (L, "\tjsr\tdecsp") && IsDigit (L->Line[10])) {
/* We know about this function */
A = -1;
} else if (LineFullMatch (L, "\tjsr\tincax1")) {
/* We know about this function */
A = X = -1;
@ -4126,6 +4130,9 @@ static Line* OptOneBlock (Line* L)
A = 0;
X = 0;
Y = 1;
} else if (LineFullMatch (L, "\tjsr\tpush0ax")) {
/* We know about this function */
Y = 0;
} else if (LineFullMatch (L, "\tjsr\tpush1")) {
/* We know about this function */
A = 1;
@ -4161,7 +4168,7 @@ static Line* OptOneBlock (Line* L)
A = 7;
X = 0;
Y = 1;
} else if (CPU == CPU_65C02 && LineFullMatch (L, "\tjsr\tpusha")) {
} else if (CPU != CPU_65C02 && LineFullMatch (L, "\tjsr\tpusha")) {
/* We know about this function */
Y = 0;
} else if (LineFullMatch (L, "\tjsr\tpusha0")) {
@ -4173,11 +4180,11 @@ static Line* OptOneBlock (Line* L)
L = ReplaceLine (L, "\tjsr\tpushax");
}
X = 0;
Y = 1;
Y = 0;
} else if (LineFullMatch (L, "\tjsr\tpushax")) {
/* We know about this function */
Y = 1;
} else if (LineFullMatch (L, "\tjsr\tpushaysp")) {
Y = 0;
} else if (CPU != CPU_65C02 && LineFullMatch (L, "\tjsr\tpushaysp")) {
/* We know about this function */
A = -1;
Y = 0;
@ -4193,6 +4200,9 @@ static Line* OptOneBlock (Line* L)
/* We know about this function */
A = 2;
Y = 0;
} else if (LineFullMatch (L, "\tjsr\tpusheax")) {
/* We know about this function */
Y = 0;
} else if (LineFullMatch (L, "\tjsr\tpushw")) {
/* We know about this function (calls pushax) */
A = X = -1;
@ -4253,6 +4263,9 @@ static Line* OptOneBlock (Line* L)
/* We know about this function */
A = X = -1;
INC (Y, 1);
} else if (LineFullMatch (L, "\tjsr\tsubysp")) {
/* We know about this function */
A = -1;
} else if (LineFullMatch (L, "\tjsr\ttosadda0")) {
/* We know about this function */
A = X = -1;