gnu@hoptoad.uucp (John Gilmore) (05/15/87)
In article <16627@amdcad.AMD.COM>, tim@amdcad.AMD.COM (Tim Olson) writes: > Our C > runtime library code we use for simulations has a multiply subroutine > which is a variant of the one shown in the user's manual. It performs a > quick check at the beginning to see how many steps are really required, > then performs only that many steps. This has been shown to reduce the > entire cost of a runtime multiply (including procedure-call overhead) to > around 25 cycles (when used on a range of multiply-intensive code). I remember Bill Joy doing a similar analysis of multiplies, using "troff" as a particularly multiplicitive example. You have to remember, though, that troff and many other Unix programs were written for 16-bit machines, so they never multiply anything that might overflow 16 bits. While this is "representative" of portable Unix programs, it isn't necessarily representative in general. -- Copyright 1987 John Gilmore; you may redistribute only if your recipients may. (This is an effort to bend Stargate to work with Usenet, not against it.) {sun,ptsfa,lll-crg,ihnp4,ucbvax}!hoptoad!gnu gnu@ingres.berkeley.edu