]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/obj/riscv: factor out shift constant code
authorJoel Sing <joel@sing.id.au>
Tue, 18 Feb 2025 07:23:27 +0000 (18:23 +1100)
committerJoel Sing <joel@sing.id.au>
Sat, 22 Mar 2025 00:40:34 +0000 (17:40 -0700)
commitaf133d86e4de00e65581799c155659ce9c8c556c
tree534fc283822a684c0dbc6932da5a46f97beb90ba
parent574e836055f2b329824ae3646bf1cb563ca03d54
cmd/internal/obj/riscv: factor out shift constant code

Move the code that tests to see if a constant can be represented by a
32 bit signed integer and a logical left shift. This reduces duplication
and increases readability. Also add test coverage now that this is an
independent function.

Change-Id: Id25395b1380b00cf5b69ca201b7715ef84f7ade6
Reviewed-on: https://go-review.googlesource.com/c/go/+/652777
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/cmd/internal/obj/riscv/obj.go
src/cmd/internal/obj/riscv/obj_test.go [new file with mode: 0644]