]> Cypherpunks repositories - gostls13.git/commitdiff
cmd: remove IntSize and Widthint
authorMatthew Dempsky <mdempsky@google.com>
Sat, 22 Apr 2017 01:44:34 +0000 (18:44 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Sat, 22 Apr 2017 17:43:43 +0000 (17:43 +0000)
Use PtrSize and Widthptr instead. CL prepared mostly with sed and
uniq.

Passes toolstash-check -all.

Fixes #19954.

Change-Id: I09371bd7128672885cb8bc4e7f534ad56a88d755
Reviewed-on: https://go-review.googlesource.com/40506
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Martin Möhrmann <moehrmann@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
16 files changed:
src/cmd/compile/internal/gc/go.go
src/cmd/compile/internal/gc/main.go
src/cmd/compile/internal/gc/obj.go
src/cmd/compile/internal/gc/reflect.go
src/cmd/compile/internal/gc/sinit.go
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/gc/universe.go
src/cmd/compile/internal/ssa/config.go
src/cmd/compile/internal/ssa/decompose.go
src/cmd/compile/internal/ssa/export_test.go
src/cmd/compile/internal/ssa/opt.go
src/cmd/compile/internal/ssa/rewrite.go
src/cmd/internal/sys/arch.go
src/cmd/link/internal/ld/data.go
src/cmd/link/internal/ld/decodesym.go
src/cmd/link/internal/ld/symtab.go

index f214b6dddf108a3d29e0b0db4775a5d4e94af08c..46cec3e8bc2a2f408031ff0ae46825cbf907e29a 100644 (file)
@@ -177,8 +177,6 @@ var Curfn *Node
 
 var Widthptr int
 
-var Widthint int
-
 var Widthreg int
 
 var nblank *Node
index ec6665f75c3a9f2853c0dbee42baa3044531e177..dde8a9a5895df4c2faed3163d143aa93aa2ea484 100644 (file)
@@ -364,7 +364,6 @@ func Main(archInit func(*Arch)) {
                Debug['l'] = 1 - Debug['l']
        }
 
-       Widthint = thearch.LinkArch.IntSize
        Widthptr = thearch.LinkArch.PtrSize
        Widthreg = thearch.LinkArch.RegSize
 
index c261713fcd730e41cf622095efe664ea5c348dbc..5067330e5232c58deb71e30c1670d36ac1a787dd 100644 (file)
@@ -405,7 +405,7 @@ func gdata(nam *Node, nr *Node, wid int) {
                case string:
                        symdata := stringsym(u)
                        s.WriteAddr(Ctxt, nam.Xoffset, Widthptr, symdata, 0)
-                       s.WriteInt(Ctxt, nam.Xoffset+int64(Widthptr), Widthint, int64(len(u)))
+                       s.WriteInt(Ctxt, nam.Xoffset+int64(Widthptr), Widthptr, int64(len(u)))
 
                default:
                        Fatalf("gdata unhandled OLITERAL %v", nr)
index 712c2aad9ec07ae745a5a7574f53d6b268c74e4c..80404df1260ca8866b60d54882d19a921ad9afa4 100644 (file)
@@ -1185,7 +1185,7 @@ ok:
                }
                ot = dgopkgpath(lsym, ot, tpkg)
 
-               ot = dsymptr(lsym, ot, lsym, ot+Widthptr+2*Widthint+uncommonSize(t))
+               ot = dsymptr(lsym, ot, lsym, ot+Widthptr+2*Widthptr+uncommonSize(t))
                ot = duintptr(lsym, ot, uint64(n))
                ot = duintptr(lsym, ot, uint64(n))
                dataAdd := imethodSize() * n
@@ -1277,7 +1277,7 @@ ok:
                        }
                }
                ot = dgopkgpath(lsym, ot, pkg)
-               ot = dsymptr(lsym, ot, lsym, ot+Widthptr+2*Widthint+uncommonSize(t))
+               ot = dsymptr(lsym, ot, lsym, ot+Widthptr+2*Widthptr+uncommonSize(t))
                ot = duintptr(lsym, ot, uint64(n))
                ot = duintptr(lsym, ot, uint64(n))
 
index b2d1fa7a2855a6fab089ccc3d4883356f4ab9499..73a342e7966ba7d46186452401fde9cf5afc3bf7 100644 (file)
@@ -333,9 +333,9 @@ func staticcopy(l *Node, r *Node, out *[]*Node) bool {
                n.Xoffset = l.Xoffset + int64(array_array)
                gdata(&n, nod(OADDR, a, nil), Widthptr)
                n.Xoffset = l.Xoffset + int64(array_nel)
-               gdata(&n, r.Right, Widthint)
+               gdata(&n, r.Right, Widthptr)
                n.Xoffset = l.Xoffset + int64(array_cap)
-               gdata(&n, r.Right, Widthint)
+               gdata(&n, r.Right, Widthptr)
                return true
 
        case OARRAYLIT, OSTRUCTLIT:
@@ -434,9 +434,9 @@ func staticassign(l *Node, r *Node, out *[]*Node) bool {
                n.Xoffset = l.Xoffset + int64(array_array)
                gdata(&n, nod(OADDR, a, nil), Widthptr)
                n.Xoffset = l.Xoffset + int64(array_nel)
-               gdata(&n, r.Right, Widthint)
+               gdata(&n, r.Right, Widthptr)
                n.Xoffset = l.Xoffset + int64(array_cap)
-               gdata(&n, r.Right, Widthint)
+               gdata(&n, r.Right, Widthptr)
 
                // Fall through to init underlying array.
                l = a
@@ -797,9 +797,9 @@ func slicelit(ctxt initContext, n *Node, var_ *Node, init *Nodes) {
                nam.Xoffset += int64(array_array)
                gdata(&nam, nod(OADDR, vstat, nil), Widthptr)
                nam.Xoffset += int64(array_nel) - int64(array_array)
-               gdata(&nam, &v, Widthint)
+               gdata(&nam, &v, Widthptr)
                nam.Xoffset += int64(array_cap) - int64(array_nel)
-               gdata(&nam, &v, Widthint)
+               gdata(&nam, &v, Widthptr)
 
                return
        }
index 9ca6ef88b76b4526b2d5764233f51eab04fd717f..a56c25bef9bc0678c988c1507d8b07ffd58fb4b2 100644 (file)
@@ -492,7 +492,7 @@ func (s *state) constFloat64(t ssa.Type, c float64) *ssa.Value {
        return s.f.ConstFloat64(s.peekPos(), t, c)
 }
 func (s *state) constInt(t ssa.Type, c int64) *ssa.Value {
-       if s.config.IntSize == 8 {
+       if s.config.PtrSize == 8 {
                return s.constInt64(t, c)
        }
        if int64(int32(c)) != c {
@@ -1164,12 +1164,12 @@ func (s *state) concreteEtype(t *types.Type) types.EType {
        default:
                return e
        case TINT:
-               if s.config.IntSize == 8 {
+               if s.config.PtrSize == 8 {
                        return TINT64
                }
                return TINT32
        case TUINT:
-               if s.config.IntSize == 8 {
+               if s.config.PtrSize == 8 {
                        return TUINT64
                }
                return TUINT32
@@ -1602,7 +1602,7 @@ func (s *state) expr(n *Node) *ssa.Value {
 
                if ft.IsFloat() || tt.IsFloat() {
                        conv, ok := fpConvOpToSSA[twoTypes{s.concreteEtype(ft), s.concreteEtype(tt)}]
-                       if s.config.IntSize == 4 && thearch.LinkArch.Name != "amd64p32" && thearch.LinkArch.Family != sys.MIPS {
+                       if s.config.PtrSize == 4 && thearch.LinkArch.Name != "amd64p32" && thearch.LinkArch.Family != sys.MIPS {
                                if conv1, ok1 := fpConvOpToSSA32[twoTypes{s.concreteEtype(ft), s.concreteEtype(tt)}]; ok1 {
                                        conv = conv1
                                }
@@ -2500,7 +2500,7 @@ func init() {
        var p8 []*sys.Arch
        for _, a := range sys.Archs {
                all = append(all, a)
-               if a.IntSize == 4 {
+               if a.PtrSize == 4 {
                        i4 = append(i4, a)
                } else {
                        i8 = append(i8, a)
@@ -2765,7 +2765,7 @@ func init() {
                sys.AMD64, sys.ARM64, sys.ARM, sys.S390X, sys.MIPS)
        addF("math/bits", "Len32",
                func(s *state, n *Node, args []*ssa.Value) *ssa.Value {
-                       if s.config.IntSize == 4 {
+                       if s.config.PtrSize == 4 {
                                return s.newValue1(ssa.OpBitLen32, types.Types[TINT], args[0])
                        }
                        x := s.newValue1(ssa.OpZeroExt32to64, types.Types[TUINT64], args[0])
@@ -2774,7 +2774,7 @@ func init() {
                sys.AMD64, sys.ARM64, sys.ARM, sys.S390X, sys.MIPS)
        addF("math/bits", "Len16",
                func(s *state, n *Node, args []*ssa.Value) *ssa.Value {
-                       if s.config.IntSize == 4 {
+                       if s.config.PtrSize == 4 {
                                x := s.newValue1(ssa.OpZeroExt16to32, types.Types[TUINT32], args[0])
                                return s.newValue1(ssa.OpBitLen32, types.Types[TINT], x)
                        }
@@ -2785,7 +2785,7 @@ func init() {
        // Note: disabled on AMD64 because the Go code is faster!
        addF("math/bits", "Len8",
                func(s *state, n *Node, args []*ssa.Value) *ssa.Value {
-                       if s.config.IntSize == 4 {
+                       if s.config.PtrSize == 4 {
                                x := s.newValue1(ssa.OpZeroExt8to32, types.Types[TUINT32], args[0])
                                return s.newValue1(ssa.OpBitLen32, types.Types[TINT], x)
                        }
@@ -2796,7 +2796,7 @@ func init() {
 
        addF("math/bits", "Len",
                func(s *state, n *Node, args []*ssa.Value) *ssa.Value {
-                       if s.config.IntSize == 4 {
+                       if s.config.PtrSize == 4 {
                                return s.newValue1(ssa.OpBitLen32, types.Types[TINT], args[0])
                        }
                        return s.newValue1(ssa.OpBitLen64, types.Types[TINT], args[0])
@@ -2825,7 +2825,7 @@ func init() {
                sys.ARM64)
        addF("math/bits", "Reverse",
                func(s *state, n *Node, args []*ssa.Value) *ssa.Value {
-                       if s.config.IntSize == 4 {
+                       if s.config.PtrSize == 4 {
                                return s.newValue1(ssa.OpBitRev32, types.Types[TINT], args[0])
                        }
                        return s.newValue1(ssa.OpBitRev64, types.Types[TINT], args[0])
@@ -2849,7 +2849,7 @@ func init() {
                        // We have the intrinsic - use it directly.
                        s.startBlock(bTrue)
                        op := op64
-                       if s.config.IntSize == 4 {
+                       if s.config.PtrSize == 4 {
                                op = op32
                        }
                        s.vars[n] = s.newValue1(op, types.Types[TINT], args[0])
@@ -3545,17 +3545,17 @@ func (s *state) storeTypeScalars(t *types.Type, left, right *ssa.Value, skip ski
                        return
                }
                len := s.newValue1(ssa.OpStringLen, types.Types[TINT], right)
-               lenAddr := s.newValue1I(ssa.OpOffPtr, s.f.Config.Types.IntPtr, s.config.IntSize, left)
+               lenAddr := s.newValue1I(ssa.OpOffPtr, s.f.Config.Types.IntPtr, s.config.PtrSize, left)
                s.vars[&memVar] = s.newValue3A(ssa.OpStore, ssa.TypeMem, types.Types[TINT], lenAddr, len, s.mem())
        case t.IsSlice():
                if skip&skipLen == 0 {
                        len := s.newValue1(ssa.OpSliceLen, types.Types[TINT], right)
-                       lenAddr := s.newValue1I(ssa.OpOffPtr, s.f.Config.Types.IntPtr, s.config.IntSize, left)
+                       lenAddr := s.newValue1I(ssa.OpOffPtr, s.f.Config.Types.IntPtr, s.config.PtrSize, left)
                        s.vars[&memVar] = s.newValue3A(ssa.OpStore, ssa.TypeMem, types.Types[TINT], lenAddr, len, s.mem())
                }
                if skip&skipCap == 0 {
                        cap := s.newValue1(ssa.OpSliceCap, types.Types[TINT], right)
-                       capAddr := s.newValue1I(ssa.OpOffPtr, s.f.Config.Types.IntPtr, 2*s.config.IntSize, left)
+                       capAddr := s.newValue1I(ssa.OpOffPtr, s.f.Config.Types.IntPtr, 2*s.config.PtrSize, left)
                        s.vars[&memVar] = s.newValue3A(ssa.OpStore, ssa.TypeMem, types.Types[TINT], capAddr, cap, s.mem())
                }
        case t.IsInterface():
@@ -4615,10 +4615,10 @@ func AddAux2(a *obj.Addr, v *ssa.Value, offset int64) {
 // panic using the given function if v does not fit in an int (only on 32-bit archs).
 func (s *state) extendIndex(v *ssa.Value, panicfn *obj.LSym) *ssa.Value {
        size := v.Type.Size()
-       if size == s.config.IntSize {
+       if size == s.config.PtrSize {
                return v
        }
-       if size > s.config.IntSize {
+       if size > s.config.PtrSize {
                // truncate 64-bit indexes on 32-bit pointer archs. Test the
                // high word and branch to out-of-bounds failure if it is not 0.
                if Debug['B'] == 0 {
@@ -4632,7 +4632,7 @@ func (s *state) extendIndex(v *ssa.Value, panicfn *obj.LSym) *ssa.Value {
        // Extend value to the required size
        var op ssa.Op
        if v.Type.IsSigned() {
-               switch 10*size + s.config.IntSize {
+               switch 10*size + s.config.PtrSize {
                case 14:
                        op = ssa.OpSignExt8to32
                case 18:
@@ -4647,7 +4647,7 @@ func (s *state) extendIndex(v *ssa.Value, panicfn *obj.LSym) *ssa.Value {
                        s.Fatalf("bad signed index extension %s", v.Type)
                }
        } else {
-               switch 10*size + s.config.IntSize {
+               switch 10*size + s.config.PtrSize {
                case 14:
                        op = ssa.OpZeroExt8to32
                case 18:
index f15d84b3a5680c2f94c4965741b82563fff6e720..1a6dcf487d4bffad60aad7a116df6411ea782957 100644 (file)
@@ -40,8 +40,8 @@ var typedefs = [...]struct {
        sameas32 types.EType
        sameas64 types.EType
 }{
-       {"int", TINT, &Widthint, TINT32, TINT64},
-       {"uint", TUINT, &Widthint, TUINT32, TUINT64},
+       {"int", TINT, &Widthptr, TINT32, TINT64},
+       {"uint", TUINT, &Widthptr, TUINT32, TUINT64},
        {"uintptr", TUINTPTR, &Widthptr, TUINT32, TUINT64},
 }
 
@@ -359,12 +359,12 @@ func typeinit() {
        simtype[TUNSAFEPTR] = types.Tptr
 
        array_array = int(Rnd(0, int64(Widthptr)))
-       array_nel = int(Rnd(int64(array_array)+int64(Widthptr), int64(Widthint)))
-       array_cap = int(Rnd(int64(array_nel)+int64(Widthint), int64(Widthint)))
-       sizeof_Array = int(Rnd(int64(array_cap)+int64(Widthint), int64(Widthptr)))
+       array_nel = int(Rnd(int64(array_array)+int64(Widthptr), int64(Widthptr)))
+       array_cap = int(Rnd(int64(array_nel)+int64(Widthptr), int64(Widthptr)))
+       sizeof_Array = int(Rnd(int64(array_cap)+int64(Widthptr), int64(Widthptr)))
 
        // string is same as slice wo the cap
-       sizeof_String = int(Rnd(int64(array_nel)+int64(Widthint), int64(Widthptr)))
+       sizeof_String = int(Rnd(int64(array_nel)+int64(Widthptr), int64(Widthptr)))
 
        dowidth(types.Types[TSTRING])
        dowidth(types.Idealstring)
index d87cbca61f00e98a8d92557bf40642092fe63c89..07d5e496495d379ba6456fa6061d5a9f0a27f997 100644 (file)
@@ -17,9 +17,8 @@ import (
 // and shared across all compilations.
 type Config struct {
        arch            string // "amd64", etc.
-       IntSize         int64  // 4 or 8
-       PtrSize         int64  // 4 or 8
-       RegSize         int64  // 4 or 8
+       PtrSize         int64  // 4 or 8; copy of cmd/internal/sys.Arch.PtrSize
+       RegSize         int64  // 4 or 8; copy of cmd/internal/sys.Arch.RegSize
        Types           Types
        lowerBlock      blockRewriter // lowering function
        lowerValue      valueRewriter // lowering function
@@ -143,7 +142,6 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize bool) *Config
        c := &Config{arch: arch, Types: types}
        switch arch {
        case "amd64":
-               c.IntSize = 8
                c.PtrSize = 8
                c.RegSize = 8
                c.lowerBlock = rewriteBlockAMD64
@@ -155,7 +153,6 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize bool) *Config
                c.LinkReg = linkRegAMD64
                c.hasGReg = false
        case "amd64p32":
-               c.IntSize = 4
                c.PtrSize = 4
                c.RegSize = 8
                c.lowerBlock = rewriteBlockAMD64
@@ -168,7 +165,6 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize bool) *Config
                c.hasGReg = false
                c.noDuffDevice = true
        case "386":
-               c.IntSize = 4
                c.PtrSize = 4
                c.RegSize = 4
                c.lowerBlock = rewriteBlock386
@@ -180,7 +176,6 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize bool) *Config
                c.LinkReg = linkReg386
                c.hasGReg = false
        case "arm":
-               c.IntSize = 4
                c.PtrSize = 4
                c.RegSize = 4
                c.lowerBlock = rewriteBlockARM
@@ -192,7 +187,6 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize bool) *Config
                c.LinkReg = linkRegARM
                c.hasGReg = true
        case "arm64":
-               c.IntSize = 8
                c.PtrSize = 8
                c.RegSize = 8
                c.lowerBlock = rewriteBlockARM64
@@ -208,7 +202,6 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize bool) *Config
                c.BigEndian = true
                fallthrough
        case "ppc64le":
-               c.IntSize = 8
                c.PtrSize = 8
                c.RegSize = 8
                c.lowerBlock = rewriteBlockPPC64
@@ -224,7 +217,6 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize bool) *Config
                c.BigEndian = true
                fallthrough
        case "mips64le":
-               c.IntSize = 8
                c.PtrSize = 8
                c.RegSize = 8
                c.lowerBlock = rewriteBlockMIPS64
@@ -237,7 +229,6 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize bool) *Config
                c.LinkReg = linkRegMIPS64
                c.hasGReg = true
        case "s390x":
-               c.IntSize = 8
                c.PtrSize = 8
                c.RegSize = 8
                c.lowerBlock = rewriteBlockS390X
@@ -254,7 +245,6 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize bool) *Config
                c.BigEndian = true
                fallthrough
        case "mipsle":
-               c.IntSize = 4
                c.PtrSize = 4
                c.RegSize = 4
                c.lowerBlock = rewriteBlockMIPS
index 56cb46ddac1d95b4c543fb05d6077c98906b91c3..b629a64e1556845535e9aa7e99cc0e5f0fabbce4 100644 (file)
@@ -25,7 +25,7 @@ func decomposeBuiltIn(f *Func) {
        for _, name := range f.Names {
                t := name.Type
                switch {
-               case t.IsInteger() && t.Size() == 8 && f.Config.IntSize == 4:
+               case t.IsInteger() && t.Size() == 8 && f.Config.PtrSize == 4:
                        var elemType Type
                        if t.IsSigned() {
                                elemType = f.Config.Types.Int32
@@ -95,8 +95,8 @@ func decomposeBuiltIn(f *Func) {
                        }
                        delete(f.NamedValues, name)
                case t.IsFloat():
-                       // floats are never decomposed, even ones bigger than IntSize
-               case t.Size() > f.Config.IntSize:
+                       // floats are never decomposed, even ones bigger than PtrSize
+               case t.Size() > f.Config.PtrSize:
                        f.Fatalf("undecomposed named type %v %v", name, t)
                default:
                        newNames = append(newNames, name)
@@ -107,7 +107,7 @@ func decomposeBuiltIn(f *Func) {
 
 func decomposeBuiltInPhi(v *Value) {
        switch {
-       case v.Type.IsInteger() && v.Type.Size() == 8 && v.Block.Func.Config.IntSize == 4:
+       case v.Type.IsInteger() && v.Type.Size() == 8 && v.Block.Func.Config.PtrSize == 4:
                if v.Block.Func.Config.arch == "amd64p32" {
                        // Even though ints are 32 bits, we have 64-bit ops.
                        break
@@ -122,8 +122,8 @@ func decomposeBuiltInPhi(v *Value) {
        case v.Type.IsInterface():
                decomposeInterfacePhi(v)
        case v.Type.IsFloat():
-               // floats are never decomposed, even ones bigger than IntSize
-       case v.Type.Size() > v.Block.Func.Config.IntSize:
+               // floats are never decomposed, even ones bigger than PtrSize
+       case v.Type.Size() > v.Block.Func.Config.PtrSize:
                v.Fatalf("undecomposed type %s", v.Type)
        }
 }
index e2d8a2d69b4337bfe014d27de0ba87df986736a1..228a33697ee58a338b9febfe0bb226e1da1dae56 100644 (file)
@@ -30,7 +30,7 @@ func testConfigArch(tb testing.TB, arch string) *Conf {
        if !ok {
                tb.Fatalf("unknown arch %s", arch)
        }
-       if ctxt.Arch.IntSize != 8 {
+       if ctxt.Arch.PtrSize != 8 {
                tb.Fatal("dummyTypes is 64-bit only")
        }
        c := &Conf{
index f211488cd74f61f13214498ee65e590d6f4caf36..7703d8b70414a4dbb20ec7109da21cb8fb6d871e 100644 (file)
@@ -11,7 +11,7 @@ func opt(f *Func) {
 
 func dec(f *Func) {
        applyRewrite(f, rewriteBlockdec, rewriteValuedec)
-       if f.Config.IntSize == 4 && f.Config.arch != "amd64p32" {
+       if f.Config.PtrSize == 4 && f.Config.arch != "amd64p32" {
                applyRewrite(f, rewriteBlockdec64, rewriteValuedec64)
        }
 }
index 8045ae4951c1766c85bc5f29d67561879905baf2..5dce8affdb640ea21c86a08181223f87ab241d4c 100644 (file)
@@ -450,7 +450,7 @@ func isSamePtr(p1, p2 *Value) bool {
 // moveSize returns the number of bytes an aligned MOV instruction moves
 func moveSize(align int64, c *Config) int64 {
        switch {
-       case align%8 == 0 && c.IntSize == 8:
+       case align%8 == 0 && c.PtrSize == 8:
                return 8
        case align%4 == 0:
                return 4
index b2f8d0b8cb05141de8a197b6468fe3c0bf2046d1..c761a834b30d9acbba31bcb3f0e42c1b9a7bed97 100644 (file)
@@ -30,8 +30,11 @@ type Arch struct {
 
        ByteOrder binary.ByteOrder
 
-       IntSize int
+       // PtrSize is the size in bytes of pointers and the
+       // predeclared "int", "uint", and "uintptr" types.
        PtrSize int
+
+       // RegSize is the size in bytes of general purpose registers.
        RegSize int
 
        // MinLC is the minimum length of an instruction code.
@@ -53,7 +56,6 @@ var Arch386 = &Arch{
        Name:      "386",
        Family:    I386,
        ByteOrder: binary.LittleEndian,
-       IntSize:   4,
        PtrSize:   4,
        RegSize:   4,
        MinLC:     1,
@@ -63,7 +65,6 @@ var ArchAMD64 = &Arch{
        Name:      "amd64",
        Family:    AMD64,
        ByteOrder: binary.LittleEndian,
-       IntSize:   8,
        PtrSize:   8,
        RegSize:   8,
        MinLC:     1,
@@ -73,7 +74,6 @@ var ArchAMD64P32 = &Arch{
        Name:      "amd64p32",
        Family:    AMD64,
        ByteOrder: binary.LittleEndian,
-       IntSize:   4,
        PtrSize:   4,
        RegSize:   8,
        MinLC:     1,
@@ -83,7 +83,6 @@ var ArchARM = &Arch{
        Name:      "arm",
        Family:    ARM,
        ByteOrder: binary.LittleEndian,
-       IntSize:   4,
        PtrSize:   4,
        RegSize:   4,
        MinLC:     4,
@@ -93,7 +92,6 @@ var ArchARM64 = &Arch{
        Name:      "arm64",
        Family:    ARM64,
        ByteOrder: binary.LittleEndian,
-       IntSize:   8,
        PtrSize:   8,
        RegSize:   8,
        MinLC:     4,
@@ -103,7 +101,6 @@ var ArchMIPS = &Arch{
        Name:      "mips",
        Family:    MIPS,
        ByteOrder: binary.BigEndian,
-       IntSize:   4,
        PtrSize:   4,
        RegSize:   4,
        MinLC:     4,
@@ -113,7 +110,6 @@ var ArchMIPSLE = &Arch{
        Name:      "mipsle",
        Family:    MIPS,
        ByteOrder: binary.LittleEndian,
-       IntSize:   4,
        PtrSize:   4,
        RegSize:   4,
        MinLC:     4,
@@ -123,7 +119,6 @@ var ArchMIPS64 = &Arch{
        Name:      "mips64",
        Family:    MIPS64,
        ByteOrder: binary.BigEndian,
-       IntSize:   8,
        PtrSize:   8,
        RegSize:   8,
        MinLC:     4,
@@ -133,7 +128,6 @@ var ArchMIPS64LE = &Arch{
        Name:      "mips64le",
        Family:    MIPS64,
        ByteOrder: binary.LittleEndian,
-       IntSize:   8,
        PtrSize:   8,
        RegSize:   8,
        MinLC:     4,
@@ -143,7 +137,6 @@ var ArchPPC64 = &Arch{
        Name:      "ppc64",
        Family:    PPC64,
        ByteOrder: binary.BigEndian,
-       IntSize:   8,
        PtrSize:   8,
        RegSize:   8,
        MinLC:     4,
@@ -153,7 +146,6 @@ var ArchPPC64LE = &Arch{
        Name:      "ppc64le",
        Family:    PPC64,
        ByteOrder: binary.LittleEndian,
-       IntSize:   8,
        PtrSize:   8,
        RegSize:   8,
        MinLC:     4,
@@ -163,7 +155,6 @@ var ArchS390X = &Arch{
        Name:      "s390x",
        Family:    S390X,
        ByteOrder: binary.BigEndian,
-       IntSize:   8,
        PtrSize:   8,
        RegSize:   8,
        MinLC:     2,
index 45a968e40fb2777dcd46a4562d754e026f90761c..36528b0aa8d5037f9d49d2a6c1d8d7eb117fd121 100644 (file)
@@ -129,7 +129,7 @@ func Adduint64(ctxt *Link, s *Symbol, v uint64) int64 {
 }
 
 func adduint(ctxt *Link, s *Symbol, v uint64) int64 {
-       return adduintxx(ctxt, s, v, SysArch.IntSize)
+       return adduintxx(ctxt, s, v, SysArch.PtrSize)
 }
 
 func setuint8(ctxt *Link, s *Symbol, r int64, v uint8) int64 {
index 0b2873a3894ab049a579f6a305ba3dab5bf18945..7a7b68b4696f921f5cb4a2a573a029d1ded00af2 100644 (file)
@@ -210,11 +210,11 @@ func decodetypeFuncOutType(arch *sys.Arch, s *Symbol, i int) *Symbol {
 
 // Type.StructType.fields.Slice::length
 func decodetypeStructFieldCount(arch *sys.Arch, s *Symbol) int {
-       return int(decodeInuxi(arch, s.P[commonsize()+2*SysArch.PtrSize:], SysArch.IntSize))
+       return int(decodeInuxi(arch, s.P[commonsize()+2*SysArch.PtrSize:], SysArch.PtrSize))
 }
 
 func decodetypeStructFieldArrayOff(s *Symbol, i int) int {
-       off := commonsize() + 2*SysArch.PtrSize + 2*SysArch.IntSize
+       off := commonsize() + 2*SysArch.PtrSize + 2*SysArch.PtrSize
        if decodetypeHasUncommon(s) {
                off += uncommonSize()
        }
@@ -255,12 +255,12 @@ func decodetypeStructFieldType(s *Symbol, i int) *Symbol {
 
 func decodetypeStructFieldOffs(arch *sys.Arch, s *Symbol, i int) int64 {
        off := decodetypeStructFieldArrayOff(s, i)
-       return int64(decodeInuxi(arch, s.P[off+2*SysArch.PtrSize:], SysArch.IntSize) >> 1)
+       return int64(decodeInuxi(arch, s.P[off+2*SysArch.PtrSize:], SysArch.PtrSize) >> 1)
 }
 
 // InterfaceType.methods.length
 func decodetypeIfaceMethodCount(arch *sys.Arch, s *Symbol) int64 {
-       return int64(decodeInuxi(arch, s.P[commonsize()+2*SysArch.PtrSize:], SysArch.IntSize))
+       return int64(decodeInuxi(arch, s.P[commonsize()+2*SysArch.PtrSize:], SysArch.PtrSize))
 }
 
 // methodsig is a fully qualified typed method signature, like
@@ -342,7 +342,7 @@ func decodetypeMethods(arch *sys.Arch, s *Symbol) []methodsig {
        off := commonsize() // reflect.rtype
        switch decodetypeKind(s) & kindMask {
        case kindStruct: // reflect.structType
-               off += 2*SysArch.PtrSize + 2*SysArch.IntSize
+               off += 2*SysArch.PtrSize + 2*SysArch.PtrSize
        case kindPtr: // reflect.ptrType
                off += SysArch.PtrSize
        case kindFunc: // reflect.funcType
@@ -356,7 +356,7 @@ func decodetypeMethods(arch *sys.Arch, s *Symbol) []methodsig {
        case kindMap: // reflect.mapType
                off += 4*SysArch.PtrSize + 8
        case kindInterface: // reflect.interfaceType
-               off += SysArch.PtrSize + 2*SysArch.IntSize
+               off += SysArch.PtrSize + 2*SysArch.PtrSize
        default:
                // just Sizeof(rtype)
        }
index c765ef604367ce2f6eb21c201bb4abab834c2f66..5fb5612f6fc47a33bd49a45dee48b8d1d7fda8cf 100644 (file)
@@ -318,7 +318,7 @@ func textsectionmap(ctxt *Link) uint32 {
                        break
                }
        }
-       Symgrow(t, nsections*(2*int64(SysArch.IntSize)+int64(SysArch.PtrSize)))
+       Symgrow(t, nsections*(2*int64(SysArch.PtrSize)+int64(SysArch.PtrSize)))
 
        off := int64(0)
        n := 0
@@ -337,8 +337,8 @@ func textsectionmap(ctxt *Link) uint32 {
                if sect.Name != ".text" {
                        break
                }
-               off = setuintxx(ctxt, t, off, sect.Vaddr-textbase, int64(SysArch.IntSize))
-               off = setuintxx(ctxt, t, off, sect.Length, int64(SysArch.IntSize))
+               off = setuintxx(ctxt, t, off, sect.Vaddr-textbase, int64(SysArch.PtrSize))
+               off = setuintxx(ctxt, t, off, sect.Length, int64(SysArch.PtrSize))
                if n == 0 {
                        s := ctxt.Syms.ROLookup("runtime.text", 0)
                        if s == nil {