mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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>
This commit is contained in:
parent
f594a3ec85
commit
b4ac4b4b42
3 changed files with 4 additions and 0 deletions
|
|
@ -265,6 +265,7 @@ const (
|
|||
ALU12IW
|
||||
ALU32ID
|
||||
ALU52ID
|
||||
APCALAU12I
|
||||
APCADDU12I
|
||||
AJIRL
|
||||
ABGE
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ var Anames = []string{
|
|||
"LU12IW",
|
||||
"LU32ID",
|
||||
"LU52ID",
|
||||
"PCALAU12I",
|
||||
"PCADDU12I",
|
||||
"JIRL",
|
||||
"BGE",
|
||||
|
|
|
|||
|
|
@ -1847,6 +1847,8 @@ func (c *ctxt0) opir(a obj.As) uint32 {
|
|||
return 0x0a << 25
|
||||
case ALU32ID:
|
||||
return 0x0b << 25
|
||||
case APCALAU12I:
|
||||
return 0x0d << 25
|
||||
case APCADDU12I:
|
||||
return 0x0e << 25
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue