<div dir="ltr">reverted in r181944.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 15, 2013 at 4:01 PM, Anton Korobeynikov <span dir="ltr"><<a href="mailto:anton@korobeynikov.info" target="_blank">anton@korobeynikov.info</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Derek,<br>
<br>
Please revert. The patch is still under review / discussion.<br>
<div class="HOEnZb"><div class="h5"><br>
On Wed, May 15, 2013 at 8:08 PM, Derek Schuff <<a href="mailto:dschuff@google.com">dschuff@google.com</a>> wrote:<br>
> Author: dschuff<br>
> Date: Wed May 15 11:08:30 2013<br>
> New Revision: 181897<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=181897&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=181897&view=rev</a><br>
> Log:<br>
> Support unaligned load/store on more ARM targets<br>
><br>
> This patch matches GCC behavior: the code used to only allow unaligned<br>
> load/store on ARM for v6+ Darwin, it will now allow unaligned load/store for<br>
> v6+ Darwin as well as for v7+ on other targets.<br>
><br>
> The distinction is made because v6 doesn't guarantee support (but LLVM assumes<br>
> that Apple controls hardware+kernel and therefore have conformant v6 CPUs),<br>
> whereas v7 does provide this guarantee (and Linux behaves sanely).<br>
><br>
> Overall this should slightly improve performance in most cases because of<br>
> reduced I$ pressure.<br>
><br>
> Patch by JF Bastien<br>
><br>
> Modified:<br>
>     llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp<br>
><br>
> Modified: llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp?rev=181897&r1=181896&r2=181897&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp?rev=181897&r1=181896&r2=181897&view=diff</a><br>

> ==============================================================================<br>
> --- llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp (original)<br>
> +++ llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp Wed May 15 11:08:30 2013<br>
> @@ -162,10 +162,23 @@ void ARMSubtarget::resetSubtargetFeature<br>
>    if (!isThumb() || hasThumb2())<br>
>      PostRAScheduler = true;<br>
><br>
> -  // v6+ may or may not support unaligned mem access depending on the system<br>
> -  // configuration.<br>
> -  if (!StrictAlign && hasV6Ops() && isTargetDarwin())<br>
> -    AllowsUnalignedMem = true;<br>
> +  if (!StrictAlign) {<br>
> +    // Assume pre-ARMv6 doesn't support unaligned accesses.<br>
> +    //<br>
> +    // ARMv6 may or may not support unaligned accesses depending on the<br>
> +    // SCTLR.U bit, which is architecture-specific. We assume ARMv6<br>
> +    // Darwin targets support unaligned accesses, and others don't.<br>
> +    //<br>
> +    // ARMv7 always has SCTLR.U set to 1, but it has a new SCTLR.A bit<br>
> +    // which raises an alignment fault on unaligned accesses. Linux<br>
> +    // defaults this bit to 0 and handles it as a system-wide (not<br>
> +    // per-process) setting. It is therefore safe to assume that ARMv7+<br>
> +    // targets support unaligned accesses.<br>
> +    //<br>
> +    // The above behavior is consistent with GCC.<br>
> +    if (hasV7Ops() || (hasV6Ops() && isTargetDarwin()))<br>
> +      AllowsUnalignedMem = true;<br>
> +  }<br>
><br>
>    // NEON f32 ops are non-IEEE 754 compliant. Darwin is ok with it by default.<br>
>    uint64_t Bits = getFeatureBits();<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">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>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
With best regards, Anton Korobeynikov<br>
Faculty of Mathematics and Mechanics, Saint Petersburg State University<br>
</font></span></blockquote></div><br></div>