1
0
mirror of https://github.com/golang/go synced 2024-11-25 16:57:58 -07:00

runtime,internal: move runtime/internal/math to internal/runtime/math

Cleanup and friction reduction.

Updates #65355.

Change-Id: I6c4fcd409d044c00d16561fe9ed2257877d73f5b
Reviewed-on: https://go-review.googlesource.com/c/go/+/600435
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>
This commit is contained in:
David Chase 2024-07-23 11:18:08 -04:00
parent fe87b586c0
commit f9eb3e3cd5
17 changed files with 19 additions and 19 deletions

View File

@ -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]))

View File

@ -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])
@ -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])

View File

@ -98,7 +98,7 @@ func TestIntendedInlining(t *testing.T) {
"traceEnabled",
},
"runtime/internal/sys": {},
"runtime/internal/math": {
"internal/runtime/math": {
"MulUintptr",
},
"bytes": {

View File

@ -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)

View File

@ -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",

View File

@ -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

View File

@ -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
@ -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",

View File

@ -5,7 +5,7 @@
package math_test
import (
. "runtime/internal/math"
. "internal/runtime/math"
"testing"
)

View File

@ -86,7 +86,7 @@ import (
"internal/abi"
"internal/goarch"
"internal/runtime/atomic"
"runtime/internal/math"
"internal/runtime/math"
"runtime/internal/sys"
"unsafe"
)

View File

@ -20,7 +20,7 @@ package runtime
import (
"internal/abi"
"internal/runtime/atomic"
"runtime/internal/math"
"internal/runtime/math"
"unsafe"
)

View File

@ -10,7 +10,7 @@
package runtime
import (
"runtime/internal/math"
"internal/runtime/math"
"unsafe"
)

View File

@ -104,7 +104,7 @@ import (
"internal/goarch"
"internal/goos"
"internal/runtime/atomic"
"runtime/internal/math"
"internal/runtime/math"
"runtime/internal/sys"
"unsafe"
)

View File

@ -57,7 +57,7 @@ import (
"internal/abi"
"internal/goarch"
"internal/runtime/atomic"
"runtime/internal/math"
"internal/runtime/math"
"unsafe"
)

View File

@ -9,7 +9,7 @@ package runtime
import (
"internal/chacha8rand"
"internal/goarch"
"runtime/internal/math"
"internal/runtime/math"
"unsafe"
_ "unsafe" // for go:linkname
)

View File

@ -7,7 +7,7 @@ package runtime
import (
"internal/abi"
"internal/goarch"
"runtime/internal/math"
"internal/runtime/math"
"runtime/internal/sys"
"unsafe"
)

View File

@ -5,7 +5,7 @@
package runtime
import (
"runtime/internal/math"
"internal/runtime/math"
"unsafe"
)