Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!uwm.edu!ux1.cso.uiuc.edu!mp.cs.niu.edu!bennett From: bennett@mp.cs.niu.edu (Scott Bennett) Newsgroups: comp.sys.next Subject: Re: Fxxx traps on 68040 Keywords: transcendental functions, 68040 math, math library Message-ID: <1991Mar27.232834.27319@mp.cs.niu.edu> Date: 27 Mar 91 23:28:34 GMT References: Organization: Northern Illinois University Lines: 52 In article burton@server2.cs.psu.edu (Brian T Burton) writes: > >The problem isn't the compiler at all, it's the subroutines in >libm.a. (The compiler doesn't generate inline instructions for fsin >etc unless the macro INLINE_MATH is explicitly defined). Well, I don't know about 2.0, but 1.0a's math.h generates the in-line transcendentals. > >libm.a contains stub routines that contain the fxxx instructions. Not unless 2.0 is screwed up. libm.a is supposed to contain the BSD math library. On a 68030/68882, libm.a takes about three times as long to calculate transcendentals as the in-line Fxxx instructions do. >To speed things up, write your own versions of the functions that No. Jeesh... >you need and call them instead of using libm. I don't think this should be necessary for most people. Simply comment out any #include lines that you find and then compile with the -lm option added to your cc command. This will cause the compiler to generate function calls rather than assemble the Fxxx instructions in-line and will result in the BSD math library routines being linked into the executable module. As someone else pointed out weeks ago in this group, the BSD routines were written for VAXes, so the limits on the exponent range that the routines can handle are the same as the limits in the VAX hardware, which are much smaller than the limits of the 68882. However, for most people's purposes, they should be adequate. Perhaps this matter should be addressed in the FAQ article. It seems to be a recurrent issue. > >So does anyone know if there is source code for a good math library >available on the net? Does GNU have on? Scott Bennett, Comm. ASMELG, CFIAG Systems Programming Northern Illinois University DeKalb, Illinois 60115 ********************************************************************** * Internet: bennett@cs.niu.edu * * BITNET: A01SJB1@NIU * *--------------------------------------------------------------------* * "Well, I don't know, but I've been told, in the heat of the sun * * a man died of cold..." Oakland, 19 Feb. 1991, first time since * * 25 Sept. 1970!!! Yippee!!!! Wondering what's NeXT... :-) * **********************************************************************