]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/obj/loong64: recheck jump offset boundary after auto-aligning loop heads
authorGuoqi Chen <chenguoqi@loongson.cn>
Tue, 15 Aug 2023 18:09:49 +0000 (02:09 +0800)
committerCherry Mui <cherryyz@google.com>
Mon, 15 Apr 2024 17:39:37 +0000 (17:39 +0000)
commitf7f56ded0179cd27f21afdd09014a51795db6419
treed634e847375f0f180b074caeb72bf19d962bc352
parent59209c4b3587f10e07ce466d41dcb74b332babd5
cmd/internal/obj/loong64: recheck jump offset boundary after auto-aligning loop heads

After the alignment of the loop header is performed, the offset of the checked
conditional branch instruction may overflow, so it needs to be checked again.

When checking whether the offset of the branch jump instruction overflows, it
can be classified and processed according to the range of the immediate field
of the specific instruction, which can reduce the introduction of unnecessary
jump instructions.

Fixes #61819

Change-Id: I772a5b5b8b8de21c78d7566be30be8ff65fdbce8
Reviewed-on: https://go-review.googlesource.com/c/go/+/519915
Reviewed-by: sophie zhao <zhaoxiaolin@loongson.cn>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Meidan Li <limeidan@loongson.cn>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Run-TryBot: qiu laidongfeng2 <2645477756@qq.com>
Reviewed-by: WANG Xuerui <git@xen0n.name>
src/cmd/internal/obj/loong64/asm.go
src/cmd/internal/obj/loong64/asm_test.go [new file with mode: 0644]