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: Fast Cray libm on axp/Linux, was Re: Fast Compilers for Linux Date: 1998/05/22 Message-ID: <3565E367.6382A19D@frankfurt.netsurf.de>#1/1 X-Deja-AN: 355661381 Content-Transfer-Encoding: 7bit References: <6k0sb6$moj$1@news.utrecht.NL.net> <6k1bar$3t7@news1.newsguy.com> <356449AC.41C6@tinman.dartmouth.edu> <35653FE4.6909CB26@frankfurt.netsurf.de> Content-Type: text/plain; charset=us-ascii Organization: OMNILINK -- your link to the Net MIME-Version: 1.0 Newsgroups: comp.os.linux.alpha Yup, I suceeded in rewriting the first of the cray CAL routines (sin()) to AXP/linux/GCC. Incredibly it worked from the start. I will later continue with the other routines. So, what's the deal ??? YES, it's pretty fast !! And it does not suffer from slowdown for larger arguments !! I wrote before: 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 >>>>>>> Here we go ...... <<<<<<<<< New converted CRAY routine sin 0.20 us 0.20 us 0.20 us Let's have a beer !!! To be honest, the routine is a bit less accurate than the old libm. It's not really true, what Cray implies in the paper, that it's always accurate up to the last bits in contrast to their fast vector routines. My "measurements" show that the old libdm based libm nearly always achieves less than 0.5 ULB (units of last bit) error, this means the result is always exact in the sense it's the same as the rounded version of the infinite precision result. cray sin instead typically has ~ 1 ULB error, some times up to 1.5 ULB, meaning that the last bit is often incorrectly rounded and very few times the next bit is also wrong. BUT, I think we can live with that, my own fast routine above even was a bit worse in that respect. So, what to do next ?? I will try to convert all the other routines in the next days and test them (vector routines later !?) and try to put them in libm compatable form. Meanwhile, could somebody else, more knownledgable of that kind of legal stuff, probably even in close contact of cray, find out what the exact status of that stuff is and how we can put it in a freely distributable form ?? Thanx, have a good night and Prost Joachim