2015-02-13 14:40:36 -05:00
|
|
|
// 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.
|
|
|
|
|
|
2015-05-21 13:28:10 -04:00
|
|
|
package x86
|
2015-02-13 14:40:36 -05:00
|
|
|
|
|
|
|
|
import (
|
2015-05-21 13:28:10 -04:00
|
|
|
"cmd/compile/internal/gc"
|
2015-02-13 14:40:36 -05:00
|
|
|
"cmd/internal/obj"
|
2015-03-04 22:58:27 -05:00
|
|
|
"cmd/internal/obj/x86"
|
2015-05-01 10:15:33 +10:00
|
|
|
"fmt"
|
|
|
|
|
"os"
|
2015-02-13 14:40:36 -05:00
|
|
|
)
|
|
|
|
|
|
2016-09-16 13:56:39 -07:00
|
|
|
func Init() {
|
2016-04-06 12:01:40 -07:00
|
|
|
gc.Thearch.LinkArch = &x86.Link386
|
2015-03-04 22:58:27 -05:00
|
|
|
gc.Thearch.REGSP = x86.REGSP
|
2016-09-09 08:13:16 -04:00
|
|
|
switch v := obj.GO386; v {
|
2015-03-24 22:16:48 +11:00
|
|
|
case "387":
|
2015-03-25 09:17:09 +11:00
|
|
|
gc.Thearch.Use387 = true
|
2015-03-24 22:16:48 +11:00
|
|
|
case "sse2":
|
|
|
|
|
default:
|
2015-05-01 10:15:33 +10:00
|
|
|
fmt.Fprintf(os.Stderr, "unsupported setting GO386=%s\n", v)
|
2015-05-01 11:51:47 +10:00
|
|
|
gc.Exit(1)
|
2015-03-24 22:16:48 +11:00
|
|
|
}
|
2016-03-15 15:55:47 +11:00
|
|
|
gc.Thearch.MAXWIDTH = (1 << 32) - 1
|
2015-03-18 17:26:36 -04:00
|
|
|
|
2015-02-13 14:40:36 -05:00
|
|
|
gc.Thearch.Defframe = defframe
|
2017-03-10 18:34:41 -08:00
|
|
|
gc.Thearch.Ginsnop = ginsnop
|
2015-02-13 14:40:36 -05:00
|
|
|
gc.Thearch.Proginfo = proginfo
|
|
|
|
|
|
2016-07-13 13:43:08 -07:00
|
|
|
gc.Thearch.SSAMarkMoves = ssaMarkMoves
|
|
|
|
|
gc.Thearch.SSAGenValue = ssaGenValue
|
|
|
|
|
gc.Thearch.SSAGenBlock = ssaGenBlock
|
2015-02-13 14:40:36 -05:00
|
|
|
}
|