Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!seismo!mimsy!chris From: chris@mimsy.UUCP Newsgroups: comp.sys.m68k Subject: Re: Incidentally ... Message-ID: <6139@mimsy.UUCP> Date: Sat, 4-Apr-87 20:04:56 EST Article-I.D.: mimsy.6139 Posted: Sat Apr 4 20:04:56 1987 Date-Received: Sun, 5-Apr-87 14:27:48 EST References: <362@sbcs.UUCP> <1466@ncr-sd.SanDiego.NCR.COM> <580@plx.UUCP> <6134@mimsy.UUCP> Distribution: comp Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 21 In article <6134@mimsy.UUCP> I wrote: >[use] while (--j >= 0) [rather than while (j--)] I poked around today and discovered that Sun's compiler, at least, will turn register short j; /* but not `register int j' */ while (--j != -1) ... into a `dbra' loop. If you are willing to put machine dependent source optimisations into your C code, this might be something to consider (at least for inner loops). Anyway, it is a good idea to profile, tune, compile to assembly code, and sometimes even hand-tweak the results, in speed-critical routines. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690) UUCP: seismo!mimsy!chris ARPA/CSNet: chris@mimsy.umd.edu