go/src/cmd/compile/internal/x86/galign.go
Matthew Dempsky 118b3fe7bb cmd/compile/internal/gc: refactor ACALL Prog creation
This abstracts creation of ACALL Progs into package gc. The main
benefit of this today is we can refactor away a lot of common
boilerplate code.

Later, once liveness analysis happens on the SSA graph, this will also
provide an easy insertion point for emitting the PCDATA Progs
immediately before call instructions.

Passes toolstash-check -all.

Change-Id: Ia15108ace97201cd84314f1ca916dfeb4f09d61c
Reviewed-on: https://go-review.googlesource.com/38081
Reviewed-by: Keith Randall <khr@golang.org>
2017-03-13 21:04:16 +00:00

35 lines
770 B
Go

// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package x86
import (
"cmd/compile/internal/gc"
"cmd/internal/obj"
"cmd/internal/obj/x86"
"fmt"
"os"
)
func Init() {
gc.Thearch.LinkArch = &x86.Link386
gc.Thearch.REGSP = x86.REGSP
switch v := obj.GO386; v {
case "387":
gc.Thearch.Use387 = true
case "sse2":
default:
fmt.Fprintf(os.Stderr, "unsupported setting GO386=%s\n", v)
gc.Exit(1)
}
gc.Thearch.MAXWIDTH = (1 << 32) - 1
gc.Thearch.Defframe = defframe
gc.Thearch.Ginsnop = ginsnop
gc.Thearch.Proginfo = proginfo
gc.Thearch.SSAMarkMoves = ssaMarkMoves
gc.Thearch.SSAGenValue = ssaGenValue
gc.Thearch.SSAGenBlock = ssaGenBlock
}