Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!uflorida!ufqtp!sutherla From: sutherla@qtp.ufl.edu (Scott Sutherland) Newsgroups: comp.sys.amiga Subject: Lattice C questions. Message-ID: <1083@orange9.qtp.ufl.edu> Date: 16 Jul 90 16:07:27 GMT Reply-To: sutherla@qtp.ufl.edu (Scott Sutherland) Distribution: na Organization: University of Florida Quantum Theory Project Lines: 95 I am about to delve into the world of Amiga C. (Most of my C programming has been on a SUN 3/50) I have read many of the Amiga C books, but I am going to start simple so that I can learn the intricacies of the Lattice C compiler. I have version 5.05 installed on the Hard Disk of my A3000. Now, the documentation for the 5.0 version says that the compiler can optimize for the 68030 chip AND can take into account the 68882. I want to run some test programs (one of them given to me by a fellow grad student who uses it as his unofficial benchmark for computer system speeds) optimized for the 68030 and I want to test them both with the 68882 AND without it (e.g. software emulation of math functions). As a novice to the Lattice environment, could someone please explain to me, with examples if possible, the major compiler flags involved in optimizing for the 68030, 68882, and software floating point emulation? I could ferret through the manual for a while and figure it out, but my friend is leaving Friday and he is very interested in seeing the results of his unofficial benchmarks. Thanks, Scott Sutherland sutherla@qtp.ufl.edu BTW, this unofficial benchmark is doing a 3x3 matrix multiply 20000 times and then checks to see what the number of calculations per minute are. Here is the code. I'd appreciate it if someone would tell me if it will run UNALTERED on the A3000 AND what the optimum compiling options would be. Source: * Program to get a "crude" estimate of the performance of a system. * The rate is the number of 3x3 matrix multiplies done 20000 times * divided by the elapsed time in seconds. * * * 6/24/90 * * rates for Idx loop of 20000: * * * Machine rate relative *------------------------------------------------------------------ * 1 Leading Edge PC-XT 7.44 MHz 185.19 1.0 * with 8087. * 2 Sun 3/280 ffpa 2857.14 15.4 * 3 Sun 3/50 68881 1176.47 6.4 * 4 Sun 3/280 SPARC 10000.0 54.0 * 5 Packard-Bell 386SX w/out /387 127.39 0.69 * 16 MHz floating point emulation * * * #include #include double a[3][3], b[3][3], c[3][3]; void main() { unsigned Idx; int i, j, k; long time1, time2; double rate; time (&time1); for (Idx=0; Idx<20000; Idx++) { for (i=0; i<3; i++) for (j=0; j<3; j++) { c[i][j] = 0; for (k=0; k<3; k++) c[i][j] += a[i][k] * b[k][i]; { { time (&time2); rate = (20000)/((double)(time2 - time1)); printf ("\n\n rate = %8.41f\n", rate); }