<div dir="ltr">On Thu, Aug 21, 2014 at 9:42 AM, Renato Golin <span dir="ltr"><<a href="mailto:renato.golin@linaro.org" target="_blank">renato.golin@linaro.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 21 August 2014 17:35, Saleem Abdulrasool <<a href="mailto:compnerd@compnerd.org">compnerd@compnerd.org</a>> wrote:<br>

> Sorry, Im afraid I don't understand something here.  Why would we want a<br>
> flag for the "bare-metal" target?  I believe both environments should<br>
> conform to the RTABI (which defines the functions being used).  As it<br>
> stands, compiler-rt (correctly, AIUI) doesn't change behavior based on the<br>
> "bare-metal" vs Linux or Android.<br>
<br>
</div>In GNUEABI mode, _modsi3 and _divsi3 are perfectly valid replacements<br>
for __aeabi_divmod. In pure EABI mode, they're not. Most of the time,<br>
they're just aliases, so that's ok, but in divmod's case, the<br>
remainder comes from a different place, so it does matter. So we don't<br>
actually need to differentiate "bare-metal" vs. "OS", but "pure EABI"<br>
from "relaxed EABI". AndroidEABI is yet another variation, not<br>
entirely compatible with either, and not just in library calls.<br></blockquote><div><br></div><div>Would you happen to have a reference for the differences in the android case?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Compiler-RT has both standards (AFAIK) and it doesn't change anything,<br>
it just provides the functionality. The problem, IIUC, is not RT, but<br>
the back-end emitting conflicting calls and result expectation.<br></blockquote><div><br></div><div>Right.  But, libgcc as well as compiler-rt already provide the needed functions for the standard EABI, so why not use that?  It results in simplicity in both LLVM as well as the user code (they see the same behavior everywhere).</div>
<div><br></div><div>As to the point of having alternatives, it seems that using the RTABI functions where there are equivalents should be better or eequivalent to the alternative.  In the particular example, the first call already does most of the work for the second, and you have two calls instead of one.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
cheers,<br>
--renato<br>
</blockquote></div><br>-- <br>Saleem Abdulrasool<br>compnerd (at) compnerd (dot) org
</div></div>