Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!decwrl!ucbvax!ucdavis!iris!zerkle From: zerkle@iris.ucdavis.edu (Dan Zerkle) Newsgroups: comp.sys.amiga Subject: Re: Maple V news for Amiga Message-ID: <7960@ucdavis.ucdavis.edu> Date: 9 Nov 90 19:23:58 GMT References: <3760@mindlink.UUCP> <15580@brahms.udel.edu> Sender: usenet@ucdavis.ucdavis.edu Reply-To: zerkle@iris.ucdavis.edu (Dan Zerkle) Organization: U.C. Davis - Department of Electrical Engineering and Computer Science Lines: 66 In article <15580@brahms.udel.edu> don@brahms.udel.edu (Donald R Lloyd) writes: > > I seem to remember hearing that under 2.0 the floating point libraries >would be able to detect the presence of an 881/882 and use it if it's there. >(Or is this one specific fp library?). If this is true, and 2.0 actually >starts shipping soon, Maple will have 881 support whether they like it or not. 2.0 has nothing to do with it. See below. > I agree that it sounds just plain stupid to produce a mathematical >program with no FPU support. I've never done any FP work on a system with >a coprocessor, but isn't it just a matter of changing a #include or an >openlibrary() call somewhere? No, that's not it. The 68881 and 68882 have their own special instruction set. When you have one of these math chips, you can mix these special instructions in with the regular 680x0 instructions in your machine language. That way, the 680x0 instructions get executed by your CPU, and your 6888x instructions get executed by your FPU. If you don't have an FPU, you have to emulate the floating point instructions in software. This works, but is not nearly as fast. A certain graphics program I wrote runs about 10 times faster (no exaggeration) when I use the 68882. In other words, getting math chip support is very important to those folks who own one and who do a large amount of number crunching. When you write a program, there are two basic places executable code comes from. The first place is from code you write/compile/assemble yourself. The second place is from libraries that you link in. If you want the code you compile yourself to have 6888x instructions in it, instead of simply emulating the instructions, you need to tell your compiler to generate code for it. In Aztec C, this is done by putting a little "-f8" flag on the command line. This is important if the code you write yourself does a lot of math. If you want your libraries to use the chip, you have to use the proper libraries in the link stage. Using these libraries is important if you do a lot of math through function calls, such as the trig functions. There are numerous libraries included with the compiler (taking up numerous disk blocks). These are the important ones I found with Aztec C: m.lib : Standard math library, without coprocessor support. m8.lib : Manx's math library, using the 6888x. I can't use this one, due to a vicious bug in the scanf() found there. ma.lib : Amiga IEEE double precision math library. It's not documented, but several people have told me that this one detects the presence or absence of a math chip at runtime and behaves accordingly at. This would mean that this library uses larger executables and is a little slower than directly using either of the above libraries. Since Maple is written in C, all the programmers would really have to do is compile two different versions using two different compile and link commands. They could use the Amiga IEEE libraries, and thereby have a version that would take advantage of the math support when using library calls, but still run on all machines. Hope this helps (TM). Dan Zerkle zerkle@iris.ucdavis.edu (916) 754-0240 Amiga... Because life is too short for boring computers.