<div class="gmail_quote">On 16 January 2012 23:57, Peter Alexander <span dir="ltr"><<a href="mailto:peter.alexander.au@gmail.com">peter.alexander.au@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 16/01/12 8:56 PM, Iain Buclaw wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
On 16 January 2012 19:25, Walter Bright<<a href="mailto:newshound2@digitalmars.com" target="_blank">newshound2@digitalmars.<u></u>com</a>>  wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 1/16/2012 11:16 AM, Iain Buclaw wrote:<div><div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
But don't worry, I'm not planning on working on that at the moment :-)<br>
</blockquote>
<br>
Leave that sort of optimisation for the backend to handle please. ;-)<br>
</blockquote>
<br>
<br>
Of course.<br>
<br>
I suspect Intel's compiler does that one, does gcc?<br>
<br>
</div></div></blockquote>
<br><div class="im">
There's auto-vectorisation for for(), foreach(), and foreach_reverse()<br>
loops that I have written support for.  I am not aware of GCC<br>
vectorising anything else.<br>
<br>
example:<br>
<br>
int a[256], b[256], c[256];<br>
void foo () {<br>
   for (int i=0; i<256; i++)<br>
     a[i] = b[i] + c[i];<br>
}<br>
<br>
</div></blockquote>
<br>
Unfortunately, if the function was this:<br>
<br>
void foo(int[] a, int[] b, int[] c) {<div class="im"><br>
  for (int i=0; i<256; i++)<br>
    a[i] = b[i] + c[i];<br>
}<br>
<br></div>
Then it can't vectorize due to aliasing.<br>
</blockquote></div><div><br></div>This is why D needs a __restrict attribute! ;)