]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/asm: fix encoding for arm right shift by constant 0
authorKeith Randall <khr@golang.org>
Thu, 14 Dec 2023 21:07:50 +0000 (13:07 -0800)
committerKeith Randall <khr@golang.org>
Fri, 15 Dec 2023 19:35:21 +0000 (19:35 +0000)
commitb60bf8f8e131b026eb2691e736d3df9dce852297
tree4ddaf9a9843712e08e4aa78fee48bf72c957552b
parent5e939b3a9ce7864551e86c04a05db887c25e2759
cmd/asm: fix encoding for arm right shift by constant 0

Right shifts, for some odd reasons, can encode shifts of constant
1-32 instead of 0-31. Left shifts, however, can encode shifts 0-31.
When the shift amount is 0, arm recommends encoding right shifts
using left shifts.

Fixes #64715

Change-Id: Id3825349aa7195028037893dfe01fa0e405eaa51
Reviewed-on: https://go-review.googlesource.com/c/go/+/549955
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
src/cmd/asm/internal/asm/testdata/arm.s
src/cmd/internal/obj/arm/asm5.go
test/fixedbugs/issue64715.go [new file with mode: 0644]
test/fixedbugs/issue64715.out [new file with mode: 0644]