1
0
mirror of https://github.com/golang/go synced 2024-11-25 02:17:57 -07:00

cgen64: dont use MVN instruction

R=r
CC=golang-dev
https://golang.org/cl/4154043
This commit is contained in:
Ken Thompson 2011-02-08 17:30:23 -08:00
parent dc331e6565
commit 5080d7617a
2 changed files with 24 additions and 20 deletions

View File

@ -64,17 +64,21 @@ cgen64(Node *n, Node *res)
return; return;
case OCOM: case OCOM:
regalloc(&t1, lo1.type, N);
gmove(ncon(-1), &t1);
split64(res, &lo2, &hi2); split64(res, &lo2, &hi2);
regalloc(&n1, lo1.type, N); regalloc(&n1, lo1.type, N);
gins(AMOVW, &lo1, &n1); gins(AMOVW, &lo1, &n1);
gins(AMVN, &n1, &n1); gins(AEOR, &t1, &n1);
gins(AMOVW, &n1, &lo2); gins(AMOVW, &n1, &lo2);
gins(AMOVW, &hi1, &n1); gins(AMOVW, &hi1, &n1);
gins(AMVN, &n1, &n1); gins(AEOR, &t1, &n1);
gins(AMOVW, &n1, &hi2); gins(AMOVW, &n1, &hi2);
regfree(&t1);
regfree(&n1); regfree(&n1);
splitclean(); splitclean();
splitclean(); splitclean();

View File

@ -133,20 +133,20 @@ loop1:
switch(p->as) { switch(p->as) {
default: default:
continue; continue;
case AEOR: // case AEOR:
/* // /*
* EOR -1,x,y => MVN x,y // * EOR -1,x,y => MVN x,y
*/ // */
if(isdconst(&p->from) && p->from.offset == -1) { // if(isdconst(&p->from) && p->from.offset == -1) {
p->as = AMVN; // p->as = AMVN;
p->from.type = D_REG; // p->from.type = D_REG;
if(p->reg != NREG) // if(p->reg != NREG)
p->from.reg = p->reg; // p->from.reg = p->reg;
else // else
p->from.reg = p->to.reg; // p->from.reg = p->to.reg;
p->reg = NREG; // p->reg = NREG;
} // }
continue; // continue;
case AMOVH: case AMOVH:
case AMOVHU: case AMOVHU:
case AMOVB: case AMOVB:
@ -337,7 +337,7 @@ subprop(Reg *r0)
case AMULLU: case AMULLU:
case AMULA: case AMULA:
case AMVN: // case AMVN:
case ACMN: case ACMN:
case AADD: case AADD:
@ -666,7 +666,7 @@ shiftprop(Reg *r)
FAIL("can't swap"); FAIL("can't swap");
if(p1->reg == NREG && p1->to.reg == n) if(p1->reg == NREG && p1->to.reg == n)
FAIL("shift result used twice"); FAIL("shift result used twice");
case AMVN: // case AMVN:
if(p1->from.type == D_SHIFT) if(p1->from.type == D_SHIFT)
FAIL("shift result used in shift"); FAIL("shift result used in shift");
if(p1->from.type != D_REG || p1->from.reg != n) if(p1->from.type != D_REG || p1->from.reg != n)
@ -1018,7 +1018,7 @@ copyu(Prog *p, Adr *v, Adr *s)
case AMULLU: /* read, read, write, write */ case AMULLU: /* read, read, write, write */
case AMULA: case AMULA:
case AMVN: // case AMVN:
return 2; return 2;
case AADD: /* read, read, write */ case AADD: /* read, read, write */
@ -1176,7 +1176,7 @@ a2type(Prog *p)
case AORR: case AORR:
case AAND: case AAND:
case AEOR: case AEOR:
case AMVN: // case AMVN:
case AMUL: case AMUL:
case AMULU: case AMULU:
case ADIV: case ADIV: