aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/obj/ppc64/obj9.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2016-04-06 12:01:40 -0700
committerMatthew Dempsky <mdempsky@google.com>2016-04-07 01:23:25 +0000
commitc6e11fe03765e3fe1fc68bd794625ca0ecd833be (patch)
treec5b131e7c2406496f836a0055e28e9a9ff09eedb /src/cmd/internal/obj/ppc64/obj9.go
parent31cf1c17792d4da9dae2504c703633a0db8072c7 (diff)
downloadgo-c6e11fe03765e3fe1fc68bd794625ca0ecd833be.tar.xz
cmd: add new common architecture representation
Information about CPU architectures (e.g., name, family, byte ordering, pointer and register size) is currently redundantly scattered around the source tree. Instead consolidate the basic information into a single new package cmd/internal/sys. Also, introduce new sys.I386, sys.AMD64, etc. names for the constants '8', '6', etc. and replace most uses of the latter. The notable exceptions are a couple of error messages that still refer to the old char-based toolchain names and function reltype in cmd/link. Passes toolstash/buildall. Change-Id: I8a6f0cbd49577ec1672a98addebc45f767e36461 Reviewed-on: https://go-review.googlesource.com/21623 Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd/internal/obj/ppc64/obj9.go')
-rw-r--r--src/cmd/internal/obj/ppc64/obj9.go22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/cmd/internal/obj/ppc64/obj9.go b/src/cmd/internal/obj/ppc64/obj9.go
index 483df3a2b3..7a24d1d1bf 100644
--- a/src/cmd/internal/obj/ppc64/obj9.go
+++ b/src/cmd/internal/obj/ppc64/obj9.go
@@ -31,7 +31,7 @@ package ppc64
import (
"cmd/internal/obj"
- "encoding/binary"
+ "cmd/internal/sys"
"fmt"
"math"
)
@@ -592,7 +592,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym) {
q.As = AMOVD
q.From.Type = obj.TYPE_MEM
q.From.Reg = REGG
- q.From.Offset = 4 * int64(ctxt.Arch.Ptrsize) // G.panic
+ q.From.Offset = 4 * int64(ctxt.Arch.PtrSize) // G.panic
q.To.Type = obj.TYPE_REG
q.To.Reg = REG_R3
@@ -827,9 +827,9 @@ func stacksplit(ctxt *obj.Link, p *obj.Prog, framesize int32) *obj.Prog {
p.As = AMOVD
p.From.Type = obj.TYPE_MEM
p.From.Reg = REGG
- p.From.Offset = 2 * int64(ctxt.Arch.Ptrsize) // G.stackguard0
+ p.From.Offset = 2 * int64(ctxt.Arch.PtrSize) // G.stackguard0
if ctxt.Cursym.Cfunc {
- p.From.Offset = 3 * int64(ctxt.Arch.Ptrsize) // G.stackguard1
+ p.From.Offset = 3 * int64(ctxt.Arch.PtrSize) // G.stackguard1
}
p.To.Type = obj.TYPE_REG
p.To.Reg = REG_R3
@@ -1181,27 +1181,17 @@ loop:
}
var Linkppc64 = obj.LinkArch{
- ByteOrder: binary.BigEndian,
- Name: "ppc64",
- Thechar: '9',
+ Arch: sys.ArchPPC64,
Preprocess: preprocess,
Assemble: span9,
Follow: follow,
Progedit: progedit,
- Minlc: 4,
- Ptrsize: 8,
- Regsize: 8,
}
var Linkppc64le = obj.LinkArch{
- ByteOrder: binary.LittleEndian,
- Name: "ppc64le",
- Thechar: '9',
+ Arch: sys.ArchPPC64LE,
Preprocess: preprocess,
Assemble: span9,
Follow: follow,
Progedit: progedit,
- Minlc: 4,
- Ptrsize: 8,
- Regsize: 8,
}