From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <199606111507.IAA08918@koala.azstarnet.com> Date: Tue, 11 Jun 1996 08:07:51 -0700 From: David Mosberger-Tang Subject: Re: performance of 21164-300 vs P6-200 >>>>> On Tue, 11 Jun 1996 09:58:30 -0400 (EDT), Jim Nance said: Jim> 2) Your program makes extensive use of float data types. I Jim> have found that RISC processors handle floats poorly compared Jim> to doubles. This was certainly a supprise to me the first time Jim> I noticed it, and its certainly not what I was taught in Jim> school. Is this because the program uses a lot of libm calls so that it ends up converting between float and double all the time? The float operations themselves certainly are _not_ slower on the Alpha: all fp operations have a latency of 4 cycles on the 21164 except for the divider which has a data-dependent latency in the range of 15..31 cycles for single-precision and 22..60 cycles for double-precision. If the problem is really due to extraneous conversions, it might be worthwhile to try the libm that comes with glibc---it has *f variants of all the libm functions. Those variants operate on single-precision floats only. As long as an ANSI C compiler is used, this should give performance at least as good as with double. E.g., to compute a single precision since, you'd call sinf() instead of sin(). --david