Commit ee7c64ef authored by Russ Cox's avatar Russ Cox

8c: only refer to extern register variables in MOVL instructions

R=ken2
https://golang.org/cl/183136
parent 616394b1
...@@ -55,6 +55,12 @@ cgen(Node *n, Node *nn) ...@@ -55,6 +55,12 @@ cgen(Node *n, Node *nn)
l = n->left; l = n->left;
r = n->right; r = n->right;
o = n->op; o = n->op;
if(n->op == OEXREG || (nn != Z && nn->op == OEXREG)) {
gmove(n, nn);
return;
}
if(n->addable >= INDEXED) { if(n->addable >= INDEXED) {
if(nn == Z) { if(nn == Z) {
switch(o) { switch(o) {
......
...@@ -98,6 +98,7 @@ indexshift(Node *n) ...@@ -98,6 +98,7 @@ indexshift(Node *n)
* (20) * (X) ==> 7 multiplier in indexing * (20) * (X) ==> 7 multiplier in indexing
* (X,7) + (13,1) ==> 8 adder in indexing (addresses) * (X,7) + (13,1) ==> 8 adder in indexing (addresses)
* (8) ==> &9(OINDEX) index, almost addressable * (8) ==> &9(OINDEX) index, almost addressable
* 100 extern register
* *
* calculate complexity (number of registers) * calculate complexity (number of registers)
*/ */
...@@ -125,7 +126,7 @@ xcom(Node *n) ...@@ -125,7 +126,7 @@ xcom(Node *n)
break; break;
case OEXREG: case OEXREG:
n->addable = 10; n->addable = 0;
break; break;
case OREGISTER: case OREGISTER:
......
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