Skip to content

Commit

Permalink
runtime,internal: move runtime/internal/math to internal/runtime/math
Browse files Browse the repository at this point in the history
Cleanup and friction reduction.

Updates golang#65355.

Change-Id: I6c4fcd409d044c00d16561fe9ed2257877d73f5b
Reviewed-on: https://go-review.googlesource.com/c/go/+/600435
Reviewed-by: Keith Randall <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Keith Randall <[email protected]>
  • Loading branch information
dr2chase committed Jul 23, 2024
1 parent fe87b58 commit f9eb3e3
Show file tree
Hide file tree
Showing 17 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/cmd/compile/internal/ssa/_gen/ARM64.rules
Original file line number Diff line number Diff line change
Expand Up @@ -1931,7 +1931,7 @@

((REV|REVW) ((REV|REVW) p)) => p

// runtime/internal/math.MulUintptr intrinsics
// internal/runtime/math.MulUintptr intrinsics

(Select0 (Mul64uover x y)) => (MUL x y)
(Select1 (Mul64uover x y)) => (NotEqual (CMPconst (UMULH <typ.UInt64> x y) [0]))
6 changes: 3 additions & 3 deletions src/cmd/compile/internal/ssagen/ssa.go
Original file line number Diff line number Diff line change
Expand Up @@ -4241,7 +4241,7 @@ func InitTables() {
},
all...)
}
addF("runtime/internal/math", "MulUintptr",
addF("internal/runtime/math", "MulUintptr",
func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value {
if s.config.PtrSize == 4 {
return s.newValue2(ssa.OpMul32uover, types.NewTuple(types.Types[types.TUINT], types.Types[types.TUINT]), args[0], args[1])
Expand Down Expand Up @@ -5025,14 +5025,14 @@ func InitTables() {
},
sys.AMD64, sys.ARM64, sys.PPC64, sys.S390X, sys.MIPS64, sys.RISCV64, sys.Loong64)
alias("math/bits", "Mul", "math/bits", "Mul64", p8...)
alias("runtime/internal/math", "Mul64", "math/bits", "Mul64", p8...)
alias("internal/runtime/math", "Mul64", "math/bits", "Mul64", p8...)
addF("math/bits", "Add64",
func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value {
return s.newValue3(ssa.OpAdd64carry, types.NewTuple(types.Types[types.TUINT64], types.Types[types.TUINT64]), args[0], args[1], args[2])
},
sys.AMD64, sys.ARM64, sys.PPC64, sys.S390X, sys.RISCV64, sys.Loong64, sys.MIPS64)
alias("math/bits", "Add", "math/bits", "Add64", p8...)
alias("runtime/internal/math", "Add64", "math/bits", "Add64", all...)
alias("internal/runtime/math", "Add64", "math/bits", "Add64", all...)
addF("math/bits", "Sub64",
func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value {
return s.newValue3(ssa.OpSub64borrow, types.NewTuple(types.Types[types.TUINT64], types.Types[types.TUINT64]), args[0], args[1], args[2])
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/compile/internal/test/inl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func TestIntendedInlining(t *testing.T) {
"traceEnabled",
},
"runtime/internal/sys": {},
"runtime/internal/math": {
"internal/runtime/math": {
"MulUintptr",
},
"bytes": {
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/compile/internal/walk/builtin.go
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ func walkUnsafeSlice(n *ir.BinaryExpr, init *ir.Nodes) ir.Node {
return walkExpr(typecheck.Expr(h), init)
}

var math_MulUintptr = &types.Sym{Pkg: types.NewPkg("runtime/internal/math", "math"), Name: "MulUintptr"}
var math_MulUintptr = &types.Sym{Pkg: types.NewPkg("internal/runtime/math", "math"), Name: "MulUintptr"}

func walkUnsafeString(n *ir.BinaryExpr, init *ir.Nodes) ir.Node {
ptr := safeExpr(n.X, init)
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/internal/objabi/pkgspecial.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var runtimePkgs = []string{

"internal/runtime/atomic",
"internal/runtime/exithook",
"runtime/internal/math",
"internal/runtime/math",
"runtime/internal/sys",
"internal/runtime/syscall",

Expand Down
2 changes: 1 addition & 1 deletion src/go/build/deps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ var depsRules = `
< internal/runtime/syscall
< internal/runtime/atomic
< internal/runtime/exithook
< runtime/internal/math
< internal/runtime/math
< runtime
< sync/atomic
< internal/race
Expand Down
4 changes: 2 additions & 2 deletions src/internal/coverage/pkid.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ package coverage
// slot: 3 path='internal/goos'
// slot: 4 path='runtime/internal/sys' hard-coded id: 5
// slot: 5 path='internal/abi' hard-coded id: 4
// slot: 6 path='runtime/internal/math' hard-coded id: 6
// slot: 6 path='internal/runtime/math' hard-coded id: 6
// slot: 7 path='internal/bytealg' hard-coded id: 7
// slot: 8 path='internal/goexperiment'
// slot: 9 path='internal/runtime/syscall' hard-coded id: 8
Expand All @@ -52,7 +52,7 @@ var rtPkgs = [...]string{
"internal/chacha8rand",
"runtime/internal/sys",
"internal/abi",
"runtime/internal/math",
"internal/runtime/math",
"internal/bytealg",
"internal/goexperiment",
"internal/runtime/syscall",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
package math_test

import (
. "runtime/internal/math"
. "internal/runtime/math"
"testing"
)

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/arena.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ import (
"internal/abi"
"internal/goarch"
"internal/runtime/atomic"
"runtime/internal/math"
"internal/runtime/math"
"runtime/internal/sys"
"unsafe"
)
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/chan.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package runtime
import (
"internal/abi"
"internal/runtime/atomic"
"runtime/internal/math"
"internal/runtime/math"
"unsafe"
)

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/hash64.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
package runtime

import (
"runtime/internal/math"
"internal/runtime/math"
"unsafe"
)

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/malloc.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ import (
"internal/goarch"
"internal/goos"
"internal/runtime/atomic"
"runtime/internal/math"
"internal/runtime/math"
"runtime/internal/sys"
"unsafe"
)
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import (
"internal/abi"
"internal/goarch"
"internal/runtime/atomic"
"runtime/internal/math"
"internal/runtime/math"
"unsafe"
)

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/rand.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package runtime
import (
"internal/chacha8rand"
"internal/goarch"
"runtime/internal/math"
"internal/runtime/math"
"unsafe"
_ "unsafe" // for go:linkname
)
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/slice.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package runtime
import (
"internal/abi"
"internal/goarch"
"runtime/internal/math"
"internal/runtime/math"
"runtime/internal/sys"
"unsafe"
)
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/unsafe.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
package runtime

import (
"runtime/internal/math"
"internal/runtime/math"
"unsafe"
)

Expand Down

0 comments on commit f9eb3e3

Please sign in to comment.