Path: utzoo!attcan!uunet!mcvax!unido!fauern!faui44!msurlich From: msurlich@faui44.informatik.uni-erlangen.de (Matthias Urlichs ) Newsgroups: comp.sys.mac.programmer Subject: MPW C & 68881 (was: Re: Knowing Machine Code) Summary: Looking at MPW C floating-point code :-( Message-ID: <348@faui10.informatik.uni-erlangen.de> Date: 14 Jun 88 08:10:53 GMT References: <1911@rayssdb.ray.com> <2586@polyslo.UUCP> <321@piring.cwi.nl> <2729@polyslo.UUCP> <6010@well.UUCP> <10893@apple.Apple.Com> <2823@polyslo.UUCP> <11093@apple.Apple.Com> <13735@comp.vuw.ac.nz> Reply-To: msurlich@faui10.UUCP (Matthias Urlichs) Organization: CSD., University of Erlangen, W - Germany Lines: 32 In article <13735@comp.vuw.ac.nz> newbery@rata.vuw.ac.nz (Michael Newbery) writes: > Life is too short to spend it writing assembler. But sometimes you just have to. (This came about as a result of computing Mandelbrot sets :-) ) At least, I did have to -- I wrote a short & hopefully tight floating-point subroutine in MPW C, turning on -mc68881, wasn't impressed with the speed at large, and decided to take the plunge and look at the code. Gasp. Two out of three statements looked like this: FMOVE.X FP7,SomeLocal(A6) FMOVE.X SomeLocal(A6),FP7 After generally throwing out all those lines (result: SomeLocal got unused) that same code went two times faster. Throwing out my inner loop and coding it myself (no more FMOVE.X RegOne,FP7 Fsomething RegTwo,FP7 FMOVE.X FP7,RegThree ) got me another 30% as the compiler generally had its own idea about "register" declarations and whether to actually use them. So the question: Is there any C compiler that'll do better? (It better run under MPW because we're stuck with it; besides that, the environment IS very good.) How about MPC C 3.0 when it comes out? (I was using MPW 2.02.) -- Matthias Urlichs CompuServe: 72437,1357 Delphi: URLICHS Rainwiesenweg 9 Phone: +49+911-574180 8501 Schwaig 2 NetMail: m_urlichs@msn.rmi.de West Germany or: (r)eply and (h)ope