8c, 6c: LEA x, R; MOV (R), R -> MOV x, R

This commit is contained in:
cinap_lenrek 2019-06-24 19:38:46 +02:00
parent 345714dd56
commit 4cffc04364
2 changed files with 37 additions and 0 deletions

View file

@ -170,6 +170,24 @@ loop1:
}
break;
case ALEAQ:
if(regtyp(&p->to)) {
r1 = rnops(uniqs(r));
if(r1 != R){
p1 = r1->prog;
if((p1->as == AMOVL || p1->as == AMOVQ)
&& p1->to.type == p->to.type
&& p1->from.type-D_INDIR == p->to.type
&& p1->from.index == D_NONE
&& p1->from.offset == 0){
p->as = p1->as;
excise(r1);
t++;
}
}
}
break;
case AADDL:
case AADDQ:
case AADDW:

View file

@ -99,6 +99,25 @@ loop1:
}
}
break;
case ALEAL:
if(regtyp(&p->to)) {
r1 = uniqs(r);
if(r1 != R){
p1 = r1->prog;
if(p1->as == AMOVL
&& p1->to.type == p->to.type
&& p1->from.type-D_INDIR == p->to.type
&& p1->from.index == D_NONE
&& p1->from.offset == 0){
p->as = p1->as;
excise(r1);
t++;
}
}
}
break;
case AADDL:
case AADDW:
if(p->from.type != D_CONST || needc(p->link))