Commit f285537b authored by Shenghou Ma's avatar Shenghou Ma Committed by Russ Cox

[dev.power64] cmd/9g: do not ignore move instructions even if from and to are samaddr()

Those moves might be significant (e.g. narrowing or widening): on Power64,
we don't distinguish between MOVWD and MOVW.

This fixes divmode.go and bug447.go.

LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/125200043
parent b6d6eb21
...@@ -62,7 +62,6 @@ vlong fieldoffset(Type*, Node*); ...@@ -62,7 +62,6 @@ vlong fieldoffset(Type*, Node*);
void sgen(Node*, Node*, int64); void sgen(Node*, Node*, int64);
void gmove(Node*, Node*); void gmove(Node*, Node*);
Prog* gins(int, Node*, Node*); Prog* gins(int, Node*, Node*);
int samaddr(Node*, Node*);
void naddr(Node*, Addr*, int); void naddr(Node*, Addr*, int);
void cgen_aret(Node*, Node*); void cgen_aret(Node*, Node*);
int componentgen(Node*, Node*); int componentgen(Node*, Node*);
......
...@@ -1006,21 +1006,6 @@ hard: ...@@ -1006,21 +1006,6 @@ hard:
return; return;
} }
int
samaddr(Node *f, Node *t)
{
if(f->op != t->op)
return 0;
switch(f->op) {
case OREGISTER:
if(f->val.u.reg != t->val.u.reg)
break;
return 1;
}
return 0;
}
/* /*
* generate one instruction: * generate one instruction:
* as f, t * as f, t
...@@ -1032,16 +1017,6 @@ gins(int as, Node *f, Node *t) ...@@ -1032,16 +1017,6 @@ gins(int as, Node *f, Node *t)
Prog *p; Prog *p;
Addr af, at; Addr af, at;
switch(as) {
case AMOVW:
case AMOVD:
case AFMOVS:
case AFMOVD:
if(f != N && t != N && samaddr(f, t))
return nil;
break;
}
memset(&af, 0, sizeof af); memset(&af, 0, sizeof af);
memset(&at, 0, sizeof at); memset(&at, 0, sizeof at);
if(f != N) if(f != N)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment