[PATCH] D153206: [PPC32] Parse bl __tls_get_addr(x at tlsgd)@plt+32768

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 6 23:40:32 PDT 2023


nemanjai accepted this revision.
nemanjai added a comment.
This revision is now accepted and ready to land.

I think the code could be clarified a bit with some additional comments, but otherwise LGTM.



================
Comment at: llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp:1568
       return true;
-    E = Parser.getTok().getLoc();
+    // PPC32 allows bl __tls_get_addr(x at tlsgd)@plt+32768. Parse "@plt+32768".
+    if (!isPPC64() && parseOptionalToken(AsmToken::At)) {
----------------
Perhaps this should be `bl __tls_get_addr[+a](x at tlsgd)@plt[+b]` to make it clear that we may be parsing an addend after `__tls_get_addr` as well as one after `@plt`.


================
Comment at: llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp:1587
+      }
+      if (TlsCallAddend)
+        EVal = MCBinaryExpr::createAdd(EVal, TlsCallAddend, getContext());
----------------
And here, perhaps a comment that this adds `__tls_get_addr` with `a|b|a+b`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153206/new/

https://reviews.llvm.org/D153206



More information about the llvm-commits mailing list