<div dir="ltr"><div><div><div>Dear all,<br><br></div>  I am trying to work on the .unwind directives in the AsmParser.  <a href="https://github.com/loganchien/llvm/compare/master...add-arm-unwind-directives">There's the incomplete patch</a> which you may be interested in.  Currently, it implements most of the existing directives which are used by Clang.  It is incomplete because:<br>
<br>(1) The test case coverage is not high enough.<br></div><div>(2) Several directives are not implemented yet: ".movsp", ".personality_index", and etc.<br></div><div>(3) The diagnostic is not implemented well.  Several assertions should always be checked.<br>
</div><div><br>  I will try to finish them ASAP.<br><br></div></div>Sincerely,<br>Logan<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 16, 2013 at 11:40 AM, Ilyong Cho <span dir="ltr"><<a href="mailto:ilyoan@gmail.com" target="_blank">ilyoan@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Thank you for response.</p>
<p dir="ltr">Does llvm-mc deal with unwind directive? That's awsome!</p>
<p dir="ltr">I've posted a snippet here( <a href="https://gist.github.com/ILyoan/5392936" target="_blank">https://gist.github.com/ILyoan/5392936</a>). I've only posted stack related parts with comments but it contains all information to exception table. So I believe you can test with it.<br>

</p>
<p dir="ltr">Regards<span class="HOEnZb"><font color="#888888"><br>
Ilyong Cho<br>
</font></span></p><div class="HOEnZb"><div class="h5">
<div style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi,<br><br></div><div>  Sorry for the late reply.  I have read your patch.  It seems that there are several differences.  Maybe we can cooperate to merge them in to one patch (if you don't mind.)<br>





<br></div>
<div><b>1. Add new .movsp directive.</b><br><br></div><div>This part LGTM.<br><br></div><div><b>2. Much more delicate algorithm for $SP offset. </b><br><br></div><div>I have to admit that the algorithm in my patch is likely to be different from the one in gas.  Due to the lack of documentation, I have to guess the algorithm by disassembling the object files generated by gas.  Since I have only tested them with the assembly files generated by clang, it might be incompatible with gas when they are used as an assembler.  Especially, when there are multiple .setfp directives in a function.</div>




<div><br></div><div>May you attach the assembly file that you are trying to assemble?  I can try to deal with llvm-mc these days.<br><br></div><div>Sincerely,<br></div><div>Logan<br></div><div><br>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 15, 2013 at 5:30 PM, Ilyong Cho <span dir="ltr"><<a href="mailto:ilyoan@gmail.com" target="_blank">ilyoan@gmail.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Or we can just ignore such cases.<br>
Becasue it's very very weird and at least there is a another option to conpile it :)</p>
<p dir="ltr">Regards<br>
Ilyong Cho</p>
<div class="gmail_quote">2013. 4. 15. ¿ÀÈÄ 6:26¿¡ "Ilyong Cho" <<a href="mailto:ilyoan@gmail.com" target="_blank">ilyoan@gmail.com</a>>´ÔÀÌ ÀÛ¼º:<div><div><br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<p dir="ltr">Ooops I've accidently pushed send button :)</p>
<p dir="ltr">Anyway, IMO, There is no problem the patch from Logan regarding to the issue I mentioned, because there is no way to produce the case right now.<br>
But after llvm-mc understand unwind directive, it can be the case.</p>
<p dir="ltr">Regards,<br>
Ilyong Cho</p>
<div class="gmail_quote">2013. 4. 15. ¿ÀÈÄ 6:12¿¡ "Ilyong Cho" <<a href="mailto:ilyoan@gmail.com" target="_blank">ilyoan@gmail.com</a>>´ÔÀÌ ÀÛ¼º:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<p dir="ltr">Hi Anton</p>
<p dir="ltr">Actually I'm not sure if it is possible to make such test cases using higher language. And llvm-mc looks like does not understand unwind directives(am I right?) so it is impossible to make test case using llvm-mc.</p>






<p dir="ltr">The counter example is a wired situation that pushes the same register into stack twice from function prologue(I just analyzed reviewing source code, so I can be wrong). There are some such handmade assemblies In my personal project for some reasons(ex. stack manipulation)<br>






And I'm pretty sure that higher language compilers never generate such assembly.<br>
</p>
<div class="gmail_quote">2013. 4. 15. ¿ÀÈÄ 5:28¿¡ "Anton Korobeynikov" <<a href="mailto:anton@korobeynikov.info" target="_blank">anton@korobeynikov.info</a>>´ÔÀÌ ÀÛ¼º:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





Hello,<br>
<br>
> I've juat looked the patch and I think it looks good but I found the<br>
> implementation of that patch is different from gas's. I have a weird use<br>
> case (hand made ARM assembly with a complex function prologue) that the<br>
> patch on D414 couldn't cover but gas implementation(and mine) could cover.<br>
Will it be possible for you to provide a testcase then? Knowing that<br>
the code is broken is not a good thing for committing it :)<br>
<br>
--<br>
With best regards, Anton Korobeynikov<br>
Faculty of Mathematics and Mechanics, Saint Petersburg State University<br>
</blockquote></div>
</blockquote></div>
</blockquote></div></div></div>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>
</div>
</div></div></blockquote></div><br></div>