summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <orib@google.com>2013-02-01 15:05:59 -0500
committerOri Bernstein <orib@google.com>2013-02-01 15:05:59 -0500
commitb33ad4ba9ef23d2dbeec7fcd895d80c1c7d45026 (patch)
tree8e9cf94e0beb222cff83e4deb196b2cfba21f120
parentb8545d80c9f3e18e2357be1a44b69dc9ad914458 (diff)
downloadmc-b33ad4ba9ef23d2dbeec7fcd895d80c1c7d45026.tar.gz
Revert "Broke some tests, but now we do a better job of callee-save."
This reverts commit b8545d80c9f3e18e2357be1a44b69dc9ad914458. Breaking tests in the main branch is bad.
-rw-r--r--6/isel.c9
-rw-r--r--6/ra.c2
2 files changed, 8 insertions, 3 deletions
diff --git a/6/isel.c b/6/isel.c
index 0833e16..aa97bc0 100644
--- a/6/isel.c
+++ b/6/isel.c
@@ -781,7 +781,7 @@ static void prologue(Isel *s, size_t sz)
Loc *rsp;
Loc *rbp;
Loc *stksz;
- size_t i;
+ //size_t i;
rsp = locphysreg(Rrsp);
rbp = locphysreg(Rrbp);
@@ -790,11 +790,14 @@ static void prologue(Isel *s, size_t sz)
g(s, Ipush, rbp, NULL);
g(s, Imov, rsp, rbp, NULL);
g(s, Isub, stksz, rsp, NULL);
+#if 0
/* save registers */
for (i = 0; i < sizeof(savedregs)/sizeof(savedregs[0]); i++) {
s->calleesave[i] = locreg(ModeQ);
g(s, Imov, locphysreg(savedregs[i]), s->calleesave[i], NULL);
}
+#endif
+
s->stksz = stksz; /* need to update if we spill */
}
@@ -802,7 +805,7 @@ static void epilogue(Isel *s)
{
Loc *rsp, *rbp;
Loc *ret;
- size_t i;
+ //size_t i;
rsp = locphysreg(Rrsp);
rbp = locphysreg(Rrbp);
@@ -810,10 +813,12 @@ static void epilogue(Isel *s)
ret = loc(s, s->ret);
g(s, Imov, ret, coreg(Rax, ret->mode), NULL);
}
+#if 0
/* restore registers */
for (i = 0; i < Nsaved; i++)
g(s, Imov, s->calleesave[i], locphysreg(savedregs[i]), NULL);
/* leave function */
+#endif
g(s, Imov, rbp, rsp, NULL);
g(s, Ipop, rbp, NULL);
g(s, Iret, NULL);
diff --git a/6/ra.c b/6/ra.c
index ff8b679..6373b7d 100644
--- a/6/ra.c
+++ b/6/ra.c
@@ -562,7 +562,7 @@ static int combinable(Isel *s, regid u, regid v)
return 1;
/* if it is, are the adjacent nodes ok to combine with this? */
- for (t = 0; adjiter(s, v, &t); t++)
+ for (t = 0; adjiter(s, u, &t); t++)
if (!ok(s, t, u))
return 0;
return 1;