diff options
| author | David Chase <drchase@google.com> | 2024-07-23 11:43:23 -0400 |
|---|---|---|
| committer | David Chase <drchase@google.com> | 2024-07-23 19:05:35 +0000 |
| commit | fc5073bc155545dde4856cccdfcbb31880d1eb66 (patch) | |
| tree | 90aba60eda016a9392cd8ee0d55a154d0aa570e3 /src/cmd/compile | |
| parent | f9eb3e3cd59c1cf38a98f2367c6c8dc180db9a95 (diff) | |
| download | go-fc5073bc155545dde4856cccdfcbb31880d1eb66.tar.xz | |
runtime,internal: move runtime/internal/sys to internal/runtime/sys
Cleanup and friction reduction
For #65355.
Change-Id: Ia14c9dc584a529a35b97801dd3e95b9acc99a511
Reviewed-on: https://go-review.googlesource.com/c/go/+/600436
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile')
| -rw-r--r-- | src/cmd/compile/internal/noder/helpers.go | 4 | ||||
| -rw-r--r-- | src/cmd/compile/internal/ssagen/ssa.go | 26 | ||||
| -rw-r--r-- | src/cmd/compile/internal/test/inl_test.go | 8 | ||||
| -rw-r--r-- | src/cmd/compile/internal/types/pkg.go | 2 | ||||
| -rw-r--r-- | src/cmd/compile/internal/types/type.go | 2 |
5 files changed, 21 insertions, 21 deletions
diff --git a/src/cmd/compile/internal/noder/helpers.go b/src/cmd/compile/internal/noder/helpers.go index 0bff71e658..45512706d2 100644 --- a/src/cmd/compile/internal/noder/helpers.go +++ b/src/cmd/compile/internal/noder/helpers.go @@ -114,11 +114,11 @@ func isTypeParam(t types2.Type) bool { } // isNotInHeap reports whether typ is or contains an element of type -// runtime/internal/sys.NotInHeap. +// internal/runtime/sys.NotInHeap. func isNotInHeap(typ types2.Type) bool { typ = types2.Unalias(typ) if named, ok := typ.(*types2.Named); ok { - if obj := named.Obj(); obj.Name() == "nih" && obj.Pkg().Path() == "runtime/internal/sys" { + if obj := named.Obj(); obj.Name() == "nih" && obj.Pkg().Path() == "internal/runtime/sys" { return true } typ = named.Underlying() diff --git a/src/cmd/compile/internal/ssagen/ssa.go b/src/cmd/compile/internal/ssagen/ssa.go index d0ca5b7f30..e6d5a13957 100644 --- a/src/cmd/compile/internal/ssagen/ssa.go +++ b/src/cmd/compile/internal/ssagen/ssa.go @@ -4287,13 +4287,13 @@ func InitTables() { // make it worthwhile as an intrinsic brev_arch = append(brev_arch, sys.PPC64) } - /******** runtime/internal/sys ********/ - addF("runtime/internal/sys", "Bswap32", + /******** internal/runtime/sys ********/ + addF("internal/runtime/sys", "Bswap32", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return s.newValue1(ssa.OpBswap32, types.Types[types.TUINT32], args[0]) }, brev_arch...) - addF("runtime/internal/sys", "Bswap64", + addF("internal/runtime/sys", "Bswap64", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return s.newValue1(ssa.OpBswap64, types.Types[types.TUINT64], args[0]) }, @@ -4309,9 +4309,9 @@ func InitTables() { // Make Prefetch intrinsics for supported platforms // On the unsupported platforms stub function will be eliminated - addF("runtime/internal/sys", "Prefetch", makePrefetchFunc(ssa.OpPrefetchCache), + addF("internal/runtime/sys", "Prefetch", makePrefetchFunc(ssa.OpPrefetchCache), sys.AMD64, sys.ARM64, sys.PPC64) - addF("runtime/internal/sys", "PrefetchStreamed", makePrefetchFunc(ssa.OpPrefetchCacheStreamed), + addF("internal/runtime/sys", "PrefetchStreamed", makePrefetchFunc(ssa.OpPrefetchCacheStreamed), sys.AMD64, sys.ARM64, sys.PPC64) /******** internal/runtime/atomic ********/ @@ -4837,8 +4837,8 @@ func InitTables() { return s.newValue1(ssa.OpCtz64, types.Types[types.TINT], y) }, sys.S390X) - alias("math/bits", "ReverseBytes64", "runtime/internal/sys", "Bswap64", all...) - alias("math/bits", "ReverseBytes32", "runtime/internal/sys", "Bswap32", all...) + alias("math/bits", "ReverseBytes64", "internal/runtime/sys", "Bswap64", all...) + alias("math/bits", "ReverseBytes32", "internal/runtime/sys", "Bswap32", all...) // ReverseBytes inlines correctly, no need to intrinsify it. // Nothing special is needed for targets where ReverseBytes16 lowers to a rotate // On Power10, 16-bit rotate is not available so use BRH instruction @@ -5051,12 +5051,12 @@ func InitTables() { sys.AMD64) alias("math/bits", "Div", "math/bits", "Div64", sys.ArchAMD64) - alias("runtime/internal/sys", "TrailingZeros8", "math/bits", "TrailingZeros8", all...) - alias("runtime/internal/sys", "TrailingZeros32", "math/bits", "TrailingZeros32", all...) - alias("runtime/internal/sys", "TrailingZeros64", "math/bits", "TrailingZeros64", all...) - alias("runtime/internal/sys", "Len8", "math/bits", "Len8", all...) - alias("runtime/internal/sys", "Len64", "math/bits", "Len64", all...) - alias("runtime/internal/sys", "OnesCount64", "math/bits", "OnesCount64", all...) + alias("internal/runtime/sys", "TrailingZeros8", "math/bits", "TrailingZeros8", all...) + alias("internal/runtime/sys", "TrailingZeros32", "math/bits", "TrailingZeros32", all...) + alias("internal/runtime/sys", "TrailingZeros64", "math/bits", "TrailingZeros64", all...) + alias("internal/runtime/sys", "Len8", "math/bits", "Len8", all...) + alias("internal/runtime/sys", "Len64", "math/bits", "Len64", all...) + alias("internal/runtime/sys", "OnesCount64", "math/bits", "OnesCount64", all...) /******** sync/atomic ********/ diff --git a/src/cmd/compile/internal/test/inl_test.go b/src/cmd/compile/internal/test/inl_test.go index 4626269582..58f5df953b 100644 --- a/src/cmd/compile/internal/test/inl_test.go +++ b/src/cmd/compile/internal/test/inl_test.go @@ -97,7 +97,7 @@ func TestIntendedInlining(t *testing.T) { "traceLocker.ok", "traceEnabled", }, - "runtime/internal/sys": {}, + "internal/runtime/sys": {}, "internal/runtime/math": { "MulUintptr", }, @@ -246,9 +246,9 @@ func TestIntendedInlining(t *testing.T) { if runtime.GOARCH != "386" { // As explained above, TrailingZeros64 and TrailingZeros32 are not Go code on 386. // The same applies to Bswap32. - want["runtime/internal/sys"] = append(want["runtime/internal/sys"], "TrailingZeros64") - want["runtime/internal/sys"] = append(want["runtime/internal/sys"], "TrailingZeros32") - want["runtime/internal/sys"] = append(want["runtime/internal/sys"], "Bswap32") + want["internal/runtime/sys"] = append(want["internal/runtime/sys"], "TrailingZeros64") + want["internal/runtime/sys"] = append(want["internal/runtime/sys"], "TrailingZeros32") + want["internal/runtime/sys"] = append(want["internal/runtime/sys"], "Bswap32") } if runtime.GOARCH == "amd64" || runtime.GOARCH == "arm64" || runtime.GOARCH == "loong64" || runtime.GOARCH == "mips" || runtime.GOARCH == "mips64" || runtime.GOARCH == "ppc64" || runtime.GOARCH == "riscv64" || runtime.GOARCH == "s390x" { // internal/runtime/atomic.Loaduintptr is only intrinsified on these platforms. diff --git a/src/cmd/compile/internal/types/pkg.go b/src/cmd/compile/internal/types/pkg.go index c6ce7889af..9f64b84db4 100644 --- a/src/cmd/compile/internal/types/pkg.go +++ b/src/cmd/compile/internal/types/pkg.go @@ -16,7 +16,7 @@ import ( var pkgMap = make(map[string]*Pkg) type Pkg struct { - Path string // string literal used in import statement, e.g. "runtime/internal/sys" + Path string // string literal used in import statement, e.g. "internal/runtime/sys" Name string // package name, e.g. "sys" Prefix string // escaped path for use in symbol table Syms map[string]*Sym diff --git a/src/cmd/compile/internal/types/type.go b/src/cmd/compile/internal/types/type.go index 88052dc97b..41fdefe830 100644 --- a/src/cmd/compile/internal/types/type.go +++ b/src/cmd/compile/internal/types/type.go @@ -1650,7 +1650,7 @@ func NewNamed(obj Object) *Type { t.SetIsShape(true) t.SetHasShape(true) } - if sym.Pkg.Path == "runtime/internal/sys" && sym.Name == "nih" { + if sym.Pkg.Path == "internal/runtime/sys" && sym.Name == "nih" { // Recognize the special not-in-heap type. Any type including // this type will also be not-in-heap. // This logic is duplicated in go/types and |
