This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Benchmark suite...


On Thu, 5 Nov 1998, Joern Rennecke wrote:

> > Another micro-benchmark to measure how well the compiler performs register
> > assignment:
> > 
> > // Test register assignment, passing reg_assignXX an array of XX values.
> > reg_assign1_8(int *a, int *b)
> > 	b[0] = 1*a[1] + 2*a[2] + 3*a[3] +  4*a[4] .... 7*a[7];
> > 	b[1] = 0*a[0] + 1*a[2] + 2*a[3] .... 6*a[7];
> > ..
> > ..
> >         b[7] =  0*a[0] + ... + 1*a[7];
> > }
> > 
> > Here, the constants in the right hand sides were chosen so that a simple
> > CSE would not work well on them, so this would test how well the compiler
> > performs register assignment.. (It could also test a much more advanced
> > CSE that could simplify this.) Again, a list of functons reg_assign1_16(),
> > reg_assign1_32(), are created...
> 
> This does not work.  a and b can be aliased.
> 

Whoops.. :-) 

How about:

// Test register assignment, passing reg_assignXX an array of XX values.
reg_assign1_8(int *a) {
	b = a;
	a = a+10;
     b[0] = 1*a[1] + 2*a[2] + 3*a[3] +  4*a[4] .... 7*a[7];
     b[1] = 0*a[0] + 1*a[2] + 2*a[3] .... 6*a[7];
 ..
 ..
     b[7] =  0*a[0] + ... + 1*a[7];
}



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]