[dev.ssa] cmd/internal/gc: Generate code from ssa form

After the ssa compiler finishes, extract a cmd/internal/obj program
from the result.

Can compile and run iterative Fibonacci.  The code is awful, but it runs.

Change-Id: I19fa27ffe69863950a8cb594f33a5e9a671a7663
Reviewed-on: https://go-review.googlesource.com/9971
Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
Keith Randall 2015-05-12 11:06:44 -07:00
parent 310d09bf73
commit 083a646f63
5 changed files with 291 additions and 24 deletions

View file

@ -35,6 +35,12 @@ func stackalloc(f *Func) {
if v.Type.IsMemory() { // TODO: only "regallocable" types
continue
}
if v.Op == OpConst {
// don't allocate space for OpConsts. They should
// have been rematerialized everywhere.
// TODO: is this the right thing to do?
continue
}
// a := v.Type.Align()
// n = (n + a - 1) / a * a TODO
n += v.Type.Size()