[llvm] [RISCV] Support Global Dynamic TLSDESC in the RISC-V backend (PR #66915)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 28 12:23:54 PST 2023


================
@@ -3107,6 +3136,41 @@ void RISCVAsmParser::emitLoadTLSGDAddress(MCInst &Inst, SMLoc IDLoc,
                     RISCV::ADDI, IDLoc, Out);
 }
 
+void RISCVAsmParser::emitLoadTLSDescAddress(MCInst &Inst, SMLoc IDLoc,
+                                            MCStreamer &Out) {
+  // The load TLS GD address pseudo-instruction "la.tlsdesc" is used in
+  // global-dynamic TLS model addressing of global symbols:
+  //   la.tlsdesc rdest, symbol
+  // expands to
+  //   TmpLabel: AUIPC rdest, %tlsdesc_hi(symbol)
+  //             ADDI rdest, rdest, %pcrel_lo(TmpLabel)
----------------
topperc wrote:

what about the JALR?

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


More information about the llvm-commits mailing list