mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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>
35 lines
770 B
Go
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
|
|
}
|