diff options
| author | Gavin Lam <gavin.oss@tutamail.com> | 2026-01-15 04:22:13 +0000 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2026-01-22 12:48:33 -0800 |
| commit | e9e05687dee08ba0f0fb07b076f1c3f47bb57f34 (patch) | |
| tree | 004cb6d4462d87c3ecee4f77758577cbf7c51bff /src/runtime | |
| parent | 1996c22f0a58a32f5f415e1a6c84bcb305f04c36 (diff) | |
| download | go-e9e05687dee08ba0f0fb07b076f1c3f47bb57f34.tar.xz | |
internal/runtime: remove math.Mul64
internal/runtime/math.Mul64 is a copy of math/bits.Mul64 and redundant.
Change-Id: I4dd2ab531a32da97839c6b45cf90df6430811967
GitHub-Last-Rev: 1a73e16049ee346ccfa8f052856e49e10e202d70
GitHub-Pull-Request: golang/go#77187
Reviewed-on: https://go-review.googlesource.com/c/go/+/736500
Auto-Submit: Keith Randall <khr@google.com>
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/runtime')
| -rw-r--r-- | src/runtime/hash64.go | 4 | ||||
| -rw-r--r-- | src/runtime/rand.go | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/runtime/hash64.go b/src/runtime/hash64.go index ac26e660c6..d29ceab7eb 100644 --- a/src/runtime/hash64.go +++ b/src/runtime/hash64.go @@ -10,7 +10,7 @@ package runtime import ( - "internal/runtime/math" + "math/bits" "unsafe" ) @@ -75,7 +75,7 @@ func memhash64Fallback(p unsafe.Pointer, seed uintptr) uintptr { } func mix(a, b uintptr) uintptr { - hi, lo := math.Mul64(uint64(a), uint64(b)) + hi, lo := bits.Mul64(uint64(a), uint64(b)) return uintptr(hi ^ lo) } diff --git a/src/runtime/rand.go b/src/runtime/rand.go index 1739e9f8f5..a30845b585 100644 --- a/src/runtime/rand.go +++ b/src/runtime/rand.go @@ -10,7 +10,7 @@ import ( "internal/byteorder" "internal/chacha8rand" "internal/goarch" - "internal/runtime/math" + "math/bits" "unsafe" _ "unsafe" // for go:linkname ) @@ -227,13 +227,13 @@ func randn(n uint32) uint32 { func cheaprand() uint32 { mp := getg().m // Implement wyrand: https://github.com/wangyi-fudan/wyhash - // Only the platform that math.Mul64 can be lowered + // Only the platform that bits.Mul64 can be lowered // by the compiler should be in this list. if goarch.IsAmd64|goarch.IsArm64|goarch.IsPpc64| goarch.IsPpc64le|goarch.IsMips64|goarch.IsMips64le| goarch.IsS390x|goarch.IsRiscv64|goarch.IsLoong64 == 1 { mp.cheaprand += 0xa0761d6478bd642f - hi, lo := math.Mul64(mp.cheaprand, mp.cheaprand^0xe7037ed1a0b428db) + hi, lo := bits.Mul64(mp.cheaprand, mp.cheaprand^0xe7037ed1a0b428db) return uint32(hi ^ lo) } |
