]> Cypherpunks repositories - gostls13.git/commit
math/big: remove copy responsibility from, rename shlVU, shrVU
authorRuss Cox <rsc@golang.org>
Sat, 5 Apr 2025 18:36:32 +0000 (14:36 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 11 Apr 2025 13:03:38 +0000 (06:03 -0700)
commit432fd9c60fac4485d0473173171206f1ef558829
tree0fe8b446b7bea587b8b7a44296a951af66620c87
parent4dffdd797b69d9423b4a492e2d832e1023326b1b
math/big: remove copy responsibility from, rename shlVU, shrVU

It is annoying that non-x86 implementations of shlVU and shrVU
have to go out of their way to handle the trivial case shift==0
with their own copy loops. Instead, arrange to never call them
with shift==0, so that the code can be removed.

Unfortunately, there are linknames of shlVU, so we cannot
change that function. But we can rename the functions and
then leave behind a shlVU wrapper, so do that.

Since the big.Int API calls the operations Lsh and Rsh, rename
shlVU/shrVU to lshVU/rshVU. Also rename various other shl/shr
methods and functions to lsh/rsh.

Change-Id: Ieaf54e0110a298730aa3e4566ce5be57ba7fc121
Reviewed-on: https://go-review.googlesource.com/c/go/+/664896
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
28 files changed:
src/math/big/arith.go
src/math/big/arith_386.s
src/math/big/arith_amd64.s
src/math/big/arith_arm.s
src/math/big/arith_arm64.s
src/math/big/arith_decl.go
src/math/big/arith_decl_pure.go
src/math/big/arith_loong64.s
src/math/big/arith_mips64x.s
src/math/big/arith_mipsx.s
src/math/big/arith_ppc64x.s
src/math/big/arith_riscv64.s
src/math/big/arith_s390x.s
src/math/big/arith_test.go
src/math/big/arith_wasm.s
src/math/big/decimal.go
src/math/big/float.go
src/math/big/ftoa.go
src/math/big/int.go
src/math/big/int_test.go
src/math/big/nat.go
src/math/big/nat_test.go
src/math/big/natconv.go
src/math/big/natdiv.go
src/math/big/natmul.go
src/math/big/prime.go
src/math/big/rat.go
src/math/big/ratconv.go