This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Benchmark suite...
- To: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Subject: Re: Benchmark suite...
- From: Scott A Crosby <crosby at qwes dot math dot cmu dot edu>
- Date: Wed, 11 Nov 1998 21:51:40 -0500 (EST)
- cc: hubicka at atrey dot karlin dot mff dot cuni dot cz, egcs at cygnus dot com
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];
}