From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,100c510dac09e617 X-Google-Attributes: gid111c93,public From: torvalds@transmeta.com (Linus Torvalds) Subject: Re: MFlops Comparison using g77 (bad news) Date: 1997/09/17 Message-ID: <5vn7si$26q$1@palladium.transmeta.com>#1/1 X-Deja-AN: 273117854 References: <5vl4lv$8ko@bgtnsc03.worldnet.att.net> <5vml8c$6kb$1@news.utrecht.NL.net> <341f1031.69553746@netnews.worldnet.att.net> Organization: Transmeta Corporation, Santa Clara, CA Newsgroups: comp.os.linux.alpha In article <341f1031.69553746@netnews.worldnet.att.net>, Luke Lonergan wrote: > >I implemented the kernel in C this morning. Unfortunately my news >server was screwed up at work so I couldn't post the results until >now: > >---------------------------------------------------------------------------- >/* Operation count = 9 operations/grid point */ > > for (j=1;j<*ny-1;j++) { > > indj = (*nx)*j; > indjp1 = (*nx)*(j+1); > indjm1 = (*nx)*(j-1); > > for (i=1;i<*nx-1;i++) { > indx = i+indj; > psi_new[indx] = (*a1)*psi[indx+1]+(*a2)*psi[indx-1]+ > (*a3)*psi[i+indjp1]+(*a4)*psi[i+indjm1]- > (*a5)*f[indx]; > } > } >---------------------------------------------------------------------------- You left out the definitions for the variables, but let me guess: they are all "int" rather than "long"? Change them all to "long" and see whether that makes a difference. At least in theory gcc should have a much easier time with long, simply because then gcc is using only 64-bit quantities. With your current code, you're mixing 32-bit and 64-bit arithmetic, which limits the code generation a lot (because order matters when you mix different sizes). On a PPro you'll never see this, because everything is 32 bits, obviously, Linus