summaryrefslogtreecommitdiff
path: root/sys/src/cmd/6c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2015-03-17 16:12:01 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2015-03-17 16:12:01 +0100
commitf5f9ecdcfa0b27f5971509137d77a5155b4b507d (patch)
tree064c56886094d7a4361679e9af90419b35d3d465 /sys/src/cmd/6c
parent972cd5e3fc96059548b725ed01704ae88c55e1b4 (diff)
6c: MOVL xxx, r; MOVLQZX r, r -> MOVL xxx, r
eleminate MOVLQXZ instructions after MOVL as MOVL implicitely zero extends the result.
Diffstat (limited to 'sys/src/cmd/6c')
-rw-r--r--sys/src/cmd/6c/peep.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/sys/src/cmd/6c/peep.c b/sys/src/cmd/6c/peep.c
index 64f13b771..7096ce958 100644
--- a/sys/src/cmd/6c/peep.c
+++ b/sys/src/cmd/6c/peep.c
@@ -100,15 +100,28 @@ loop1:
case AMOVQ:
case AMOVSS:
case AMOVSD:
- if(regtyp(&p->to))
+ if(!regtyp(&p->to))
+ break;
if(regtyp(&p->from)) {
if(copyprop(r)) {
excise(r);
t++;
- } else
+ break;
+ }
if(subprop(r) && copyprop(r)) {
excise(r);
t++;
+ break;
+ }
+ }
+ if(p->as != AMOVL)
+ break;
+ r1 = rnops(uniqs(r));
+ if(r1 != R){
+ p1 = r1->prog;
+ if(p1->as == AMOVLQZX && p1->from.type == p->to.type && p1->to.type == p->to.type){
+ excise(r1);
+ t++;
}
}
break;