changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: 8c, 6c: LEA x, R; MOV (R), R -> MOV x, R

changeset 7298: 1d4da8ed4cb1
parent 7297: 3b23784f9e2f
child 7299: 2c3cb67101c4
author: cinap_lenrek@felloff.net
date: Mon, 24 Jun 2019 19:38:46 +0200
files: sys/src/cmd/6c/peep.c sys/src/cmd/8c/peep.c
description: 8c, 6c: LEA x, R; MOV (R), R -> MOV x, R
     1.1--- a/sys/src/cmd/6c/peep.c
     1.2+++ b/sys/src/cmd/6c/peep.c
     1.3@@ -170,6 +170,24 @@ loop1:
     1.4 			}
     1.5 			break;
     1.6 
     1.7+		case ALEAQ:
     1.8+			if(regtyp(&p->to)) {
     1.9+				r1 = rnops(uniqs(r));
    1.10+				if(r1 != R){
    1.11+					p1 = r1->prog;
    1.12+					if((p1->as == AMOVL || p1->as == AMOVQ)
    1.13+					&& p1->to.type == p->to.type
    1.14+					&& p1->from.type-D_INDIR == p->to.type
    1.15+					&& p1->from.index == D_NONE
    1.16+					&& p1->from.offset == 0){
    1.17+						p->as = p1->as;
    1.18+						excise(r1);
    1.19+						t++;
    1.20+					}
    1.21+				}
    1.22+			}
    1.23+			break;
    1.24+
    1.25 		case AADDL:
    1.26 		case AADDQ:
    1.27 		case AADDW:
     2.1--- a/sys/src/cmd/8c/peep.c
     2.2+++ b/sys/src/cmd/8c/peep.c
     2.3@@ -99,6 +99,25 @@ loop1:
     2.4 				}
     2.5 			}
     2.6 			break;
     2.7+
     2.8+		case ALEAL:
     2.9+			if(regtyp(&p->to)) {
    2.10+				r1 = uniqs(r);
    2.11+				if(r1 != R){
    2.12+					p1 = r1->prog;
    2.13+					if(p1->as == AMOVL
    2.14+					&& p1->to.type == p->to.type
    2.15+					&& p1->from.type-D_INDIR == p->to.type
    2.16+					&& p1->from.index == D_NONE
    2.17+					&& p1->from.offset == 0){
    2.18+						p->as = p1->as;
    2.19+						excise(r1);
    2.20+						t++;
    2.21+					}
    2.22+				}
    2.23+			}
    2.24+			break;
    2.25+
    2.26 		case AADDL:
    2.27 		case AADDW:
    2.28 			if(p->from.type != D_CONST || needc(p->link))