From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1103af,c041d60c5ac9906 X-Google-Attributes: gid1103af,public X-Google-Thread: 102b32,c041d60c5ac9906 X-Google-Attributes: gid102b32,public X-Google-Thread: f9b51,c041d60c5ac9906 X-Google-Attributes: gidf9b51,public X-Google-Thread: 111c93,c041d60c5ac9906 X-Google-Attributes: gid111c93,public From: phr@netcom.com (Paul Rubin) Subject: Re: Alpha vs Pentium II Date: 1998/06/19 Message-ID: #1/1 X-Deja-AN: 364254791 Sender: phr@netcom9.netcom.com References: <35884FD2.AB856CEB@san.rr.com> <6m99p4$ln6$1@mamenchi.zrz.TU-Berlin.DE> <6me3tn$6c5$1@mamenchi.zrz.TU-Berlin.DE> Organization: Netcom Newsgroups: comp.os.linux.alpha,comp.os.linux.hardware,comp.os.linux.misc,comp.os.linux.setup In article <6me3tn$6c5$1@mamenchi.zrz.TU-Berlin.DE>, Warner Bruns wrote: > Okay, Here are the details: > The 25 MHz Power chip (as every POWER chip) can execute two > floating point operations (one add and one multiply) per cycle. > The Pentium can do one FP-operation. > This gives a peak performance of 50 MFlops on the IBM > and 300 MFlop on the Pentium.... > > I use both these machines every day and see that the pentium > performs normally about four times as fast as this obsolete IBM, > **but** for heavy number crunching, my IBM's perform better. > I have made extensive optimization studies with the > IBM-compiler, and have found that he can compile my inner loop > such that the execution needs 19 cycles for 21 floating > operations. > ---> So, the speed of this old Lady is probably > because the compiler is so extraordinary good. Getting a multiply-add in 2 cycles from the Pentium is extremely difficult because while the multiplier can give one result per cycle, there is 3 cycles of latency. Take a look at the vector dot product assembly code (based on code by Harlan Stockman) in Michael Schmit's book on Pentium performance optimization to see what kinds of lengths one must go through to get maximum throughput. You have to keep track of what is happening at every stage of all three of the Pentium's pipelines (two integer and one floating point) in order to overlap operations most efficiently (never stall a pipeline because it's waiting for another pipeline's result), plus arrange the code very carefully in order to not run out of registers. This is far too much to expect of any compiler. It's much simpler on the RS/6000, which has a MAC instruction and plenty of registers. Nonetheless, if you're doing a lot of numerical linear algebra or signal processing on a Pentium, you can get a huge speedup by using assembly code like that on the inner loops. You might want to modify your matrix multiplication (etc.) routines to use inline assembly or make function calls to do the row/column operations.