Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!spool.mu.edu!sdd.hp.com!caen!uflorida!travis!hcx2.ssd.csd.harris.com!bill From: bill@hcx2.ssd.csd.harris.com (Bill Leonard) Newsgroups: comp.benchmarks Subject: Re: C Cost Model Message-ID: <2388@travis.csd.harris.com> Date: 18 Feb 91 22:46:36 GMT References: <5778@beryl12.UUCP> <2340@travis.csd.harris.com> Sender: news@travis.csd.harris.com Reply-To: bill@hcx2.ssd.csd.harris.com (Bill Leonard) Distribution: comp Organization: Harris Computer Systems Division, Fort Lauderdale, FL Lines: 34 In article , meissner@osf.org (Michael Meissner) writes: > While the general point applies, I think you choose a bad example. On > the 88k, single precision divides are 30 clocks and double precision > divides are 60 clocks. It's hard to keep the machine busy for that > many clocks before needing the divide results. I'd agree it's hard to keep the machine busy for the entire 30-60 clocks, but it's usually not hard to do quite a bit of useful work in there. So there are two points: 1) the cost of the divide may be significantly less than 30 or 60 clocks; 2) the cost of those operations that were done while the divide was executing _appears_ to be zero in this case, whereas they would be non-zero if done in isolation. Nevertheless, I recently examined the code for a FORTRAN program that contained quite a few floating-point operations (including divides) in a monstrously long section of straight-line code. Several of the divisions were completely overlapped with other operations. Difficult, yes, impossible, no. > In signed integer divides it is worse in that the compiler generally has > to account for the signedness of the operands with branches and such, > which means if either operand is negative you typically must do a negate > directly after the divide, stalling the pipeline. A reasonably good instruction scheduler should be able to insert other instructions between the divide and the negate, if there's anything useful to do. -- Bill Leonard Harris Computer Systems Division 2101 W. Cypress Creek Road Fort Lauderdale, FL 33309 bill@ssd.csd.harris.com