<div dir="ltr">On 16 May 2013 01:18, JF Bastien <span dir="ltr"><<a href="mailto:jfb@google.com" target="_blank">jfb@google.com</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 dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="im"><div><div class="gmail_extra">

<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><span style="color:rgb(34,34,34)">I disagree, but my opinion may not align with what's "LLVM-like":</span></div>
</blockquote></div></div></div></div></div></blockquote></div></blockquote><div><br></div><div style>That's not true, especially in the LLVM community. We're all on the same side, here.</div><div><br></div><div><br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>So my rationale is: user-mode code should get the best out of LLVM, and system code should have a harder time. Is that the right approach for LLVM?<br>
</div></div></div></blockquote><div><br></div><div style>Most of the time, yes. However, we're talking about ARM, here...</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div>Similar to what x86 does for fast unaligned support? Even there x86 does it per-hardware target, it's OS-independent. I'd argue that the code I submitted was checking for features (v6 and v7), the Darwin check is more of a "Apple is vertically integrated and knows that it wouldn't ship a silly v6 CPU".<br>
</div></div></div></blockquote><div><br></div><div style>This is not an Apple vs. the world issue, be sure of that. LLVM has more Darwin tweaks than any other just because Apple has historically spent the bulk of time&money on LLVM, more than any other company or group. Things are changing recently, but Apple still has a big share of the changes even today. Hardly surprising.</div>
<div style><br></div><div style>The problem here is that ARM is not x86. All modern x86 hardware (90's+) have a BIOS to correctly set-up the best options (have you ever seen BIOS code? It's horrendous), something that is not true for ARM. OSs like Darwin and Linux have total control on how to bring the hardware up, and this is orthogonal to what the hardware is capable or not.</div>
<div style><br></div><div style>An analogy to x86 world would be if there was an option in the BIOS to disable unaligned memory access, so the user could change it randomly. If the kernel had unaligned access in it without any guard, a trap would ensue and you'd get kernel panic. Large OSs hopefully have ways to work around any issue a BIOS or an ARM boot code can throw at it, but bare metal applications (still quite an important realm in ARM-land) does not necessarily have to.</div>
<div style><br></div><div style>What Anton was referring to, and I agree, is that *that* kind of code *will* break with the current change. Adding a new default that traps on current user code *IS* a regression. What we were saying is that, for the sake of future folks getting more juice out of LLVM, we'll break much of the existing bare metal code base, which is not acceptable.</div>
<div style><br></div><div style>Normally, when changes like that are really important, and I agree with you that one *IS*, the course of action is to allow a flag to exist for at least one full release, ask people to use it, document that we *intend* to make it default on the next release, and given enough interest is put forward by a larger community than you and me, we change the default and put big red warnings on the release notes on the next-next release.</div>
<div style><br></div><div style>GCC has put a lot of work on unaligned access for ARMv7 for the same reason, but that's mainly Linux realm. However, as has been said many times on this very list, "what GCC does" is not a valid argument. If the whole point of LLVM is do "what GCC does", why bother?</div>
<div style><br></div><div style>In a nutshell, I agree with you that this is an important feature, and must be always on on Linux (v6/v7) and Darwin (v7), but not as a default for anything else. At least, not yet.</div></div>
<br></div><div class="gmail_extra" style>cheers,</div><div class="gmail_extra" style>--renato</div></div>