<div>> Showing the value for the fixup requires full object </div><div>> code layout and relaxation, which isn't done is the text-to-text path.
</div><div><br></div><div>Their are 2 problems I'm looking to solve:</div><div><br></div><div>  1) How do we unit-test the integrated assembler when there are fixups?</div><div>  2) Can we avoid the duplication in encoding a fixup versus encoding an immediate?</div>

<div><br></div><div>In the case of ADR, the fixup was properly being shifted for Thumb mode, but the immediate was not.  In my first attempt to fix this (and another developer as well), we patched the .td file, which fixed the immediate and broke the fixup.</div>

<div><br></div><div>So I wonder, do all fixups require full object code layout?  For example, in the context of Thumb, can we always convert:</div><div><br></div><div>        adr r0, lbl</div><div>        nop</div><div>    lbl:</div>

<div><br></div><div>into:</div><div><br></div><div>        adr.n r0, #0</div><div><br></div><div>I understand why clang's "-S" option would never want to output this syntax (GCC doesn't grok all UAL syntax).  But for LLVM's internal assembler, should we be trying to remove some fixups with a text-to-text pass before encoding?  I see llvm-mc has a '-mc-relax-all' option, but doesn't seem to do anything for me - unrelated?</div>

<div><br></div><div>Thanks,</div><div>Greg</div><div><br></div><div><br><div class="gmail_quote">On Wed, Sep 12, 2012 at 9:20 PM, Owen Anderson <span dir="ltr"><<a href="mailto:resistor@mac.com" target="_blank">resistor@mac.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Showing the value for the fixup requires full object code layout and relaxation, which isn't done is the text-to-text path.<div>

<br></div><div>--Owen<br><div><br><div><div><div class="h5"><div>On Sep 12, 2012, at 5:54 PM, Greg Fitzgerald <<a href="mailto:garious@gmail.com" target="_blank">garious@gmail.com</a>> wrote:</div><br></div></div><blockquote type="cite">

<div><div class="h5"><p class="MsoNormal">When I use llvm-mc’s ‘-show-encoding’, it only goes as far
as printing “fixups”:</p><div> <br></div><p class="MsoNormal" style="margin-left:.5in">$ echo -e "adr r0,
lbl\nnop\nlbl:" | llvm-mc -triple=thumbv7 -show-encoding</p><div style="margin-left:0.5in"> <br></div><p class="MsoNormal">Outputs:</p><p class="MsoNormal" style="margin-left:.5in">@ encoding: [A,0xa0]</p><p class="MsoNormal" style="margin-left:.5in">

@    fixup A – offset:
0, value: lbl, kind: fixup_thumb_adr_pcrel_10</p><div> <br></div><div> <br></div><p class="MsoNormal">To find out that it is encoded as 0xa001, I can do:</p><div> <br></div><p class="MsoNormal" style="margin-left:.5in">$ echo -e "adr r0,
lbl\nnop\nlbl:" | llvm-mc -triple=thumbv7 -show-encoding <span style="color:red">-filetype=obj > tmp.o</span></p><p class="MsoNormal" style="margin-left:.5in"><span style="color:red">$
llvm-objdump -d tmp.o</span></p><div> <br></div><p class="MsoNormal">Is there a way to get that encoding directly from llvm-mc?</p><div> <br></div><p class="MsoNormal">Thanks,</p><p class="MsoNormal">Greg</p></div></div>


_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>

<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></blockquote></div><br></div></div></div></blockquote></div><br></div>