summaryrefslogtreecommitdiff
path: root/sys/src/cmd/8c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2019-06-24 19:38:46 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2019-06-24 19:38:46 +0200
commit4cffc0436451cb192fb041a4b2be6fa8db5eda8e (patch)
treedbbf4444189c7a34a203e01256b026d74aea7508 /sys/src/cmd/8c
parent345714dd56f5da8dcb2193f9cdf041cfc005d82f (diff)
8c, 6c: LEA x, R; MOV (R), R -> MOV x, R
Diffstat (limited to 'sys/src/cmd/8c')
-rw-r--r--sys/src/cmd/8c/peep.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/src/cmd/8c/peep.c b/sys/src/cmd/8c/peep.c
index 482f17a65..439adbc4f 100644
--- a/sys/src/cmd/8c/peep.c
+++ b/sys/src/cmd/8c/peep.c
@@ -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))