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];
> >
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];
>
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
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