summaryrefslogtreecommitdiff
path: root/src/cmd/5g/reg.c
diff options
context:
space:
mode:
authorTianon Gravi <admwiggin@gmail.com>2015-01-15 11:54:00 -0700
committerTianon Gravi <admwiggin@gmail.com>2015-01-15 11:54:00 -0700
commitf154da9e12608589e8d5f0508f908a0c3e88a1bb (patch)
treef8255d51e10c6f1e0ed69702200b966c9556a431 /src/cmd/5g/reg.c
parent8d8329ed5dfb9622c82a9fbec6fd99a580f9c9f6 (diff)
downloadgolang-upstream/1.4.tar.gz
Imported Upstream version 1.4upstream/1.4
Diffstat (limited to 'src/cmd/5g/reg.c')
-rw-r--r--src/cmd/5g/reg.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/cmd/5g/reg.c b/src/cmd/5g/reg.c
index 4762df506..b78c268df 100644
--- a/src/cmd/5g/reg.c
+++ b/src/cmd/5g/reg.c
@@ -36,6 +36,11 @@
#define NREGVAR 32
#define REGBITS ((uint32)0xffffffff)
+/*c2go enum {
+ NREGVAR = 32,
+ REGBITS = 0xffffffff,
+};
+*/
void addsplits(void);
static Reg* firstr;
@@ -194,7 +199,7 @@ regopt(Prog *firstp)
proginfo(&info, p);
// Avoid making variables for direct-called functions.
- if(p->as == ABL && p->to.type == D_EXTERN)
+ if(p->as == ABL && p->to.name == D_EXTERN)
continue;
bit = mkvar(r, &p->from);
@@ -222,6 +227,10 @@ regopt(Prog *firstp)
for(z=0; z<BITS; z++)
r->set.b[z] |= bit.b[z];
}
+
+ /* the mod/div runtime routines smash R12 */
+ if(p->as == ADIV || p->as == ADIVU || p->as == AMOD || p->as == AMODU)
+ r->set.b[0] |= RtoB(12);
}
if(firstr == R)
return;
@@ -1306,6 +1315,7 @@ void
addreg(Adr *a, int rn)
{
a->sym = nil;
+ a->node = nil;
a->name = D_NONE;
a->type = D_REG;
a->reg = rn;