mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.ssa] cmd/compile/internal/ssa: Fix bootstrap of ssa codegen
The cmd/compile/internal/ssa/gen directory can't depend on cmd/internal/gc because that package doesn't exist in go1.4. Use strings instead of constants from that package. The asm fields seem somewhat redundant to the opcode names we conventionally use. Maybe we can just trim the lowercase from the end of the op name? At least by default? Change-Id: I96e8cda44833763951709e2721588fbd34580989 Reviewed-on: https://go-review.googlesource.com/11129 Reviewed-by: Michael Matloob <michaelmatloob@gmail.com>
This commit is contained in:
parent
703ef06039
commit
50ceef26e6
3 changed files with 33 additions and 34 deletions
|
|
@ -9,8 +9,6 @@ package main
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"cmd/internal/obj"
|
||||
"cmd/internal/obj/x86"
|
||||
"fmt"
|
||||
"go/format"
|
||||
"io/ioutil"
|
||||
|
|
@ -27,7 +25,7 @@ type arch struct {
|
|||
type opData struct {
|
||||
name string
|
||||
reg regInfo
|
||||
asm int16
|
||||
asm string
|
||||
}
|
||||
|
||||
type blockData struct {
|
||||
|
|
@ -114,8 +112,8 @@ func genOp() {
|
|||
for _, v := range a.ops {
|
||||
fmt.Fprintln(w, "{")
|
||||
fmt.Fprintf(w, "name:\"%s\",\n", v.name)
|
||||
if v.asm != 0 {
|
||||
fmt.Fprintf(w, "asm: x86.A%s,\n", x86.Anames[v.asm-obj.ABaseAMD64])
|
||||
if v.asm != "" {
|
||||
fmt.Fprintf(w, "asm: x86.A%s,\n", v.asm)
|
||||
}
|
||||
fmt.Fprintln(w, "reg:regInfo{")
|
||||
fmt.Fprintln(w, "inputs: []regMask{")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue