]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/obj/loong64: change the immediate range of ALSL{W/WU/V}
authorlimeidan <limeidan@loongson.cn>
Wed, 6 Aug 2025 06:57:39 +0000 (14:57 +0800)
committerabner chenc <chenguoqi@loongson.cn>
Fri, 8 Aug 2025 02:04:41 +0000 (19:04 -0700)
commit73ff6d148038da77dd05b3dca3f0767db000a0f7
tree3d8b69175ba4133bcdff62f6d1ecf61aec90196a
parentf3606b0825c20e3f3ccdae00bb8d5d7d8dfd745e
cmd/internal/obj/loong64: change the immediate range of ALSL{W/WU/V}

When executing the alsl.w/wu/d family of instructions, the actual shift amount is the immediate value
in the instruction encoding plus one. Therefore, this change is made to align the immediate value
in the assembly code with the programmer's intended shift amount, and to include the result of
the immediate value minus one in the final encoding.

Change-Id: Ic82249251878eabde8372e183d841a03f963f9f9
Reviewed-on: https://go-review.googlesource.com/c/go/+/693475
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: sophie zhao <zhaoxiaolin@loongson.cn>
src/cmd/asm/internal/asm/testdata/loong64enc1.s
src/cmd/internal/obj/loong64/asm.go
src/cmd/internal/obj/loong64/doc.go