From e9e05687dee08ba0f0fb07b076f1c3f47bb57f34 Mon Sep 17 00:00:00 2001 From: Gavin Lam Date: Thu, 15 Jan 2026 04:22:13 +0000 Subject: 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 Reviewed-by: Jorropo Reviewed-by: Keith Randall Reviewed-by: Carlos Amedee LUCI-TryBot-Result: Go LUCI --- src/internal/runtime/math/math.go | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'src/internal/runtime') diff --git a/src/internal/runtime/math/math.go b/src/internal/runtime/math/math.go index 0af5aa3f76..e3b277a505 100644 --- a/src/internal/runtime/math/math.go +++ b/src/internal/runtime/math/math.go @@ -25,27 +25,6 @@ func MulUintptr(a, b uintptr) (uintptr, bool) { return a * b, overflow } -// Mul64 returns the 128-bit product of x and y: (hi, lo) = x * y -// with the product bits' upper half returned in hi and the lower -// half returned in lo. -// This is a copy from math/bits.Mul64 -// On supported platforms this is an intrinsic lowered by the compiler. -func Mul64(x, y uint64) (hi, lo uint64) { - const mask32 = 1<<32 - 1 - x0 := x & mask32 - x1 := x >> 32 - y0 := y & mask32 - y1 := y >> 32 - w0 := x0 * y0 - t := x1*y0 + w0>>32 - w1 := t & mask32 - w2 := t >> 32 - w1 += x0 * y1 - hi = x1*y1 + w2 + w1>>32 - lo = x * y - return -} - // Add64 returns the sum with carry of x, y and carry: sum = x + y + carry. // The carry input must be 0 or 1; otherwise the behavior is undefined. // The carryOut output is guaranteed to be 0 or 1. -- cgit v1.3-6-g1900