Source file src/cmd/compile/internal/x86/galign.go

     1  // Copyright 2009 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package x86
     6  
     7  import (
     8  	"cmd/compile/internal/base"
     9  	"cmd/compile/internal/ssagen"
    10  	"cmd/internal/obj/x86"
    11  	"fmt"
    12  	"internal/buildcfg"
    13  	"os"
    14  )
    15  
    16  func Init(arch *ssagen.ArchInfo) {
    17  	arch.LinkArch = &x86.Link386
    18  	arch.REGSP = x86.REGSP
    19  	arch.SSAGenValue = ssaGenValue
    20  	arch.SSAGenBlock = ssaGenBlock
    21  	arch.MAXWIDTH = (1 << 32) - 1
    22  	switch v := buildcfg.GO386; v {
    23  	case "sse2":
    24  	case "softfloat":
    25  		arch.SoftFloat = true
    26  	case "387":
    27  		fmt.Fprintf(os.Stderr, "unsupported setting GO386=387. Consider using GO386=softfloat instead.\n")
    28  		base.Exit(1)
    29  	default:
    30  		fmt.Fprintf(os.Stderr, "unsupported setting GO386=%s\n", v)
    31  		base.Exit(1)
    32  
    33  	}
    34  
    35  	arch.ZeroRange = zerorange
    36  	arch.Ginsnop = ginsnop
    37  
    38  	arch.SSAMarkMoves = ssaMarkMoves
    39  }
    40  

View as plain text