Skip to content

Commit 03ef105

Browse files
committed
all: remove nacl (part 3, more amd64p32)
Part 1: CL 199499 (GOOS nacl) Part 2: CL 200077 (amd64p32 files, toolchain) Part 3: stuff that arguably should've been part of Part 2, but I forgot one of my grep patterns when splitting the original CL up into two parts. This one might also have interesting stuff to resurrect for any future x32 ABI support. Updates #30439 Change-Id: I2b4143374a253a003666f3c69e776b7e456bdb9c Reviewed-on: https://go-review.googlesource.com/c/go/+/200318 Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 6dc740f commit 03ef105

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+56
-154
lines changed

src/cmd/asm/internal/arch/arch.go

-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ func Set(GOARCH string) *Arch {
5656
return archX86(&x86.Link386)
5757
case "amd64":
5858
return archX86(&x86.Linkamd64)
59-
case "amd64p32":
60-
return archX86(&x86.Linkamd64p32)
6159
case "arm":
6260
return archArm()
6361
case "arm64":

src/cmd/compile/internal/amd64/galign.go

-5
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,12 @@ package amd64
77
import (
88
"cmd/compile/internal/gc"
99
"cmd/internal/obj/x86"
10-
"cmd/internal/objabi"
1110
)
1211

1312
var leaptr = x86.ALEAQ
1413

1514
func Init(arch *gc.Arch) {
1615
arch.LinkArch = &x86.Linkamd64
17-
if objabi.GOARCH == "amd64p32" {
18-
arch.LinkArch = &x86.Linkamd64p32
19-
leaptr = x86.ALEAL
20-
}
2116
arch.REGSP = x86.REGSP
2217
arch.MAXWIDTH = 1 << 50
2318

src/cmd/compile/internal/ssa/config.go

-13
Original file line numberDiff line numberDiff line change
@@ -210,19 +210,6 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize bool) *Config
210210
c.FPReg = framepointerRegAMD64
211211
c.LinkReg = linkRegAMD64
212212
c.hasGReg = false
213-
case "amd64p32":
214-
c.PtrSize = 4
215-
c.RegSize = 8
216-
c.lowerBlock = rewriteBlockAMD64
217-
c.lowerValue = rewriteValueAMD64
218-
c.splitLoad = rewriteValueAMD64splitload
219-
c.registers = registersAMD64[:]
220-
c.gpRegMask = gpRegMaskAMD64
221-
c.fpRegMask = fpRegMaskAMD64
222-
c.FPReg = framepointerRegAMD64
223-
c.LinkReg = linkRegAMD64
224-
c.hasGReg = false
225-
c.noDuffDevice = true
226213
case "386":
227214
c.PtrSize = 4
228215
c.RegSize = 4

src/cmd/compile/internal/ssa/rewrite.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ func isInlinableMemmove(dst, src *Value, sz int64, c *Config) bool {
10611061
// lowers them, so we only perform this optimization on platforms that we know to
10621062
// have fast Move ops.
10631063
switch c.arch {
1064-
case "amd64", "amd64p32":
1064+
case "amd64":
10651065
return sz <= 16 || (sz < 1024 && disjoint(dst, sz, src, sz))
10661066
case "386", "ppc64", "ppc64le", "arm64":
10671067
return sz <= 8
@@ -1077,7 +1077,7 @@ func isInlinableMemmove(dst, src *Value, sz int64, c *Config) bool {
10771077
// for sizes < 32-bit. This is used to decide whether to promote some rotations.
10781078
func hasSmallRotate(c *Config) bool {
10791079
switch c.arch {
1080-
case "amd64", "amd64p32", "386":
1080+
case "amd64", "386":
10811081
return true
10821082
default:
10831083
return false

src/cmd/compile/main.go

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424
var archInits = map[string]func(*gc.Arch){
2525
"386": x86.Init,
2626
"amd64": amd64.Init,
27-
"amd64p32": amd64.Init,
2827
"arm": arm.Init,
2928
"arm64": arm64.Init,
3029
"mips": mips.Init,

src/cmd/dist/build.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ var (
6161
var okgoarch = []string{
6262
"386",
6363
"amd64",
64-
"amd64p32",
6564
"arm",
6665
"arm64",
6766
"mips",
@@ -86,6 +85,7 @@ var okgoos = []string{
8685
"android",
8786
"solaris",
8887
"freebsd",
88+
"nacl", // keep;
8989
"netbsd",
9090
"openbsd",
9191
"plan9",

src/cmd/go/internal/imports/build.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ var KnownOS = map[string]bool{
210210
"illumos": true,
211211
"js": true,
212212
"linux": true,
213-
"nacl": true,
213+
"nacl": true, // legacy; don't remove
214214
"netbsd": true,
215215
"openbsd": true,
216216
"plan9": true,
@@ -222,7 +222,7 @@ var KnownOS = map[string]bool{
222222
var KnownArch = map[string]bool{
223223
"386": true,
224224
"amd64": true,
225-
"amd64p32": true,
225+
"amd64p32": true, // legacy; don't remove
226226
"arm": true,
227227
"armbe": true,
228228
"arm64": true,

src/cmd/go/internal/work/exec.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2390,7 +2390,7 @@ func (b *Builder) gccArchArgs() []string {
23902390
switch cfg.Goarch {
23912391
case "386":
23922392
return []string{"-m32"}
2393-
case "amd64", "amd64p32":
2393+
case "amd64":
23942394
return []string{"-m64"}
23952395
case "arm":
23962396
return []string{"-marm"} // not thumb

src/cmd/internal/obj/x86/obj6.go

-10
Original file line numberDiff line numberDiff line change
@@ -1226,16 +1226,6 @@ var Linkamd64 = obj.LinkArch{
12261226
DWARFRegisters: AMD64DWARFRegisters,
12271227
}
12281228

1229-
var Linkamd64p32 = obj.LinkArch{
1230-
Arch: sys.ArchAMD64P32,
1231-
Init: instinit,
1232-
Preprocess: preprocess,
1233-
Assemble: span6,
1234-
Progedit: progedit,
1235-
UnaryDst: unaryDst,
1236-
DWARFRegisters: AMD64DWARFRegisters,
1237-
}
1238-
12391229
var Link386 = obj.LinkArch{
12401230
Arch: sys.Arch386,
12411231
Init: instinit,

src/cmd/internal/objfile/disasm.go

+14-16
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ func (d *Disasm) Print(w io.Writer, filter *regexp.Regexp, start, end uint64, pr
241241
fmt.Fprintf(tw, " %s:%d\t%#x\t", base(file), line, pc)
242242
}
243243

244-
if size%4 != 0 || d.goarch == "386" || d.goarch == "amd64" || d.goarch == "amd64p32" {
244+
if size%4 != 0 || d.goarch == "386" || d.goarch == "amd64" {
245245
// Print instruction as bytes.
246246
fmt.Fprintf(tw, "%x", code[i:i+size])
247247
} else {
@@ -367,24 +367,22 @@ func disasm_ppc64(code []byte, pc uint64, lookup lookupFunc, byteOrder binary.By
367367
}
368368

369369
var disasms = map[string]disasmFunc{
370-
"386": disasm_386,
371-
"amd64": disasm_amd64,
372-
"amd64p32": disasm_amd64,
373-
"arm": disasm_arm,
374-
"arm64": disasm_arm64,
375-
"ppc64": disasm_ppc64,
376-
"ppc64le": disasm_ppc64,
370+
"386": disasm_386,
371+
"amd64": disasm_amd64,
372+
"arm": disasm_arm,
373+
"arm64": disasm_arm64,
374+
"ppc64": disasm_ppc64,
375+
"ppc64le": disasm_ppc64,
377376
}
378377

379378
var byteOrders = map[string]binary.ByteOrder{
380-
"386": binary.LittleEndian,
381-
"amd64": binary.LittleEndian,
382-
"amd64p32": binary.LittleEndian,
383-
"arm": binary.LittleEndian,
384-
"arm64": binary.LittleEndian,
385-
"ppc64": binary.BigEndian,
386-
"ppc64le": binary.LittleEndian,
387-
"s390x": binary.BigEndian,
379+
"386": binary.LittleEndian,
380+
"amd64": binary.LittleEndian,
381+
"arm": binary.LittleEndian,
382+
"arm64": binary.LittleEndian,
383+
"ppc64": binary.BigEndian,
384+
"ppc64le": binary.LittleEndian,
385+
"s390x": binary.BigEndian,
388386
}
389387

390388
type Liner interface {

src/cmd/internal/sys/arch.go

+1-12
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ package sys
77
import "encoding/binary"
88

99
// ArchFamily represents a family of one or more related architectures.
10-
// For example, amd64 and amd64p32 are both members of the AMD64 family,
11-
// and ppc64 and ppc64le are both members of the PPC64 family.
10+
// For example, ppc64 and ppc64le are both members of the PPC64 family.
1211
type ArchFamily byte
1312

1413
const (
@@ -72,15 +71,6 @@ var ArchAMD64 = &Arch{
7271
MinLC: 1,
7372
}
7473

75-
var ArchAMD64P32 = &Arch{
76-
Name: "amd64p32",
77-
Family: AMD64,
78-
ByteOrder: binary.LittleEndian,
79-
PtrSize: 4,
80-
RegSize: 8,
81-
MinLC: 1,
82-
}
83-
8474
var ArchARM = &Arch{
8575
Name: "arm",
8676
Family: ARM,
@@ -183,7 +173,6 @@ var ArchWasm = &Arch{
183173
var Archs = [...]*Arch{
184174
Arch386,
185175
ArchAMD64,
186-
ArchAMD64P32,
187176
ArchARM,
188177
ArchARM64,
189178
ArchMIPS,

src/cmd/link/internal/amd64/obj.go

-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ import (
3838

3939
func Init() (*sys.Arch, ld.Arch) {
4040
arch := sys.ArchAMD64
41-
if objabi.GOARCH == "amd64p32" {
42-
arch = sys.ArchAMD64P32
43-
}
4441

4542
theArch := ld.Arch{
4643
Funcalign: funcAlign,

src/cmd/link/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func main() {
4545
os.Exit(2)
4646
case "386":
4747
arch, theArch = x86.Init()
48-
case "amd64", "amd64p32":
48+
case "amd64":
4949
arch, theArch = amd64.Init()
5050
case "arm":
5151
arch, theArch = arm.Init()

src/crypto/md5/md5block_decl.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// +build amd64 amd64p32 386 arm ppc64le ppc64 s390x arm64
5+
// +build amd64 386 arm ppc64le ppc64 s390x arm64
66

77
package md5
88

src/crypto/md5/md5block_generic.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// +build !amd64,!amd64p32,!386,!arm,!ppc64le,!ppc64,!s390x,!arm64
5+
// +build !amd64,!386,!arm,!ppc64le,!ppc64,!s390x,!arm64
66

77
package md5
88

src/crypto/sha1/sha1block_decl.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// +build amd64p32 arm 386 s390x
5+
// +build arm 386 s390x
66

77
package sha1
88

src/crypto/sha1/sha1block_generic.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// +build !amd64,!amd64p32,!386,!arm,!s390x,!arm64
5+
// +build !amd64,!386,!arm,!s390x,!arm64
66

77
package sha1
88

src/go/build/syslist.go

+3
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@
44

55
package build
66

7+
// List of past, present, and future known GOOS and GOARCH values.
8+
// Do not remove from this list, as these are used for go/build filename matching.
9+
710
const goosList = "aix android darwin dragonfly freebsd hurd illumos js linux nacl netbsd openbsd plan9 solaris windows zos "
811
const goarchList = "386 amd64 amd64p32 arm armbe arm64 arm64be ppc64 ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le ppc riscv riscv64 s390 s390x sparc sparc64 wasm "

src/hash/crc32/crc32_otherarch.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// +build !amd64,!amd64p32,!s390x,!ppc64le,!arm64
5+
// +build !amd64,!s390x,!ppc64le,!arm64
66

77
package crc32
88

src/internal/bytealg/compare_generic.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// +build !386,!amd64,!amd64p32,!s390x,!arm,!arm64,!ppc64,!ppc64le,!mips,!mipsle,!wasm,!mips64,!mips64le
5+
// +build !386,!amd64,!s390x,!arm,!arm64,!ppc64,!ppc64le,!mips,!mipsle,!wasm,!mips64,!mips64le
66

77
package bytealg
88

src/internal/bytealg/compare_native.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// +build 386 amd64 amd64p32 s390x arm arm64 ppc64 ppc64le mips mipsle wasm mips64 mips64le
5+
// +build 386 amd64 s390x arm arm64 ppc64 ppc64le mips mipsle wasm mips64 mips64le
66

77
package bytealg
88

src/internal/bytealg/indexbyte_generic.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// +build !386,!amd64,!amd64p32,!s390x,!arm,!arm64,!ppc64,!ppc64le,!mips,!mipsle,!mips64,!mips64le,!wasm
5+
// +build !386,!amd64,!s390x,!arm,!arm64,!ppc64,!ppc64le,!mips,!mipsle,!mips64,!mips64le,!wasm
66

77
package bytealg
88

src/internal/bytealg/indexbyte_native.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// +build 386 amd64 amd64p32 s390x arm arm64 ppc64 ppc64le mips mipsle mips64 mips64le wasm
5+
// +build 386 amd64 s390x arm arm64 ppc64 ppc64le mips mipsle mips64 mips64le wasm
66

77
package bytealg
88

src/internal/cpu/cpu_no_init.go

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
// +build !386
66
// +build !amd64
7-
// +build !amd64p32
87
// +build !arm
98
// +build !arm64
109
// +build !ppc64

src/internal/cpu/cpu_x86.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// +build 386 amd64 amd64p32
5+
// +build 386 amd64
66

77
package cpu
88

@@ -55,8 +55,8 @@ func doinit() {
5555
{Name: "sse42", Feature: &X86.HasSSE42},
5656
{Name: "ssse3", Feature: &X86.HasSSSE3},
5757

58-
// These capabilities should always be enabled on amd64(p32):
59-
{Name: "sse2", Feature: &X86.HasSSE2, Required: GOARCH == "amd64" || GOARCH == "amd64p32"},
58+
// These capabilities should always be enabled on amd64:
59+
{Name: "sse2", Feature: &X86.HasSSE2, Required: GOARCH == "amd64"},
6060
}
6161

6262
maxID, _, _, _ := cpuid(0, 0)

src/internal/cpu/cpu_x86.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// +build 386 amd64 amd64p32
5+
// +build 386 amd64
66

77
#include "textflag.h"
88

src/internal/cpu/cpu_x86_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// +build 386 amd64 amd64p32
5+
// +build 386 amd64
66

77
package cpu_test
88

src/math/exp_asm.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// +build amd64 amd64p32
5+
// +build amd64
66

77
package math
88

src/reflect/all_test.go

-3
Original file line numberDiff line numberDiff line change
@@ -6104,9 +6104,6 @@ var funcLayoutTests []funcLayoutTest
61046104

61056105
func init() {
61066106
var argAlign uintptr = PtrSize
6107-
if runtime.GOARCH == "amd64p32" {
6108-
argAlign = 2 * PtrSize
6109-
}
61106107
roundup := func(x uintptr, a uintptr) uintptr {
61116108
return (x + a - 1) / a * a
61126109
}

0 commit comments

Comments
 (0)