[PATCH] D67853: [PowerPC][XCOFF] Fix expansion of LWZtoc Pseudo for AIX.

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 25 10:37:43 PDT 2019


hubert.reinterpretcast added inline comments.


================
Comment at: llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp:696
+    // AIX uses the local symbol directly for the operand; that the symbol is
+    // accessed toc-relative is implicit.
+    if (IsAIX) {
----------------
sfertile wrote:
> hubert.reinterpretcast wrote:
> > I would prefer if we mentioned "label" somewhere in the comment as the term that maps better in the context of AIX. The implicit property is also limited to certain contexts (the Assembler Language Reference describes the condition as use of the label as a displacement in a D-form instruction), and the comment is insufficiently qualified to make that clear.
> > I would prefer if we mentioned "label" somewhere in the comment as the term that maps better in the context of AIX. 
> 
> Can you expand on that, I'm not sure what semantic difference there is between a local symbol and a local label. I considered them equivalent, but can be wrong.
> 
> >  The implicit property is also limited to certain contexts (the Assembler Language Reference describes the condition as use of the label as a displacement in a D-form instruction), and the comment is insufficiently qualified to make that clear.
> 
> What about:
> ```
> // AIX uses the local symbol directly for the operand; that the symbol is
>  // accessed toc-relative in a lwz instruction is implicit.
> ```
> 
Maybe: "[ ... ] directly as the lwz displacement operand for references into the toc section. The displacement value will be generated relative to the toc-base."

As for the difference between a label and a local symbol: A label in the assembly may be used to provide a definition for a symbol, but does not itself form a symbol. When using a reference to a label that is not a symbol, the generated relocation should refer to the symbol table entry of the csect. When using a reference to a label that is a symbol, the generated relocation refers to the symbol table entry of the symbol. For toc entries, the csect is the entry itself, so a non-symbol label to the start of the entry would act like the entry symbol/csect.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D67853





More information about the llvm-commits mailing list