[lld] [lld][LoongArch] Relax R_LARCH_PCALA_HI20 and R_LARCH_PCALA_LO12 (PR #112696)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 17 22:05:31 PST 2024


================
@@ -159,6 +160,17 @@ static bool isJirl(uint32_t insn) {
   return (insn & 0xfc000000) == JIRL;
 }
 
+static bool isAddi_w(uint32_t insn) { return (insn & 0xffc00000) == ADDI_W; }
+
+static bool isAddi_d(uint32_t insn) { return (insn & 0xffc00000) == ADDI_D; }
+
+// LoongArch instructions could be divided into a number of kinds based on
+// the width of imm and the number of registers. get_rd/get_rj only applies
+// to those kinds of instructions that could do relocation.
+static uint8_t get_rd(uint32_t insn) { return insn & 0x1f; }
----------------
MaskRay wrote:

`functionCase`

https://github.com/llvm/llvm-project/pull/112696


More information about the llvm-commits mailing list