Path: utzoo!attcan!uunet!aplcen!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!mips!dalek!keith From: keith@mips.COM (Keith Garrett) Newsgroups: comp.arch Subject: Re: int x int -> long for * (or is it 32x32->64) Keywords: arithmetic,arbitrary precision,benchmark,modular arithmetic Message-ID: <41501@mips.mips.COM> Date: 14 Sep 90 16:34:29 GMT References: <3984@bingvaxu.cc.binghamton.edu> <41425@mips.mips.COM> <353@kaos.MATH.UCLA.EDU> <2118@charon.cwi.nl> Sender: news@mips.COM Reply-To: keith@mips.COM (Keith Garrett) Organization: MIPS Computer Systems, Inc. Lines: 18 In article <2118@charon.cwi.nl> dik@cwi.nl (Dik T. Winter) writes: >[multipy comparisions deleted] >MIPS: Multiply is 10 cycles (I found this somewhere in Kanes book, but > can not find it now). Divide for small numbers (i.e. 32/32) is a > single instruction, for which I cannot find the timing now. Larger > numbers require more cycles. My code uses 9 cycles per bit, which > can be reduced to 6 if only the remainder is required. Using hardware > divide might give some benefits here. Note that hardware multiply and > hardware divide are free running, i.e. other operations can be > performed, but the benefit would be very limited in this case. integer multiply is actually 12 cycles (32*32->64)...integer divide is 35 cycles (32/32->quot,rem) there are addition cycles required to move the result from the special mult/div result registers to gp registers (MFHI/MFLO). >[...] -- Keith Garrett "This is *MY* opinion, OBVIOUSLY" Mips Computer Systems, 930 Arques Ave, Sunnyvale, Ca. 94086 (408) 524-8110 keith@mips.com or {ames,decwrl,prls}!mips!keith