From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,6efc7adbcf3cc73 X-Google-Attributes: gid111c93,public From: Joachim Wesner Subject: Re: Fast Compilers for Linux Date: 1998/05/22 Message-ID: <3565A475.3940EB48@frankfurt.netsurf.de>#1/1 X-Deja-AN: 355585583 Content-Transfer-Encoding: 7bit References: <356449AC.41C6@tinman.dartmouth.edu> <6k211t$l64@news3.newsguy.com> <3565885C.41C6@tinman.dartmouth.edu> To: "John Lyon " Content-Type: text/plain; charset=us-ascii Organization: OMNILINK -- your link to the Net MIME-Version: 1.0 Newsgroups: comp.os.linux.alpha Hi, John Lyon wrote: > > If you pick up ftp://ftp.arsc.edu/pub/mpp/docs/bmguide.ps.Z, there's a > table which gives values of the speeds of the various routines: roughly > 100 clocks for scalar transcendtals and 25-45 for vector versions. The > document is an optimization guide for single processor code on the T3E, > but it does have some useful things to say about how high level code can > be structured for better performance. > > John Do you know for what argument range those result apply ?? I ask because my initial testing of the actual libm and and some other routines I will try to use shows the surprising result that, at least for sin, cos and tan and also the hyperbolic equivalents, most of the time is spent in argument reduction instead of approximating. The upshot is that, if Cray tested only for small arguments, their sin routine for example, is NOT any faster than the actual libm !! My measured execution time on a LX 533 (1 tick ~ 2 ns) (all routines were tested with random arguments from 0 to x) 0..0.3 0..10 0..300 actual libm sin 0.18 us 0.45 us 0.51 us cos 0.20 us 0.46 us 0.52 us tan 0.30 us 0.63 us 0.69 us goto's routine (sin/cos kernel in assembler) sin 0.12 us 0.36 us 0.49 us cos 0.15 us 0.39 us 0.52 us my alternative routine (C, will be changed to assembler later) sin 0.22 us 0.27 us 0.27 us cos 0.26 us 0.26 us 0.26 us Cray routines range = ? sin 0.24 us cos 0.26 us As one can see, for larger arguments, most of the time is spent in argument reductions. Similar increases can be seen for libm and tan and the xxxh functions. If the cray numbers only apply for arguments up to ~ 1, it's not much faster. I sincerely hope not, I think I will know soon. Another way to follow would be to combine my way of argument reduction with goto's routine (goto@statabo.rim.or.jp), he still seems to use the original libm subroutine written in C, which is way too complicated and long, much longer than the sin or cos kernel. HOWEVER **Unfortunatelly**, a "real" coprocessor like in a Pentium can still keep the competition with those numbers and it's even more accurate ! For a sad comparison, Pentium MMX 233: :-(( sin 0.21 us 0.32 us 0.32 us cos 0.21 us 0.32 us 0.33 us Joachim