Russ Cox | 8c195bd | 2015-02-13 14:40:36 -0500 | [diff] [blame] | 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 main |
| 6 | |
| 7 | import ( |
| 8 | "cmd/internal/obj" |
| 9 | "cmd/internal/obj/ppc64" |
| 10 | ) |
| 11 | import "cmd/internal/gc" |
| 12 | |
| 13 | var thechar int = '9' |
| 14 | |
| 15 | var thestring string = "ppc64" |
| 16 | |
| 17 | var thelinkarch *obj.LinkArch |
| 18 | |
| 19 | func linkarchinit() { |
| 20 | thestring = obj.Getgoarch() |
| 21 | gc.Thearch.Thestring = thestring |
| 22 | if thestring == "ppc64le" { |
| 23 | thelinkarch = &ppc64.Linkppc64le |
| 24 | } else { |
| 25 | thelinkarch = &ppc64.Linkppc64 |
| 26 | } |
| 27 | gc.Thearch.Thelinkarch = thelinkarch |
| 28 | } |
| 29 | |
| 30 | var MAXWIDTH int64 = 1 << 50 |
| 31 | |
| 32 | /* |
| 33 | * go declares several platform-specific type aliases: |
| 34 | * int, uint, float, and uintptr |
| 35 | */ |
| 36 | var typedefs = []gc.Typedef{ |
| 37 | gc.Typedef{"int", gc.TINT, gc.TINT64}, |
| 38 | gc.Typedef{"uint", gc.TUINT, gc.TUINT64}, |
| 39 | gc.Typedef{"uintptr", gc.TUINTPTR, gc.TUINT64}, |
| 40 | } |
| 41 | |
| 42 | func betypeinit() { |
| 43 | gc.Widthptr = 8 |
| 44 | gc.Widthint = 8 |
| 45 | gc.Widthreg = 8 |
| 46 | |
| 47 | } |
| 48 | |
| 49 | func main() { |
| 50 | gc.Thearch.Thechar = thechar |
| 51 | gc.Thearch.Thestring = thestring |
| 52 | gc.Thearch.Thelinkarch = thelinkarch |
| 53 | gc.Thearch.Typedefs = typedefs |
| 54 | gc.Thearch.REGSP = ppc64.REGSP |
| 55 | gc.Thearch.REGCTXT = ppc64.REGCTXT |
| 56 | gc.Thearch.MAXWIDTH = MAXWIDTH |
| 57 | gc.Thearch.Anyregalloc = anyregalloc |
| 58 | gc.Thearch.Betypeinit = betypeinit |
| 59 | gc.Thearch.Bgen = bgen |
| 60 | gc.Thearch.Cgen = cgen |
| 61 | gc.Thearch.Cgen_call = cgen_call |
| 62 | gc.Thearch.Cgen_callinter = cgen_callinter |
| 63 | gc.Thearch.Cgen_ret = cgen_ret |
| 64 | gc.Thearch.Clearfat = clearfat |
| 65 | gc.Thearch.Defframe = defframe |
| 66 | gc.Thearch.Excise = excise |
| 67 | gc.Thearch.Expandchecks = expandchecks |
| 68 | gc.Thearch.Gclean = gclean |
| 69 | gc.Thearch.Ginit = ginit |
| 70 | gc.Thearch.Gins = gins |
| 71 | gc.Thearch.Ginscall = ginscall |
| 72 | gc.Thearch.Igen = igen |
| 73 | gc.Thearch.Linkarchinit = linkarchinit |
| 74 | gc.Thearch.Peep = peep |
| 75 | gc.Thearch.Proginfo = proginfo |
| 76 | gc.Thearch.Regalloc = regalloc |
| 77 | gc.Thearch.Regfree = regfree |
| 78 | gc.Thearch.Regtyp = regtyp |
| 79 | gc.Thearch.Sameaddr = sameaddr |
| 80 | gc.Thearch.Smallindir = smallindir |
| 81 | gc.Thearch.Stackaddr = stackaddr |
| 82 | gc.Thearch.Excludedregs = excludedregs |
| 83 | gc.Thearch.RtoB = RtoB |
| 84 | gc.Thearch.FtoB = RtoB |
| 85 | gc.Thearch.BtoR = BtoR |
| 86 | gc.Thearch.BtoF = BtoF |
| 87 | gc.Thearch.Optoas = optoas |
| 88 | gc.Thearch.Doregbits = doregbits |
| 89 | gc.Thearch.Regnames = regnames |
| 90 | |
| 91 | gc.Main() |
Russ Cox | 53d4123 | 2015-02-23 10:22:26 -0500 | [diff] [blame] | 92 | gc.Exit(0) |
Russ Cox | 8c195bd | 2015-02-13 14:40:36 -0500 | [diff] [blame] | 93 | } |