]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/obj/loong64: add the PCALAU12I instruction for reloc use
authorWANG Xuerui <git@xen0n.name>
Sat, 3 Dec 2022 12:57:52 +0000 (20:57 +0800)
committerGopher Robot <gobot@golang.org>
Thu, 16 Mar 2023 17:24:42 +0000 (17:24 +0000)
commitb4ac4b4b42bd2b8014cba57991d43f09eb6292f6
tree723d2d785ca68cd979cc5208669d3cb17acd7288
parentf594a3ec85a3bdeaa3d22bf0deb5f9d6d70d3af1
cmd/internal/obj/loong64: add the PCALAU12I instruction for reloc use

The LoongArch ELF psABI v2.00 revamped the relocation design, largely
moving to using the `pcalau12i + addi/ld/st` pair for PC-relative
addressing within +/- 32 bits. The "pcala" in `pcalau12i` stands for
"PC-aligned add"; the instruction's semantics happen to coincide with
arm64's `adrp`.

Add support for emitting this instruction as part of the relevant
addressing ops, for use with new reloc types later.

Updates #58784

Change-Id: Ic1747cd9745aad0d1abb9bd78400cd5ff5978bc8
Reviewed-on: https://go-review.googlesource.com/c/go/+/455016
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Auto-Submit: Wayne Zuo <wdvxdr@golangcn.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Wayne Zuo <wdvxdr@golangcn.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Wayne Zuo <wdvxdr@golangcn.org>
Reviewed-by: xiaodong liu <teaofmoli@gmail.com>
Reviewed-by: Meidan Li <limeidan@loongson.cn>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/internal/obj/loong64/a.out.go
src/cmd/internal/obj/loong64/anames.go
src/cmd/internal/obj/loong64/asm.go