Path: utzoo!attcan!uunet!husc6!mailrus!ames!amdahl!pyramid!prls!mips!mash From: mash@mips.COM (John Mashey) Newsgroups: comp.arch Subject: Re: integer multiplies (Was: architecture/implementation -- MIPS) Message-ID: <2242@winchester.mips.COM> Date: 25 May 88 07:45:44 GMT References: <2231@gumby.mips.COM> <3006@phoenix.Princeton.EDU> <2241@gumby.mips.COM> Reply-To: mash@winchester.UUCP (John Mashey) Organization: MIPS Computer Systems, Sunnyvale, CA Lines: 47 In article <2241@gumby.mips.COM> earl@mips.COM (Earl Killian) writes: >In article <3006@phoenix.Princeton.EDU> lgy@pupthy2.PRINCETON.EDU (Larry Yaffe) writes: > I'm curious and a little surprised about the relative speed of > integer and floating point multiplies.... Here are the dynamic frequencies of integer and FP multiplies, as a percentage of instructions (NOT instruction cycles, which is much more complex to describe, given instruction overlap), in a quick sample of programs. No science presumed: I just grabbed a few programs believed to be OK: Program Integer FP as1 .02% 0 ccom .08% 0 espresso <.01% <.01% gnuchess .06% 0 hspice .02% 2.4% linpackd* .13% 8.2% nroff .45% 0 whetd* 1.42% 7.38% timberwolf .31% .45% As a gross cycle estimate, multiply the Integer # by 10, and the FP one by 5. (* = benchmark, above) Conclusions: 1) If a program uses FP in any serious fashion, FP mult > integer mult. 2) A few programs (nroff, whetd, and timberwolf) use integer mult enough that it would be nice to be faster, i.e., a 10-cycle multiply causes >2% of the instruction cycles. 3) Many programs don't execute integer mult enough to be noticable. Of course, our compilers do strength reduction, common subexpression elimination, etc, and convert mulitplies by constants into shifts/adds/subs; i.e., they've squished out a lot of actual multiplies. This is perfect example where your choice of benchmarks tells completely different answers to the question: "should we have an integer mult instruction, and if so, how much silicon are we willing to devote to making it X cycles." -- -john mashey DISCLAIMER: UUCP: {ames,decwrl,prls,pyramid}!mips!mash OR mash@mips.com DDD: 408-991-0253 or 408-720-1700, x253 USPS: MIPS Computer Systems, 930 E. Arques, Sunnyvale, CA 94086