diff options
author | David du Colombier <0intro@gmail.com> | 2014-11-16 22:55:07 +0100 |
---|---|---|
committer | David du Colombier <0intro@gmail.com> | 2014-11-16 22:55:07 +0100 |
commit | f0d3ce1441606e5694c49255c7d702acc28d3cc0 (patch) | |
tree | 92c7f792ae65bf7a912b3730cf50661d32c3e936 /src/cmd | |
parent | 5012c68de6a62a5adb006f2820a4435c9c349efc (diff) | |
download | go-f0d3ce1441606e5694c49255c7d702acc28d3cc0.tar.gz |
[dev.cc] cmd/8g: work around "out of fixed registers" on Plan 9
This change works around the "out of fixed registers"
issue with the Plan 9 C compiler on 386, introduced by
the Bits change to uint64 in CL 169060043.
The purpose of this CL is to be able to properly
follow the conversion of the Plan 9 runtime to Go
on the Plan 9 builders.
This CL could be reverted once the Go compilers will
be converted to Go.
Thanks to Nick Owens for investigating this issue.
LGTM=rsc
R=rsc
CC=austin, golang-codereviews, mischief
https://codereview.appspot.com/177860043
Diffstat (limited to 'src/cmd')
-rw-r--r-- | src/cmd/8g/reg.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/cmd/8g/reg.c b/src/cmd/8g/reg.c index 79d60bed5..aa39dbd43 100644 --- a/src/cmd/8g/reg.c +++ b/src/cmd/8g/reg.c @@ -926,7 +926,7 @@ paint1(Reg *r, int bn) Reg *r1; Prog *p; int z; - uint64 bb; + uint64 bb, rbz; z = bn/64; bb = 1LL<<(bn%64); @@ -945,7 +945,8 @@ paint1(Reg *r, int bn) r = r1; } - if(LOAD(r) & ~(r->set.b[z]&~(r->use1.b[z]|r->use2.b[z])) & bb) { + rbz = ~(r->set.b[z]&~(r->use1.b[z]|r->use2.b[z])); + if(LOAD(r) & rbz & bb) { change -= CLOAD * r->f.loop; } for(;;) { @@ -1053,7 +1054,7 @@ paint3(Reg *r, int bn, uint32 rb, int rn) Reg *r1; Prog *p; int z; - uint64 bb; + uint64 bb, rbz; z = bn/64; bb = 1LL << (bn%64); @@ -1072,7 +1073,8 @@ paint3(Reg *r, int bn, uint32 rb, int rn) r = r1; } - if(LOAD(r) & ~(r->set.b[z] & ~(r->use1.b[z]|r->use2.b[z])) & bb) + rbz = ~(r->set.b[z] & ~(r->use1.b[z]|r->use2.b[z])); + if(LOAD(r) & rbz & bb) addmove(r, bn, rn, 0); for(;;) { r->act.b[z] |= bb; |