Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!apple!oliveb!pyramid!prls!mips!winchester!mash From: mash@mips.COM (John Mashey) Newsgroups: comp.arch Subject: Re: Integer Multiply/Divide on Sparc Message-ID: <34530@mips.mips.COM> Date: 16 Jan 90 16:52:34 GMT References: <8840005@hpfcso.HP.COM> <1249@otc.otca.oz> <1255@otc.otca.oz> <2819@auspex.auspex.com> Sender: news@mips.COM Reply-To: mash@mips.COM (John Mashey) Organization: MIPS Computer Systems, Inc. Lines: 18 In article <2819@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes: .... >the compiler writers were too lazy to change the compiler, I think it >was done because it was *still* faster to do the shifts and adds. I >can't speak for MIPS, but I wouldn't be surprised to hear that even >though they had a multiply instruction since Day 1 they still did shifts >and adds for multiplies by constants. Yes, of course: shifts, adds, and subtracts, up to the point where it takes about as long as a multiply. (I think there's a bias to use multiply if its equal or close, since the code sequence is shorter, andthere may be code scheduling opportunities in the shadow of the multiply, although not many.) -- -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