From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,27808f716cd282c7 X-Google-Attributes: gid11318c,public X-Google-Thread: 111c93,27808f716cd282c7 X-Google-Attributes: gid111c93,public From: clarksimsgnu@my-deja.com Subject: Re: poor fp performance on alpha/linux/gcc Date: 1999/09/20 Message-ID: <7s5his$i75$1@nnrp1.deja.com>#1/1 X-Deja-AN: 527295602 References: <37E3273E.60EA22C7@alumni.caltech.edu> X-Http-Proxy: 1.1 x26.deja.com:80 (Squid/1.1.22) for client 209.246.58.190 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Mon Sep 20 14:50:09 1999 GMT X-MyDeja-Info: XMYDJUIDclarksimsgnu Newsgroups: comp.os.linux.alpha,gnu.gcc.help X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT) In article <37E3273E.60EA22C7@alumni.caltech.edu>, William Snyder wrote: > Hi > > I am running Redhat 6.0 on both an alpha 21164A 533Mhz and a celeron > 333Mhz. When I compile and run a simple floating point intensive program > under gcc I get about the same performance on these machines. The alpha > should be more than twice as fast. I am using the fast floating point > library (libfm) for the alpha. My optimization is: > Have you profiled the program? If you hand optimize the problematic loops with register variables, you should get close to optimum performance. I have included an example of a hand optimized template function for multiplying matrixes. Notice that all intermost loops are executed using register variables. template void Matrix_Multiply( const L * lhs , S lnum, S ldim, S lfmt, const R * rhs , S rnum, S rdim, S rfmt, P * prod, S pnum, S pdim, S pfmt, int skip_na) { S i, j; register const L * pl; register const R * pr, * prend; register P* pp; P pna; short all_na; if (skip_na) { pna = 0l; pna /= 0l; } if (ldim!=rnum || lnum!=pnum || rdim!=pdim) { error( "matrix's have mismatched dimensions in Matrix_Multiply"); } for (i=0;i