This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: a C routine to optimize GCC for
- To: diep at xs4all dot nl, gcc at gcc dot gnu dot org
- Subject: Re: a C routine to optimize GCC for
- From: N8TM at aol dot com
- Date: Wed, 29 Sep 1999 22:05:43 EDT
In a message dated 9/29/99 6:56:46 PM EST, diep@xs4all.nl writes:
> int tryalles(void){
> int ut,*va,ua,summation=0;
>
> for( ua = 0 ; ua < 16 ; ua++ ) {
> va = Pindex;
> ut = 0;
> if( !sweep[snelbord[ua]] )
> ut = board[ua];
> va += ut;
> summation += *va;
> }
> return(summation);
> }
guessing at appropriate declarations, with gcc-2.96 -ffast-math
-march=pentiumpro -O2 produces
....
L6:
movl -64(%ebp,%ecx), %eax
movl $0, %edx
sall $3, %eax
fldl (%eax,%edi)
fcomip %st(1), %st
jne L7
movl -128(%ebp,%ecx), %edx
L7:
movl -260(%ebp), %eax
addl $4, %ecx
addl (%eax,%edx,4), %esi
decl %ebx
jne L6
...
sall $2,%eax <== where do we need this shift instruction
for?
Without it, you could only address char, not float (I see now you're not
declaring double)
HTH
Tim