Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!hp4nl!sara5!toon From: toon@news.sara.nl Newsgroups: comp.sys.next Subject: Re: 68040 Math: Emulation or library call or inline code ? Message-ID: <1991Feb18.105109.2810@news.sara.nl> Date: 18 Feb 91 09:51:09 GMT References: <1991Feb14.160749.19048@batcomputer.tn.cornell.edu> <290@rosie.NeXT.COM> <1991Feb15.135340.2808@news.sara.nl> <1991Feb17.113656.5876@kithrup.COM> Lines: 34 >In article <1991Feb17.113656.5876@kithrup.COM>, > sef@kithrup.COM (Sean Eric Fagan) writes: >> In article <1991Feb15.135340.2808@news.sara.nl> toon@news.sara.nl writes: toon>Sorts of. Is trapping these instructions really faster than implementing toon>sin(), cos(), tan() and friends as run time library subroutines to the toon>(Objective-) C(++) compiler ? I would doubt it. sean> sean> Very good! Perhaps you noticed the comment in this thread, a while ago, sean> about 68040 fp-intensive programs being faster *when recompiled*? sean> You're right, I had seen that one then, but it was not clear how this was accomplished. I suppose a lot of DPS code makes heavy use of these transcendentals, so optimizing them IS important. sean> Or aren't you aware that there is no easy way to replace a single sean> instruction, e.g., fsin? Well, that depends on how this is implemented. I can imagine that in the old ('030) case, sin(), cos(), tan() and friends translated to either a single instruction library call, or a single instruction expanded inline (although I don't know enough of the (gcc) compiler to know whether it is _possible_ to translate library calls to inline code). If this _is_ possible you have the choices (for the '040) to either translate to a library call (with the library routine containing the 'emulation' code) or to expand the 'emulation' code inline. Note that the reason for this - although it amounts to more code - is that it is faster. Either of the two possibilities is faster than heaving the instructions emulated by traps, because in that case you also have to execute the trap code itself. -- Toon Moene, SARA - Amsterdam (NL) Internet: TOON@SARA.NL /usr/lib/sendmail.cf: Do.:%@!=/