diff options
| author | Keith Randall <khr@golang.org> | 2015-06-06 16:03:33 -0700 |
|---|---|---|
| committer | Keith Randall <khr@golang.org> | 2015-06-08 21:02:03 +0000 |
| commit | 0dca7351e9d51bdaf980e1256ec41af8cb1b9747 (patch) | |
| tree | 82553209d0f920fa55e54bc6a066c96c749ea3df /src/cmd/compile/internal/ssa/stackalloc.go | |
| parent | 6241a41e33fb1dcfb36f86b0578592219a36d443 (diff) | |
| download | go-0dca7351e9d51bdaf980e1256ec41af8cb1b9747.tar.xz | |
[dev.ssa] cmd/compile/internal/ssa: autogenerate opcodes
Revamp autogeneration. Get rid of gogenerate commands, they are more
trouble than they are worth. (If the code won't compile, gogenerate
doesn't work.)
Generate opcode enums & tables. This means we only have to specify
opcodes in one place instead of two.
Add arch prefixes to opcodes so they will be globally unique.
Change-Id: I175d0a89b701b2377bbe699f3756731b7c9f5a9f
Reviewed-on: https://go-review.googlesource.com/10812
Reviewed-by: Alan Donovan <adonovan@google.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/stackalloc.go')
| -rw-r--r-- | src/cmd/compile/internal/ssa/stackalloc.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/cmd/compile/internal/ssa/stackalloc.go b/src/cmd/compile/internal/ssa/stackalloc.go index dd55d96ccc..a4ce343b5d 100644 --- a/src/cmd/compile/internal/ssa/stackalloc.go +++ b/src/cmd/compile/internal/ssa/stackalloc.go @@ -91,12 +91,12 @@ func stackalloc(f *Func) { } // TODO: do this with arch-specific rewrite rules somehow? switch v.Op { - case OpADDQ: + case OpAMD64ADDQ: // (ADDQ (FP) x) -> (LEAQ [n] (SP) x) - v.Op = OpLEAQ + v.Op = OpAMD64LEAQ v.Aux = n - case OpLEAQ, OpMOVQload, OpMOVQstore, OpMOVBload, OpMOVQloadidx8: - if v.Op == OpMOVQloadidx8 && i == 1 { + case OpAMD64LEAQ, OpAMD64MOVQload, OpAMD64MOVQstore, OpAMD64MOVBload, OpAMD64MOVQloadidx8: + if v.Op == OpAMD64MOVQloadidx8 && i == 1 { // Note: we could do it, but it is probably an error log.Panicf("can't do FP->SP adjust on index slot of load %s", v.Op) } @@ -104,6 +104,7 @@ func stackalloc(f *Func) { v.Aux = addOffset(v.Aux.(int64), n) default: log.Panicf("can't do FP->SP adjust on %s", v.Op) + // TODO: OpCopy -> ADDQ } } } |
