Re: Problem with -ftree-ter and loop unrolling

2005-05-18 Thread Zdenek Dvorak
Hello, > > > So far OK, but with ter, this becomes > > > > > > sum1 = 0; > > > sum2 = 0; > > > for (i = 0; i < n; i+=4) > > > { > > > x_1 = a[i]; > > > y_1 = b[i]; > > > x_2 = a[i+1]; > > > y_2 = b[i+1]; > > > x_3 = a[i+2]; > > > y_3 = b[i+2]; > > > x_4 = a[i+3]; > >

Re: Problem with -ftree-ter and loop unrolling

2005-05-18 Thread Andrew MacLeod
On Wed, 2005-05-18 at 09:23, Steven Bosscher wrote: > On May 18, 2005 03:06 PM, Zdenek Dvorak <[EMAIL PROTECTED]> wrote: > > > So far OK, but with ter, this becomes > > > > sum1 = 0; > > sum2 = 0; > > for (i = 0; i < n; i+=4) > > { > > x_1 = a[i]; > > y_1 = b[i]; > > x_2 = a[i+1]; >

Re: Problem with -ftree-ter and loop unrolling

2005-05-18 Thread Steven Bosscher
On May 18, 2005 03:06 PM, Zdenek Dvorak <[EMAIL PROTECTED]> wrote: > So far OK, but with ter, this becomes > > sum1 = 0; > sum2 = 0; > for (i = 0; i < n; i+=4) > { > x_1 = a[i]; > y_1 = b[i]; > x_2 = a[i+1]; > y_2 = b[i+1]; > x_3 = a[i+2]; > y_3 = b[i+2]; > x_4 = a[i

Problem with -ftree-ter and loop unrolling

2005-05-18 Thread Zdenek Dvorak
Hello, I am just playing with loop unrolling on trees (for the purposes of prefetching), and I encountered the following problem. Consider loop sum1 = 0; sum2 = 0; for (i = 0; i < n; i++) { x_1 = a[i]; y_1 = b[i]; sum1 += x_1 * y_1; sum2 += x_1 / y_1; } Now after unrolling w